:root {
  --ice: #eff9fd;
  --ice-2: #dff4fb;
  --white: #ffffff;
  --ink: #000000;
  --ink-deep: #000000;
  --muted: #000000;
  --line: rgba(71, 104, 143, 0.18);
  --cyan: #72e9ef;
  --sky: #75c9ff;
  --hero-sky: #000000;
  --hero-sky-deep: #000000;
  --lavender: #bda7ff;
  --pink: #ef8bea;
  --font: "Pretendard", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 24px 60px rgba(57, 90, 129, 0.14);
  --ease: cubic-bezier(.23, 1, .32, 1);
}

@font-face {
  font-family: "Pretendard";
  src: url("./fonts/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
}

@font-face {
  font-family: "Pretendard";
  src: url("./fonts/Pretendard-Bold.woff2") format("woff2");
  font-weight: 700 900;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-deep);
  background: var(--ice);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; }

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  padding: 22px 0;
  background: rgba(245, 251, 253, .82);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 42px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a,
.nav-text {
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 800;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-text:hover {
  color: #655bd8;
}

.pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 18px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 100ms var(--ease), box-shadow 180ms var(--ease);
}

.pill:active { transform: translateY(1px); }
.pill-dark { color: #fff; background: var(--ink-deep); box-shadow: 0 10px 24px rgba(19, 41, 75, .18); }
.pill-light { color: var(--ink); background: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px var(--line), 0 10px 24px rgba(57,90,129,.08); }
.pill-outline { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 2px rgba(36, 51, 111, .68); }
.arrow::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.menu-button { display: none; }
.mobile-menu-tree { display: none; }

.all-menu {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.all-menu span,
.all-menu::before,
.all-menu::after {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: .18s var(--ease);
}
.all-menu span { display: block; }
.all-menu::before, .all-menu::after { content: ""; position: absolute; }
.all-menu::before { transform: translateY(-6px); }
.all-menu::after { transform: translateY(6px); }
.all-menu[aria-expanded="true"] span { opacity: 0; }
.all-menu[aria-expanded="true"]::before { transform: rotate(45deg); }
.all-menu[aria-expanded="true"]::after { transform: rotate(-45deg); }

.mega-menu {
  position: absolute;
  z-index: 19;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 34px 0 38px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  box-shadow: 0 28px 60px rgba(46,75,110,.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: .2s var(--ease);
}
.mega-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 26px; }
.mega-column { padding-left: 20px; border-left: 1px solid var(--line); }
.mega-column:first-child { padding-left: 0; border-left: 0; }
.mega-column > a {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}
.mega-column ul { margin: 0; padding: 0; list-style: none; }
.mega-column li + li { margin-top: 10px; }
.mega-column li a { color: var(--muted); font-size: 14px; font-weight: 700; }
.mega-column a:hover { color: #655bd8; }

.home-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 30%, rgba(255,255,255,.94), transparent 29rem),
    linear-gradient(135deg, #f5fbfd 0%, #eaf8fc 45%, #dff3fa 100%);
}

.hero {
  position: relative;
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(360px, .76fr) minmax(500px, 1.24fr);
  align-items: center;
  gap: 16px;
  padding-bottom: 50px;
}

.hero-copy {
  position: relative;
  z-index: 5;
  width: min(640px, 52vw);
  max-width: 640px;
  padding-bottom: 40px;
}

.kicker {
  margin: 0 0 22px;
  color: var(--hero-sky-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .11em;
}

.hero h1 {
  max-width: 640px;
  margin: 0;
  color: var(--hero-sky);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: clamp(46px, 4.85vw, 64px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.044em;
  word-break: keep-all;
}

.hero-copy > p:not(.kicker) {
  max-width: 540px;
  margin: 28px 0 0;
  color: #51667f;
  font-size: 20px;
  line-height: 1.78;
  font-weight: 500;
  word-break: keep-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.art {
  position: absolute;
  z-index: 1;
  top: -86px;
  right: -180px;
  width: 850px;
  height: 790px;
  pointer-events: none;
}

.soft-ribbon {
  position: absolute;
  border-radius: 999px;
  background: rgba(204, 236, 247, .55);
  transform: rotate(-24deg);
}
.soft-ribbon.one { top: 10px; right: -80px; width: 820px; height: 120px; }
.soft-ribbon.two { right: -40px; bottom: 30px; width: 760px; height: 118px; opacity: .58; }
.soft-ribbon.three { top: 70px; left: 10px; width: 450px; height: 82px; opacity: .28; transform: rotate(-12deg); }

.orb {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset -28px -38px 58px rgba(128, 96, 220, .16), 0 34px 90px rgba(73, 157, 205, .12);
}

.orb-main {
  left: 128px;
  top: 180px;
  width: 540px;
  height: 540px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.94) 0 5%, rgba(255,255,255,.2) 28%, transparent 42%),
    radial-gradient(circle at 76% 72%, rgba(242,126,232,.96), transparent 31%),
    radial-gradient(circle at 62% 48%, rgba(116,187,255,.88), transparent 43%),
    linear-gradient(145deg, #d6fff8 3%, #8cebf1 36%, #80cfff 62%, #b7a6ff 81%, #f38be5 100%);
}

.orb-small {
  top: 102px;
  right: 86px;
  width: 214px;
  height: 214px;
  opacity: .82;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.92), transparent 31%),
    linear-gradient(145deg, #cbfbf4 0%, #9ee3f9 43%, #b9a7ff 72%, #ed9be7 100%);
}

.dot-field {
  position: absolute;
  z-index: 3;
  top: 280px;
  left: 122px;
  width: 230px;
  height: 190px;
  background-image: radial-gradient(circle, rgba(255,255,255,.96) 0 2px, transparent 2.5px);
  background-size: 15px 15px;
}

.shape {
  position: absolute;
  z-index: 4;
  border-color: rgba(255,255,255,.95);
}

.shape.square {
  top: 105px;
  left: 330px;
  width: 72px;
  height: 72px;
  border: 5px solid rgba(255,255,255,.9);
  transform: rotate(45deg);
}

.shape.ring {
  width: 76px;
  height: 76px;
  border: 5px solid rgba(255,255,255,.92);
  border-radius: 50%;
}
.shape.ring.one { top: 242px; left: 515px; }
.shape.ring.two { right: 115px; bottom: 82px; }
.shape.ring.three { top: 310px; right: 28px; width: 28px; height: 28px; border-width: 3px; }

.shape.arc {
  width: 74px;
  height: 74px;
  border: 14px solid rgba(255,255,255,.94);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}
.shape.arc.one { top: 125px; right: 120px; transform: rotate(-45deg); }
.shape.arc.two { left: 12px; top: 350px; transform: rotate(42deg); }
.shape.arc.three { left: 100px; bottom: 60px; width: 42px; height: 42px; border-width: 8px; transform: rotate(18deg); }

.shape.line { width: 72px; height: 3px; background: rgba(255,255,255,.92); }
.shape.line.one { top: 360px; right: 120px; }
.shape.line.two { bottom: 92px; left: 410px; width: 54px; }

.shape.plus::before,
.shape.plus::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.86);
}
.shape.plus::before { width: 54px; height: 3px; left: -27px; }
.shape.plus::after { width: 3px; height: 54px; top: -26px; }
.shape.plus.one { top: 485px; left: 114px; }
.shape.plus.two { top: 495px; right: 122px; }

.pager {
  position: absolute;
  left: 0;
  bottom: 54px;
  display: flex;
  gap: 10px;
}
.pager span {
  width: 13px;
  height: 13px;
  border: 2px solid #6877a1;
  border-radius: 50%;
}
.pager span:first-child { background: var(--ink); border-color: var(--ink); }

.content-page { min-height: 100vh; background: linear-gradient(180deg, #f4fbfe, #eaf7fc); }
.page-main { padding: 74px 0 110px; }
.page-intro { max-width: 760px; margin-bottom: 42px; }
.page-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -.06em;
  word-break: keep-all;
}
.page-intro p { margin: 20px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }

.panel-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; }
.panel {
  padding: 28px;
  border: 1px solid rgba(95,126,162,.16);
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.panel-title { margin: 0 0 22px; color: var(--ink-deep); font-size: 20px; }
.field { display: grid; gap: 8px; margin-top: 16px; }
.field label, .label { color: #71809a; font-size: 12px; font-weight: 800; }
.control {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255,255,255,.86);
  color: var(--ink-deep);
  font-weight: 700;
}
textarea.control { min-height: 100px; resize: vertical; }
.panel .pill { margin-top: 20px; }
.result {
  min-height: 330px;
  padding: 28px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  color: #7b8aa1;
  background:
    radial-gradient(circle at 80% 85%, rgba(234,140,233,.24), transparent 34%),
    linear-gradient(145deg, rgba(216,255,249,.72), rgba(208,237,255,.8) 50%, rgba(226,217,255,.72));
  font-size: 17px;
  line-height: 1.8;
}
.result.has-message { align-items: flex-start; color: var(--ink-deep); font-weight: 700; }
.result-buttons { display: none; gap: 10px; flex-wrap: wrap; }
.result-buttons.show { display: flex; }

.feature-grid,
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.section-block { margin-top: 88px; }
.section-heading { max-width: 700px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 52px); letter-spacing: -.05em; }
.section-heading p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.tool-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.tool-choice {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.68);
}
.tool-choice strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 18px; }
.tool-choice span { color: var(--muted); font-size: 14px; line-height: 1.6; }
.privacy-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255,255,255,.7);
}
.privacy-icon { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg,var(--cyan),var(--lavender)); }
.privacy-box h3 { margin: 0 0 8px; color: var(--ink); }
.privacy-box p { margin: 0; color: var(--muted); line-height: 1.7; }
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(209,252,248,.86), rgba(210,235,255,.88), rgba(228,216,255,.85));
}
.cta-band h2 { margin: 0; color: var(--ink); font-size: 30px; letter-spacing: -.04em; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.content-search {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin-bottom: 18px;
}
.content-search .control { flex: 1; }
.content-search .pill { flex: 0 0 auto; margin: 0; }
.filter-button {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.76);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 800;
  cursor: pointer;
}
.filter-button.active { color: #fff; background: var(--ink); }
.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.content-thumb {
  height: 180px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--cyan), var(--sky) 48%, var(--lavender) 76%, var(--pink));
  font-size: 25px;
  font-weight: 900;
}
.content-body { padding: 22px; }
.content-body small { color: #7168cf; font-weight: 900; }
.content-body h2 { margin: 10px 0 8px; color: var(--ink); font-size: 21px; }
.content-body p { margin: 0; color: var(--muted); line-height: 1.65; }
.content-card.hidden { display: none; }

.timeline { display: grid; gap: 16px; }
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-date { color: #7168cf; font-size: 13px; font-weight: 900; }
.timeline-item h2 { margin: 0 0 8px; color: var(--ink); font-size: 22px; }
.timeline-item p { margin: 0; color: var(--muted); line-height: 1.6; }
.timeline-arrow { color: var(--ink); font-size: 24px; }

.about-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.value-list { display: grid; gap: 16px; }
.value-item { padding: 24px; border-radius: 20px; background: rgba(255,255,255,.72); }
.value-item strong { color: var(--ink); font-size: 20px; }
.value-item p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }

.faq-list { display: grid; gap: 12px; }
.faq-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.faq-question {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}
.faq-question::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 400;
}
.faq-item.open .faq-question::after { content: "−"; }
.faq-answer { display: none; padding: 0 20px 20px; }
.faq-item.open .faq-answer { display: block; }
.faq-answer p { margin: 0; color: var(--muted); line-height: 1.75; }
.feature-card,
.example-card {
  min-height: 250px;
  padding: 26px;
  border: 1px solid rgba(95,126,162,.16);
  border-radius: 24px;
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow);
}
.feature-mark {
  width: 50px;
  height: 50px;
  margin-bottom: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cyan), var(--sky), var(--lavender), var(--pink));
  box-shadow: inset -8px -10px 16px rgba(120,83,210,.14);
}
.feature-card h2, .example-card h2 { margin: 0; color: var(--ink); font-size: 23px; letter-spacing: -.035em; }
.feature-card p, .example-card p { color: var(--muted); line-height: 1.7; }
.example-card .tag { color: #7168cf; font-size: 12px; font-weight: 900; letter-spacing: .08em; }

.beta-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: 42px; align-items: start; }
.benefits { display: grid; gap: 12px; margin-top: 28px; }
.benefit { padding: 16px 18px; border-radius: 15px; background: rgba(255,255,255,.65); font-weight: 800; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  padding: 11px 17px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink-deep);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .18s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.program-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.program-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}

