:root {
  --navy: #0d3040;
  --navy-2: #174d5c;
  --red: #9c3126;
  --red-2: #6d201c;
  --gold: #e1b84f;
  --gold-light: #f6dd88;
  --cream: #fff8e7;
  --paper: #fffdf6;
  --ink: #18394a;
  --muted: #66756f;
  --green: #1c7b66;
  --purple: #714374;
  --blue: #175a83;
  --line: #dfcfaa;
  --shadow: 0 24px 60px rgba(32, 24, 13, .18);
  font-family: "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  color: var(--ink);
  background: #f5ead3;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 30% 0, #fffaf0, #f1e2c6 70%, #e8d5b1); font-size: 17px; line-height: 1.65; overflow-x: hidden; }
body.is-playing { background: #f3ead8; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.game-shell { width: min(1420px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 16px; color: #fff; background: var(--red); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; width: 5px; height: 5px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 16px 5px rgba(225,184,79,.4); animation: drift 8s ease-in-out infinite; }
.ambient i:nth-child(1) { left: 8%; top: 18%; }
.ambient i:nth-child(2) { right: 12%; top: 31%; animation-delay: -2s; }
.ambient i:nth-child(3) { left: 24%; bottom: 20%; animation-delay: -4s; }
.ambient i:nth-child(4) { right: 30%; bottom: 12%; animation-delay: -6s; }
.ambient i:nth-child(5) { left: 55%; top: 12%; animation-delay: -3s; }
@keyframes drift { 0%,100% { transform: translateY(0) scale(.7); opacity: .35; } 50% { transform: translateY(-26px) scale(1.2); opacity: 1; } }

.game-header { position: fixed; inset: 0 0 auto; z-index: 100; min-height: 78px; display: flex; align-items: center; gap: 28px; padding: 8px max(20px, calc((100vw - 1420px) / 2)); color: #fff; background: rgba(8, 40, 52, .94); border-bottom: 3px solid var(--gold); box-shadow: 0 9px 30px rgba(5,24,31,.25); backdrop-filter: blur(16px); }
.game-brand { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; }
.game-brand img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(0,0,0,.3)); }
.game-brand span { display: grid; line-height: 1.25; }
.game-brand strong { font-family: Georgia, "Th Sarabun New", serif; font-size: 20px; }
.game-brand small { color: var(--gold-light); font-size: 12px; }
.header-progress { flex: 1; max-width: 480px; margin-inline: auto; }
.header-progress > span { display: flex; justify-content: space-between; margin-bottom: 4px; color: rgba(255,255,255,.78); font-size: 12px; }
.header-progress > div { height: 7px; overflow: hidden; background: rgba(255,255,255,.14); border-radius: 99px; }
.header-progress i { width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--gold), #ffe49a); border-radius: inherit; transition: width .5s ease; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button { width: 43px; height: 43px; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: 11px; font-size: 21px; }
.icon-button:hover, .icon-button:focus-visible { color: var(--navy); background: var(--gold-light); }
.icon-button[aria-pressed="false"] span { opacity: .45; text-decoration: line-through; }
.exit-link { min-height: 43px; display: flex; align-items: center; gap: 7px; padding: 8px 14px; color: var(--gold-light); border: 1px solid rgba(225,184,79,.48); border-radius: 11px; font-weight: 800; font-size: 14px; }
.exit-link:hover { color: #fff; background: rgba(255,255,255,.08); }

.game-screen { min-height: 100vh; display: none; padding-top: 78px; }
.game-screen.is-active { display: block; animation: screen-in .55s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.welcome-screen { position: relative; overflow: hidden; color: #fff; background: var(--navy); }
.welcome-backdrop { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(6,32,43,.98) 2%, rgba(6,38,50,.93) 46%, rgba(30,28,22,.58) 100%), url("assets/warrior-black-cutout.webp") center 30%/cover no-repeat; opacity: .15; filter: blur(3px); transform: scale(1.05); }
.welcome-backdrop::after { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(45deg, transparent 48%, rgba(255,255,255,.5) 49%, transparent 51%); background-size: 40px 40px; }
.welcome-layout { position: relative; z-index: 2; min-height: calc(100vh - 78px); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(410px, .92fr); gap: clamp(30px, 6vw, 95px); align-items: center; padding-block: 55px 70px; }
.welcome-copy { max-width: 790px; }
.game-kicker { margin: 0 0 9px; color: var(--red); font-size: 14px; font-weight: 900; letter-spacing: .04em; }
.welcome-copy > .game-kicker { width: fit-content; padding: 7px 14px 7px 7px; color: #fff; background: rgba(26,39,40,.64); border: 1px solid rgba(231,197,105,.56); border-radius: 99px; }
.game-kicker span { display: inline-block; margin-right: 9px; padding: 3px 10px; color: #3a2f13; background: var(--gold-light); border-radius: 99px; }
.welcome-copy h1 { margin: 20px 0 0; font-family: Georgia, "Th Sarabun New", "Leelawadee UI", serif; font-size: clamp(58px, 7vw, 102px); line-height: .98; letter-spacing: -.04em; text-shadow: 0 8px 30px rgba(0,0,0,.25); }
.welcome-copy h1 > span,
.welcome-copy h1 > em { display: block; }
.welcome-copy h1 em { color: var(--gold-light); font-style: normal; }
.welcome-lead { max-width: 720px; margin: 27px 0 0; color: rgba(255,255,255,.84); font-size: 19px; }
.welcome-features { max-width: 650px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 0; margin: 27px 0; list-style: none; }
.welcome-features li { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 13px; }
.welcome-features b { color: var(--gold-light); font-family: Georgia, serif; font-size: 29px; }
.welcome-features span { color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.35; }
.player-card { max-width: 760px; padding: 20px; color: var(--ink); background: rgba(255,253,246,.97); border: 1px solid var(--gold); border-radius: 17px; box-shadow: 0 22px 50px rgba(0,0,0,.2); }
.form-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.form-heading > span { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 50%; }
.form-heading > div { display: grid; }
.form-heading strong { color: var(--navy); font-size: 18px; }
.form-heading small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.form-grid label { display: grid; gap: 5px; color: var(--ink); font-size: 13px; font-weight: 800; }
.form-grid input, .form-grid select { width: 100%; min-height: 50px; padding: 10px 13px; color: var(--ink); background: #fff; border: 1px solid #cfba91; border-radius: 10px; outline: 0; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(156,49,38,.13); }
.privacy-note { margin: 11px 0; color: #69746e; font-size: 11px; }
.privacy-note span { color: var(--green); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary-button, .secondary-button, .text-button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 19px; cursor: pointer; border-radius: 10px; font-weight: 900; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { color: #2e321b; background: linear-gradient(135deg, #f3d675, var(--gold)); border: 1px solid #f5db82; box-shadow: 0 9px 20px rgba(204,157,48,.22); }
.primary-button:hover:not(:disabled), .primary-button:focus-visible:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(204,157,48,.32); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; filter: grayscale(.5); }
.secondary-button { color: var(--navy); background: #fff; border: 1px solid #bda87e; }
.secondary-button:hover { background: #f7efdf; }
.text-button { color: var(--red); background: transparent; border: 1px solid transparent; text-decoration: underline; }
.welcome-character { position: relative; min-height: 690px; display: grid; place-items: center; align-self: end; }
.welcome-character > img { position: relative; z-index: 2; width: min(500px, 42vw); max-height: 760px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 30px 35px rgba(0,0,0,.48)); animation: hero-float 4.5s ease-in-out infinite; }
@keyframes hero-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.sun-ring { position: absolute; width: min(520px, 40vw); aspect-ratio: 1; border: 1px solid rgba(239,199,97,.35); border-radius: 50%; box-shadow: 0 0 0 25px rgba(239,199,97,.035), 0 0 0 50px rgba(239,199,97,.025); }
.character-badge { position: absolute; z-index: 3; right: 0; bottom: 65px; display: grid; padding: 12px 18px; background: rgba(255,250,234,.96); color: var(--navy); border-left: 5px solid var(--gold); border-radius: 5px 13px 13px 5px; box-shadow: var(--shadow); }
.character-badge small { color: var(--red); }
.thai-border { position: absolute; z-index: 4; inset: auto 0 0; height: 18px; background: linear-gradient(135deg, transparent 8px, var(--cream) 0) 0 0/24px 18px repeat-x, linear-gradient(225deg, transparent 8px, var(--gold) 0) 12px 0/24px 18px repeat-x; }

.assessment-screen { padding-bottom: 50px; background: linear-gradient(135deg, #e9dbc0, #fff9ed 55%, #edddc1); }
.assessment-layout { min-height: calc(100vh - 78px); display: grid; grid-template-columns: 310px minmax(0, 820px); justify-content: center; gap: 34px; align-items: center; padding-block: 45px; }
.assessment-aside { align-self: stretch; display: flex; flex-direction: column; justify-content: end; overflow: hidden; padding: 20px 24px; color: #fff; background: linear-gradient(180deg, var(--purple), #32203b); border: 1px solid var(--gold); border-radius: 24px; box-shadow: var(--shadow); }
.assessment-aside img { width: 100%; max-height: 530px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 18px 22px rgba(0,0,0,.3)); }
.assessment-aside p { margin: 0; padding: 16px 4px 4px; color: rgba(255,255,255,.82); font-size: 14px; }
.assessment-panel, .mission-panel { padding: clamp(24px, 4vw, 44px); background: rgba(255,253,247,.98); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.panel-title-row, .mission-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.panel-title-row h2, .mission-header h2, .map-heading h2, .report-heading h2 { margin: 0; font-family: Georgia, "Th Sarabun New", serif; color: var(--navy); font-size: clamp(32px, 4vw, 51px); line-height: 1.15; }
.panel-title-row p { margin: 7px 0 0; color: var(--muted); }
.question-counter { flex: 0 0 auto; min-width: 70px; padding: 7px 11px; text-align: center; color: var(--red); background: #f7ead0; border: 1px solid #e1c88c; border-radius: 999px; font-weight: 900; }
.assessment-progress { height: 8px; margin: 24px 0; overflow: hidden; background: #e9dfcc; border-radius: 99px; }
.assessment-progress i { width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .35s; }
.question-card h3, .challenge-card h3 { margin: 0 0 20px; color: var(--navy); font-size: clamp(21px, 2.2vw, 29px); line-height: 1.45; }
.question-card > p, .challenge-card > p { color: var(--muted); }
.answer-grid { display: grid; gap: 10px; }
.answer-option { min-height: 57px; display: grid; grid-template-columns: 39px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; text-align: left; color: var(--ink); background: #fff; border: 1px solid #d8c7a7; border-radius: 12px; transition: border .18s, transform .18s, background .18s; }
.answer-option:hover:not(:disabled), .answer-option:focus-visible:not(:disabled) { transform: translateX(4px); border-color: var(--red); background: #fff8e9; }
.answer-option > span { width: 35px; height: 35px; display: grid; place-items: center; color: var(--red); background: #f5ead3; border-radius: 9px; font-weight: 900; }
.answer-option.is-correct { color: #155847; background: #e6f5ee; border-color: #3a947d; }
.answer-option.is-wrong { color: #7e281f; background: #fae6e3; border-color: #bf5548; }
.answer-option:disabled { cursor: default; }
.feedback-box { margin-top: 18px; padding: 15px 18px; color: #4f6259; background: #eef8f2; border-left: 5px solid var(--green); border-radius: 4px 12px 12px 4px; }
.feedback-box.is-wrong { color: #70332d; background: #fff0e9; border-left-color: var(--red); }
.feedback-box strong { display: block; color: inherit; }
.feedback-box p { margin: 4px 0 0; }
.next-button { margin: 19px 0 0 auto; }

.map-screen { position: relative; overflow: hidden; padding-bottom: 80px; background: linear-gradient(180deg, #cbe1db 0, #e7e0ba 34%, #e8d1a3 100%); }
.map-sky { position: absolute; inset: 78px 0 auto; height: 410px; pointer-events: none; background: radial-gradient(circle at 50% 10%, rgba(255,255,255,.95), transparent 12%), radial-gradient(ellipse at 20% 65%, rgba(255,255,255,.55), transparent 24%), linear-gradient(180deg, #86b8c7, transparent); }
.map-sky::after { content: ""; position: absolute; inset: auto 0 0; height: 170px; opacity: .25; background: linear-gradient(135deg, transparent 36%, #386c62 37% 48%, transparent 49%) 0 0/300px 170px repeat-x; }
.map-content { position: relative; z-index: 1; padding-top: 55px; }
.map-heading { display: flex; align-items: center; justify-content: space-between; gap: 35px; margin-bottom: 36px; }
.map-heading > div:first-child > p:last-child { margin: 9px 0 0; color: #425f5d; }
.player-summary { flex: 0 0 auto; min-width: 260px; display: flex; align-items: center; gap: 12px; padding: 12px 17px; color: #fff; background: rgba(13,48,64,.9); border: 1px solid rgba(225,184,79,.75); border-radius: 15px; box-shadow: 0 12px 25px rgba(20,49,55,.18); }
.player-avatar { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy); background: var(--gold-light); border-radius: 50%; font-family: Georgia, serif; font-size: 24px; }
.player-summary > div { display: grid; }
.player-summary small { color: var(--gold-light); }
.player-summary em { color: rgba(255,255,255,.67); font-size: 11px; font-style: normal; }
.map-path { position: absolute; z-index: -1; inset: 210px 0 auto; height: 480px; opacity: .55; }
.map-path svg { width: 100%; height: 100%; overflow: visible; }
.map-path path { fill: none; stroke: #7d6337; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 3 20; }
.map-path .path-glow { stroke: rgba(255,255,255,.45); stroke-width: 14; stroke-dasharray: none; }
.base-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.base-card { position: relative; min-height: 330px; display: grid; grid-template-columns: minmax(170px, .42fr) minmax(0, .58fr); align-items: end; overflow: hidden; background: rgba(255,250,236,.96); border: 1px solid rgba(126,91,39,.28); border-top: 7px solid var(--navy); border-radius: 27px 8px 27px 8px; box-shadow: 0 18px 42px rgba(74,54,29,.15); transition: transform .24s, box-shadow .24s; }
.base-card:hover { transform: translateY(-6px); box-shadow: 0 27px 55px rgba(74,54,29,.23); }
.base-card::before { content: ""; position: absolute; inset: 0; opacity: .2; background: radial-gradient(circle at 15% 10%, var(--base-color), transparent 45%); }
.base-history { --base-color: #7c5424; }
.base-sacrifice { --base-color: #2b8a70; border-top-color: var(--green); }
.base-courage { --base-color: #b94a3d; border-top-color: var(--red); }
.base-wisdom { --base-color: #3476a6; border-top-color: var(--blue); }
.base-character { position: relative; min-height: 315px; align-self: stretch; display: grid; align-items: end; }
.base-character-button { width: 100%; padding: 0; cursor: pointer; appearance: none; color: inherit; text-align: inherit; background: transparent; border: 0; border-radius: 24px; font: inherit; }
.base-character-button:focus-visible { outline: 4px solid #ffe783; outline-offset: -4px; }
.base-character-button::after { content: "คลิกตัวละครเพื่อเริ่ม"; position: absolute; z-index: 4; right: 8px; bottom: 24px; padding: 5px 9px; color: #fff; background: rgba(7,54,82,.9); border: 1px solid rgba(255,255,255,.7); border-radius: 99px; box-shadow: 0 6px 14px rgba(9,35,51,.24); font-size: 10px; font-weight: 900; }
.base-character img { position: absolute; inset: 13px 0 0; width: 100%; height: calc(100% - 13px); object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 13px rgba(35,29,20,.3)); transition: transform .28s; }
.base-character-button img { pointer-events: none; }
.base-card:hover .base-character img { transform: scale(1.035) translateY(-3px); }
.base-character > span { position: absolute; z-index: 2; top: 20px; left: 20px; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--red); border: 4px solid var(--gold); border-radius: 50%; font-family: Georgia, serif; font-size: 21px; }
.base-copy { position: relative; z-index: 2; align-self: stretch; display: flex; flex-direction: column; padding: 30px 25px 25px 8px; }
.base-copy > small { color: var(--red); font-weight: 900; }
.base-copy h3 { margin: 7px 0; color: var(--navy); font-family: Georgia, "Th Sarabun New", serif; font-size: 29px; line-height: 1.25; }
.base-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.base-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 15px; border-top: 1px solid #e3d5bb; font-size: 12px; }
.base-meta span { color: var(--muted); }
.base-meta b { color: var(--red); }
.base-copy button { min-height: 45px; display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 9px 14px; cursor: pointer; color: #fff; background: var(--navy); border: 1px solid #204d5c; border-radius: 10px; font-weight: 900; }
.base-copy button:hover { background: var(--red); }
.base-card.is-complete { border-color: #478e76; }
.base-card.is-complete .base-meta span { color: var(--green); font-weight: 900; }
.base-card.is-complete .base-copy button { background: var(--green); }
.final-gate { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 35px; padding: 22px 27px; color: #fff; background: linear-gradient(120deg, var(--navy), #174e59); border: 1px solid var(--gold); border-radius: 20px; box-shadow: var(--shadow); }
.final-gate > div { display: flex; align-items: center; gap: 16px; }
.gate-icon { width: 61px; height: 61px; display: grid; place-items: center; color: var(--navy); background: var(--gold-light); border-radius: 50%; font-size: 27px; }
.final-gate small { color: var(--gold-light); }
.final-gate h3 { margin: 0; font-size: 24px; }
.final-gate p { margin: 3px 0 0; color: rgba(255,255,255,.7); font-size: 13px; }
.final-gate.is-unlocked { background: linear-gradient(120deg, #195d4d, #1f7e67); }

.mission-screen { padding-bottom: 55px; background: linear-gradient(135deg, #e8dcc5, #fff9ec 55%, #ead7b8); }
.mission-shell { min-height: calc(100vh - 78px); display: grid; grid-template-columns: 300px minmax(0, 860px); justify-content: center; gap: 32px; align-items: center; padding-block: 40px; }
.mission-aside { align-self: stretch; min-height: 630px; display: flex; flex-direction: column; align-items: center; overflow: hidden; padding: 18px; color: #fff; background: linear-gradient(180deg, var(--navy-2), var(--navy)); border: 1px solid var(--gold); border-radius: 23px; box-shadow: var(--shadow); }
.mission-aside.is-sacrifice { background: linear-gradient(180deg, #26816e, #0d4c43); }
.mission-aside.is-courage { background: linear-gradient(180deg, #a93c31, #5f1d1a); }
.mission-aside.is-wisdom { background: linear-gradient(180deg, #2875a2, #123e5c); }
.back-map { align-self: flex-start; cursor: pointer; color: #fff; background: transparent; border: 0; font-weight: 800; }
.mission-aside img { width: 100%; flex: 1; min-height: 0; object-fit: contain; object-position: bottom; filter: drop-shadow(0 18px 22px rgba(0,0,0,.35)); }
.mission-score { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; }
.mission-score small { color: rgba(255,255,255,.72); }
.mission-score strong { color: var(--gold-light); font-size: 21px; }
.mission-header { align-items: center; }
.timer { min-width: 74px; text-align: center; padding: 8px 12px; color: var(--red); background: #fff1dd; border: 1px solid #e3bd75; border-radius: 12px; }
.timer span { display: block; font-size: 11px; }
.timer strong { font-size: 25px; }
.timer.is-urgent { color: #fff; background: var(--red); animation: timer-pulse .7s infinite; }
@keyframes timer-pulse { 50% { transform: scale(1.06); } }
.mission-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 23px 0; }
.mission-progress i { height: 8px; background: #e5d9c2; border-radius: 99px; }
.mission-progress i.is-done { background: var(--green); }
.mission-progress i.is-current { background: var(--gold); box-shadow: 0 0 0 3px rgba(225,184,79,.18); }
.challenge-card { min-height: 320px; }
.base-completion-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.base-completion-summary p { margin: 0; padding: 16px; text-align: center; color: var(--muted); background: #f6eedf; border: 1px solid #e0cfad; border-radius: 12px; }
.base-completion-summary strong { display: block; color: var(--navy); font-size: 22px; }
.challenge-label { width: fit-content; display: block; margin-bottom: 12px; padding: 4px 10px; color: #fff; background: var(--red); border-radius: 999px; font-size: 12px; font-weight: 900; }
.sequence-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sequence-source, .sequence-target { min-height: 220px; padding: 13px; background: #f7f0e1; border: 1px dashed #c4aa72; border-radius: 13px; }
.sequence-source h4, .sequence-target h4 { margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.sequence-items { display: grid; gap: 7px; }
.sequence-item { min-height: 45px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; text-align: left; color: var(--ink); background: #fff; border: 1px solid #d6c39d; border-radius: 9px; font-size: 13px; }
.sequence-item:hover { border-color: var(--red); }
.sequence-item span { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 900; }
.sequence-actions { display: flex; gap: 8px; margin-top: 13px; }
.mini-button { min-height: 42px; padding: 8px 13px; cursor: pointer; color: var(--navy); background: #fff; border: 1px solid #bfa779; border-radius: 9px; font-weight: 800; }
.mini-button.is-submit { color: #fff; background: var(--red); border-color: var(--red); }

.report-screen { padding-bottom: 75px; background: radial-gradient(circle at 50% 15%, #fffaf0, #ebdcc0 68%, #ddc69e); }
.report-shell { position: relative; padding-top: 55px; }
.report-heading { text-align: center; }
.report-heading > p:last-child { margin: 8px 0 34px; color: var(--muted); font-size: 18px; }
.celebration i { position: absolute; z-index: 0; width: 8px; height: 15px; background: var(--gold); animation: confetti 3.5s ease-in-out infinite; }
.celebration i:nth-child(1) { left: 8%; top: 60px; }
.celebration i:nth-child(2) { left: 22%; top: 110px; background: var(--red); animation-delay: -.7s; }
.celebration i:nth-child(3) { right: 13%; top: 70px; background: var(--green); animation-delay: -1.4s; }
.celebration i:nth-child(4) { right: 29%; top: 150px; background: var(--purple); animation-delay: -2s; }
.celebration i:nth-child(5) { left: 42%; top: 50px; background: var(--blue); animation-delay: -.4s; }
.celebration i:nth-child(6) { right: 43%; top: 120px; animation-delay: -2.6s; }
@keyframes confetti { 0% { opacity: 0; transform: translateY(-30px) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(140px) rotate(480deg); } }
.report-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.growth-card, .mastery-card, .base-results { padding: 27px; background: rgba(255,253,247,.96); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 13px 34px rgba(54,39,21,.09); }
.growth-card h3, .mastery-card h3, .base-results h3 { margin: 0; color: var(--navy); font-size: 22px; }
.score-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; }
.score-comparison > div { padding: 16px; background: #f4ecdd; border-radius: 12px; }
.score-comparison span { color: var(--muted); }
.score-comparison strong { display: block; color: var(--red); font-size: 30px; }
.score-comparison i { height: 7px; display: block; overflow: hidden; background: #ddd0b8; border-radius: 99px; }
.score-comparison b { width: 0; height: 100%; display: block; background: var(--red); transition: width .8s ease; }
.score-comparison .after-score { background: #e8f4ee; }
.score-comparison .after-score strong { color: var(--green); }
.score-comparison .after-score b { background: var(--green); }
.growth-card > p { margin: 0; color: var(--muted); }
.mastery-card { display: flex; align-items: center; gap: 25px; }
.mastery-ring { --score-angle: 0deg; flex: 0 0 145px; width: 145px; height: 145px; display: grid; place-items: center; background: conic-gradient(var(--green) var(--score-angle), #e4d8c2 0); border-radius: 50%; }
.mastery-ring::before { content: ""; grid-area: 1 / 1; width: 112px; height: 112px; background: var(--paper); border-radius: 50%; }
.mastery-ring > span { position: relative; grid-area: 1 / 1; z-index: 1; text-align: center; }
.mastery-ring strong { display: block; color: var(--navy); font-size: 37px; line-height: 1; }
.mastery-ring small { color: var(--muted); font-size: 11px; }
.mastery-card p { margin: 5px 0; color: var(--muted); }
.badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.badge-row span { padding: 4px 8px; color: #fff; background: var(--green); border-radius: 99px; font-size: 11px; font-weight: 800; }
.base-results { margin-top: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title > span { color: var(--muted); font-size: 13px; }
.base-result { display: grid; grid-template-columns: minmax(190px, .35fr) minmax(0, 1fr) 90px; align-items: center; gap: 17px; padding: 12px 0; border-top: 1px solid #e7dcc7; }
.base-result:first-child { border-top: 0; }
.base-result > div:first-child { display: grid; }
.base-result small { color: var(--muted); }
.base-result-bar { height: 11px; overflow: hidden; background: #e8decb; border-radius: 99px; }
.base-result-bar i { width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: inherit; transition: width .8s; }
.base-result > b { text-align: right; color: var(--navy); }
.certificate { position: relative; max-width: 1040px; margin: 34px auto 0; padding: 42px 55px; text-align: center; overflow: hidden; background: #fffaf0; border: 11px double #b88a2b; box-shadow: 0 18px 45px rgba(69,47,18,.18); }
.certificate-pattern { position: absolute; inset: 8px; pointer-events: none; border: 1px solid #d4b45c; }
.certificate img { width: 74px; height: 74px; margin: auto; object-fit: contain; }
.certificate > small { display: block; margin-top: 10px; color: var(--red); font-weight: 900; letter-spacing: .06em; }
.certificate h3 { margin: 12px 0 0; color: var(--muted); font-size: 17px; font-weight: 500; }
.certificate > strong { display: block; margin: 5px 0; color: var(--navy); font-family: Georgia, "Th Sarabun New", serif; font-size: 40px; border-bottom: 1px solid #d6bd7a; }
.certificate > p { color: #51655d; }
.certificate-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin: 23px 0 15px; color: var(--muted); font-size: 13px; }
.certificate-meta b { display: block; color: var(--navy); }
.certificate > em { display: inline-block; padding: 6px 14px; color: #fff; background: var(--green); border-radius: 99px; font-style: normal; font-weight: 900; }
.certificate.is-locked { filter: grayscale(.7); opacity: .76; }
.certificate.is-locked > em { background: var(--red); }
.report-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 27px; }

.toast { position: fixed; z-index: 999; left: 50%; bottom: 25px; max-width: min(520px, calc(100% - 30px)); padding: 12px 20px; color: #fff; background: rgba(8,42,54,.95); border: 1px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow); transform: translateX(-50%); }
.game-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 35px; padding: 25px max(24px, calc((100vw - 1420px) / 2)); color: rgba(255,255,255,.72); background: #082a38; border-top: 5px solid var(--gold); font-size: 12px; }
.game-footer > div { display: flex; flex-wrap: wrap; gap: 12px; }
.game-footer strong { color: #fff; }
.game-footer a { color: var(--gold-light); text-decoration: underline; }
.game-footer p { max-width: 520px; margin: 0; text-align: right; }

@media (max-width: 1180px) {
  .game-shell { width: min(100% - 40px, 1420px); }
  .welcome-layout { grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); }
  .welcome-character { min-height: 610px; }
  .base-card { grid-template-columns: 155px minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .game-header { padding-inline: 17px; }
  .game-brand span { display: none; }
  .header-progress { max-width: none; }
  .exit-link { font-size: 0; }
  .exit-link span { font-size: 18px; }
  .welcome-layout { grid-template-columns: 1fr; padding-top: 45px; }
  .welcome-character { min-height: 480px; grid-row: 1; }
  .welcome-character > img { width: min(360px, 70vw); max-height: 500px; }
  .sun-ring { width: min(390px, 75vw); }
  .character-badge { right: 12%; bottom: 20px; }
  .assessment-layout, .mission-shell { grid-template-columns: 1fr; max-width: 850px; }
  .assessment-aside, .mission-aside { min-height: 250px; display: grid; grid-template-columns: 210px 1fr; align-items: center; }
  .assessment-aside img, .mission-aside img { height: 230px; }
  .mission-aside { min-height: 260px; grid-template-columns: auto 210px minmax(160px, 1fr); }
  .back-map { align-self: start; }
  .base-grid { grid-template-columns: 1fr; }
  .base-card { min-height: 300px; grid-template-columns: minmax(180px, .36fr) minmax(0, .64fr); }
  .map-path { display: none; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .game-shell { width: min(100% - 26px, 1420px); }
  .game-header { min-height: 70px; gap: 8px; }
  .game-screen { padding-top: 70px; }
  .game-brand img { width: 46px; height: 46px; }
  .header-progress > span { display: none; }
  .header-actions { gap: 5px; }
  .icon-button { width: 40px; height: 40px; }
  .welcome-layout { min-height: calc(100vh - 70px); gap: 0; padding-block: 25px 55px; }
  .welcome-character { min-height: 330px; }
  .welcome-character > img { width: 250px; max-height: 330px; }
  .character-badge { right: 0; bottom: 8px; padding: 8px 12px; }
  .welcome-copy h1 { font-size: clamp(49px, 17vw, 74px); }
  .welcome-lead { font-size: 16px; }
  .welcome-features { gap: 5px; }
  .welcome-features li { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; }
  .welcome-features b { font-size: 23px; }
  .player-card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .primary-button, .form-actions .secondary-button { width: 100%; }
  .assessment-layout, .mission-shell { padding-block: 22px; }
  .assessment-aside { min-height: 180px; grid-template-columns: 130px 1fr; padding: 12px; }
  .assessment-aside img { height: 170px; }
  .assessment-panel, .mission-panel { padding: 21px 17px; border-radius: 17px; }
  .panel-title-row { flex-direction: column; gap: 12px; }
  .question-counter { align-self: flex-end; }
  .map-content { padding-top: 35px; }
  .map-heading { align-items: flex-start; flex-direction: column; gap: 17px; }
  .player-summary { min-width: 0; width: 100%; }
  .base-grid { gap: 17px; }
  .base-card { min-height: 450px; grid-template-columns: 1fr; }
  .base-character { min-height: 205px; }
  .base-character img { height: 220px; }
  .base-copy { padding: 15px 19px 19px; }
  .final-gate { align-items: stretch; flex-direction: column; }
  .mission-aside { min-height: 210px; grid-template-columns: auto 125px minmax(115px, 1fr); padding: 10px; }
  .mission-aside img { height: 185px; }
  .mission-score { flex-direction: column; align-items: flex-start; }
  .mission-header h2 { font-size: 30px; }
  .sequence-board { grid-template-columns: 1fr; }
  .base-completion-summary { grid-template-columns: 1fr; }
  .report-shell { padding-top: 35px; }
  .growth-card, .mastery-card, .base-results { padding: 19px 16px; }
  .mastery-card { align-items: flex-start; flex-direction: column; }
  .score-comparison { grid-template-columns: 1fr; }
  .base-result { grid-template-columns: 1fr 70px; gap: 8px; }
  .base-result-bar { grid-column: 1 / -1; grid-row: 2; }
  .certificate { padding: 30px 19px; border-width: 7px; }
  .certificate > strong { font-size: 30px; }
  .certificate-meta { flex-direction: column; gap: 8px; }
  .report-actions > * { width: 100%; }
  .game-footer { flex-direction: column; }
  .game-footer p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  .player-card, .assessment-panel, .mission-panel, .base-card, .growth-card, .mastery-card, .base-results { border-width: 2px; border-color: #47391f; }
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
}

@media print {
  body { background: #fff; }
  .game-header, .ambient, .report-heading, .report-grid, .base-results, .report-actions, .game-footer, .toast { display: none !important; }
  .game-screen { display: none !important; padding: 0; }
  .report-screen.is-active { display: block !important; }
  .report-shell { width: 100%; padding: 0; }
  .certificate { max-width: none; min-height: 670px; margin: 0; box-shadow: none; break-inside: avoid; }
}

/* PHAKHUN FLOATING WORLD V44
   Original floating-island adventure art direction for the learning game. */
:root {
  --sky: #70c8ff;
  --sky-deep: #388edc;
  --cloud: rgba(255,255,255,.88);
  --night-blue: #08364f;
}

.welcome-screen {
  isolation: isolate;
  min-height: 100svh;
  background: linear-gradient(180deg, #73c9ff 0%, #85d4ff 58%, #c9efff 100%);
}
.welcome-backdrop {
  inset: 0;
  opacity: 1;
  filter: none;
  transform: none;
  background:
    radial-gradient(circle at 50% 22%, rgba(255,255,255,.68) 0 3%, transparent 15%),
    radial-gradient(circle at 50% 82%, rgba(32,104,177,.17), transparent 31%),
    linear-gradient(180deg, #6cc4ff 0%, #8cd7ff 62%, #d3f3ff 100%);
}
.welcome-backdrop::after {
  opacity: .32;
  background:
    radial-gradient(circle at 12% 20%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 82% 28%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 32% 72%, #fff 0 1px, transparent 2px);
  background-size: 150px 150px, 210px 210px, 180px 180px;
  animation: stars-drift 24s linear infinite;
}
@keyframes stars-drift { to { background-position: 150px -70px, -210px 90px, 180px -120px; } }

.intro-worlds,
.map-atmosphere,
.mission-environment { position: absolute; inset: 78px 0 0; overflow: hidden; pointer-events: none; }
.intro-worlds { z-index: 1; }
.intro-worlds .floating-world { pointer-events: auto; }
.sky-orb { position: absolute; left: 50%; top: 13%; width: min(42vw, 600px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.42), rgba(255,255,255,.08) 47%, transparent 68%); transform: translateX(-50%); }
.wind-trail { position: absolute; width: 42vw; height: 90px; border-top: 5px solid rgba(255,255,255,.29); border-radius: 50%; filter: drop-shadow(0 12px 0 rgba(255,255,255,.14)); }
.wind-trail-one { left: 3%; top: 12%; transform: rotate(5deg); animation: wind-shift 10s ease-in-out infinite; }
.wind-trail-two { right: 4%; top: 55%; transform: rotate(-7deg); animation: wind-shift 13s ease-in-out -5s infinite reverse; }
@keyframes wind-shift { 50% { translate: 35px -10px; scale: 1.05; } }
.game-cloud { position: absolute; width: 160px; height: 34px; opacity: .6; border-radius: 99px; background: var(--cloud); box-shadow: 43px -19px 0 9px var(--cloud), 88px 0 0 1px var(--cloud); filter: blur(.3px); animation: cloud-flight 26s linear infinite; }
.cloud-one { top: 23%; left: -230px; }
.cloud-two { top: 65%; left: -300px; animation-duration: 34s; animation-delay: -17s; transform: scale(.7); }
.cloud-three { top: 8%; left: -260px; animation-duration: 40s; animation-delay: -7s; transform: scale(.48); }
@keyframes cloud-flight { from { translate: -10vw 0; } to { translate: 135vw 0; } }

.floating-world { --world: #238368; --world-dark: #155843; --rock: #5b6673; --rock-dark: #343e49; position: absolute; width: clamp(230px, 19vw, 360px); height: clamp(220px, 27vh, 350px); padding: 0; cursor: pointer; appearance: none; color: inherit; text-align: inherit; background: transparent; border: 0; animation: world-float 6.2s ease-in-out infinite; filter: drop-shadow(0 28px 20px rgba(24,77,112,.23)); transition: scale .2s ease, filter .2s ease; }
.floating-world:nth-of-type(even) { animation-delay: -2.7s; }
.floating-world:hover { scale: 1.045; filter: drop-shadow(0 32px 24px rgba(24,77,112,.34)) brightness(1.07); }
.floating-world:focus-visible { outline: 4px solid #ffe783; outline-offset: 5px; border-radius: 42%; }
.floating-world::after { content: "คลิก"; position: absolute; z-index: 8; top: 12%; right: 16%; min-width: 42px; padding: 4px 7px; color: #432c08; background: #ffe783; border: 2px solid rgba(255,255,255,.82); border-radius: 99px; box-shadow: 0 6px 14px rgba(11,47,60,.2); font-size: 10px; font-weight: 900; line-height: 1; }
@keyframes world-float { 0%,100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-18px) rotate(.55deg); } }
.island-mass { position: absolute; inset: auto 5% 6% 5%; height: 44%; background: linear-gradient(170deg, var(--world) 0 31%, var(--world-dark) 32% 45%, var(--rock) 46% 63%, var(--rock-dark) 64%); border-radius: 50% 47% 42% 50% / 28% 35% 65% 70%; clip-path: polygon(2% 10%, 17% 0, 40% 7%, 60% 0, 84% 8%, 100% 24%, 85% 48%, 67% 62%, 51% 100%, 35% 64%, 14% 51%); }
.island-mass::before { content: ""; position: absolute; inset: 4% 5% auto; height: 31%; border-radius: 50%; background: linear-gradient(180deg, color-mix(in srgb, var(--world) 72%, white), var(--world)); box-shadow: inset 0 -7px rgba(0,0,0,.09); }
.island-mass::after { content: ""; position: absolute; left: 28%; bottom: 5%; width: 41%; height: 50%; clip-path: polygon(0 0, 100% 0, 52% 100%); background: linear-gradient(90deg, rgba(255,255,255,.14), transparent 38%, rgba(0,0,0,.2)); }
.island-mass i { position: absolute; z-index: 2; bottom: 55%; width: 12%; height: 28%; background: var(--world-dark); clip-path: polygon(50% 0, 100% 36%, 78% 100%, 17% 100%, 0 38%); }
.island-mass i:nth-child(1) { left: 15%; }
.island-mass i:nth-child(2) { left: 31%; height: 43%; }
.island-mass i:nth-child(3) { right: 15%; height: 36%; }
.island-mass b { position: absolute; z-index: 2; right: 32%; bottom: 59%; width: 18%; height: 40%; background: color-mix(in srgb, var(--world) 45%, #fff); clip-path: polygon(50% 0, 92% 29%, 77% 43%, 100% 67%, 66% 68%, 50% 100%, 34% 68%, 0 67%, 23% 43%, 8% 29%); }
.floating-world > img { position: absolute; z-index: 4; width: 41%; height: 80%; bottom: 24%; right: 28%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 10px rgba(8,35,54,.35)); animation: guardian-breathe 3.6s ease-in-out infinite; }
@keyframes guardian-breathe { 50% { transform: translateY(-7px) scale(1.012); } }
.world-label { position: absolute; z-index: 6; left: 50%; bottom: 0; min-width: 165px; padding: 7px 12px; color: #fff; text-align: center; font-weight: 900; line-height: 1.25; background: rgba(5,46,70,.88); border: 1px solid rgba(255,255,255,.45); border-radius: 999px; box-shadow: 0 8px 18px rgba(15,61,91,.2); transform: translateX(-50%); }
.world-label small { display: block; color: #d8f4ff; font-size: 10px; font-weight: 700; }
.world-history { left: 2%; top: 5%; --world: #45a2ed; --world-dark: #1768af; }
.world-sacrifice { right: 2%; top: 7%; --world: #36aa6c; --world-dark: #157346; animation-delay: -1.5s; }
.world-courage { left: 3%; bottom: 0; --world: #ff6555; --world-dark: #bb2f32; animation-delay: -3.4s; }
.world-wisdom { right: 3%; bottom: -1%; --world: #a06bd4; --world-dark: #663b9b; animation-delay: -4.7s; }

.welcome-layout { z-index: 5; min-height: calc(100svh - 78px); grid-template-columns: 1fr; place-items: center; padding: 35px 0 150px; pointer-events: none; text-align: center; }
.welcome-copy { width: min(660px, 100%); margin-inline: auto; }
.welcome-copy > * { pointer-events: auto; }
.welcome-copy > .game-kicker { margin-inline: auto; color: #fff; background: rgba(9,67,102,.82); border-color: rgba(255,255,255,.54); box-shadow: 0 8px 24px rgba(16,90,140,.2); }
.presented-by { margin: 15px 0 0; color: #0b537c; font-size: 14px; font-weight: 900; letter-spacing: .04em; text-shadow: 0 1px rgba(255,255,255,.5); }
.welcome-copy h1 { margin-top: 4px; color: #fff; font-size: clamp(52px, 5.6vw, 88px); line-height: .94; text-shadow: 0 7px 0 rgba(18,101,158,.24), 0 18px 40px rgba(14,74,113,.28); }
.welcome-copy h1 em { color: #ffe786; text-shadow: 0 5px 0 rgba(172,114,25,.27), 0 18px 34px rgba(17,82,124,.27); }
.welcome-lead { width: min(590px, 100%); margin: 16px auto 0; color: #0c4d70; font-size: 17px; font-weight: 700; text-shadow: 0 1px rgba(255,255,255,.65); }
.welcome-features { width: min(570px, 100%); margin: 18px auto 20px; }
.welcome-features li { justify-content: center; background: rgba(255,255,255,.72); border-color: rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(22,97,142,.12); backdrop-filter: blur(8px); }
.welcome-features b { color: #0b6596; }
.welcome-features span { color: #345e74; text-align: left; }
.launch-button { min-width: 235px; min-height: 62px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; padding: 12px 25px; cursor: pointer; color: #fff; background: linear-gradient(135deg, #246eea, #1656cf); border: 2px solid rgba(255,255,255,.72); border-radius: 14px; box-shadow: 0 11px 0 #0e46a7, 0 20px 38px rgba(14,82,159,.32); font-size: 20px; font-weight: 900; transition: transform .2s, box-shadow .2s; animation: launch-pulse 2.6s ease-in-out infinite; }
.launch-button:hover, .launch-button:focus-visible { transform: translateY(-4px) scale(1.025); box-shadow: 0 14px 0 #0e46a7, 0 27px 42px rgba(14,82,159,.38); }
.launch-button i { width: 34px; height: 34px; display: grid; place-items: center; color: #195fd8; background: #fff; border-radius: 50%; font-size: 12px; font-style: normal; }
@keyframes launch-pulse { 50% { filter: brightness(1.08); } }
.launch-hint { margin: 18px 0 0; color: #16577a; font-size: 12px; font-weight: 800; }
.welcome-character { position: absolute; z-index: 6; left: 50%; bottom: -58px; width: 230px; min-height: 235px; transform: translateX(-50%); }
.welcome-character > img { width: 145px; max-height: 225px; object-fit: contain; object-position: bottom; }
.welcome-character .sun-ring { width: 200px; background: radial-gradient(circle, rgba(255,255,255,.45), transparent 67%); }
.hero-rock { position: absolute; z-index: 1; left: 50%; bottom: 15px; width: 230px; height: 70px; border-radius: 50% 50% 38% 38%; clip-path: polygon(4% 13%, 22% 0, 72% 3%, 96% 24%, 81% 72%, 56% 100%, 31% 81%, 10% 64%); background: linear-gradient(150deg, #788797, #425564 58%, #273845); transform: translateX(-50%); filter: drop-shadow(0 20px 12px rgba(21,79,112,.22)); }
.character-badge { display: none; }

body.is-setup-open { overflow: hidden; }
body.is-setup-open .welcome-screen::after { content: ""; position: fixed; z-index: 4; inset: 0; background: rgba(4,32,52,.58); backdrop-filter: blur(7px); }
body.is-setup-open .welcome-layout { pointer-events: none; }
body.is-setup-open .setup-dialog { pointer-events: auto; }
.setup-dialog { position: fixed; z-index: 400; left: 50%; top: 50%; width: min(720px, calc(100vw - 30px)); max-width: none; padding: 29px; text-align: left; transform: translate(-50%, -50%); border: 2px solid #fff; border-top: 8px solid var(--gold); border-radius: 24px; animation: dialog-pop .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes dialog-pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.92); } }
.setup-close { position: absolute; top: 13px; right: 14px; width: 42px; height: 42px; cursor: pointer; color: var(--navy); background: #f5ead4; border: 0; border-radius: 50%; font-size: 29px; line-height: 1; }

.map-screen { min-height: 100svh; padding-bottom: 95px; background: linear-gradient(180deg, #63c2fa 0%, #8bd8ff 57%, #dbf6ff 100%); }
.map-sky { inset: 78px 0 0; height: auto; background: radial-gradient(circle at 50% 0, rgba(255,255,255,.75), transparent 24%), linear-gradient(180deg, rgba(54,151,224,.22), transparent 65%); }
.map-sky::after { height: 100%; opacity: .17; background: radial-gradient(circle at 14% 20%, #fff 0 2px, transparent 3px); background-size: 110px 110px; }
.map-atmosphere { z-index: 0; }
.map-atmosphere > i { position: absolute; width: 7px; aspect-ratio: 1; border-radius: 50%; background: #fff6b0; box-shadow: 0 0 17px #fff; animation: sparkle 2.3s infinite; }
.map-atmosphere > i:nth-of-type(1) { left: 20%; top: 37%; }
.map-atmosphere > i:nth-of-type(2) { right: 23%; top: 18%; animation-delay: -.8s; }
.map-atmosphere > i:nth-of-type(3) { left: 52%; top: 61%; animation-delay: -1.5s; }
@keyframes sparkle { 50% { opacity: .2; transform: scale(.35); } }
.map-content { padding-top: 34px; }
.map-heading { position: relative; z-index: 10; width: min(880px, 100%); margin: 0 auto 20px; padding: 18px 22px; color: #fff; background: rgba(6,60,94,.78); border: 1px solid rgba(255,255,255,.55); border-radius: 22px; box-shadow: 0 15px 35px rgba(15,80,121,.2); backdrop-filter: blur(12px); }
.map-heading h2 { color: #fff; font-size: clamp(32px, 3.7vw, 50px); }
.map-heading > div:first-child > p:last-child { color: rgba(255,255,255,.83); }
.map-heading .game-kicker { color: #ffe582; }
.player-summary { min-width: 240px; background: rgba(255,255,255,.14); box-shadow: none; }
.map-path { z-index: 1; inset: 250px 8% auto; height: 600px; opacity: .65; }
.map-path path { stroke: rgba(255,255,255,.84); stroke-width: 5; stroke-dasharray: 5 18; animation: route-flow 9s linear infinite; }
.map-path .path-glow { stroke: rgba(17,91,139,.22); stroke-width: 15; }
@keyframes route-flow { to { stroke-dashoffset: -184px; } }
.map-core { position: absolute; z-index: 4; left: 50%; top: 48%; width: 150px; aspect-ratio: 1; display: grid; place-items: center; color: #fff; text-align: center; background: linear-gradient(145deg, #f2bf3c, #d27d25); border: 8px solid rgba(255,255,255,.7); border-radius: 50%; box-shadow: 0 16px 0 #7c501e, 0 28px 35px rgba(21,74,101,.28); transform: translate(-50%, -50%); animation: core-float 4.8s ease-in-out infinite; }
.map-core::after { content: ""; position: absolute; z-index: -1; inset: 60% -28% -34%; background: linear-gradient(145deg, #77828d, #354651); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.map-core span { font-weight: 900; font-size: 20px; }
.map-core i { position: absolute; inset: 20%; border: 2px dashed rgba(255,255,255,.7); border-radius: 50%; animation: core-spin 15s linear infinite; }
.map-core b { position: absolute; bottom: -23px; padding: 3px 10px; color: #18394a; background: #fff; border-radius: 99px; font-size: 11px; }
@keyframes core-spin { to { transform: rotate(360deg); } }
@keyframes core-float { 50% { transform: translate(-50%, calc(-50% - 12px)); } }
.base-grid { position: relative; z-index: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 70px 190px; padding: 25px 0 60px; }
.base-card { --base-color: #287fc2; min-height: 365px; grid-template-columns: minmax(170px,.45fr) minmax(0,.55fr); overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; animation: world-float 6.2s ease-in-out infinite; }
.base-card:nth-child(even) { animation-delay: -2.8s; }
.base-card:hover { transform: none; box-shadow: none; }
.base-card::before { inset: auto 1% 0; height: 52%; opacity: 1; background: linear-gradient(168deg, color-mix(in srgb, var(--base-color) 76%, white) 0 19%, var(--base-color) 20% 36%, #657581 37% 55%, #344653 56%); border: 5px solid rgba(255,255,255,.45); border-radius: 50% 50% 45% 48% / 30% 36% 69% 72%; clip-path: polygon(2% 10%, 18% 0, 42% 7%, 62% 0, 86% 8%, 100% 23%, 87% 48%, 69% 62%, 52% 100%, 35% 66%, 13% 51%); box-shadow: 0 27px 35px rgba(20,79,112,.25); }
.base-card::after { content: ""; position: absolute; z-index: 0; left: 24%; bottom: 3%; width: 42%; height: 42%; clip-path: polygon(0 0, 100% 0, 55% 100%); background: linear-gradient(90deg, rgba(255,255,255,.16), transparent, rgba(0,0,0,.18)); }
.base-history { --base-color: #3c92d5; }
.base-sacrifice { --base-color: #2fa46a; }
.base-courage { --base-color: #eb5848; }
.base-wisdom { --base-color: #815ac1; }
.base-character { z-index: 2; min-height: 330px; }
.base-character img { inset: 0; height: 90%; object-position: bottom; animation: guardian-breathe 3.8s ease-in-out infinite; }
.base-card:hover .base-character img { transform: translateY(-9px) scale(1.04); }
.base-character > span { top: 36px; left: 4px; box-shadow: 0 7px 14px rgba(21,72,103,.25); }
.base-copy { align-self: center; margin: 35px 0 45px; padding: 20px; color: #fff; background: rgba(7,54,82,.88); border: 1px solid rgba(255,255,255,.53); border-radius: 18px; box-shadow: 0 16px 30px rgba(14,65,96,.2); backdrop-filter: blur(10px); }
.base-copy > small { color: #ffe98f; }
.base-copy h3 { color: #fff; font-size: 27px; }
.base-copy p, .base-meta span { color: rgba(255,255,255,.8); }
.base-meta { border-top-color: rgba(255,255,255,.23); }
.base-meta b { color: #ffe98f; }
.base-copy button { background: linear-gradient(135deg, #2677e9, #1255cc); border-color: rgba(255,255,255,.5); box-shadow: 0 7px 0 rgba(5,49,104,.8); }
.base-copy button:hover { background: linear-gradient(135deg, #f0c95b, #dc952d); }
.base-card.is-complete .base-copy { border-color: #b4ffca; }
.final-gate { position: relative; z-index: 8; max-width: 900px; margin: 0 auto; background: rgba(6,56,85,.88); border: 2px solid rgba(255,255,255,.65); backdrop-filter: blur(12px); }

.mission-screen { isolation: isolate; min-height: 100svh; overflow: hidden; background: linear-gradient(180deg, #76cafa, #d6f2ff); }
.mission-environment { z-index: -1; background: linear-gradient(180deg, var(--scene-sky-top, #65bdf5), var(--scene-sky-bottom, #daf3ff)); transition: background .4s; }
.scene-sun { position: absolute; right: 9%; top: 8%; width: 150px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fff8bf 0 36%, rgba(255,238,132,.28) 38% 64%, transparent 66%); animation: sun-glow 3s ease-in-out infinite; }
@keyframes sun-glow { 50% { transform: scale(1.07); filter: brightness(1.08); } }
.scene-cloud { position: absolute; width: 210px; height: 42px; background: rgba(255,255,255,.66); border-radius: 99px; box-shadow: 45px -20px 0 8px rgba(255,255,255,.66), 98px 0 rgba(255,255,255,.66); animation: cloud-flight 30s linear infinite; }
.scene-cloud-one { left: -280px; top: 19%; }
.scene-cloud-two { left: -360px; top: 55%; animation-delay: -15s; animation-duration: 39s; transform: scale(.65); }
.scene-ground { position: absolute; inset: auto -5% -10%; height: 42%; background: var(--scene-land, #398b72); clip-path: polygon(0 28%, 9% 19%, 20% 28%, 33% 12%, 43% 24%, 55% 6%, 69% 22%, 81% 10%, 100% 25%, 100% 100%, 0 100%); filter: drop-shadow(0 -14px 30px rgba(15,70,96,.18)); }
.scene-object { position: absolute; bottom: 20%; width: 95px; height: 180px; background: var(--scene-object, #246d63); clip-path: polygon(45% 0, 58% 26%, 92% 32%, 68% 49%, 78% 100%, 21% 100%, 31% 49%, 7% 32%, 40% 26%); }
.scene-object-one { left: 5%; transform: scale(.8); }
.scene-object-two { right: 5%; transform: scale(1.2); }
.scene-object-three { right: 28%; bottom: 15%; transform: scale(.55); }
.scene-history { --scene-sky-top: #5ebbf4; --scene-sky-bottom: #d6efff; --scene-land: #477e9e; --scene-object: #24668b; }
.scene-sacrifice { --scene-sky-top: #77d6bd; --scene-sky-bottom: #e7fff4; --scene-land: #2f8a60; --scene-object: #19634d; }
.scene-courage { --scene-sky-top: #f39972; --scene-sky-bottom: #ffe6b9; --scene-land: #a95a42; --scene-object: #783a34; }
.scene-wisdom { --scene-sky-top: #9279dc; --scene-sky-bottom: #e6e6ff; --scene-land: #4d5f9b; --scene-object: #403e7d; }
.scene-history .scene-object { clip-path: polygon(10% 100%, 10% 32%, 24% 32%, 24% 11%, 37% 11%, 37% 0, 61% 0, 61% 19%, 77% 19%, 77% 43%, 92% 43%, 92% 100%); }
.scene-sacrifice .scene-object { border-radius: 55% 55% 18% 18%; clip-path: polygon(50% 0, 70% 25%, 98% 31%, 75% 52%, 81% 100%, 18% 100%, 25% 52%, 2% 31%, 30% 25%); }
.scene-courage .scene-object { clip-path: polygon(0 100%, 0 38%, 18% 38%, 18% 11%, 35% 11%, 50% 0, 65% 11%, 82% 11%, 82% 38%, 100% 38%, 100% 100%); }
.scene-wisdom .scene-object { clip-path: polygon(22% 100%, 22% 27%, 37% 27%, 50% 0, 63% 27%, 78% 27%, 78% 100%); }
.mission-shell { position: relative; z-index: 3; grid-template-columns: 310px minmax(0, 900px); }
.mission-aside { min-height: 650px; background: rgba(8,60,85,.82); border: 2px solid rgba(255,255,255,.58); backdrop-filter: blur(12px); }
.mission-aside.is-sacrifice { background: rgba(15,105,76,.8); }
.mission-aside.is-courage { background: rgba(137,52,41,.82); }
.mission-aside.is-wisdom { background: rgba(53,55,129,.82); }
.mission-aside img { animation: guardian-breathe 3.5s ease-in-out infinite; }
.mission-panel { border: 2px solid rgba(255,255,255,.75); box-shadow: 0 25px 60px rgba(17,70,102,.23); backdrop-filter: blur(16px); }

@media (max-width: 1180px) {
  .world-history, .world-courage { left: -5%; }
  .world-sacrifice, .world-wisdom { right: -5%; }
  .floating-world { width: 270px; }
  .welcome-copy { width: min(570px, 100%); }
  .base-grid { gap: 55px 80px; }
}

@media (max-width: 940px) {
  .welcome-layout { grid-template-columns: 1fr; padding-top: 38px; }
  .welcome-character { min-height: 235px; grid-row: auto; }
  .world-history { left: -12%; top: 7%; }
  .world-sacrifice { right: -12%; top: 8%; }
  .world-courage { left: -12%; bottom: -2%; }
  .world-wisdom { right: -12%; bottom: -2%; }
  .world-label { display: none; }
  .base-grid { grid-template-columns: 1fr; gap: 30px; padding-inline: 7vw; }
  .base-card { min-height: 390px; }
  .map-core, .map-path { display: none; }
  .mission-shell { grid-template-columns: 1fr; max-width: 850px; }
  .mission-aside { min-height: 260px; background: rgba(8,60,85,.82); }
}

@media (max-width: 680px) {
  .intro-worlds, .map-atmosphere, .mission-environment { inset: 70px 0 0; }
  .welcome-layout { min-height: calc(100svh - 70px); padding: 32px 0 125px; }
  .welcome-copy { align-self: start; }
  .presented-by { font-size: 11px; }
  .welcome-copy h1 { font-size: clamp(43px, 13vw, 66px); }
  .welcome-lead { font-size: 14px; }
  .welcome-features { margin: 13px auto 15px; }
  .welcome-features li { align-items: center; padding: 6px 4px; }
  .welcome-features span { text-align: center; font-size: 9px; }
  .welcome-features b { font-size: 20px; }
  .launch-button { min-width: 210px; min-height: 54px; font-size: 17px; }
  .launch-hint { font-size: 10px; }
  .floating-world { width: 190px; height: 195px; opacity: .88; }
  .floating-world > img { width: 37%; }
  .world-history { left: -20%; top: 1%; }
  .world-sacrifice { right: -20%; top: 4%; }
  .world-courage { left: -20%; bottom: -3%; }
  .world-wisdom { right: -20%; bottom: -3%; }
  .welcome-character { bottom: -49px; width: 180px; min-height: 185px; }
  .welcome-character > img { width: 110px; max-height: 180px; }
  .hero-rock { width: 180px; height: 57px; }
  .setup-dialog { max-height: calc(100svh - 26px); overflow-y: auto; padding: 22px 16px 17px; border-radius: 18px; }
  .setup-dialog .form-heading { padding-right: 38px; }
  .map-heading { padding: 16px; }
  .map-heading .player-summary { width: 100%; }
  .base-grid { padding: 10px 0 35px; }
  .base-card { min-height: 500px; grid-template-columns: 1fr; }
  .base-card::before { height: 46%; }
  .base-character { min-height: 255px; }
  .base-character img { height: 270px; }
  .base-copy { margin: -15px 12px 52px; padding: 16px; }
  .mission-aside { min-height: 220px; grid-template-columns: auto 125px minmax(115px,1fr); }
  .scene-object { opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-world, .base-card, .welcome-character > img, .mission-aside img, .game-cloud, .scene-cloud, .wind-trail, .launch-button, .map-core { animation: none !important; }
}

@media print {
  .intro-worlds, .map-atmosphere, .mission-environment { display: none !important; }
}

/* ================================================================
   ANCIENT MUEANG RAT FANTASY WORLD V45
   Original historically inspired fantasy scenery; not a reconstruction.
   ================================================================ */
:root {
  --ancient-night: #102b31;
  --ancient-ink: #1d302f;
  --ancient-gold: #f2c85b;
  --laterite: #8e452c;
}

body,
body.is-playing { background: #142c31; }

.game-header {
  background: linear-gradient(90deg, rgba(20,35,34,.97), rgba(32,47,43,.94) 58%, rgba(70,42,26,.95));
  border-bottom-color: #e6ba4f;
  box-shadow: 0 10px 34px rgba(17,16,10,.36);
}

.welcome-screen { background: #203c3d; }
.welcome-backdrop {
  background:
    linear-gradient(90deg, rgba(10,31,33,.62), rgba(10,36,38,.32) 27%, rgba(12,32,32,.58) 50%, rgba(15,26,25,.31) 73%, rgba(31,18,10,.62)),
    linear-gradient(180deg, rgba(8,28,32,.12), rgba(13,32,30,.12) 55%, rgba(17,24,21,.72)),
    url("assets/ancient-city-sunrise-v2.webp") center center / cover no-repeat;
  filter: saturate(.96) contrast(1.03);
  animation: ancient-camera-breathe 18s ease-in-out infinite alternate;
}
.welcome-backdrop::after {
  opacity: .58;
  background:
    radial-gradient(circle at 17% 27%, rgba(255,224,125,.95) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 79% 31%, rgba(255,214,105,.85) 0 1.3px, transparent 2.4px),
    radial-gradient(circle at 38% 72%, rgba(255,235,165,.8) 0 1px, transparent 2.1px),
    linear-gradient(180deg, transparent 55%, rgba(12,29,27,.35));
  background-size: 145px 145px, 210px 210px, 175px 175px, auto;
  mix-blend-mode: screen;
  animation: ancient-fireflies 14s linear infinite;
}
@keyframes ancient-camera-breathe {
  from { transform: scale(1.015); }
  to { transform: scale(1.065) translate3d(-.5%, -.4%, 0); }
}
@keyframes ancient-fireflies {
  to { background-position: 40px -90px, -70px -110px, 65px -75px, 0 0; }
}

.intro-worlds { background: radial-gradient(ellipse at 50% 42%, transparent 0 26%, rgba(4,20,22,.06) 56%, rgba(5,18,19,.3)); }
.intro-worlds .sky-orb { opacity: .22; background: radial-gradient(circle, rgba(255,217,124,.65), transparent 65%); }
.intro-worlds .wind-trail { border-top-color: rgba(255,226,163,.25); filter: drop-shadow(0 12px 0 rgba(255,204,111,.1)); }
.intro-worlds .game-cloud { opacity: .19; filter: blur(2px); }
.floating-world { filter: drop-shadow(0 25px 23px rgba(6,22,22,.5)); }
.floating-world .island-mass { --rock: #755944; --rock-dark: #3d352d; }
.world-label {
  background: linear-gradient(135deg, rgba(29,48,45,.94), rgba(83,44,27,.94));
  border-color: rgba(242,200,91,.67);
  box-shadow: 0 9px 20px rgba(9,21,19,.38);
}
.world-label small { color: #ffe9a5; }

.welcome-copy > .game-kicker {
  background: rgba(28,46,42,.87);
  border-color: rgba(242,200,91,.72);
  box-shadow: 0 9px 26px rgba(8,20,19,.35);
}
.presented-by,
.welcome-lead,
.launch-hint { color: #fff6dd; text-shadow: 0 2px 7px rgba(5,16,16,.88); }
.welcome-copy h1 { color: #fffaf0; text-shadow: 0 3px 0 rgba(66,31,17,.42), 0 12px 34px rgba(6,16,16,.72); }
.welcome-copy h1 em { color: #ffd96b; text-shadow: 0 4px 0 rgba(110,55,24,.58), 0 15px 38px rgba(5,17,17,.7); }
.welcome-features li {
  color: #fff;
  background: rgba(22,44,41,.78);
  border-color: rgba(242,200,91,.5);
  box-shadow: 0 10px 27px rgba(7,20,19,.33);
}
.welcome-features b { color: #ffd96b; }
.welcome-features span { color: #fff8e8; }
.launch-button {
  background: linear-gradient(135deg, #a93d2f, #76261f);
  border-color: #f7d36f;
  box-shadow: 0 10px 0 #4e1c18, 0 22px 42px rgba(34,17,12,.48);
}
.launch-button:hover,
.launch-button:focus-visible { box-shadow: 0 14px 0 #4e1c18, 0 28px 48px rgba(34,17,12,.56); }
.launch-button i { color: #8a3026; background: #ffe59a; }
.hero-rock { background: linear-gradient(150deg, #b56a41, #754329 57%, #3c3028); filter: drop-shadow(0 20px 16px rgba(10,24,21,.5)); }

.map-screen {
  background:
    linear-gradient(180deg, rgba(14,38,40,.66), rgba(18,46,42,.54) 45%, rgba(33,29,20,.78)),
    url("assets/ancient-city-sunrise-v2.webp") center / cover fixed no-repeat;
}
.map-sky {
  background:
    radial-gradient(circle at 50% 8%, rgba(255,221,128,.28), transparent 25%),
    linear-gradient(180deg, rgba(13,36,38,.34), rgba(17,36,32,.63));
}
.map-sky::after { opacity: .5; background: radial-gradient(circle at 14% 20%, #ffe48b 0 1.4px, transparent 2.4px); background-size: 110px 110px; }
.map-heading,
.final-gate { background: linear-gradient(135deg, rgba(20,50,47,.94), rgba(70,39,25,.92)); border-color: rgba(242,200,91,.7); }
.map-core { background: linear-gradient(145deg, #e6b749, #9f4f2e); border-color: rgba(255,231,154,.82); box-shadow: 0 16px 0 #63311f, 0 28px 40px rgba(10,25,22,.48); }
.map-path path { stroke: rgba(255,220,119,.92); }
.map-path .path-glow { stroke: rgba(70,29,18,.34); }
.base-copy { background: linear-gradient(135deg, rgba(20,48,45,.94), rgba(65,39,27,.93)); border-color: rgba(242,200,91,.62); box-shadow: 0 18px 36px rgba(9,23,21,.42); }
.base-card::before { border-color: rgba(242,200,91,.55); box-shadow: 0 28px 38px rgba(7,22,21,.47); }
.base-copy button { background: linear-gradient(135deg, #a33a2e, #6e241d); border-color: #e5bd59; box-shadow: 0 7px 0 #431a16; }

.mission-screen {
  background: #1d3433;
  --scene-wash: rgba(12,38,38,.58);
  --scene-glow: rgba(219,170,67,.12);
}
.mission-environment {
  background:
    radial-gradient(circle at 22% 15%, var(--scene-glow), transparent 34%),
    linear-gradient(110deg, var(--scene-wash), rgba(22,27,23,.3) 47%, var(--scene-wash)),
    url("assets/ancient-citadel-amber-v2.webp") center / cover no-repeat;
  filter: saturate(.92) contrast(1.04);
  transform: scale(1.025);
  animation: mission-camera-drift 22s ease-in-out infinite alternate;
}
@keyframes mission-camera-drift { to { transform: scale(1.07) translate3d(.6%, -.5%, 0); } }
.scene-history { --scene-wash: rgba(17,50,61,.58); --scene-glow: rgba(82,178,225,.16); }
.scene-sacrifice { --scene-wash: rgba(13,64,48,.56); --scene-glow: rgba(83,206,141,.16); }
.scene-courage { --scene-wash: rgba(82,29,23,.55); --scene-glow: rgba(255,119,74,.2); }
.scene-wisdom { --scene-wash: rgba(44,32,77,.57); --scene-glow: rgba(159,120,238,.2); }
.scene-sun { opacity: .48; mix-blend-mode: screen; }
.scene-cloud { opacity: .22; filter: blur(2px); }
.scene-ground,
.scene-object { opacity: .16; mix-blend-mode: soft-light; }
.mission-aside { background: rgba(18,52,51,.88); border-color: rgba(242,200,91,.68); box-shadow: 0 23px 50px rgba(7,19,18,.45); }
.mission-aside.is-sacrifice { background: rgba(18,83,62,.87); }
.mission-aside.is-courage { background: rgba(104,41,32,.88); }
.mission-aside.is-wisdom { background: rgba(55,43,101,.87); }
.mission-panel { background: rgba(255,251,240,.96); border-color: rgba(242,200,91,.68); box-shadow: 0 25px 60px rgba(7,20,18,.45); }

@media (max-width: 680px) {
  .welcome-backdrop { background-position: 56% center; }
  .map-screen { background-position: 58% center; background-attachment: scroll; }
  .welcome-copy { padding: 9px 8px 14px; border-radius: 24px; background: linear-gradient(180deg, rgba(13,38,38,.12), rgba(14,35,33,.34)); }
  .welcome-features li { background: rgba(21,46,43,.84); }
  .mission-environment { background-position: 61% center; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-backdrop,
  .mission-environment { animation: none !important; }
}

/* ================================================================
   COMPLETE PLAYABLE MISSION SYSTEM V48
   Hands-on challenges for evidence matching, sacrifice allocation,
   courage movement, and optional camera-based AR interaction.
   ================================================================ */
.match-board,
.resource-dashboard,
.maze-panel,
.ar-panel {
  margin-top: 18px;
  padding: clamp(14px, 2vw, 22px);
  background: linear-gradient(145deg, rgba(255,252,244,.96), rgba(248,237,211,.95));
  border: 1px solid rgba(160,122,55,.35);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 16px 32px rgba(45,32,16,.1);
}

.match-board {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 14px;
}

.match-column {
  display: grid;
  align-content: start;
  gap: 9px;
}

.match-column h4,
.resource-group h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.match-card {
  min-height: 58px;
  padding: 10px 13px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid #d9c59d;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.match-card:hover:not(:disabled),
.match-card:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--red);
  background: #fff7e5;
}

.match-card.is-selected {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-color: var(--gold);
}

.match-card.is-matched {
  color: #115545;
  background: #e7f6ed;
  border-color: #3f967d;
}

.match-card.is-wrong {
  color: #fff;
  background: var(--red);
  border-color: #ffd46c;
  animation: wrong-shake .32s ease;
}

@keyframes wrong-shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.resource-status {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.resource-status strong {
  color: var(--navy);
  font-size: 18px;
}

.resource-status i {
  height: 10px;
  overflow: hidden;
  background: #e8dbc2;
  border-radius: 999px;
}

.resource-status b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: inherit;
  transition: width .22s ease;
}

.resource-status small {
  color: var(--muted);
}

.resource-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.resource-group {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  text-align: center;
  background: #fffdf7;
  border: 1px solid #dbc89e;
  border-radius: 15px;
}

.resource-group strong {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 42px;
  line-height: 1;
}

.resource-group div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.resource-group button,
.maze-controls button {
  width: 46px;
  height: 46px;
  cursor: pointer;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  font-size: 23px;
  font-weight: 900;
}

.resource-group button:disabled,
.maze-controls button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.maze-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px;
  gap: 16px;
  align-items: center;
}

.maze-topline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
}

.maze-topline span {
  padding: 4px 10px;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  font-weight: 900;
}

.maze-topline small {
  color: var(--muted);
}

.maze-grid {
  display: grid;
  grid-template-columns: repeat(var(--maze-size), minmax(44px, 1fr));
  gap: 8px;
}

.maze-cell {
  aspect-ratio: 1;
  color: transparent;
  background: linear-gradient(145deg, #fffaf0, #ecd8ae);
  border: 1px solid #d2b572;
  border-radius: 13px;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.maze-cell.has-token {
  color: #0f654f;
  background: radial-gradient(circle, #dff7ed 0 42%, #fffaf0 45%);
}

.maze-cell.has-hazard {
  color: #8e2f25;
  background: radial-gradient(circle, #ffe2dd 0 42%, #fffaf0 45%);
}

.maze-cell.has-player {
  color: #fff;
  background: linear-gradient(145deg, #114a64, #0d3040);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(225,184,79,.25), 0 10px 18px rgba(13,48,64,.25);
  animation: player-pulse 1.15s ease-in-out infinite;
}

@keyframes player-pulse {
  50% { transform: scale(1.05); }
}

.maze-controls {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.maze-controls div {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 8px;
}

.ar-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, .45fr);
  gap: 16px;
  align-items: center;
}

.ar-stage {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(242,200,91,.18), transparent 46%), linear-gradient(145deg, #0c3442, #271d2f);
  border: 1px solid rgba(242,200,91,.55);
  border-radius: 18px;
}

.ar-stage video,
.ar-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ar-stage video {
  opacity: .58;
  transform: scaleX(-1);
}

.ar-stage canvas {
  opacity: .32;
  mix-blend-mode: screen;
}

.ar-targets {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.ar-targets i {
  width: min(92px, 24vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  cursor: pointer;
  color: #fff8df;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,226,137,.72);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 34px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 0 0 9px rgba(242,200,91,.08), 0 0 28px rgba(242,200,91,.22);
  animation: ar-orbit 2.8s ease-in-out infinite;
}

.ar-targets i:nth-child(2) { animation-delay: -.8s; }
.ar-targets i:nth-child(3) { animation-delay: -1.6s; }

.ar-targets i.is-hit {
  color: #173d37;
  background: #f7d86f;
  border-color: #fff;
  animation: none;
}

@keyframes ar-orbit {
  50% { transform: translateY(-8px) scale(1.06); }
}

.ar-actions {
  display: grid;
  gap: 10px;
}

.ar-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .match-board,
  .resource-groups,
  .maze-panel,
  .ar-panel {
    grid-template-columns: 1fr;
  }

  .maze-controls {
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  .maze-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .maze-grid {
    gap: 6px;
  }

  .resource-group {
    min-height: 118px;
  }
}

/* ================================================================
   LUK PHO KHUN MA — MODERN GAME UI V5
   Refined from the Canva Code workflow: clear onboarding, compact HUD,
   immediate rewards, responsive touch targets, and readable glass panels.
   ================================================================ */
.game-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -3px;
  height: 3px;
  background: linear-gradient(90deg, #ffcf5d, #ff7262, #5ee7c8, #67b8ff, #ffcf5d);
  background-size: 220% 100%;
  animation: header-energy 8s linear infinite;
}

@keyframes header-energy { to { background-position: 220% 0; } }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: #effff8;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.live-pill i {
  width: 8px;
  height: 8px;
  background: #56e6a9;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(86,230,169,.14);
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse { 50% { box-shadow: 0 0 0 9px rgba(86,230,169,0); } }

.game-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0 12px;
  padding: 0;
  list-style: none;
}

.game-flow li {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf7, #f7ead0);
  border: 1px solid rgba(160,122,55,.28);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
}

.game-flow b {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #a93d2f, #75221c);
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(117,34,28,.22);
}

.virtue-hud {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.virtue-hud > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  color: #fff;
  background: rgba(4,25,28,.28);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
}

.virtue-hud small { color: rgba(255,255,255,.74); font-size: 11px; }
.virtue-hud strong { color: #ffe486; font-size: 20px; }
.virtue-hud.is-pulsing { animation: momentum-pop .38s ease; }
@keyframes momentum-pop { 50% { transform: scale(1.035); filter: brightness(1.18); } }

.report-momentum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-momentum span {
  padding: 7px 10px;
  color: #624414;
  background: #fff2bf;
  border: 1px solid #e9ca62;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.base-card:hover::before,
.base-card:focus-within::before {
  transform: translateY(-5px) rotateX(1deg);
  box-shadow: 0 34px 48px rgba(7,22,21,.5);
}

.primary-button,
.launch-button,
.base-copy button {
  position: relative;
  overflow: hidden;
}

.primary-button::after,
.launch-button::after,
.base-copy button::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -55%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.34), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
}

.primary-button:hover::after,
.launch-button:hover::after,
.base-copy button:hover::after { left: 115%; }

@media (max-width: 820px) {
  .live-pill { display: none; }
  .game-flow { grid-template-columns: 1fr; }
  .game-flow li { min-height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-header::after,
  .live-pill i { animation: none !important; }
}

/* ================================================================
   GAME NAVIGATION V6
   Accessible navigation drawer for desktop, tablet, and mobile.
   ================================================================ */
.game-menu-trigger {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  cursor: pointer;
  color: #253016;
  background: linear-gradient(135deg, #ffe493, #e7b94b);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 11px;
  box-shadow: 0 7px 18px rgba(14,20,13,.2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
}

.game-menu-trigger:hover,
.game-menu-trigger:focus-visible,
.game-menu-trigger.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ad4032, #76231d);
}

.menu-lines {
  width: 20px;
  display: grid;
  gap: 4px;
}

.menu-lines i {
  width: 100%;
  height: 2px;
  display: block;
  background: currentColor;
  border-radius: 99px;
  transition: transform .2s ease, opacity .2s ease;
}

.game-menu-trigger.is-active .menu-lines i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.game-menu-trigger.is-active .menu-lines i:nth-child(2) { opacity: 0; }
.game-menu-trigger.is-active .menu-lines i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.game-menu-scrim {
  position: fixed;
  z-index: 295;
  inset: 0;
  background: rgba(4,21,26,.5);
  backdrop-filter: blur(5px);
}

.game-menu-panel {
  position: fixed;
  z-index: 300;
  top: 88px;
  right: max(18px, calc((100vw - 1420px) / 2));
  width: min(620px, calc(100vw - 30px));
  max-height: calc(100svh - 108px);
  padding: 15px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255,252,244,.98);
  border: 1px solid rgba(235,197,94,.75);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(3,18,23,.38);
  animation: menu-arrive .22s ease both;
}

@keyframes menu-arrive { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

.game-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 7px 14px;
  border-bottom: 1px solid #eadfc7;
}

.game-menu-head > div { display: grid; gap: 2px; }
.game-menu-head small { color: #9b3b2f; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.game-menu-head strong { color: var(--navy); font-size: 19px; }
.game-menu-head button { width: 38px; height: 38px; cursor: pointer; color: var(--navy); background: #f2e7d2; border: 0; border-radius: 50%; font-size: 26px; line-height: 1; }

.game-menu-scroll {
  max-height: calc(100svh - 190px);
  overflow-y: auto;
  padding: 0 4px 5px;
  scrollbar-color: #d1a83e transparent;
  scrollbar-width: thin;
}

.game-menu-section-label {
  margin: 14px 2px 7px;
  color: #8a3127;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .035em;
}

.game-menu-links {
  display: grid;
  gap: 7px;
  padding: 0;
}

.game-menu-actions,
.game-menu-external { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.game-menu-links a,
.game-menu-links button {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #eadfc7;
  border-radius: 14px;
  font: inherit;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.game-menu-links a:hover,
.game-menu-links button:hover,
.game-menu-links a:focus-visible,
.game-menu-links button:focus-visible {
  transform: translateX(-3px);
  background: #fff5d7;
  border-color: #d8af45;
}

.game-menu-links > * > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #17495e, #0c3040);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 900;
}

.game-menu-links .is-current > span,
.game-menu-links button[data-game-command="start"] > span { background: linear-gradient(135deg, #ad4032, #76231d); }
.game-menu-links div { min-width: 0; display: grid; gap: 2px; }
.game-menu-links strong { color: var(--navy); font-size: 15px; }
.game-menu-links small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.game-menu-guide { margin-top: 8px; overflow: hidden; background: linear-gradient(135deg, #fff9e9, #f7ebc9); border: 1px solid #ddc681; border-radius: 14px; }
.game-menu-guide > summary { min-height: 64px; display: grid; grid-template-columns: 43px minmax(0, 1fr) 24px; align-items: center; gap: 12px; padding: 9px 11px; cursor: pointer; list-style: none; }
.game-menu-guide > summary::-webkit-details-marker { display: none; }
.game-menu-guide > summary::marker { content: ""; }
.game-menu-guide > summary:focus-visible { outline: 3px solid #1c78ad; outline-offset: -3px; }
.game-menu-guide > summary > span { width: 43px; height: 43px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ad4032, #76231d); border-radius: 12px; font-size: 20px; font-weight: 900; }
.game-menu-guide > summary > div { min-width: 0; display: grid; gap: 2px; }
.game-menu-guide > summary strong { color: var(--navy); font-size: 15px; }
.game-menu-guide > summary small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.game-menu-guide > summary > i { color: #8b3128; font-size: 21px; font-style: normal; font-weight: 900; transition: transform .18s ease; }
.game-menu-guide[open] > summary > i { transform: rotate(180deg); }
.game-menu-guide-content { padding: 0 12px 12px; border-top: 1px solid rgba(150,108,33,.18); }
.game-menu-guide-content > p { margin: 11px 1px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.game-menu-guide-content ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.game-menu-guide-content li { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px; background: rgba(255,255,255,.72); border: 1px solid rgba(150,108,33,.16); border-radius: 10px; }
.game-menu-guide-content li > b { color: #9a352b; font-size: 13px; }
.game-menu-guide-content li > span { display: grid; gap: 1px; }
.game-menu-guide-content li strong { color: var(--navy); font-size: 12px; }
.game-menu-guide-content li small { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.game-menu-guide-content > button { width: 100%; min-height: 43px; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 8px 12px; cursor: pointer; color: #fff; background: linear-gradient(135deg, #a83c31, #75241d); border: 1px solid #d5aa43; border-radius: 10px; font: inherit; font-size: 12px; font-weight: 900; }
.game-menu-guide-content > button:hover,
.game-menu-guide-content > button:focus-visible { background: linear-gradient(135deg, #be493a, #872a21); }

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

.game-menu-bases button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid #eadfc7;
  border-radius: 14px;
  font: inherit;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.game-menu-bases button:hover,
.game-menu-bases button:focus-visible {
  transform: translateY(-2px);
  background: #fff5d7;
  border-color: #d8af45;
}

.game-menu-bases button > span {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #343a3e, #111a1e);
  border-radius: 13px;
  font-size: 14px;
  font-weight: 900;
}

.game-menu-bases .is-sacrifice > span { background: linear-gradient(135deg, #4d9453, #1e5730); }
.game-menu-bases .is-courage > span { background: linear-gradient(135deg, #c94a38, #842820); }
.game-menu-bases .is-wisdom > span { background: linear-gradient(135deg, #6b55a5, #3e2d72); }
.game-menu-bases button.is-complete { background: #eff9eb; border-color: #91bf76; }
.game-menu-bases button.is-complete > span { box-shadow: 0 0 0 3px rgba(92,148,64,.2); }
.game-menu-bases div { min-width: 0; display: grid; gap: 3px; }
.game-menu-bases strong { color: var(--navy); font-size: 14px; line-height: 1.25; }
.game-menu-bases small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.welcome-features.mission-overview {
  width: min(920px, 100%);
  max-width: 920px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.mission-overview li {
  min-height: 92px;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 12px;
}
.mission-overview li > b {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #3b2c0d;
  background: #ffd96b;
  border-radius: 50%;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
}
.mission-overview li > span { display: grid; gap: 4px; text-align: left; }
.mission-overview strong { color: #fffaf0; font-size: 13px; line-height: 1.3; }
.mission-overview small { color: rgba(255,248,232,.78); font-size: 10px; line-height: 1.35; }

.quick-guide {
  position: relative;
  z-index: 6;
  width: min(290px, calc(100% - 48px));
  margin: -72px 24px 28px auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(135deg, rgba(255,253,247,.97), rgba(248,235,202,.96));
  border: 1px solid rgba(244,208,104,.75);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(5,22,25,.3);
  scroll-margin-top: 105px;
  transition: width .24s ease, margin .24s ease, border-radius .24s ease;
}
.quick-guide[hidden] { display: none !important; }

.quick-guide[open] {
  width: min(1180px, calc(100% - 48px));
  margin: -95px auto 72px;
  border-radius: 26px;
  box-shadow: 0 28px 70px rgba(5,22,25,.34);
}

.quick-guide-summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px 9px 15px;
  cursor: pointer;
  user-select: none;
}

.quick-guide-summary::-webkit-details-marker { display: none; }
.quick-guide-summary::marker { content: ""; }
.quick-guide-summary:focus-visible { outline: 3px solid #1c78ad; outline-offset: -3px; }
.quick-guide-summary-copy { min-width: 0; display: grid; gap: 1px; }
.quick-guide-summary-copy small { overflow: hidden; color: #a43a2e; font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.quick-guide-summary-copy strong { overflow: hidden; color: var(--navy); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.quick-guide-toggle { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; color: var(--navy); }
.quick-guide-toggle i { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: #a43a2e; border-radius: 50%; font-style: normal; font-weight: 900; }
.quick-guide-toggle b { font-size: 12px; }
.quick-guide .when-open,
.quick-guide[open] .when-closed { display: none; }
.quick-guide[open] .when-open { display: inline; }
.quick-guide-content { padding: 4px clamp(22px, 3vw, 34px) clamp(22px, 3vw, 34px); border-top: 1px solid rgba(161,121,50,.16); }
.quick-guide:not([open]) .quick-guide-content { display: none; }
.quick-guide[open] .quick-guide-toggle i { transform: rotate(180deg); }
.quick-guide[open] .quick-guide-summary { background: rgba(255,255,255,.46); }

@media (hover: hover) {
  .quick-guide:not([open]) .quick-guide-summary:hover { background: rgba(255,255,255,.62); }
}

body.is-setup-open .quick-guide {
  z-index: 3;
  pointer-events: none;
}

.quick-guide-head { max-width: 760px; }
.quick-guide-head h2 { margin: 0 0 7px; color: var(--navy); font-size: clamp(24px, 3vw, 38px); }
.quick-guide-head > p:last-child { margin: 0; color: var(--muted); }
.quick-guide ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0; padding: 0; list-style: none; }
.quick-guide li { min-height: 112px; display: flex; align-items: center; gap: 13px; padding: 16px; background: rgba(255,255,255,.76); border: 1px solid rgba(161,121,50,.22); border-radius: 17px; }
.quick-guide li > b { flex: 0 0 45px; color: #a93d2f; font-family: Georgia,serif; font-size: 26px; }
.quick-guide li span { display: grid; gap: 4px; }
.quick-guide li strong { color: var(--navy); font-size: 16px; }
.quick-guide li small { color: var(--muted); line-height: 1.55; }

@media (max-width: 820px) {
  .game-menu-trigger b { display: none; }
  .game-menu-trigger { width: 42px; padding: 0; justify-content: center; }
  .game-menu-panel { top: 78px; right: 13px; }
  .quick-guide { margin: -64px 14px 22px auto; }
  .quick-guide[open] { width: calc(100% - 28px); margin: -64px auto 40px; }
  .quick-guide ol { grid-template-columns: 1fr; }
  .quick-guide li { min-height: 78px; }
}

@media (max-width: 940px) {
  .welcome-features.mission-overview {
    width: min(570px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mission-overview li { min-height: 82px; }
}

@media (max-width: 520px) {
  .game-menu-panel { top: 74px; max-height: calc(100svh - 88px); padding: 11px; border-radius: 18px; }
  .game-menu-scroll { max-height: calc(100svh - 164px); }
  .game-menu-actions,
  .game-menu-external,
  .game-menu-bases { grid-template-columns: 1fr; }
  .game-menu-links a,
  .game-menu-links button { min-height: 60px; }
  .game-menu-bases button { min-height: 62px; }
  .quick-guide { width: min(240px, calc(100% - 24px)); margin-right: 12px; border-radius: 16px; }
  .quick-guide[open] { width: calc(100% - 24px); margin-right: auto; border-radius: 21px; }
  .quick-guide-summary { min-height: 52px; padding: 7px 9px 7px 12px; }
  .quick-guide-summary-copy strong { font-size: 13px; }
  .quick-guide-toggle i { width: 30px; height: 30px; }
  .quick-guide-content { padding: 3px 15px 19px; }
  .welcome-features.mission-overview { gap: 6px; }
  .mission-overview li { min-height: 76px; flex-direction: row; align-items: flex-start; gap: 7px; padding: 8px 7px; }
  .mission-overview li > b { flex-basis: 28px; width: 28px; height: 28px; font-size: 13px; }
  .mission-overview strong { font-size: 11px; }
  .mission-overview small { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-menu-panel { animation: none !important; }
  .menu-lines i { transition: none !important; }
}
