@font-face {
  font-family: "Alfa Interface Sans";
  src: url("assets/fonts/alfa-interface-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alfa Interface Sans";
  src: url("assets/fonts/alfa-interface-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alfa Interface Sans";
  src: url("assets/fonts/alfa-interface-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Styrene A";
  src: url("assets/fonts/styrene-a-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f4f4f6;
  --white: #fff;
  --ink: #19191f;
  --muted: #5d5d6b;
  --line: #e6e4ec;
  --red: #d82c23;
  --hot-red: #ef3124;
  --red-hover: #bd251e;
  --violet: #4f32d6;
  --sun: #ffdb6e;
  --lilac: #cbb9ff;
  --sky: #9ddfff;
  --mint: #e8f8ed;
  --green: #16613c;
  --radius: 20px;
  --display-face: "Styrene A", "Alfa Interface Sans", Arial, sans-serif;
  font-family: "Alfa Interface Sans", Arial, Helvetica, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
svg { flex: 0 0 auto; vertical-align: middle; }
h1, h2, p, figure, blockquote { margin: 0; }
h1, h2 { font-family: var(--display-face); letter-spacing: -.034em; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
::selection { color: var(--ink); background: #ffd6d1; }
:root { scrollbar-color: #b6b0c7 var(--canvas); }
.sr-only, .skip:not(:focus) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 12px 18px; background: var(--white); border-radius: 12px; }

body { margin: 0; min-width: 280px; }
.phone-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  padding: 16px;
  background: radial-gradient(ellipse at 58% 76%, #f8e0da 0%, #f4eeeb 28%, #e7e7e8 70%, #d9d9d6 100%);
}
.phone-device {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  height: min(100%, 892px);
  min-height: 0;
  padding: 7px;
  border: 1px solid #29292b;
  border-radius: 47px;
  background: #151517;
  box-shadow: 0 26px 70px #251b2632, inset 0 0 0 2px #414143;
}
.phone-device::before, .phone-device::after {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #39393b;
  content: "";
}
.phone-device::before { top: 22%; left: -4px; height: 34px; box-shadow: 0 42px #39393b; }
.phone-device::after { top: 26%; right: -4px; height: 62px; }
.phone-screen {
  --gutter: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 39px;
  background: var(--canvas);
}
.phone-status {
  position: relative;
  display: flex;
  flex: 0 0 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #17171a;
  color: #fff;
}
.phone-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.phone-island {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 94px;
  height: 24px;
  translate: -50%;
  border-radius: 30px;
  background: #070708;
}
.phone-signal { display: flex; gap: 2px; align-items: center; }
.phone-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #aba7af transparent;
}
.phone-scroll:focus-visible { outline-offset: -3px; }
.phone-bottom {
  display: grid;
  flex: 0 0 19px;
  align-items: center;
  justify-items: center;
  background: #fff;
}
.phone-bottom span { width: 105px; height: 4px; border-radius: 8px; background: #252529; }

.mini-bar-wrap { flex: 0 0 auto; padding-top: 6px; background: #17171a; }
.mini-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 6px;
  align-items: center;
  min-height: 55px;
  padding: 5px 9px 0;
  background: #fff;
  border-bottom: 1px solid #e8e7eb;
  border-radius: 22px 22px 0 0;
}
.mini-bar > span { text-align: center; font-size: 15px; font-weight: 680; }
.mini-bar a { display: grid; place-items: center; min-height: 44px; border-radius: 12px; }
.mini-bar a:hover { background: #f1eff3; }
.mini-bar .mini-close { background: #f4f2f6; }
.mini-bar .mini-close:hover { background: #eae5ef; }

.art { pointer-events: none; user-select: none; object-fit: contain; }

.main { max-width: 100%; padding: 17px var(--gutter) 27px; }
.page-title { font-size: clamp(27px, 8vw, 34px); line-height: 1.06; font-weight: 780; margin-bottom: 16px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.catalog-card { display: block; overflow: hidden; color: var(--ink); background: #fff; border-radius: 18px; }
.catalog-card:hover .catalog-card-foot > span:last-child { color: var(--red); }
.catalog-cover { position: relative; height: 188px; overflow: hidden; background: radial-gradient(ellipse at 56% 76%, #f8e9fb, #e4ceef 70%); }
.catalog-cover-art { position: absolute; width: 78%; height: 123%; bottom: -26px; left: 11%; }
.catalog-card-copy { padding: 16px; }
.catalog-card-copy h2 { font-size: 25px; line-height: 1.1; font-weight: 780; }
.catalog-card-copy p { color: var(--muted); margin-top: 7px; font-size: 15px; line-height: 1.35; }
.catalog-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 15px; font-size: 13px; font-weight: 640; }
.catalog-card-foot > span:first-child { color: var(--muted); }
.catalog-card-foot > span:last-child { display: inline-flex; align-items: center; gap: 5px; }
.catalog-achievements { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 70px; margin-top: 14px; padding: 11px 14px; border-radius: 15px; background: #fff; }
.catalog-achievements:hover { color: var(--violet); }
.catalog-award-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #6d4513; background: #fff0cf; }
.catalog-achievements > span:nth-child(2) { display: grid; gap: 4px; }
.catalog-achievements small { color: var(--muted); font-size: 13px; }
.resume-card { display: grid; gap: 13px; margin-top: 14px; padding: 16px; border: 1px solid #e5daff; border-radius: var(--radius); background: #f0eaff; }
.resume-card h2 { font-size: 19px; line-height: 1.2; }
.resume-card p { margin-top: 4px; color: #5f5277; font-size: 14px; }
.resume-card .button { justify-self: start; }

.catalog-hero, .finish-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 253px;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
}
.catalog-hero { background: linear-gradient(142deg, #c22421 0%, #dd2a23 59%, #ef4438 100%); }
.catalog-copy, .finish-copy { position: relative; z-index: 2; width: 76%; padding: 15px; }
.catalog-copy h1, .finish-copy h1 { font-size: 36px; line-height: 1; font-weight: 800; }
.catalog-copy p, .finish-copy p { max-width: 188px; margin: 10px 0 14px; color: #fff; font-size: 14px; line-height: 1.38; }
.catalog-art, .finish-art { position: absolute; width: 59%; height: 87%; bottom: -20px; right: -19px; z-index: 1; object-position: center bottom; }
.catalog-orbit, .finish-orbit, .scene-ring { position: absolute; pointer-events: none; z-index: -1; border: 1px solid currentColor; border-radius: 50%; }
.catalog-orbit { color: #ffab9e9c; width: 53%; aspect-ratio: 1; bottom: -28%; right: -7%; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 11px; border: 0; padding: 0 19px; min-height: 49px; border-radius: 12px; font-weight: 720; font-size: 15px; line-height: 1.25; text-align: center; transition: background-color .16s; }
.button-white { background: var(--white); color: var(--ink); }
.button-white:hover { background: #fff0ea; }
.button-primary { background: var(--red); color: var(--white); }
.button-primary:hover:enabled, a.button-primary:hover { background: var(--red-hover); }
.button-primary:disabled { color: #5d5864; background: #eae7ed; }
.button-wide { width: 100%; }
.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--ink); background: #f2f0f5; }

.level-list-section { margin-top: 22px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.section-heading h2 { font-weight: 750; font-size: 23px; }
.section-heading > span { color: var(--muted); font-weight: 580; white-space: nowrap; font-size: 13px; }
.level-list, .award-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chapter-map { gap: 10px; }
.chapter-map > li { position: relative; }
.chapter-map > li + li::before { content: ""; position: absolute; top: -10px; left: 38px; width: 3px; height: 10px; border-radius: 99px; background: #d8c8f8; }
.level-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 13px 9px 9px; background: var(--white); border-radius: 15px; min-height: 72px; }
a.level-row:hover { background: #fdfbff; box-shadow: 0 4px 14px #0000000b; }
.level-thumbnail { display: grid; place-items: center; width: 61px; height: 55px; overflow: hidden; border-radius: 10px; }
.level-thumbnail img { height: 59px; width: 65px; max-width: none; transform: translateY(2px); }
.sun { background-color: var(--sun); }
.lilac { background-color: var(--lilac); }
.sky { background-color: var(--sky); }
.level-text { display: grid; gap: 3px; }
.level-text strong { font-size: 16px; }
.level-text > span { color: var(--muted); font-size: 13px; }
.level-status { display: grid; place-items: center; width: 35px; height: 35px; color: var(--red); background: #fff0ee; border-radius: 11px; }
.level-status.is-done { color: var(--green); background: var(--mint); }
.is-locked .level-status { color: #696573; background: #f1eff4; }
.is-locked .level-thumbnail { opacity: .6; }

.game-main { padding-top: 13px; }
.game-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px; align-items: center; margin-bottom: 12px; }
.game-header p { color: var(--ink); font-size: 13px; font-weight: 730; line-height: 1.2; margin-bottom: 7px; }
.episode-progress, .progress-segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.episode-progress span, .progress-segments span { height: 6px; border-radius: 10px; background: #dedce5; }
.episode-progress .complete, .progress-segments .filled { background: #8853f0; }
.episode-progress .current { background: var(--hot-red); }
.game-time { display: flex; gap: 5px; align-items: center; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 13px; }
.chapter-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 0 0 15px; padding: 4px; background: #eae7ef; border-radius: 12px; }
.chapter-steps li { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 28px; border-radius: 8px; color: #615968; font-size: 12px; font-weight: 650; }
.chapter-steps .step-done { color: var(--violet); }
.chapter-steps [aria-current="step"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px #230f430f; }
.chapter-steps [aria-current="step"].step-done { color: var(--green); }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; align-items: start; }
.scene-column { min-width: 0; }
.scene-frame { position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden; border-radius: var(--radius); min-height: 192px; }
.scene-art { position: absolute; right: -1%; bottom: -1%; width: 57%; height: 106%; object-position: center bottom; }
.scene-dialogue {
  width: 48%;
  margin: 3px 0 30px 11px;
  padding: 11px;
  z-index: 1;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
}
.scene-dialogue p { font-size: 15px; line-height: 1.26; font-weight: 700; }
.scene-dialogue cite { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; font-style: normal; }
.scene-topic { background: var(--white); font-weight: 700; color: var(--ink); font-size: 12px; position: absolute; bottom: 12px; left: 12px; padding: 7px 9px; border-radius: 8px; z-index: 2; }
.scene-ring { width: 67%; aspect-ratio: 1; color: #ffffffb0; right: 9%; bottom: -30%; box-shadow: 0 0 0 23px #ffffff2b, 0 0 0 46px #ffffff22; }
.scene-title { margin: 0 0 11px; font-size: 30px; line-height: 1.08; font-weight: 700; text-wrap: balance; }
.scene-story { margin-top: 12px; font-size: 16px; line-height: 1.48; max-width: 63ch; }
.hint { margin-top: 15px; background: #ebe5ff; color: #3e2a6d; display: flex; gap: 9px; align-items: flex-start; border-radius: 12px; padding: 12px; }
.hint p { font-size: 13px; line-height: 1.45; font-weight: 570; }
.hint > span { padding-top: 1px; }

.decision-panel { background: var(--white); border-radius: var(--radius); padding: 15px; min-width: 0; }
.panel-title { font-size: 24px; line-height: 1.12; font-weight: 800; margin-bottom: 16px; }
.option-list { display: grid; gap: 8px; border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.option { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.option:hover { background: #faf8ff; border-color: #cdbbfa; }
.option:has(:checked) { background: #f5f0ff; border-color: #6e48dd; }
.option:has(:focus-visible) { outline: 3px solid var(--violet); outline-offset: 2px; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-icon { display: grid; place-items: center; width: 37px; height: 37px; color: #5328a7; background: #eee7ff; border-radius: 10px; }
.option-copy { display: grid; gap: 3px; }
.option-copy strong { font-size: 15px; line-height: 1.2; }
.option-copy > span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.radio-indicator { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #837b91; border-radius: 50%; }
.option:has(:checked) .radio-indicator { border-color: var(--violet); }
.option:has(:checked) .radio-indicator::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }

.result-panel, .practice-passed { animation: result-in .33s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes result-in { from { transform: translateY(8px); opacity: .6; } }
.result-icon { color: #5427ad; background: #eee7ff; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 13px; }
.result-detail { font-size: 15px; line-height: 1.5; max-width: 66ch; margin-bottom: 16px; }
.result-stats { margin: 0 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.result-stats > div { border-radius: 12px; background: #f2eefb; padding: 11px; }
.result-stats dt { font-size: 12px; line-height: 1.25; color: #514368; }
.result-stats dd { margin: 4px 0 0; font-size: clamp(18px, 2.8vw, 27px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.goal-track { display: grid; gap: 5px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.goal-track progress { appearance: none; height: 8px; width: 100%; border: 0; border-radius: 10px; overflow: hidden; background: #efebf6; color: var(--violet); accent-color: var(--violet); }
.goal-track progress::-webkit-progress-bar { background: #efebf6; }
.goal-track progress::-webkit-progress-value { background: var(--violet); border-radius: 10px; }
.goal-track progress::-moz-progress-bar { background: var(--violet); border-radius: 10px; }
.earned-row { display: flex; gap: 9px; align-items: center; margin: 0 0 15px; }
.earned-row > span { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: #7b4a08; background: #fff0c8; }
.earned-row > div { display: grid; gap: 2px; }
.earned-row small { color: var(--muted); font-size: 11px; font-weight: 560; }
.earned-row strong { font-size: 14px; }
.result-panel .button-quiet, .practice-panel .button-quiet { margin-top: 5px; min-height: 44px; }
.practice-options { display: grid; gap: 8px; }
.practice-answer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbf9fe; text-align: start; font-size: 15px; font-weight: 690; }
.practice-answer > span:last-child { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 7px; color: var(--violet); background: #eee7ff; }
.practice-answer:hover { border-color: #9c82e3; }
.practice-answer.is-missed { border-color: #dfa58c; background: #fff6ee; }
.practice-answer.is-missed > span:last-child { color: #843e21; background: #ffe6d7; }
.practice-feedback { margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff1de; color: #653712; }
.practice-feedback strong { font-size: 14px; }
.practice-feedback p { margin-top: 4px; font-size: 14px; line-height: 1.4; }
.practice-success-icon { color: var(--green); background: var(--mint); }

.finish-hero { background: linear-gradient(148deg, #472abf, #6040e8 60%, #856cff); }
.finish-copy h1 { margin-top: 14px; }
.finish-copy p { color: #f6f0ff; }
.finish-flag { display: inline-flex; align-items: center; gap: 5px; border-radius: 10px; padding: 7px 9px; background: #c9f86b; color: #263511; font-size: 13px; font-weight: 740; }
.finish-orbit { color: #cab8ff86; width: 50%; aspect-ratio: 1; right: -4%; bottom: -37%; box-shadow: 0 0 0 25px #e1d5ff22, 0 0 0 49px #e1d5ff15; }
.bonus { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; align-items: center; border-radius: 16px; background: #ffedb3; padding: 16px; margin: 18px 0 25px; }
.bonus button { grid-column: 1 / -1; }
.bonus-icon { display: grid; place-items: center; width: 51px; height: 51px; border-radius: 13px; color: #7a4200; background: #ffdc75; }
.bonus h2 { font-size: clamp(19px, 2.7vw, 25px); }
.bonus p { color: #5e4523; font-size: 13px; line-height: 1.4; margin-top: 3px; }
.bonus-sticker { grid-row: 1; grid-column: 1; width: 54px; height: 54px; object-fit: contain; pointer-events: none; z-index: 1; }
.award-list li { background: var(--white); border-radius: 15px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 15px; }
.award-list li > span:nth-child(2) { display: grid; gap: 3px; }
.award-list small { color: var(--muted); font-size: 13px; }
.award-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; }
.award-list li > svg { color: var(--green); }
.locked-award .award-icon { background: #f0edf5; color: #6b647b; }
.progress-panel { display: grid; gap: 16px; padding: clamp(17px, 3.5vw, 28px); border-radius: var(--radius); background: var(--white); margin-bottom: 28px; }
.progress-panel h2 { font-size: 25px; margin-bottom: 4px; }
.progress-panel p { color: var(--muted); font-size: 15px; line-height: 1.35; }
.progress-panel .button { justify-self: start; }
.reset-button { margin-top: 12px; }
dialog { border: 0; border-radius: var(--radius); padding: 23px; color: var(--ink); max-width: min(400px, 100% - 30px); }
dialog::backdrop { background: #24203570; }
dialog h2 { font-size: 27px; }
dialog p { line-height: 1.5; margin: 10px 0 18px; color: var(--muted); }
dialog form { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }

@media (max-width: 520px) {
  .phone-stage { padding: 3px; }
  .phone-device { width: 100%; height: 100%; padding: 3px; border-radius: 32px; box-shadow: none; }
  .phone-device::before, .phone-device::after { display: none; }
  .phone-screen { border-radius: 28px; }
  .phone-status { flex-basis: 39px; padding-inline: 17px; }
  .phone-island { top: 6px; width: 82px; height: 22px; }
}
@media (max-width: 340px) {
  .phone-screen { --gutter: 11px; }
  .phone-status { padding-inline: 13px; }
  .catalog-copy h1, .finish-copy h1 { font-size: 31px; }
  .scene-frame { min-height: 178px; }
  .scene-dialogue { margin-left: 8px; padding: 9px; }
  .scene-title { font-size: 27px; }
  .option { gap: 8px; }
  .option-icon { width: 32px; height: 32px; }
}

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