.program-card.primary {
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(114,233,239,.35), transparent 32%),
    linear-gradient(145deg, #12345d, #13294b);
}

.program-card.muted { opacity: .78; }
.program-card strong { color: inherit; font-size: 28px; letter-spacing: -.04em; }
.program-card p { margin: 0; color: inherit; line-height: 1.7; opacity: .78; }

.program-icon {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(114,233,239,.18);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 42, .42);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] { display: none; }

.dialog-card {
  position: relative;
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(19, 41, 75, .24);
}

.dialog-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -.04em;
}

.dialog-card p {
  color: var(--muted);
  line-height: 1.75;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(19,41,75,.08);
  cursor: pointer;
}

.dialog-close::before,
.dialog-close::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 9px;
  width: 16px;
  height: 2px;
  background: var(--ink-deep);
}

.dialog-close::before { transform: rotate(45deg); }
.dialog-close::after { transform: rotate(-45deg); }

.program-options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.program-option {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.program-option-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--hero-sky), var(--hero-sky-deep));
  font-size: 12px;
  font-weight: 900;
}

.program-option strong { display: block; color: var(--ink); }
.program-option span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.auth-gate {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.login-panel {
  width: min(520px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}

.login-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  letter-spacing: -.04em;
}

.login-panel p { color: var(--muted); line-height: 1.7; }
.login-form { margin-top: 22px; }

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.login-actions .pill { margin-top: 0; }

.game-workspace {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.game-workspace.locked { display: none; }

.bookshelf-panel,
.game-stage {
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}

.bookshelf-panel {
  padding: 22px;
}

.game-stage {
  display: none;
}

.bookshelf-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.bookshelf-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -.04em;
}

.book-list {
  display: grid;
  gap: 14px;
}

.book-item {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(71,104,143,.14);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(230,247,252,.72));
  color: var(--ink-deep);
  text-align: left;
  cursor: pointer;
}

