/* Style « Journal » commun aux jeux du 25 oct. (le compte est bon, le mot le plus long, la ville mystère). */
:root {
  --bg: #f3eee3; --bg2: #fbf8f1; --card: #fffefb; --panel: rgba(40,30,10,.06); --panel2: rgba(40,30,10,.12); --fg: #1c1c1c; --muted: #6b6358;
  --cell: #fffefb; --cell-fg: #111; --word: #fff0a3; --hl2: #ffd84a; --line: #1c1c1c; --bad: #c62828; --good: #2f8f4e; --focus: #c62828; --cb-border: #1c1c1c;
  --blue: #dce9f5; --grad: linear-gradient(#1c1c1c, #1c1c1c); --grad-fg: #fdf9f0; --grad-shadow: 0 3px 0 rgba(0,0,0,.18); --accent: linear-gradient(#c62828, #c62828);
  --f-title: Georgia, "Times New Roman", "Noto Serif", serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { overscroll-behavior: none; }
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); background: radial-gradient(rgba(60,45,20,.06) 1px, transparent 1.2px) 0 0 / 5px 5px, linear-gradient(#f6f1e7, #ece4d4);
  background-attachment: fixed; color: var(--fg); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(14px + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; border-bottom: 3px double var(--line); margin: 0 8px;
  background: rgba(243,238,227,.94); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--panel); flex: none; }
.title { flex: 1; min-width: 0; text-align: center; }
.title b { display: block; font: 700 clamp(15px, 4.8vw, 21px)/1.25 var(--f-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; } .title small span { white-space: nowrap; }
.hint { margin: 6px 12px 0; padding: 5px 10px; border-radius: 10px; border: 1.5px dashed var(--line); font-size: 12.5px; line-height: 1.3; display: flex; gap: 8px; align-items: center; }
.hint span { flex: 1; }
.hint button { font-weight: 700; font-size: 13px; min-height: 40px; padding: 6px 12px; border-radius: 10px; background: var(--grad); color: var(--grad-fg); flex: none; }
main { flex: 1; display: grid; align-content: start; gap: 10px; padding: 10px 12px 6px; }
.btn { display: grid; place-items: center; font-weight: 750; font-size: 17px; min-height: 50px; padding: 0 14px; border-radius: 14px; background: var(--grad); color: var(--grad-fg); box-shadow: var(--grad-shadow); }
.btn.ghost { background: var(--panel2); color: var(--fg); box-shadow: none; }
.btn.small { min-height: 42px; font-size: 15px; }
.btn:disabled { opacity: .45; }
.row-btns { display: flex; gap: 8px; } .row-btns > * { flex: 1; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 6px; box-shadow: 4px 4px 0 rgba(28,28,28,.1); padding: 14px; }
.muted { color: var(--muted); font-size: 14px; text-align: center; }
/* écran de départ : énoncé caché tant que le chrono n'a pas démarré */
.start { display: grid; gap: 10px; text-align: center; justify-items: center; padding: 18px 14px; }
.start .em { font-size: 52px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.start h2 { font: 700 26px/1.15 var(--f-title); }
.start .tag { font: 800 12px/1 system-ui; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--bad); padding: 6px 9px; border-radius: 3px; }
.start ul { text-align: left; display: grid; gap: 6px; font-size: 15px; color: var(--muted); margin-left: 18px; max-width: 420px; }
.start .btn { width: 100%; max-width: 360px; }
/* fenêtres */
.back { position: fixed; inset: 0; z-index: 30; background: rgba(10,8,20,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--bg2); border-radius: 20px; padding: 22px 18px 18px; display: grid; gap: 12px;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); animation: in .25s ease; }
@keyframes in { from { transform: translateY(16px); opacity: 0; } }
.modal h3 { font: 700 24px/1.2 var(--f-title); }
.modal p { color: var(--muted); }
.modal .em { font-size: 54px; line-height: 1; }
.modal .answer { font: 800 26px/1.1 system-ui; letter-spacing: .12em; padding: 10px; border: 2px solid var(--line); border-radius: 6px; background: var(--word); word-break: break-word; }
.modal .steps { display: grid; gap: 3px; font: 600 15px/1.35 ui-monospace, Menlo, Consolas, monospace; }
.modal .rules { text-align: left; display: grid; gap: 9px; font-size: 15px; }
.modal .rules p { color: var(--fg); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.msg { position: fixed; left: 50%; top: calc(80px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; transition: opacity .3s; pointer-events: none; text-align: center; max-width: calc(100% - 32px); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.tv button:focus, .tv a:focus, .tv input:focus { outline: 4px solid var(--focus); outline-offset: 3px; position: relative; z-index: 2; }
@media (min-width: 900px) { .tv #app { max-width: 860px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
