:root {
  --ink: #17233b;
  --ink-soft: #637089;
  --navy: #17243c;
  --navy-2: #0f1729;
  --paper: #f5f0e7;
  --paper-2: #fcfaf5;
  --line: #e4ddd0;
  --coral: #ed6f6a;
  --coral-dark: #c64f5b;
  --gold: #f5c767;
  --mint: #8dc4a8;
  --lavender: #b7a9e8;
  --shadow: 0 24px 60px rgba(32, 40, 62, 0.13);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(237, 111, 106, 0.08), transparent 28rem),
    radial-gradient(circle at 94% 12%, rgba(183, 169, 232, 0.13), transparent 30rem),
    var(--paper);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

.app-shell { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 34px 0 20px; }

.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; }

.site-header { padding: 0 2px 28px; }

.brand-lockup { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: #fff3dd; background: var(--coral); font-size: 22px; line-height: 1;
  box-shadow: 0 9px 20px rgba(198, 79, 91, 0.25);
}

.eyebrow, .overlay-kicker, .section-heading, .chapter-chip, .route-time, .microcopy, .game-card-note, .footer-hint, .sound-button, .header-note, .site-footer {
  letter-spacing: 0.08em; text-transform: uppercase;
}

.eyebrow { margin: 0 0 5px; color: var(--coral-dark); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.site-header h1 { margin: 0; font-size: clamp(21px, 3vw, 29px); letter-spacing: -0.045em; line-height: 1; }

.header-note { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(141, 196, 168, 0.16); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 20px; align-items: stretch; }

.game-card { min-width: 0; padding: 16px; border-radius: 27px; background: var(--navy); box-shadow: var(--shadow); }

.game-card-topline { height: 30px; display: flex; align-items: flex-start; justify-content: space-between; padding: 0 5px 10px; }
.chapter-chip { display: inline-flex; align-items: center; gap: 8px; color: #fce8c3; font-size: 9px; font-weight: 700; }
.chapter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(245, 199, 103, 0.12); }
.game-card-note { color: #8795af; font-size: 9px; font-weight: 600; }

.game-stage { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; background: #8eb1d9; isolation: isolate; }

#gameCanvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; }
.scanlines { position: absolute; z-index: 3; inset: 0; pointer-events: none; opacity: 0.12; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px); mix-blend-mode: overlay; }

.screen-overlay { position: absolute; z-index: 6; inset: 0; display: grid; place-items: center; background: linear-gradient(90deg, rgba(15, 23, 41, 0.82), rgba(15, 23, 41, 0.52)); transition: opacity 240ms ease, visibility 240ms ease; }
.screen-overlay.hidden, .toast-message.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.story-overlay { overflow: auto; padding: 20px; background: linear-gradient(135deg, rgba(18, 28, 48, 0.97), rgba(55, 46, 75, 0.95)); }
.comic-book { width: min(930px, 100%); padding: 23px; border: 1px solid rgba(255,255,255,0.14); border-radius: 20px; color: #fff8e9; background: rgba(18, 26, 46, 0.84); box-shadow: 0 25px 50px rgba(5, 10, 24, 0.35); }
.comic-topline, .comic-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.comic-topline h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); line-height: 1.02; letter-spacing: -0.07em; }
.comic-topline h2 em { color: #ffcf7a; font-family: Georgia, serif; font-weight: 400; }
.comic-page { padding-bottom: 3px; color: #8d9db8; font-size: 8px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.comic-panels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 18px 0; }
.comic-panel { overflow: hidden; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; background: #f8edda; color: #1c2942; animation: comicRise 620ms cubic-bezier(.22,.82,.27,1) both; }
.comic-panel:nth-child(2) { animation-delay: 90ms; }
.comic-panel:nth-child(3) { animation-delay: 180ms; }
.comic-panel:nth-child(4) { animation-delay: 270ms; }
.panel-art { position: relative; display: grid; height: 152px; place-items: end center; overflow: hidden; }
.story-panel { transition: border-color 260ms ease, box-shadow 260ms ease, filter 260ms ease; }
.story-panel.story-active { border-color: rgba(255, 207, 122, 0.72); box-shadow: 0 8px 18px rgba(7, 12, 25, 0.24); filter: saturate(1.08); }
.story-scene { display: block; background-color: #5c4c6e; background-repeat: no-repeat; background-size: 135% 135%; background-position: 50% 50%; }
.story-scene::before { position: absolute; z-index: 1; inset: 0; content: ""; background: linear-gradient(180deg, rgba(11, 20, 39, 0.1), rgba(11, 20, 39, 0.5)); pointer-events: none; }
.story-scene::after { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 24%; content: ""; background: linear-gradient(180deg, transparent, rgba(10, 17, 31, 0.4)); pointer-events: none; }
.story-scene-meet { background-image: url("assets/story-meet.png"); animation: storyPanLeftRight 8s ease-in-out infinite alternate; }
.story-scene-messages { background-image: url("assets/story-messages.png"); animation: storyPanTopBottom 8.4s ease-in-out infinite alternate; }
.story-scene-campus { background-image: url("assets/story-campus.png"); animation: storyPanLeftRight 9.2s ease-in-out infinite alternate-reverse; }
.story-scene-home { background-image: url("assets/story-home.png"); animation: storyPanBottomRight 8.8s ease-in-out infinite alternate; }
.story-camera { position: absolute; z-index: 2; right: 9px; bottom: 9px; color: rgba(255, 243, 207, 0.88); font-size: 6px; font-weight: 800; letter-spacing: 0.08em; text-shadow: 0 1px 2px rgba(10, 16, 30, 0.65); }
.campus-panel .panel-art { background: linear-gradient(180deg, #7c91ca, #f6c57b); }
.letter-panel .panel-art { background: linear-gradient(180deg, #624b76, #ed9b7d); }
.road-panel .panel-art { background: linear-gradient(180deg, #3e5e88, #eda660); }
.home-panel .panel-art { background: linear-gradient(180deg, #9c78c7, #f9b174); }
.panel-number { position: absolute; z-index: 2; top: 10px; left: 11px; color: rgba(255,255,255,0.68); font-family: "Press Start 2P", monospace; font-size: 8px; }
.panel-sun { position: absolute; top: 28px; right: 18px; width: 26px; height: 26px; border-radius: 50%; background: #ffe2a4; box-shadow: 0 0 0 8px rgba(255, 226, 164, 0.15); }
.panel-building { position: absolute; right: 4px; bottom: 0; width: 68%; height: 64px; border: 4px solid #5d4052; border-bottom: 0; background: #b96d5d; box-shadow: inset 0 8px 0 rgba(255, 226, 164, 0.38); }
.panel-building::after { position: absolute; inset: 20px 9px auto; height: 8px; content: ""; background: repeating-linear-gradient(90deg, #ffe4ad 0 8px, transparent 8px 16px); }
.comic-sprite { position: relative; z-index: 1; display: block; width: 76px; height: 102px; background-image: url("assets/character-sprites-v2.png"); background-repeat: no-repeat; background-size: 600% 300%; image-rendering: pixelated; transform-origin: center bottom; animation: comicBob 2.8s ease-in-out infinite; }
.comic-boy { background-position: 0 0; }
.comic-boy.wave { background-position: 100% 0; }
.comic-boy.jump { position: absolute; bottom: 5px; left: 12px; background-position: 80% 0; transform: rotate(-5deg); }
.comic-anna { position: absolute; bottom: 2px; left: 19px; background-position: 0 50%; }
.comic-helper { position: absolute; right: 4px; bottom: 2px; width: 68px; height: 92px; background-position: 0 100%; transform: scaleX(-1); }
.panel-letter { z-index: 1; margin-bottom: 40px; color: #ffcf7a; font-family: Georgia, serif; font-size: 54px; text-shadow: 2px 3px 0 rgba(151, 67, 83, 0.45); animation: letterFloat 2.2s ease-in-out infinite; }
.panel-road-line { position: absolute; right: -20px; bottom: 18px; left: -20px; height: 19px; background: repeating-linear-gradient(90deg, rgba(255,241,181,0.85) 0 26px, transparent 26px 52px); transform: rotate(-4deg); }
.panel-truck { position: absolute; right: 9px; bottom: 37px; width: 76px; height: 32px; border-radius: 4px 6px 2px 2px; background: #3d7984; box-shadow: -31px 6px 0 -3px #e5a45f, -42px 14px 0 -3px #273a53; }
.panel-mountain { position: absolute; right: -10px; bottom: 32px; width: 130px; height: 74px; background: #6f73a6; clip-path: polygon(0 100%, 46% 19%, 61% 42%, 100% 0, 100% 100%); }
.panel-hearts { position: absolute; z-index: 2; top: 10px; right: 11px; color: #ffdf9b; font-family: Georgia, serif; font-size: 13px; letter-spacing: 3px; }
.panel-copy { min-height: 93px; padding: 11px 12px 12px; }
.panel-copy span { display: block; margin-bottom: 5px; color: #c06466; font-size: 7px; font-weight: 700; letter-spacing: 0.13em; }
.panel-copy strong { display: block; font-size: 12px; line-height: 1.08; letter-spacing: -0.035em; }
.panel-copy p { margin: 6px 0 0; color: #7d7780; font-size: 9px; line-height: 1.32; }
.comic-footer { align-items: center; }
.story-subtitle-wrap { min-width: 0; flex: 1; }
.story-subtitle-label { color: #f4c873; font-size: 7px; font-weight: 800; letter-spacing: 0.16em; }
.story-subtitle { margin: 5px 0 3px; color: #fff5de; font-family: Georgia, serif; font-size: 14px; line-height: 1.22; }
.story-caption { margin: 0; color: #9aa8bd; font-size: 9px; }

.dialogue-overlay { display: block; background: transparent; pointer-events: none; }
.dialogue-card {
  --cloud-tail: 72%;
  position: absolute; top: 56%; left: 50%; display: grid; grid-template-columns: 132px 1fr;
  width: min(560px, calc(100vw - 32px)); min-height: 164px; overflow: visible;
  border: 3px solid #3a3145; border-radius: 46px; color: #28334a; background: #fff9e9;
  box-shadow: 0 22px 55px rgba(8, 12, 26, 0.32), inset 0 -5px 0 rgba(234, 192, 137, 0.22);
  transform: translate(-50%, -100%); pointer-events: auto;
}
.dialogue-card::before, .dialogue-card::after { position: absolute; z-index: -1; border: 3px solid #3a3145; border-radius: 50%; content: ""; background: #fff9e9; }
.dialogue-card::before { bottom: -19px; left: var(--cloud-tail); width: 24px; height: 24px; }
.dialogue-card::after { bottom: -35px; left: calc(var(--cloud-tail) + 20px); width: 11px; height: 11px; }
.dialogue-card.speaker-gev { --cloud-tail: 24%; }
.dialogue-card.speaker-lilit { --cloud-tail: 72%; }
.dialogue-card.town-square .dialogue-avatars {
  background-image: linear-gradient(150deg, rgba(255, 229, 178, 0.72), rgba(111, 91, 117, 0.5)), url("assets/armenia-town-panorama.png");
  background-position: center, 68% 50%;
  background-size: cover, auto 100%;
  background-repeat: no-repeat;
}
.dialogue-card.town-square .dialogue-avatars::after {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 10px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 243, 207, 0.4);
  border-radius: 99px;
  content: "TOWN SQUARE";
  color: #fff3cf;
  background: rgba(42, 43, 69, 0.62);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.dialogue-card.town-square .gev-avatar { z-index: 2; opacity: 1; transform: translateY(-3px) scale(1.04); }
.dialogue-card.town-square .helper-avatar { opacity: 0; visibility: hidden; transform: scale(0.91); pointer-events: none; }
.dialogue-overlay:not(.hidden) .dialogue-card { animation: dialogueCloudPop 260ms cubic-bezier(.2,.82,.28,1.22) both; }
.dialogue-avatars { position: relative; min-height: 158px; overflow: hidden; border-radius: 42px 0 0 42px; background: linear-gradient(155deg, #ffe5b2, #eda083); }
.dialogue-avatar { position: absolute; bottom: 8px; width: 74px; height: 100px; background-image: url("assets/character-sprites-v2.png"); background-repeat: no-repeat; background-size: 600% 300%; image-rendering: pixelated; filter: drop-shadow(0 8px 0 rgba(38,37,61,0.13)); transition: opacity 180ms ease, transform 180ms ease; }
.dialogue-avatar span { position: absolute; bottom: 0; left: 2px; color: rgba(47,48,69,0.74); font-size: 6px; font-weight: 800; letter-spacing: 0.1em; white-space: nowrap; }
.anna-avatar { left: 11px; background-position: 0 50%; }
.gev-avatar { left: 6px; background-position: 0 0; }
.helper-avatar { right: 2px; width: 67px; height: 91px; background-position: 0 100%; }
.dialogue-card.speaker-gev .helper-avatar, .dialogue-card.speaker-lilit .gev-avatar { opacity: 0.42; transform: scale(0.91); }
.dialogue-card.speaker-gev .gev-avatar, .dialogue-card.speaker-lilit .helper-avatar { opacity: 1; transform: translateY(-3px) scale(1.04); }
.dialogue-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 22px 28px 20px 24px; }
.dialogue-copy .overlay-kicker { margin-bottom: 6px; color: #c4565f; font-size: 8px; }
.dialogue-copy h2 { margin: 0; color: #263149; font-size: 27px; letter-spacing: -0.055em; }
.dialogue-line { margin: 8px 0 13px; color: #536078; font-family: Georgia, serif; font-size: 18px; line-height: 1.3; }
.dialogue-copy .primary-button { align-self: flex-start; border-radius: 99px; padding: 9px 13px 9px 15px; font-size: 10px; }

.talk-prompt { position: absolute; z-index: 8; left: 50%; bottom: 25px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.2); border-radius: 99px; padding: 7px 12px 7px 8px; color: #fff8e9; background: rgba(23, 36, 60, 0.9); cursor: pointer; font-size: 10px; font-weight: 700; transform: translateX(-50%); transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease; }
.talk-prompt.hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 7px); }
.talk-key { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; color: #2a3049; background: #ffcf7a; font-family: "Press Start 2P", monospace; font-size: 8px; }

@keyframes comicRise { from { opacity: 0; transform: translateY(18px) rotate(1deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }
@keyframes comicBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes letterFloat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(5deg); } }
@keyframes dialogueCloudPop { from { opacity: 0; transform: translate(-50%, -88%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@keyframes storyPanLeftRight { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes storyPanTopBottom { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
@keyframes storyPanBottomRight { from { background-position: 0% 100%; } to { background-position: 100% 50%; } }

.start-copy { width: min(410px, 82%); margin-right: auto; margin-left: 8%; color: #fff9ee; }
.pixel-heart { display: inline-grid; place-items: center; color: #ffcf7a; text-shadow: 4px 4px 0 rgba(205, 87, 76, 0.6); font-family: Georgia, serif; }
.pixel-heart.large { width: 52px; height: 52px; margin-bottom: 14px; border: 1px solid rgba(255, 220, 154, 0.35); border-radius: 16px; background: rgba(251, 205, 120, 0.13); font-size: 32px; }
.overlay-kicker { margin: 0 0 12px; color: #f9d694; font-size: 10px; font-weight: 700; letter-spacing: 0.15em; }
.start-copy h2, .pause-card h2, .finish-copy h2 { margin: 0; font-size: clamp(26px, 4vw, 50px); line-height: 1.05; letter-spacing: -0.06em; }
.overlay-body { max-width: 370px; margin: 17px 0 21px; color: #d7dfec; font-size: 14px; line-height: 1.55; }
.microcopy { margin: 15px 0 0; color: #9aabc4; font-size: 8px; font-weight: 600; }

.primary-button { appearance: none; display: inline-flex; align-items: center; gap: 18px; border: 0; border-radius: 11px; padding: 13px 17px 13px 18px; color: #fff8ec; background: var(--coral); cursor: pointer; font-size: 12px; font-weight: 700; box-shadow: 0 10px 19px rgba(199, 77, 87, 0.3); transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.primary-button span { font-size: 18px; font-weight: 400; line-height: 10px; }
.primary-button:hover { transform: translateY(-2px); background: #f27e72; box-shadow: 0 13px 22px rgba(199, 77, 87, 0.34); }
.primary-button:active { transform: translateY(1px); }

.pause-overlay { background: rgba(15, 23, 41, 0.72); }
.pause-card { width: min(340px, 80%); padding: 32px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 20px; color: #fff9ee; background: rgba(23, 36, 60, 0.92); text-align: center; box-shadow: 0 20px 50px rgba(8, 12, 26, 0.35); }
.pause-card .overlay-body { margin: 12px auto 20px; }

.finish-overlay { background: rgba(15, 23, 41, 0.73); }
.finish-card { display: grid; grid-template-columns: 0.72fr 1fr; width: min(750px, 92%); overflow: hidden; border: 1px solid rgba(255,255,255,0.18); border-radius: 20px; color: #fff9ee; background: rgba(23, 36, 60, 0.95); box-shadow: 0 26px 70px rgba(8, 12, 26, 0.4); }
.finish-art-wrap { position: relative; min-height: 320px; overflow: hidden; background: #321c2b; }
.finish-scene { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 70% 20%, rgba(255,206,137,0.7), transparent 22%), linear-gradient(160deg, #4f416f, #9d6076 58%, #e19479); }
.finish-scene::after { position: absolute; right: -8%; bottom: 0; left: -8%; height: 36%; content: ""; background: repeating-linear-gradient(90deg, rgba(255,223,174,0.2) 0 16px, transparent 16px 34px), #7d5060; transform: skewY(-4deg); }
.finish-scene-label { position: absolute; z-index: 3; top: 16px; left: 18px; color: rgba(255,241,202,0.78); font-size: 9px; font-weight: 800; letter-spacing: 0.18em; }
.finish-character { position: absolute; z-index: 2; bottom: 19px; width: 168px; height: 224px; background-image: url("assets/character-sprites-v2.png"); background-repeat: no-repeat; background-size: 600% 300%; image-rendering: pixelated; filter: drop-shadow(0 13px 0 rgba(37,29,54,0.24)); }
.finish-boy { left: calc(50% - 143px); background-position: 100% 0; transform: scaleX(-1); }
.finish-anna { left: calc(50% - 4px); background-position: 100% 50%; }
.finish-hug { position: absolute; z-index: 2; bottom: 7px; left: 50%; width: min(88%, 300px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 14px 0 rgba(37,29,54,0.22)); transform: translateX(-50%); }
.finish-heart { position: absolute; z-index: 4; color: #ffcf7a; font-family: Georgia, serif; line-height: 1; text-shadow: 4px 4px 0 rgba(205,87,76,0.55); }
.finish-heart-one { top: 70px; left: 52%; font-size: 32px; transform: rotate(-10deg); }
.finish-heart-two { top: 107px; left: 64%; font-size: 20px; transform: rotate(11deg); }
.finish-copy { display: flex; flex-direction: column; justify-content: center; padding: 38px 36px; }
.finish-copy .overlay-body { margin: 16px 0 19px; }
.quote { margin: 0 0 22px; color: #ffcf7a; font-family: Georgia, serif; font-size: clamp(18px, 2.2vw, 26px); line-height: 1.25; }
.finish-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.collected-note { color: #9aabc4; font-size: 11px; }

.touch-controls { position: absolute; z-index: 7; right: max(13px, env(safe-area-inset-right)); bottom: max(13px, env(safe-area-inset-bottom)); left: max(13px, env(safe-area-inset-left)); display: none; align-items: flex-end; justify-content: space-between; gap: 14px; pointer-events: none; }
.joystick-control { position: relative; width: 92px; height: 92px; flex: 0 0 auto; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.joystick-base { position: absolute; inset: 0; display: block; border: 1px solid rgba(255,255,255,0.28); border-radius: 50%; background: radial-gradient(circle at 50% 46%, rgba(69, 90, 125, 0.66), rgba(17, 28, 49, 0.86) 68%); box-shadow: inset 0 0 0 7px rgba(8, 14, 28, 0.2), 0 9px 24px rgba(5, 9, 19, 0.25); }
.joystick-base::before { position: absolute; top: 50%; left: 12px; width: calc(100% - 24px); height: 1px; content: ""; background: rgba(255,255,255,0.16); }
.joystick-base::after { position: absolute; top: 12px; left: 50%; width: 1px; height: calc(100% - 24px); content: ""; background: rgba(255,255,255,0.16); }
.joystick-thumb { position: absolute; top: 50%; left: 50%; display: block; width: 39px; height: 39px; border: 2px solid rgba(255,244,211,0.8); border-radius: 50%; background: radial-gradient(circle at 36% 29%, #fff0bf, #f2b96f 64%, #d46e6a); box-shadow: 0 6px 16px rgba(5, 9, 19, 0.36), inset 0 1px 0 rgba(255,255,255,0.46); transform: translate(-50%, -50%); transition: transform 90ms ease-out, box-shadow 120ms ease; }
.joystick-control.is-active .joystick-thumb { box-shadow: 0 8px 19px rgba(5, 9, 19, 0.4), 0 0 0 5px rgba(255, 207, 122, 0.13), inset 0 1px 0 rgba(255,255,255,0.46); }
.joystick-caption { position: absolute; right: 0; bottom: -15px; left: 0; color: rgba(255,255,255,0.6); font-size: 7px; font-weight: 800; letter-spacing: 0.14em; text-align: center; }
.touch-button-row { display: flex; align-items: center; gap: 9px; pointer-events: auto; padding: 5px; border: 1px solid rgba(255,255,255,0.12); border-radius: 18px; background: rgba(8, 14, 28, 0.28); box-shadow: 0 9px 24px rgba(5, 9, 19, 0.22); backdrop-filter: blur(8px); }
.touch-button { display: grid; width: 54px; height: 54px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,0.3); border-radius: 15px; color: #fff9ee; background: rgba(23, 36, 60, 0.82); cursor: pointer; font: 700 25px/1 "DM Sans", sans-serif; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; transition: transform 100ms ease, background 100ms ease, border-color 100ms ease; }
.touch-button:focus-visible { outline: 2px solid #fff0bf; outline-offset: 3px; }
.touch-button:active, .touch-button.is-pressed { border-color: rgba(255,255,255,0.72); background: rgba(62, 79, 112, 0.95); transform: translateY(2px) scale(0.96); }
.jump-control { color: #1a2640; background: rgba(255, 207, 122, 0.92); }
.jump-control:active, .jump-control.is-pressed { background: rgba(255, 224, 156, 1); }

.toast-message { position: absolute; z-index: 8; left: 50%; bottom: 23px; transform: translateX(-50%); padding: 10px 14px; border-radius: 20px; color: #fff9ee; background: rgba(23, 36, 60, 0.88); box-shadow: 0 9px 20px rgba(8, 12, 26, 0.2); font-size: 11px; transition: opacity 160ms ease, visibility 160ms ease; }

.game-footer { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 11px 5px 0; }
.footer-hint, .sound-button { color: #8d9bb5; font-size: 8px; font-weight: 700; }
.kbd { display: inline-grid; min-width: 24px; height: 19px; margin: 0 3px; padding: 0 5px; place-items: center; border: 1px solid #44536f; border-radius: 5px; color: #d6dfed; background: #263651; font-size: 8px; }
.footer-separator { padding: 0 3px; color: #56647c; }
.sound-button { display: inline-flex; align-items: center; gap: 7px; border: 0; color: #c9d1df; background: none; cursor: pointer; }
.sound-button:hover { color: #fff5d9; }
.sound-button span:first-child { color: var(--gold); font-family: Georgia, serif; font-size: 17px; letter-spacing: 0; text-transform: none; }

.side-panel { display: flex; flex-direction: column; gap: 14px; }
.side-intro { padding: 9px 4px 5px; }
.side-intro h2 { margin: 0 0 13px; font-size: clamp(27px, 3vw, 36px); line-height: 1.02; letter-spacing: -0.07em; }
.side-intro h2 em { color: var(--coral-dark); font-family: Georgia, serif; font-weight: 400; letter-spacing: -0.05em; }
.side-intro > p:last-child { max-width: 280px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.route-card, .heart-card, .controls-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-2); }
.section-heading { display: flex; align-items: center; justify-content: space-between; color: #8690a2; font-size: 9px; font-weight: 700; }
.route-time { color: #b1a999; font-size: 8px; }
.route-line { position: relative; display: flex; align-items: center; justify-content: space-between; height: 28px; margin: 14px 1px 4px; }
.route-line::before { position: absolute; top: 50%; right: 7px; left: 7px; height: 2px; content: ""; background: #ded7cc; transform: translateY(-50%); }
.route-fill { position: absolute; top: 50%; left: 7px; width: 0; height: 2px; content: ""; background: var(--coral); transform: translateY(-50%); transition: width 280ms ease; }
.route-stop { z-index: 1; width: 10px; height: 10px; border: 2px solid var(--paper-2); border-radius: 50%; background: #d3ccc0; box-shadow: 0 0 0 1px #d3ccc0; transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease; }
.route-stop.active, .route-stop.passed { background: var(--coral); box-shadow: 0 0 0 1px var(--coral), 0 0 0 4px rgba(237,111,106,0.13); }
.route-stop.final-stop { display: grid; width: 21px; height: 21px; border-radius: 50%; place-items: center; color: var(--paper-2); background: #d7c3b7; box-shadow: 0 0 0 1px #d7c3b7; font-family: Georgia, serif; font-size: 11px; }
.route-stop.final-stop.active, .route-stop.final-stop.passed { color: #fff4df; background: var(--coral); }
.route-labels { display: grid; grid-template-columns: repeat(8, 1fr); color: #9ba1ae; font-size: 7px; line-height: 1.25; }
.route-labels span:not(:first-child):not(:last-child) { text-align: center; }
.route-labels span:last-child { text-align: right; }

.heart-card { background: #fff8ee; }
.heart-sparkle { color: var(--coral); font-size: 15px; }
.heart-count { margin: 12px 0 10px; color: var(--coral-dark); font-family: "Press Start 2P", monospace; font-size: clamp(23px, 3.8vw, 33px); letter-spacing: -0.1em; }
.heart-total { padding-left: 4px; color: #c9bbae; font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0; }
.heart-meter { height: 7px; overflow: hidden; border-radius: 99px; background: #f0dfd3; }
.heart-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ec8a79, #e85c66); transition: width 280ms ease; }
.heart-card p { margin: 10px 0 0; color: #9a8e87; font-size: 11px; line-height: 1.4; }

.controls-card { padding-bottom: 13px; }
.control-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; color: #6d7688; font-size: 11px; }
.control-keys { display: flex; min-width: 56px; gap: 3px; }
.key { display: inline-grid; width: 23px; height: 22px; place-items: center; border: 1px solid #ddd5ca; border-radius: 5px; color: #687284; background: #f9f6ef; font-size: 11px; font-weight: 700; }
.key.wide { width: 53px; font-size: 8px; letter-spacing: 0.05em; }

.dedication-note { display: flex; align-items: flex-start; gap: 11px; margin: auto 4px 0; padding: 14px 0 0; border-top: 1px solid var(--line); color: #9299a5; }
.tiny-scribble { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #fff9ed; background: var(--lavender); font-family: Georgia, serif; }
.dedication-note p { margin: 1px 0 0; font-family: Georgia, serif; font-size: 13px; line-height: 1.35; }

.site-footer { padding: 22px 4px 0; color: #a7a49e; font-size: 9px; font-weight: 700; }
.footer-heart-row { color: #d78b89; letter-spacing: 0.24em; }

@media (max-width: 1080px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 285px; }
  .side-intro h2 { font-size: 29px; }
}

@media (max-width: 820px) {
  .app-shell { width: min(100% - 28px, 680px); padding-top: 20px; }
  .site-header { padding-bottom: 19px; }
  .header-note { display: none; }
  .game-layout { display: flex; flex-direction: column; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .side-intro { grid-column: 1 / -1; padding-top: 4px; }
  .route-card, .heart-card, .controls-card { padding: 15px; }
  .dedication-note { grid-column: 1 / -1; margin-top: 2px; }
  .touch-controls { display: flex; }
  .story-overlay { padding: 10px; }
  .comic-book { padding: 16px; }
  .comic-panels { grid-template-columns: repeat(2, 1fr); max-height: 395px; overflow: auto; }
  .panel-art { height: 126px; }
  .panel-copy { min-height: 88px; }
  .comic-footer { align-items: flex-start; flex-direction: column; }
  .dialogue-card { width: min(620px, 94%); }
}

@media (max-width: 540px) {
  .app-shell { width: calc(100% - 20px); padding-top: 14px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .site-header h1 { font-size: 22px; }
  .game-card { padding: 9px; border-radius: 20px; }
  .game-card-topline { height: 27px; padding: 0 2px 8px; }
  .game-card-note { display: none; }
  .start-copy { margin-left: 7%; }
  .start-copy h2 { font-size: 27px; }
  .overlay-body { font-size: 12px; }
  .finish-card { grid-template-columns: 1fr; max-height: 91%; overflow: auto; }
  .finish-art-wrap { min-height: 150px; max-height: 180px; }
  .finish-character { bottom: 8px; width: 98px; height: 131px; }
  .finish-boy { left: calc(50% - 84px); }
  .finish-anna { left: calc(50% - 2px); }
  .finish-hug { bottom: 2px; width: min(60%, 170px); }
  .finish-scene-label { top: 9px; left: 11px; font-size: 7px; }
  .finish-heart-one { top: 40px; font-size: 23px; }
  .finish-heart-two { top: 63px; font-size: 15px; }
  .finish-copy { padding: 25px 23px 27px; }
  .finish-copy h2 { font-size: 33px; }
  .finish-copy .overlay-body { font-size: 12px; }
  .touch-controls { right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); gap: 8px; }
  .joystick-control { width: 82px; height: 82px; }
  .joystick-thumb { width: 35px; height: 35px; }
  .touch-button-row { gap: 6px; padding: 4px; border-radius: 15px; }
  .touch-button { width: 48px; height: 48px; border-radius: 13px; font-size: 22px; }
  .comic-topline { align-items: flex-start; flex-direction: column; gap: 4px; }
  .comic-topline h2 { font-size: 25px; }
  .comic-page { align-self: flex-end; }
  .comic-panels { gap: 7px; max-height: 320px; }
  .panel-art { height: 104px; }
  .comic-sprite { width: 58px; height: 78px; }
  .comic-helper { width: 52px; height: 70px; }
  .panel-copy { min-height: 84px; padding: 8px; }
  .panel-copy strong { font-size: 10px; }
  .panel-copy p { font-size: 8px; }
  .dialogue-card { grid-template-columns: 100px 1fr; width: calc(100vw - 20px); min-height: 142px; max-height: none; overflow: visible; border-radius: 34px; }
  .dialogue-avatars { min-height: 136px; border-radius: 31px 0 0 31px; }
  .dialogue-avatar { width: 61px; height: 82px; }
  .helper-avatar { width: 56px; height: 76px; }
  .dialogue-copy { padding: 16px 15px 14px; }
  .dialogue-copy h2 { font-size: 22px; }
  .dialogue-line { margin: 6px 0 10px; font-size: 15px; }
  .footer-hint { display: none; }
  .side-panel { display: flex; }
  .side-intro h2 { font-size: 31px; }
  .site-footer { gap: 10px; font-size: 8px; }
  .site-footer span:first-child, .site-footer span:last-child { max-width: 92px; }
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
  .toast-message { bottom: max(112px, calc(env(safe-area-inset-bottom) + 104px)); }
  .game-footer { top: 136px; right: 9px; bottom: auto; left: auto; }
  .sound-button { padding: 7px 9px; font-size: 7px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .touch-controls { bottom: max(6px, env(safe-area-inset-bottom)); }
  .toast-message { bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px)); }
  .joystick-control { width: 72px; height: 72px; }
  .joystick-thumb { width: 31px; height: 31px; }
  .touch-button-row { gap: 5px; padding: 3px; }
  .touch-button { width: 43px; height: 43px; border-radius: 12px; font-size: 20px; }
}

/* Immersive full-screen presentation */
html, body { width: 100%; height: 100%; overflow: hidden; background: #090d18; }
body { min-height: 100%; color: #fff6e4; }
.app-shell { width: 100%; height: 100%; margin: 0; padding: 0; }
.site-header, .site-footer { display: none; }
.game-layout { display: block; width: 100%; height: 100%; }
.game-card { position: relative; width: 100%; height: 100%; padding: 0; border-radius: 0; background: #090d18; box-shadow: none; }
.game-card-topline { position: fixed; z-index: 21; top: 18px; right: 20px; left: 20px; height: auto; padding: 0; pointer-events: none; }
.chapter-chip, .game-card-note { border: 1px solid rgba(255,255,255,0.15); border-radius: 99px; padding: 9px 12px; color: #fff0cc; background: rgba(13, 20, 37, 0.66); box-shadow: 0 8px 25px rgba(4,8,18,0.24); backdrop-filter: blur(10px); }
.game-card-note { color: rgba(255,255,255,0.62); }
.game-stage { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: #090d18; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.scanlines { opacity: 0.1; }
.screen-overlay { position: fixed; z-index: 40; inset: 0; }
.game-footer { position: fixed; z-index: 21; right: 20px; bottom: 17px; left: 20px; min-height: 0; padding: 0; pointer-events: none; }
.footer-hint, .sound-button { border: 1px solid rgba(255,255,255,0.14); border-radius: 99px; padding: 8px 11px; color: rgba(255,255,255,0.78); background: rgba(13,20,37,0.66); box-shadow: 0 8px 25px rgba(4,8,18,0.22); backdrop-filter: blur(10px); }
.sound-button { pointer-events: auto; }
.side-panel { position: fixed; z-index: 15; top: 70px; right: 18px; display: grid; width: 238px; gap: 9px; pointer-events: none; }
.side-intro, .controls-card, .dedication-note { display: none; }
.route-card, .heart-card { padding: 13px 14px; border-color: rgba(255,255,255,0.14); border-radius: 15px; background: rgba(13,20,37,0.68); box-shadow: 0 12px 32px rgba(4,8,18,0.25); backdrop-filter: blur(12px); }
.heart-card { background: rgba(39,27,45,0.7); }
.section-heading, .route-time { color: rgba(255,255,255,0.56); }
.route-line { height: 21px; margin: 8px 1px 3px; }
.route-line::before { background: rgba(255,255,255,0.22); }
.route-labels { color: rgba(255,255,255,0.5); font-size: 7px; }
.route-stop { border-color: #17243c; background: #737a89; box-shadow: 0 0 0 1px #737a89; }
.route-stop.final-stop { color: #1a2438; background: #ccb8ac; box-shadow: 0 0 0 1px #ccb8ac; }
.heart-count { margin: 8px 0 7px; color: #ff8c88; font-size: 21px; }
.heart-total { color: rgba(255,255,255,0.42); }
.heart-meter { height: 5px; background: rgba(255,255,255,0.13); }
.heart-card p { display: none; }
.touch-controls { position: fixed; z-index: 24; }
.talk-prompt, .toast-message { position: fixed; z-index: 25; }
body.cinematic-mode .game-card-topline,
body.cinematic-mode .game-footer,
body.cinematic-mode .side-panel { opacity: 0; pointer-events: none; }
.game-card-topline, .game-footer, .side-panel { transition: opacity 500ms ease; }

.ready-overlay { overflow: hidden; color: #fff7e8; background: linear-gradient(135deg, rgba(5,9,19,0.9), rgba(38,24,43,0.64)), url("assets/story-home.png") center / cover no-repeat; }
.ready-overlay::before { position: absolute; inset: 0; content: ""; background: radial-gradient(circle at 50% 46%, transparent 0 20%, rgba(5,8,17,0.3) 55%, rgba(5,8,17,0.76) 100%); }
.ready-overlay::after { position: absolute; inset: 0; content: ""; opacity: 0.22; background-image: radial-gradient(circle, #ffd88f 0 1px, transparent 1.5px); background-size: 38px 38px; mask-image: linear-gradient(180deg, #000, transparent 72%); }
.ready-glow { position: absolute; top: 50%; left: 50%; width: min(68vw, 780px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(240,112,108,0.21), rgba(245,199,103,0.08) 38%, transparent 68%); transform: translate(-50%, -50%); animation: readyGlow 4s ease-in-out infinite alternate; }
.ready-card { position: relative; z-index: 2; width: min(760px, 88vw); text-align: center; }
.ready-kicker { margin: 0 0 18px; color: #ffd68d; font-size: clamp(9px, 1.1vw, 12px); font-weight: 800; letter-spacing: 0.22em; }
.ready-heart { display: grid; width: 72px; height: 72px; margin: 0 auto 23px; border: 1px solid rgba(255,255,255,0.22); border-radius: 24px; place-items: center; color: #fff0c8; background: linear-gradient(145deg, #ed6f6a, #bc5364); box-shadow: 0 18px 50px rgba(219,82,91,0.36), inset 0 1px 0 rgba(255,255,255,0.28); font-family: Georgia, serif; font-size: 34px; transform: rotate(-4deg); }
.ready-card h2 { margin: 0; font-size: clamp(42px, 6.8vw, 92px); line-height: 0.92; letter-spacing: -0.075em; text-shadow: 0 10px 34px rgba(0,0,0,0.34); }
.ready-card h2 em { color: #ffd07c; font-family: Georgia, serif; font-weight: 400; letter-spacing: -0.055em; }
.ready-copy { margin: 24px auto; color: rgba(255,255,255,0.74); font-family: Georgia, serif; font-size: clamp(16px, 1.8vw, 22px); }
.ready-button { padding: 15px 24px; border-radius: 99px; font-size: 14px; box-shadow: 0 15px 38px rgba(199,77,87,0.4); }
.ready-note { margin: 20px 0 0; color: rgba(255,255,255,0.43); font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }

.story-overlay { overflow: hidden; padding: 0; background: #060912; transition: opacity 900ms ease, visibility 240ms ease; }
.story-overlay.story-fading { opacity: 0; pointer-events: none; }
.cinematic-story { position: absolute; inset: 0; overflow: hidden; background: #060912; }
.story-slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 900ms ease; }
.story-slide.active { z-index: 2; opacity: 1; }
.story-frame { position: absolute; inset: 0; background-color: #211c30; background-repeat: no-repeat; background-size: 130% auto; will-change: background-position; }
.story-frame-meet { background-image: url("assets/story-messages.png"); }
.story-frame-messages { background-image: url("assets/story-messages.png"); }
.story-frame-campus { background-image: url("assets/malibu.png"); }
.story-frame-home { background-image: url("assets/together-in-car.png"); }
.story-slide.active .story-frame-meet { animation: cinematicLeftRight 5.5s ease-out both; }
.story-slide.active .story-frame-messages { animation: cinematicTopBottom 5.5s ease-out both; }
.story-slide.active .story-frame-campus { animation: cinematicLeftRight 5.5s ease-out both; }
.story-slide.active .story-frame-home { animation: cinematicBottomRight 5.5s ease-out both; }
.story-vignette { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(5,8,17,0.86) 0%, rgba(5,8,17,0.26) 48%, rgba(5,8,17,0.5) 100%), linear-gradient(180deg, rgba(5,8,17,0.15), rgba(5,8,17,0.82)); }
.cinematic-copy { position: absolute; z-index: 3; bottom: clamp(70px, 11vh, 120px); left: clamp(28px, 7vw, 100px); display: flex; width: min(620px, 76vw); flex-direction: column; align-items: flex-start; color: #fff7e6; text-align: left; text-shadow: 0 4px 26px rgba(0,0,0,0.62); }
.cinematic-copy-right { right: clamp(28px, 7vw, 100px); left: auto; align-items: flex-end; text-align: right; }
.cinematic-copy > p { margin: 0 0 13px; color: #ffd17e; font-size: clamp(9px, 1vw, 12px); font-weight: 800; letter-spacing: 0.18em; }
.cinematic-copy h2 { margin: 0; font-size: clamp(38px, 5.8vw, 78px); line-height: 0.98; letter-spacing: -0.065em; }
.cinematic-subtitle { max-width: 590px; margin-top: 24px; border-left: 3px solid #ed6f6a; padding: 11px 15px; color: rgba(255,248,231,0.92); background: rgba(5,9,19,0.46); box-shadow: 0 8px 24px rgba(0,0,0,0.18); backdrop-filter: blur(8px); font-family: Georgia, serif; font-size: clamp(15px, 1.6vw, 21px); line-height: 1.35; }
.cinematic-copy-right .cinematic-subtitle { border-right: 3px solid #ed6f6a; border-left: 0; }
.story-slide.active .cinematic-copy { animation: cinematicCopyIn 900ms 300ms cubic-bezier(.2,.74,.28,1) both; }
.story-status { position: fixed; z-index: 6; top: 26px; left: 50%; display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,0.7); font-size: 9px; font-weight: 800; letter-spacing: 0.13em; transform: translateX(-50%); }
.story-progress { display: flex; gap: 6px; }
.story-progress-dot { width: 24px; height: 3px; border-radius: 99px; background: rgba(255,255,255,0.2); transition: background 400ms ease, width 400ms ease; }
.story-progress-dot.active { width: 34px; background: #ef746e; }
.story-skip { position: fixed; z-index: 6; top: 20px; right: 22px; border: 1px solid rgba(255,255,255,0.18); border-radius: 99px; padding: 9px 13px; color: rgba(255,255,255,0.72); background: rgba(8,13,26,0.48); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; backdrop-filter: blur(9px); }
.story-skip:hover { color: #fff; background: rgba(237,111,106,0.58); }

@keyframes readyGlow { from { opacity: 0.65; transform: translate(-50%, -50%) scale(0.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes cinematicLeftRight { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes cinematicTopBottom { from { background-position: 50% 0%; } to { background-position: 50% 100%; } }
@keyframes cinematicBottomRight { from { background-position: 10% 100%; } to { background-position: 100% 58%; } }
@keyframes cinematicCopyIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .game-card-topline { top: 10px; right: 10px; left: 10px; }
  .game-card-note { display: none; }
  .side-panel { top: 59px; right: 9px; width: 142px; }
  .route-card { display: none; }
  .heart-card { padding: 10px 11px; }
  .heart-count { font-size: 17px; }
  .game-footer { right: 10px; bottom: 10px; left: 10px; }
  .footer-hint { display: none; }
  .story-frame { background-size: auto 130%; }
  .cinematic-copy, .cinematic-copy-right { right: 22px; bottom: 86px; left: 22px; width: auto; align-items: flex-start; text-align: left; }
  .cinematic-copy h2 { font-size: clamp(34px, 11vw, 54px); }
  .cinematic-copy-right .cinematic-subtitle { border-right: 0; border-left: 3px solid #ed6f6a; }
  .story-status { top: 15px; left: 17px; transform: none; }
  .story-skip { top: 10px; right: 10px; }
  .ready-card h2 { font-size: clamp(42px, 14vw, 72px); }
  .ready-note { padding: 0 25px; line-height: 1.5; }
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .game-footer { top: 136px; right: 9px; bottom: auto; left: auto; }
  .sound-button { padding: 7px 9px; font-size: 7px; }
  .toast-message { bottom: max(112px, calc(env(safe-area-inset-bottom) + 104px)); }
}

@media (max-width: 820px) and (max-height: 500px) and (orientation: landscape), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .toast-message { bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px)); }
}