.book-item.active {
  border-color: rgba(47,111,159,.55);
  background: linear-gradient(90deg, rgba(210,252,248,.95), rgba(223,237,255,.9));
}

.book-item.locked {
  background: linear-gradient(90deg, rgba(236,240,245,.86), rgba(255,255,255,.72));
}

.book-number {
  width: 38px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 10px 4px 4px 10px;
  color: #fff;
  background: linear-gradient(180deg, var(--hero-sky), var(--ink-deep));
  font-weight: 900;
}

.book-item.locked .book-number { background: #8390a6; }
.book-copy strong { display: block; color: var(--ink); font-size: 15px; }
.book-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.book-lock { font-size: 18px; }

.game-stage {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.stage-empty,
.game-stage .stage-card {
  height: 100%;
  min-height: 710px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.book-detail {
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}

.book-detail .stage-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
}

.stage-empty h2,
.stage-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -.06em;
}

.stage-empty p,
.stage-card p {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.game-demo-screen {
  min-height: min(62vh, 620px);
  display: grid;
  place-items: center;
  margin: 26px 0;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 24%, rgba(114,233,239,.38), transparent 32%),
    linear-gradient(145deg, #10284b, #244a8f);
  font-size: 26px;
  font-weight: 900;
}

.game-embed {
  width: 100%;
  min-height: min(68vh, 680px);
  margin: 22px 0;
  border: 1px solid rgba(71,104,143,.16);
  border-radius: 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.payment-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.payment-flow span {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(239,249,253,.9);
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
}

.admin-layout.locked { display: none; }

.admin-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.admin-tab {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}

.admin-tab.active {
  color: #fff;
  background: var(--ink-deep);
}

.admin-main { display: grid; gap: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.metric-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 10px 0;
  color: var(--ink);
  font-size: 38px;
  letter-spacing: -.04em;
}

.admin-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list strong { color: var(--ink); }
.rule-list span { color: var(--muted); text-align: right; }
.timeline.compact .timeline-item { grid-template-columns: 48px 1fr; gap: 16px; padding: 14px 0; }
.timeline.compact h2 { font-size: 18px; }

.home-page,
.content-page {
  color: #000;
}

.home-page :where(h1, h2, h3, h4, p, a, button, span, strong, small, label, input, select, textarea, li, dt, dd),
.content-page :where(h1, h2, h3, h4, p, a, button, span, strong, small, label, input, select, textarea, li, dt, dd) {
  color: #000;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-text:hover,
.mega-column a:hover {
  color: #000;
}

.pill-dark,
.filter-button.active,
.admin-tab.active {
  color: #000;
  background: rgba(255,255,255,.88);
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 24px rgba(57,90,129,.08);
}

.program-card.primary,
.content-thumb,
.game-demo-screen,
.book-number,
.book-item.locked .book-number,
.program-option-icon,
.toast {
  color: #000;
  background: rgba(239,249,253,.92);
}

@media (min-width: 961px) {
  .site-header:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .shell { width: min(100% - 36px, 740px); }
  .nav-links, .nav-actions .nav-text { display: none; }
  .menu-button {
    position: relative;
    display: inline-flex;
    width: 44px;
    min-height: 42px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-deep);
    box-shadow: none;
    font-size: 0;
  }
  .menu-button::before,
  .menu-button::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: translateX(-50%);
    transition: top .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
  }
  .menu-button::before {
    top: 13px;
    box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
  }
  .menu-button::after {
    top: 20px;
    opacity: 0;
  }
  .menu-button[aria-expanded="true"]::before {
    top: 20px;
    box-shadow: none;
    transform: translateX(-50%) rotate(45deg);
  }
  .menu-button[aria-expanded="true"]::after {
    opacity: 1;
    transform: translateX(-50%) rotate(-45deg);
  }
  .all-menu { display: none; }
  .nav-links.open {
    position: absolute;
    top: 68px;
    right: 18px;
    width: min(340px, calc(100vw - 36px));
    max-height: calc(100vh - 92px);
    display: block;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
    overflow-y: auto;
  }
  .nav-links.open > a {
    display: none;
  }
  .nav-links.open .mobile-menu-tree {
    display: grid;
    gap: 24px;
  }
  .mobile-menu-section {
    display: grid;
    gap: 11px;
  }
  .mobile-menu-heading {
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
  }
  .mobile-submenu {
    display: grid;
    gap: 9px;
    margin-left: 7px;
    padding-left: 17px;
    border-left: 2px solid rgba(101, 91, 216, .18);
  }
  .mobile-submenu a {
    position: relative;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
  }
  .mobile-submenu a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -18px;
    width: 9px;
    height: 1px;
    background: rgba(101, 91, 216, .38);
  }
  .hero { grid-template-columns: 1fr; padding-top: 70px; align-items: start; }
  .hero-copy { width: auto; padding-bottom: 540px; }
  .art { top: 370px; left: 50%; right: auto; width: 720px; height: 680px; transform: translateX(-47%); }
  .orb-main { width: 470px; height: 470px; }
  .orb-small { right: 70px; }
  .pager { bottom: 24px; }
  .panel-grid, .beta-wrap { grid-template-columns: 1fr; }
  .feature-grid, .example-grid { grid-template-columns: repeat(2, 1fr); }
  .mega-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-choices, .content-grid { grid-template-columns: repeat(2, 1fr); }
  .about-layout { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: 1fr; }
  .game-workspace { grid-template-columns: 1fr; }
  .bookshelf-panel, .game-stage { min-height: auto; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-panels { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 32px); }
  .site-header { padding: 16px 0; }
  .brand { height: 38px; }
  .brand-logo { height: 28px; }
  .nav-actions .pill-dark { display: none; }
  .nav-actions .menu-button { display: inline-flex; }
  .hero { min-height: auto; padding-top: 42px; }
  .hero h1 { font-size: clamp(40px, 11vw, 56px); }
  .hero-copy > p:not(.kicker) { font-size: 17px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .pill { width: 100%; }
  .hero-copy { padding-bottom: 430px; }
  .art { top: 430px; width: 540px; height: 520px; transform: translateX(-46%); }
  .orb-main { left: 80px; top: 120px; width: 350px; height: 350px; }
  .orb-small { top: 58px; right: 42px; width: 145px; height: 145px; }
  .dot-field { top: 190px; left: 76px; width: 145px; height: 130px; background-size: 12px 12px; }
  .shape.square { top: 55px; left: 220px; width: 50px; height: 50px; }
  .shape.arc.one { right: 55px; }
  .shape.arc.two { left: 0; top: 260px; }
  .shape.ring.one { top: 150px; left: 340px; width: 54px; height: 54px; }
  .shape.plus.one { top: 330px; left: 90px; }
  .shape.plus.two { top: 335px; right: 80px; }
  .pager { display: none; }
  .page-main { padding-top: 52px; }
  .feature-grid, .example-grid, .form-grid { grid-template-columns: 1fr; }
  .tool-choices, .content-grid, .mega-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .panel, .feature-card, .example-card { padding: 22px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .timeline-arrow { display: none; }
  .cta-band { align-items: flex-start; flex-direction: column; }
  .content-search { align-items: stretch; flex-direction: column; }
  .program-card, .login-panel, .dialog-card { padding: 22px; }
  .program-option { grid-template-columns: 42px 1fr; }
  .program-option .arrow { grid-column: 1 / -1; }
  .payment-flow { grid-template-columns: 1fr 1fr; }
  .admin-sidebar, .metric-grid { grid-template-columns: 1fr; }
  .rule-list p { align-items: flex-start; flex-direction: column; }
  .rule-list span { text-align: left; }
}

/* Minigame library only: warm Notion-style bookshelf */
.games-page .page-intro h1,
.games-page .page-intro p,
.games-page .bookshelf-panel h2,
.games-page .stage-card h2,
.games-page .stage-card p {
  color: #242424;
}

.games-page .auth-gate,
.games-page .game-workspace {
  color: #242424;
}

.games-page .login-panel,
.games-page .bookshelf-panel,
.games-page .book-detail,
.games-page .game-stage {
  background: #fbfaf7;
  border: 1px solid #242424;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #242424;
}

.games-page .bookshelf-panel {
  padding: clamp(18px, 3vw, 30px);
}

.games-page .bookshelf-head {
  padding-bottom: 18px;
  border-bottom: 1px solid #d8d6d1;
}

.games-page .book-list {
  gap: 9px;
}

.games-page .book-item,
.games-page .book-item.locked,
.games-page .book-item.active {
  min-height: 72px;
  grid-template-columns: 44px 1fr auto;
  padding: 10px 12px;
  color: #242424;
  background: #fff;
  border: 1px solid #d8d6d1;
  border-radius: 9px;
  box-shadow: none;
}

.games-page .book-item:hover {
  background: #efeee9;
  border-color: #a9a7a1;
}

.games-page .book-item.active {
  background: #efeee9;
  border-color: #242424;
  box-shadow: inset 4px 0 0 #242424;
}

/* Account and QR enrollment */
.platform-auth-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(114, 233, 239, .18), transparent 34%),
    linear-gradient(180deg, #f8fcfd, #eaf7fb);
}

.account-main {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(420px, 1fr);
  align-items: start;
  gap: clamp(36px, 7vw, 96px);
  padding-top: clamp(54px, 9vw, 110px);
  padding-bottom: 96px;
}

.account-heading {
  position: sticky;
  top: 44px;
}

.account-heading h1,
.join-panel h1 {
  margin: 12px 0 0;
  color: #000;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: 0;
}

.account-heading p:not(.kicker),
.join-panel > p:not(.kicker) {
  margin: 22px 0 0;
  color: #000;
  font-size: 18px;
  line-height: 1.7;
}

.account-panel {
  width: 100%;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid #000;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 8px 8px 0 #000;
}

.account-panel > h2 {
  margin: 0 0 18px;
  font-size: 19px;
  letter-spacing: 0;
}

.role-segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid #000;
  border-radius: 6px;
  background: #000;
}

.role-segments button {
  min-height: 46px;
  padding: 10px 8px;
  color: #000;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.role-segments button.active {
  background: #9eeaf0;
  box-shadow: inset 0 -4px 0 #e0b740;
}

.account-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-panel .field > span {
  color: #000;
  font-size: 13px;
  font-weight: 800;
}

.account-panel .control {
  min-height: 50px;
  border-color: rgba(0, 0, 0, .34);
  border-radius: 6px;
  color: #000;
  background: #fff;
}

.account-panel .control:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(114, 233, 239, .45);
}

