:root{
  --bg1:#0b2f1c;
  --bg2:#1f6b3a;
  --bg3:#2f9b55;

  --card:#ffffff12;
  --card2:#ffffff18;
  --text:#f7fff9;
  --muted:#dbffe6cc;

  --good:#9cffc0;
  --warn:#ffd59c;

  --radius:18px;
  --shadow: 0 10px 30px #00000055;
}

/* Reset & base */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 20% 15%, #b5ffb922, transparent),
    radial-gradient(900px 540px at 80% 20%, #ffd59c18, transparent),
    linear-gradient(180deg, var(--bg3), var(--bg1));
}

/* Top bar */
.topbar{
  max-width:1100px;
  margin:14px auto 0;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--card);
  border:1px solid #ffffff1e;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.logo{font-size:32px}
.title{font-weight:1000}
.subtitle{
  font-size:13px;
  color:var(--muted);
}

/* HUD */
.hud{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.progressPill{
  padding:10px 12px;
  border-radius:999px;
  background:var(--card2);
  border:1px solid #ffffff1e;
  font-weight:900;
  color:var(--muted);
}

.btn{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid #ffffff2a;
  background:#ffffff12;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.btn:hover{
  background:#ffffff18;
  border-color:#ffffff44;
}
.btn.ghost{
  background:transparent;
}

/* Layout */
.wrap{
  max-width:1100px;
  margin:14px auto 40px;
  padding:0 14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* Scene */
.scene{
  position:relative;
  padding:18px;
  border-radius:var(--radius);
  background:
    radial-gradient(900px 520px at 25% 20%, #d9ffb61c, transparent),
    radial-gradient(700px 420px at 80% 15%, #ffffff10, transparent),
    linear-gradient(180deg, #0f4426aa, #082414cc);
  border:1px solid #ffffff1e;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.sceneOverlay{
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 22px,
      rgba(0,0,0,0.05) 22px,
      rgba(0,0,0,0.05) 44px
    );
  opacity:.25;
  pointer-events:none;
}

/* Jax row */
.jaxRow{
  position:relative;
  display:grid;
  grid-template-columns:260px 1fr;
  gap:14px;
}

.jaxCard,
.speechCard{
  background:var(--card);
  border:1px solid #ffffff1e;
  border-radius:var(--radius);
  padding:14px;
  backdrop-filter:blur(10px);
}

.jaxFace{
  font-size:78px;
  text-align:center;
  filter:drop-shadow(0 8px 16px #00000055);
}
.jaxName{
  margin-top:6px;
  text-align:center;
  font-weight:1000;
}
.jaxHint{
  margin-top:6px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.speechTitle{
  font-weight:1000;
  margin-bottom:6px;
}
.speech{
  font-size:18px;
  line-height:1.35;
}

.bodyClues{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  background:#00000022;
  border:1px solid #ffffff1e;
  color:var(--muted);
  font-weight:800;
}

/* Panel & notices */
.panel{
  padding:14px;
  background:var(--card);
  border:1px solid #ffffff1e;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  line-height:1.35;
}

.notice{
  padding:12px;
  border-radius:14px;
  border:1px solid #ffffff2a;
  background:#ffffff10;
}
.notice.good{
  border-color:#9cffc066;
  background:#9cffc01a;
}
.notice.warn{
  border-color:#ffd59c66;
  background:#ffd59c1a;
}

/* Choices */
.choices{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}

.choice{
  padding:14px;
  border-radius:16px;
  background:#ffffff12;
  border:1px solid #ffffff2a;
  cursor:pointer;
  font-weight:1000;
  text-align:center;
  user-select:none;
  transition:
    transform .08s ease,
    background .12s ease,
    border-color .12s ease,
    opacity .12s ease;
}
.choice:hover{
  transform:translateY(-1px);
  background:#ffffff18;
  border-color:#ffffff44;
}
.choice:active{
  transform:translateY(1px);
}
.choice.selected{
  opacity:.65;
  border-color:#a9ffbf88;
  background:#a9ffbf1a;
}

/* Next / Try Again buttons */
.nextBtn{
  margin-top:12px;
  width:100%;
  font-size:16px;
}

/* Badge area */
.badgeArea{
  margin-top:4px;
}
.badgeArea.hidden{
  display:none;
}

.badgeCard{
  padding:16px;
  background:var(--card);
  border:1px solid #ffffff1e;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}

.badgeTop{
  display:flex;
  gap:12px;
  align-items:center;
}
.badgeIcon{
  font-size:44px;
}
.badgeTitle{
  font-weight:1000;
}
.badgeSub{
  color:var(--muted);
  font-weight:800;
  font-size:13px;
  margin-top:2px;
}

/* CTA + QR */
.cta{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid #ffffff1e;
  background:#00000022;
}
.ctaTitle{
  font-weight:1000;
}
.bookTitleLine{
  margin-top:6px;
}
.bookTitle{
  font-size:18px;
}
.ctaText{
  color:var(--muted);
  font-weight:800;
  margin-top:6px;
}

.qrWrap{
  margin-top:10px;
  display:flex;
  justify-content:center;
}
.qr{
  width:180px;
  height:180px;
  background:white;
  padding:10px;
  border-radius:14px;
}
.qrCaption{
  margin-top:8px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

/* Try it section */
.tryIt{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid #ffffff1e;
  background:#00000022;
}
.tryTitle{
  font-weight:1000;
}
.tryText{
  color:var(--muted);
  font-weight:800;
  margin-top:4px;
}

/* Footer */
.footer{
  max-width:1100px;
  margin:10px auto 18px;
  padding:0 14px;
  text-align:center;
  font-size:12px;
  color:var(--muted);
}

/* Responsive */
@media (max-width:980px){
  .jaxRow{
    grid-template-columns:1fr;
  }
  .choices{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}
/* ===== Bookshelf CTA (shared across all games) ===== */

.ctaTop{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

.bookTitleLine{
  text-align:center;
}

.ctaText{
  text-align:center;
}

.orLine{
  display:block;
  margin:6px 0;
  font-weight:900;
  color:rgba(255,255,255,0.75);
}

.bookshelfLink{
  display:inline-block;
  margin-top:8px;
  font-weight:1000;
  color:#ffffff;
  text-decoration:none;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,0.15);
  border:1px solid rgba(255,255,255,0.35);
}

.bookshelfLink:hover{
  background:rgba(255,255,255,0.25);
}
.levelUpNote{
  margin-top:10px;
  text-align:center;
  font-weight:900;
  color:rgba(255,255,255,0.85);
}

