:root {
  font-family: "DM Sans", "Trebuchet MS", Arial, sans-serif;
  color: #243237;
  background: #fbfaf6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #243237;
  --muted: #6c7776;
  --purple: #176b5d;
  --purple-dark: #105649;
  --purple-pale: #e7f2ed;
  --yellow: #f4c56a;
  --line: #e7e5dc;
  --card: #fff;
  --green: #28a879;
  --shadow: 0 16px 48px rgba(48, 37, 100, .09);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.boot .brand-mark { width: 52px; height: 52px; }
.topbar { height: 76px; padding: 0 max(5vw, 24px); display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 22px "Space Grotesk", "Trebuchet MS", sans-serif; letter-spacing: -.8px; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; color: white; border-radius: 9px 9px 9px 3px; background: var(--purple); font: 700 21px "Space Grotesk", sans-serif; box-shadow: none; }
.top-actions { display: flex; align-items: center; gap: 11px; }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-right: 7px; font-size: 13px; font-weight: 700; }
.user-chip small { color: var(--muted); font-weight: 500; }
.button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 0 18px; border-radius: 13px; font-weight: 700; text-decoration: none; transition: transform .16s, background .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: var(--purple); color: white; box-shadow: 0 6px 14px #6b55e828; }
.button-primary:hover { background: var(--purple-dark); }
.button-yellow { background: var(--yellow); color: #342b14; }
.button-light { background: #f0eef7; color: var(--ink); }
.button-outline { background: white; color: var(--purple-dark); box-shadow: inset 0 0 0 1px #d9d3f5; }
.button-danger { background: #fff0ef; color: #b3413e; }
.button-small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.button-block { width: 100%; }
.hero { position: relative; overflow: hidden; min-height: 590px; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr); align-items: center; gap: 36px; padding: 74px max(8vw, 28px) 84px; background: #f3f0ff; }
.hero:before, .hero:after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero:before { width: 500px; height: 500px; right: -100px; top: -260px; background: #e3dcff; }
.hero:after { width: 260px; height: 260px; left: 36%; bottom: -180px; background: #fff0bd; }
.hero-copy, .hero-art { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; padding: 8px 13px; background: white; color: #5b47cf; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 700px; margin: 21px 0 19px; font: 700 clamp(42px, 6vw, 70px)/1.02 "Space Grotesk", sans-serif; letter-spacing: -3.2px; }
.hero h1 span { color: var(--purple); }
.hero-copy > p { max-width: 540px; color: #656179; font-size: 18px; line-height: 1.65; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { display: flex; gap: 9px; align-items: center; margin-top: 25px; color: #77748b; font-size: 13px; }
.hero-note strong { color: #423c63; }
.hero-art { min-height: 380px; display: grid; place-items: center; }
.game-card-art { position: absolute; width: min(390px, 100%); min-height: 255px; padding: 26px; border-radius: 24px; background: white; box-shadow: var(--shadow); transform: rotate(4deg); }
.game-card-art.back { width: min(345px, 90%); background: #ffcf52; transform: translate(-33px, 27px) rotate(-8deg); }
.art-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.art-badge { border-radius: 10px; padding: 7px 10px; background: #edfff8; color: #218c68; font-size: 12px; }
.art-question { margin: 34px 0 20px; font: 700 23px "Space Grotesk", sans-serif; }
.art-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.art-answers span { padding: 11px 12px; border-radius: 11px; background: #f2f0fa; color: #615d72; font-weight: 600; font-size: 13px; }
.art-answers span:nth-child(2) { background: #eeeaff; color: var(--purple-dark); }
.section { padding: 76px max(8vw, 28px); }
.section-heading { max-width: 650px; margin: 0 auto 34px; text-align: center; }
.section-heading h2 { margin-bottom: 10px; font: 700 clamp(29px, 4vw, 42px) "Space Grotesk", sans-serif; letter-spacing: -1.3px; }
.section-heading p { color: var(--muted); line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1120px; margin: auto; }
.feature { padding: 25px; border: 1px solid var(--line); border-radius: 19px; background: white; }
.feature-icon { display: grid; place-items: center; width: 47px; height: 47px; margin-bottom: 17px; border-radius: 15px; background: var(--purple-pale); font-size: 22px; }
.feature:nth-child(2) .feature-icon { background: #fff4d4; }
.feature:nth-child(3) .feature-icon { background: #e4faf2; }
.feature h3 { margin-bottom: 8px; font: 700 18px "Space Grotesk", sans-serif; }
.feature p { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.footer { padding: 23px max(5vw, 24px); background: white; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { max-width: 1140px; display: flex; align-items: center; justify-content: space-between; margin: auto; }
.page-shell { max-width: 1240px; margin: auto; padding: 36px 26px 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 5px 0 25px; }
.page-heading h1 { margin: 0 0 5px; font: 700 clamp(30px, 4vw, 42px) "Space Grotesk", sans-serif; letter-spacing: -1.3px; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading-actions { display: flex; gap: 9px; align-items: center; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr); gap: 22px; align-items: start; }
.column { display: grid; gap: 20px; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 5px 20px #2b23520a; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font: 700 19px "Space Grotesk", sans-serif; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-count { padding: 5px 9px; background: #f1eff9; color: #615c7a; border-radius: 8px; font-size: 12px; font-weight: 800; }
.game-list, .session-list, .staff-list { display: grid; gap: 10px; }
.game-row, .session-row, .staff-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid #eeecf4; border-radius: 13px; }
.game-meta, .session-meta, .staff-meta { min-width: 0; }
.game-meta strong, .session-meta strong, .staff-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.game-meta span, .session-meta span, .staff-meta span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; background: #f1eff9; color: #655e81; font-size: 11px; font-weight: 800; }
.tag-live { background: #e4faf2; color: #278361; }
.tag-dev { background: #eeeaff; color: #5842ce; }
.empty { padding: 19px; border: 1px dashed #dcd7eb; border-radius: 13px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.6; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset { padding: 15px; border-radius: 13px; background: #f7f6fb; }
.preset h3 { margin: 0 0 5px; font: 700 15px "Space Grotesk", sans-serif; }
.preset p { min-height: 40px; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.preset small { display: block; margin-bottom: 9px; color: #87839a; font-size: 11px; }
.school-select { min-width: 180px; }
.select, .input, .textarea { width: 100%; min-height: 45px; padding: 11px 13px; outline: 0; border: 1px solid #dedbe9; border-radius: 11px; background: white; color: var(--ink); }
.select:focus, .input:focus, .textarea:focus { border-color: #9c8df0; box-shadow: 0 0 0 3px #6b55e81c; }
.textarea { min-height: 90px; resize: vertical; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 7px; }
.field label { color: #4e4a62; font-size: 13px; font-weight: 700; }
.help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.divider { display: flex; align-items: center; gap: 11px; color: #9a96a9; font-size: 12px; }
.divider:before, .divider:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-wrap { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 42px 22px; background: #f3f0ff; }
.auth-card { width: min(100%, 460px); padding: 32px; border: 1px solid #ebe8f4; border-radius: 23px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 22px 0 7px; font: 700 31px "Space Grotesk", sans-serif; letter-spacing: -1px; }
.auth-card > p { margin-bottom: 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-switch { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.auth-switch button { padding: 0; border: 0; background: none; color: var(--purple-dark); font-weight: 800; }
.notice { padding: 13px 15px; border-radius: 12px; background: #f1eff9; color: #5e5878; font-size: 13px; line-height: 1.6; }
.notice-warn { background: #fff5d8; color: #74591d; }
.game-editor { max-width: 780px; margin: auto; }
.question-editor { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.question-editor h3 { margin: 0 0 14px; font: 700 16px "Space Grotesk", sans-serif; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.radio-options { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 13px; }
.radio-options label { display: flex; align-items: center; gap: 5px; }
.host-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .75fr); gap: 20px; }
.pin-display { padding: 24px; border-radius: 17px; background: #f3f0ff; text-align: center; }
.pin-display small { display: block; color: #736b97; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.pin-number { display: block; margin: 5px 0; font: 700 clamp(42px, 7vw, 66px) "Space Grotesk", sans-serif; letter-spacing: 6px; color: var(--purple-dark); }
.pin-display p { margin: 0; color: var(--muted); font-size: 13px; }
.host-question { padding: 19px 0; border-bottom: 1px solid var(--line); }
.host-question h2 { font: 700 25px/1.35 "Space Grotesk", sans-serif; }
.host-question li { margin: 8px 0; color: #605c73; }
.player-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.player-tile { padding: 11px 12px; border: 1px solid #eeecf4; border-radius: 11px; }
.player-tile strong { display: block; font-size: 13px; }
.player-tile small { color: var(--muted); font-size: 11px; }
.play-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: #f3f0ff; }
.play-card { width: min(100%, 700px); padding: clamp(20px, 5vw, 38px); border: 1px solid #ebe8f4; border-radius: 23px; background: white; box-shadow: var(--shadow); }
.play-card h1 { margin: 14px 0 8px; font: 700 clamp(25px, 5vw, 37px) "Space Grotesk", sans-serif; letter-spacing: -1px; }
.play-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 23px; }
.answer-button { min-height: 74px; padding: 14px; border: 1px solid #e8e5f1; border-radius: 13px; background: #faf9fd; color: #302d46; text-align: left; font-weight: 700; transition: .15s ease; }
.answer-button:hover:not(:disabled) { border-color: #a194ed; background: #f2efff; }
.answer-button:disabled { cursor: default; opacity: .68; }
.score-list { display: grid; gap: 8px; margin-top: 18px; }
.score-line { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 10px; background: #f7f6fb; font-size: 14px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: min(420px, calc(100vw - 40px)); padding: 14px 18px; border-radius: 12px; background: #28253b; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9f3c3a; }
.permission-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.permission-list label { display: flex; align-items: center; gap: 8px; color: #5e5a71; font-size: 13px; }
.attest { display: flex; align-items: flex-start; gap: 9px; color: #5e5a71; font-size: 13px; line-height: 1.5; }
.attest input { margin-top: 3px; accent-color: var(--purple); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.home-main { max-width: 1240px; margin: auto; padding: 0 34px; }
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(345px, 430px); gap: clamp(42px, 8vw, 110px); align-items: center; min-height: 570px; padding: 72px 5.5% 78px; border-bottom: 1px solid var(--line); }
.home-hero:before { content: ""; position: absolute; z-index: -1; top: 42px; right: 0; width: 48%; height: calc(100% - 84px); border-radius: 4px 80px 4px 4px; background-color: #edf2eb; background-image: linear-gradient(90deg, transparent 49%, #ffffff55 50%, transparent 51%), linear-gradient(transparent 49%, #ffffff55 50%, transparent 51%); background-size: 32px 32px; }
.home-copy { max-width: 610px; }
.home-kicker { display: inline-flex; align-items: center; gap: 11px; color: #54615d; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.kicker-rule { width: 27px; height: 2px; background: #d47c58; }
.home-copy h1 { margin: 24px 0 19px; color: #203331; font: 700 clamp(46px, 6.5vw, 77px)/.99 Georgia, "Times New Roman", serif; letter-spacing: -3.4px; }
.home-copy h1 em { color: #176b5d; font-weight: 500; }
.home-copy > p:not(.home-promise) { max-width: 510px; margin-bottom: 0; color: #687472; font-size: 17px; line-height: 1.75; }
.home-copy .hero-buttons { margin-top: 28px; }
.button-paper { background: white; color: #344340; box-shadow: inset 0 0 0 1px #d9ded5; }
.home-promise { margin: 25px 0 0; color: #737d78; font-size: 12px; line-height: 1.6; }
.home-promise strong { color: #364942; }
.join-panel { position: relative; z-index: 1; padding: 30px; border-radius: 4px 22px 4px 4px; background: #173d36; color: #fffdf6; box-shadow: 0 20px 46px #203b301e; }
.join-panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid #ffffff25; }
.join-label { color: #c8d6ca; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.join-step { color: #9ab2a7; font-size: 11px; font-variant-numeric: tabular-nums; }
.join-panel h2 { margin: 22px 0 7px; color: white; font: 700 29px Georgia, "Times New Roman", serif; letter-spacing: -.5px; }
.join-panel > p { margin-bottom: 21px; color: #c3d1c9; font-size: 13px; line-height: 1.6; }
.join-form { display: grid; gap: 9px; }
.join-form label { margin-top: 4px; color: #e2e8df; font-size: 11px; font-weight: 700; }
.join-form .input { min-height: 47px; border-color: #ffffff30; border-radius: 5px; background: #ffffff10; color: white; }
.join-form .input::placeholder { color: #a7bbb0; }
.join-form .input:focus { border-color: #e8bd72; box-shadow: 0 0 0 3px #e8bd7228; }
.join-form .join-code { font-size: 19px; font-weight: 800; letter-spacing: 5px; }
.join-submit { justify-content: space-between; min-height: 49px; margin-top: 9px; padding: 0 15px; border-radius: 5px; background: #e6b866; color: #20352f; }
.join-submit:hover { background: #f0c879; }
.join-foot { display: flex; align-items: center; gap: 8px; margin-top: 17px; color: #b7c8be; font-size: 11px; }
.join-lock { width: 9px; height: 9px; border: 1px solid #c9d7c8; border-radius: 50%; }
.how-section { padding: 63px 5.5% 80px; }
.how-heading { margin-bottom: 31px; }
.how-heading h2 { margin: 13px 0 0; color: #263634; font: 700 clamp(27px, 4vw, 39px) Georgia, "Times New Roman", serif; letter-spacing: -.7px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.step { display: flex; gap: 18px; padding: 24px 25px 10px 0; }
.step + .step { padding-left: 24px; border-left: 1px solid var(--line); }
.step-number { color: #bc7959; font: 700 12px Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; }
.step h3 { margin: 0 0 7px; color: #2c3936; font: 700 16px Georgia, "Times New Roman", serif; }
.step p { max-width: 280px; margin: 0; color: #717a76; font-size: 13px; line-height: 1.7; }
.footer { background: #fbfaf6; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .hero-art { min-height: 330px; }
  .dashboard-grid, .host-layout { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr minmax(300px, .82fr); gap: 30px; padding-right: 1%; padding-left: 1%; }
  .home-hero:before { right: -20px; width: 50%; }
  .home-copy h1 { font-size: clamp(45px, 6.3vw, 62px); }
}
@media (max-width: 620px) {
  .topbar { height: 66px; padding: 0 16px; }
  .user-chip { display: none; }
  .hero { min-height: 0; padding: 50px 22px 58px; }
  .hero h1 { letter-spacing: -2px; }
  .hero-copy > p { font-size: 16px; }
  .hero-art { min-height: 285px; }
  .game-card-art { padding: 20px; min-height: 225px; }
  .section { padding: 55px 20px; }
  .feature-grid, .preset-grid { grid-template-columns: 1fr; }
  .page-shell { padding: 25px 15px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading-actions { flex-wrap: wrap; width: 100%; }
  .panel { padding: 17px; }
  .game-row, .session-row, .staff-row { align-items: flex-start; flex-direction: column; }
  .form-row, .choice-grid, .play-options, .player-grid, .permission-list { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .footer-inner { gap: 8px; align-items: flex-start; flex-direction: column; }
  .home-main { padding: 0 19px; }
  .home-hero { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding: 52px 0 43px; }
  .home-hero:before { top: 31px; right: -9px; width: 74%; height: 265px; }
  .home-copy h1 { margin-top: 18px; font-size: clamp(47px, 14vw, 66px); letter-spacing: -2.6px; }
  .home-copy > p:not(.home-promise) { font-size: 15px; }
  .join-panel { padding: 23px; }
  .how-section { padding: 47px 0 55px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 19px 0; border-left: 0; }
  .step + .step { border-top: 1px solid var(--line); }
}
