:root{
  --bg:#0b0b0e;
  --card:#121218;
  --text:#f2f2f5;
  --muted:#b7b7c4;
  --muted2:#8e8ea1;
  --line:rgba(255,255,255,.10);
  --good:#52ffb8;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% 0%, rgba(255,255,255,.06), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(255,255,255,.04), transparent 60%),
              var(--bg);
  color:var(--text);
}

/* .logo is pre-existing dead code (no element in index.html uses it),
   left as-is per project convention of not deleting unrelated dead code. */
.logo{
  width:44px;
  height:44px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow);
}

/* .game-nav / .back-button / .options-button / .options-panel* come from
   the shared public/shared/css/game-header.css; only dark-theme overrides
   for this game live here. */
.game-nav{
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}
.back-button,
.options-button{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.back-button:hover,
.options-button:hover{background: rgba(255,255,255,.07)}

.options-panel-sheet{
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
}

.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 16px 28px;
}

.splash-screen{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 0;
  padding: 20px 16px 40px;
}

.splashCard{
  max-width: 520px;
  text-align:center;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 45%), var(--card);
  box-shadow: var(--shadow);
}

.splashTitle{
  margin: 0 0 12px;
  font-size: 30px;
}

.splashSubtitle{
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.splashStart{
  min-width: 180px;
}

.splashActions{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}

.splashActions .btn{
  flex: none;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 45%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metaRow{
  display:flex;
  gap:10px;
  justify-content:flex-start;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

.pill{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding: 6px 10px;
  border-radius: 999px;
}

.title{
  margin: 8px 0 14px;
  font-size: 26px;
  line-height: 1.1;
}

.label{
  font-size: 12px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 10px 0 8px;
}

.short{
  margin: 0 0 14px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

.revealHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top: 6px;
}

.linkBtn{
  background: transparent;
  border: 0;
  color: var(--good);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
}
.linkBtn:hover{background: rgba(82,255,184,.08)}

.revealBox{
  width: 100%;
  text-align:left;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  padding: 14px 14px;
  cursor: pointer;
  color: var(--text);
}

.revealHint{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;

  /* double la hauteur visuelle */
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.6;
}


.full{
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 16px;
}

.hidden{display:none}

.footerRow{
  display:flex;
  gap:10px;
  margin-top: 14px;
  flex-wrap:wrap;
}

.btn{
  flex: 1 1 140px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.btn:hover{background: rgba(255,255,255,.07)}
.btn:active{transform: translateY(1px)}

.btn.primary{
  background: rgba(82,255,184,.14);
  border-color: rgba(82,255,184,.25);
}
.btn.primary:hover{background: rgba(82,255,184,.18)}

.chip{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .3px;
}
.chip:hover{background: rgba(255,255,255,.07)}

.langWrap{
  display:flex;
  gap:8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.langBtn[aria-pressed="true"]{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.25);
}


.titleRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.illusWrap{
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  border: 0px solid var(--line);
  /*background: rgba(255,255,255,.03);*/
  overflow: hidden;
  /*box-shadow: 0 10px 30px rgba(0,0,0,.35);*/
}

.illusImg{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.illusHidden{
  display:none !important;
}

/* Responsive: sur petits écrans, on passe l’image sous le titre */
@media (max-width: 520px){
  .titleRow{
    flex-direction: column;
    align-items: stretch;
  }
  .illusWrap{
    width: 100%;
    height: 160px;
  }
}


/* navigation arrows */

.navRow{
  display:flex;
  width:100%;
  gap:0;
}

.navBtn{
  flex:1;
  height:56px;
  background:none;
  border:none;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  transition: background 0.15s ease, color 0.15s ease;
}

.navPrev{
  border-right:1px solid rgba(255,255,255,0.15);
  color:#aaa;
}

.navNext{
  color:#fff;
}

.navBtn:active{
  background: rgba(255,255,255,0.05);
}

.navIcon{
  width:28px;
  height:28px;
  pointer-events:none;
}

/* --- Platform layout (docs/PLATFORM_RULES.md sections 6 and 7) ---
   Mobile first, no page scroll: the page is one 100dvh column, the story
   card scrolls inside itself, Previous / Next stay on screen. */
[hidden]{display:none !important}

body{
  display:flex;
  flex-direction:column;
  height:100dvh;
  overflow:hidden;
  overscroll-behavior:none;
  font-size:max(16px, 2.4dvh);
}
.game-nav{flex:0 0 auto}

/* Android bars can cover the bottom even when the safe-area inset is 0. */
.splash-screen,
.container{
  flex:1 1 auto;
  min-height:0;
  width:100%;
  max-width:none;
  margin:0;
  padding:8px max(24px, env(safe-area-inset-right, 0px))
    max(40px, calc(env(safe-area-inset-bottom, 0px) + 24px))
    max(24px, env(safe-area-inset-left, 0px));
}
.splash-screen{overflow:auto}
.splash-screen.hidden,
.container.hidden{display:none}
.splashCard{margin:auto}
.splashStart{min-height:48px; font-size:1em}

.container{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.card{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.navRow{
  flex:0 0 auto;
  margin-top:0;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.03);
}
.navBtn{height:max(52px, 7dvh)}
.navBtn:disabled{opacity:.35; cursor:default}

/* Keyboard and TV focus: visible ring (no hover-only feedback). */
:focus-visible,
html.tv :focus{
  outline:max(3px, .4dvh) solid #52ffb8;
  outline-offset:max(2px, .3dvh);
}

@media (max-width: 520px){
  .illusWrap{height:120px}
}

/* Landscape phones (~360px tall): illustration beside the title, smaller. */
@media (orientation: landscape) and (max-height: 500px){
  .splashCard{padding:14px 18px}
  .splashTitle{font-size:24px; margin-bottom:6px}
  .splashSubtitle{margin-bottom:10px}
  .splashActions{flex-direction:row; justify-content:center}
  .card{padding:12px}
  .titleRow{flex-direction:row}
  .title{font-size:22px; margin:4px 0 6px}
  .label{display:none}
  .short{margin-bottom:8px; font-size:15px}
  .revealBox{padding:6px 12px}
  .revealHint{padding:4px 0; margin-bottom:0}
  .full{margin-top:6px}
  .metaRow{margin-bottom:4px}
  .illusWrap{width:80px; height:80px}
  /* Previous / Next move beside the card. */
  .container{flex-direction:row; padding-top:4px}
  .navRow{flex-direction:column; width:72px}
  .navBtn{height:auto}
  .navPrev{border-right:0; border-bottom:1px solid rgba(255,255,255,0.15)}
}

/* Desktop and TV, 960x540 up to 3840x2160: sizes follow the screen height
   and everything stays 3% away from the edges (TV overscan). */
@media (min-width: 960px) and (min-height: 500px){
  .game-nav{
    height:auto;
    padding:3dvh max(3vw, env(safe-area-inset-right, 0px)) 1dvh
      max(3vw, env(safe-area-inset-left, 0px));
  }
  .back-button,
  .options-button{
    width:max(36px, 6dvh);
    height:max(36px, 6dvh);
    font-size:max(1rem, 3dvh);
  }
  .back-button svg,
  .options-button svg{width:50%; height:50%}
  .splash-screen,
  .container{
    padding:2dvh max(3vw, env(safe-area-inset-right, 0px)) max(40px, 5dvh)
      max(3vw, env(safe-area-inset-left, 0px));
  }
  .splashCard{max-width:min(90vw, 34em); padding:1.6em 1.4em}
  .splashTitle{font-size:2.2em}
  .card{padding:1.2em 1.4em}
  .title{font-size:1.9em}
  .label,
  .pill,
  .revealHint{font-size:.8em}
  .short,
  .full{font-size:1.1em}
  .illusWrap{width:22dvh; height:22dvh}
  .navIcon{width:5dvh; height:5dvh}
  .chip{font-size:1em}
}