.account-actions {
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, .14);
}

.agreement-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  color: #000;
  font-size: 14px;
  line-height: 1.5;
}

.agreement-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #000;
}

.form-status {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-left: 4px solid #23713f;
  background: #e8f8ed;
  color: #000;
  font-weight: 700;
  line-height: 1.5;
}

.form-status[data-type="error"] {
  border-left-color: #c52f2f;
  background: #fff0f0;
}

.join-main {
  width: min(620px, calc(100% - 32px));
  min-height: calc(100vh - 100px);
  display: grid;
  align-items: center;
  margin-inline: auto;
  padding: 48px 0 80px;
}

.join-panel h1 {
  font-size: clamp(30px, 8vw, 52px);
}

.join-teacher {
  margin: 10px 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .18);
  font-weight: 800;
}

.account-loader {
  width: 36px;
  height: 36px;
  margin-top: 26px;
  border: 4px solid rgba(0, 0, 0, .16);
  border-top-color: #000;
  border-radius: 50%;
  animation: account-spin .8s linear infinite;
}

.full-account-button {
  width: 100%;
  margin-top: 24px;
}

@keyframes account-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .account-main {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 36px;
    padding-bottom: 64px;
  }

  .account-heading {
    position: static;
  }

  .account-heading h1 {
    font-size: 44px;
  }

  .account-field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .role-segments {
    grid-template-columns: repeat(2, 1fr);
  }

  .compact-account-header .nav {
    justify-content: center;
  }
}

/* Role dashboards */
.platform-dashboard-page {
  min-height: 100vh;
  background: #f2fafc;
}

.dashboard-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(0, 0, 0, .14);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}

.dashboard-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  padding: 7px 9px;
  border: 1px solid #000;
  border-radius: 5px;
  background: #b8eff2;
  font-size: 12px;
  font-weight: 900;
}

.icon-command {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #000;
  border-radius: 50%;
  color: #000;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding-top: 42px;
  padding-bottom: 96px;
}

.dashboard-sidebar {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 6px;
}

.dashboard-side-button {
  min-height: 44px;
  padding: 10px 12px;
  border-left: 3px solid transparent;
  color: #000;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}

.dashboard-side-button.active {
  border-left-color: #000;
  background: #fff;
}

.dashboard-content {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.dashboard-anchor {
  scroll-margin-top: 106px;
}

.dashboard-loading {
  min-height: 500px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}

.dashboard-section-head h1 {
  margin: 10px 0 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.dashboard-section-head > p:not(.kicker) {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-metric {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 8px;
  background: #fff;
}

.dashboard-metric span,
.dashboard-metric small {
  display: block;
  color: #000;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-metric strong {
  display: block;
  margin: 10px 0;
  overflow-wrap: anywhere;
  color: #000;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.dashboard-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.teacher-columns {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
}

.dashboard-block {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 8px;
  background: #fff;
}

.dashboard-block-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.dashboard-block-head h2,
.qr-output h3 {
  margin: 5px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.dashboard-block-head > span {
  font-size: 13px;
  font-weight: 800;
}

.compact-dashboard-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(0, 0, 0, .14);
}

.compact-dashboard-form.stacked {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.compact-dashboard-form label {
  display: grid;
  gap: 7px;
  color: #000;
  font-size: 12px;
  font-weight: 800;
}

.compact-dashboard-form .control {
  min-height: 42px;
  border-color: rgba(0, 0, 0, .24);
  border-radius: 5px;
}

.dashboard-list {
  display: grid;
  gap: 4px;
}

.dashboard-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.dashboard-list-row div {
  min-width: 0;
}

.dashboard-list-row strong,
.dashboard-list-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-row small,
.dashboard-list-row > span:last-child {
  margin-top: 3px;
  font-size: 12px;
}

.list-initial {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #000;
  border-radius: 50%;
  background: #b8eff2;
  font-weight: 900;
}

.list-initial.student {
  background: #f3dc77;
}

.dashboard-empty {
  margin: 16px 0;
  line-height: 1.6;
}

.subscription-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.subscription-summary-grid p {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 6px;
  background: #f7fbfc;
}

.subscription-summary-grid strong {
  font-size: 22px;
}

.subscription-summary-grid span,
.dashboard-note {
  font-size: 12px;
}

.dashboard-note {
  margin: 16px 0 0;
  line-height: 1.6;
}

.dashboard-action-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dashboard-action-button {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid #000;
  border-radius: 8px;
  color: #000;
  background: #b8eff2;
  cursor: pointer;
  text-align: left;
}

.dashboard-action-button.attendance { background: #f3dc77; }
.dashboard-action-button.game { background: #d6c9ff; }
.dashboard-action-button span { font-size: 12px; font-weight: 800; }
.dashboard-action-button strong { font-size: 18px; }

.student-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  color: #000;
  text-align: left;
}

.student-table th,
.student-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  white-space: nowrap;
}

.student-table th { font-size: 12px; }
.student-table small { display: block; margin-top: 3px; }

.table-command {
  padding: 7px 9px;
  border: 1px solid #000;
  border-radius: 5px;
  color: #000;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.qr-output {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 0, 0, .16);
}

.qr-output-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.qr-output img {
  width: min(100%, 360px);
  display: block;
  margin: 18px auto;
  border: 1px solid #000;
}

.qr-output code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  background: #edf1ed;
  font-size: 11px;
}

.game-room-output {
  display: grid;
  justify-items: start;
  gap: 14px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #000;
  border-radius: 8px;
  background: #f2fafc;
}

.game-room-output h3 {
  margin: 5px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.game-room-output img {
  width: min(100%, 360px);
  border: 1px solid #000;
  background: #fff;
}

.game-room-output p { margin: 0; }

.game-room-output code {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 10px;
  background: #fff;
  font-size: 11px;
}

.student-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 16px;
}

.character-stage {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid #000;
  border-radius: 8px;
  background: linear-gradient(135deg, #b8eff2, #f5edb8 58%, #d6c9ff);
}

.character-visual {
  position: relative;
  min-height: 250px;
  display: grid;
  place-items: center;
}

.character-visual img {
  position: relative;
  z-index: 1;
  width: min(72%, 180px);
  height: auto;
  image-rendering: auto;
}

.character-aura {
  position: absolute;
  width: 190px;
  height: 190px;
  border: 2px solid #000;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
}

.character-copy span { font-size: 12px; font-weight: 900; }
.character-copy h2 { margin: 8px 0 12px; font-size: 38px; letter-spacing: 0; }
.character-copy p { margin: 0; line-height: 1.6; }

.student-summary {
  display: grid;
  gap: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-grid div {
  padding: 16px 10px;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 6px;
  text-align: center;
}

.stat-grid span,
.stat-grid strong { display: block; }
.stat-grid span { font-size: 12px; }
.stat-grid strong { margin-top: 8px; font-size: 28px; }

.stat-allocation-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, .14);
}

.stat-allocation-form > p { margin: 0; }

.stat-allocation-form > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-allocation-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.stat-allocation-form .control {
  min-width: 0;
  min-height: 40px;
  border-radius: 5px;
}

.item-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.item-shop-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 7px;
  background: #fff;
}

.item-shop-card.equipped {
  border-color: #000;
  background: #edfaf4;
}

.item-shop-card > div {
  min-width: 0;
}

.item-shop-card strong,
.item-shop-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-shop-card small,
.item-shop-card p {
  margin: 3px 0 0;
  font-size: 11px;
}

.item-shop-card p {
  grid-column: 2;
}

.item-shop-card .table-command {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.item-swatch,
.attendance-mark {
  display: grid;
  place-items: center;
  border: 1px solid #000;
  background: var(--item-color, #dff5eb);
  font-weight: 900;
}

.item-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.attendance-mark {
  min-width: 48px;
  min-height: 34px;
  padding: 5px;
  border-radius: 5px;
  background: #f3dc77;
  font-size: 12px;
}

.talent-amount {
  min-width: 48px;
  color: #176c35;
  font-weight: 900;
}

.talent-amount.minus { color: #b52828; }

.dashboard-error {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.credential-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid #000;
  border-radius: 8px;
  color: #000;
  background: #fff;
  box-shadow: 8px 8px 0 #000;
}

.credential-dialog::backdrop {
  background: rgba(0, 0, 0, .56);
}

.credential-dialog-inner {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.credential-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.credential-dialog h2 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.credential-dialog p { margin: 0; line-height: 1.6; }

.credential-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.credential-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 6px;
  background: #f2fafc;
}

.credential-list dt { font-size: 12px; font-weight: 800; }
.credential-list dd { margin: 0; overflow-wrap: anywhere; font-weight: 900; }

.credential-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-dashboard-shell {
  grid-template-columns: 190px minmax(0, 1fr);
}

.admin-table .control {
  min-width: 170px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(0, 0, 0, .28);
  border-radius: 5px;
  color: #000;
  background: #fff;
}

.admin-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-game-grid article {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 6px;
}

.admin-game-grid article > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #b8eff2;
  font-weight: 900;
}

.admin-game-grid div { min-width: 0; }
.admin-game-grid strong,
.admin-game-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-game-grid small,
.admin-game-grid b { font-size: 11px; }

.attendance-check-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #b8eff2, #f5edb8 56%, #d6c9ff);
}

.attendance-check-main {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
  padding: 48px 0 80px;
}

.attendance-check-panel {
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid #000;
  border-radius: 8px;
  background: #fff;
  box-shadow: 8px 8px 0 #000;
  text-align: center;
}

.attendance-check-panel .account-loader { margin-inline: auto; }
.attendance-check-panel h1 { margin: 20px 0 0; font-size: clamp(34px, 8vw, 56px); letter-spacing: 0; }
.attendance-check-panel > p:not(.kicker) { line-height: 1.6; }
.attendance-check-panel .pill { margin-top: 22px; }

.attendance-reward {
  width: fit-content;
  margin: 24px auto 0;
  padding: 12px 18px;
  border: 1px solid #000;
  border-radius: 999px;
  background: #f3dc77;
  font-size: 20px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; grid-template-columns: repeat(4, 1fr); overflow-x: auto; }
  .dashboard-side-button { text-align: center; white-space: nowrap; }
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-two-column,
  .teacher-columns,
  .student-hero-grid { grid-template-columns: 1fr; }
  .item-shop-grid { grid-template-columns: 1fr; }
  .admin-dashboard-shell { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dashboard-nav { min-height: 66px; }
  .dashboard-account strong { display: none; }
  .dashboard-shell { gap: 20px; padding-top: 24px; }
  .dashboard-sidebar { margin-inline: -8px; }
  .dashboard-side-button { min-width: 110px; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-metric { padding: 15px; }
  .dashboard-action-strip { grid-template-columns: 1fr; }
  .compact-dashboard-form { grid-template-columns: 1fr; align-items: stretch; }
  .dashboard-block { padding: 18px; }
  .character-stage { grid-template-columns: 1fr; padding: 22px; text-align: center; }
  .character-visual { min-height: 210px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-allocation-form > div,
  .subscription-summary-grid { grid-template-columns: 1fr; }
  .credential-list > div { grid-template-columns: 1fr; gap: 4px; }
  .admin-game-grid { grid-template-columns: 1fr; }
  .admin-platform-page .dashboard-account .pill { display: none; }
}

.games-page .book-item.locked {
  color: #777;
  background: #f7f6f3;
}

.games-page .book-number,
.games-page .book-item.locked .book-number {
  width: 36px;
  height: 48px;
  color: #242424;
  background: #efeee9;
  border: 1px solid #d8d6d1;
  border-radius: 5px;
}

.games-page .book-copy strong {
  color: #242424;
  font-size: 16px;
}

.games-page .book-copy span {
  color: #686868;
  font-size: 13px;
}

.games-page .book-lock {
  color: #555;
  font-size: 13px;
  font-weight: 800;
}

.games-page .book-detail {
  margin: 12px 0 20px;
  padding: clamp(18px, 3vw, 30px);
}

.games-page .game-embed {
  border: 1px solid #d8d6d1;
  border-radius: 10px;
  box-shadow: none;
}

.games-page .game-embed.qr-embed {
  min-height: min(82vh, 820px);
  background: #111827;
}

.games-page .pill,
.games-page .filter-button {
  border: 1px solid #242424;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #242424;
}

.games-page .pill-dark {
  color: #242424;
  background: #fff;
}

.games-page .pill:hover,
.games-page .filter-button:hover {
  background: #efeee9;
  box-shadow: 1px 1px 0 #242424;
  transform: translate(2px, 2px);
}

@media (max-width: 560px) {
  .games-page .login-panel,
  .games-page .bookshelf-panel,
  .games-page .book-detail {
    border-radius: 10px;
    box-shadow: 4px 4px 0 #242424;
  }
}
