:root {
  color-scheme: light;
  --paper: #fcf8f1;
  --surface: #fffefa;
  --ink: #251b44;
  --muted: #594d6d;
  --line: #e6daec;
  --grape: #6239d1;
  --grape-deep: #4b25ad;
  --lilac: #efe7ff;
  --gold: #f7bc54;
  --teal: #176f5a;
  --cherry: #a72c65;
  --focus: #4c28b8;
  --shadow: 0 8px 26px #4b297113;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 100%;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -15%, #f3eaff 0%, transparent 43rem), var(--paper);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:where(a, button) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(a, button, input, select):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.skip-link {
  position: fixed; z-index: 12; top: 10px; left: 10px; transform: translateY(-180%);
  padding: 12px 18px; color: #fff; background: var(--grape-deep); border-radius: 10px;
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.top-bar {
  border-bottom: 1px solid #e9dfeb;
  background: #fffaf4;
}
.top-inner, .main-shell, .footer { width: min(1170px, calc(100% - 56px)); margin-inline: auto; }
.top-inner { min-height: 77px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.wordmark {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 1.24rem; font-weight: 900; letter-spacing: -.065em; white-space: nowrap;
}
.brand-mark {
  flex: 0 0 38px; position: relative; width: 38px; height: 38px; display: grid;
  grid-template-columns: repeat(2, 6px); gap: 3px; place-content: center;
  border-radius: 14px; border: 1px solid #693bc5; color: #fff;
  background: radial-gradient(circle at 27% 12%, #b77afb, transparent 43%), linear-gradient(145deg, #9b59f5, #663bce);
  box-shadow: inset 0 1px 0 #ffffff83, 0 3px 0 #4c239b, 0 6px 12px #6431a337; transform: rotate(-8deg);
}
.brand-mark i { height: 6px; border-radius: 50%; background: #fff; }
.brand-mark i:nth-child(3) { background: #e6a9fc; transform: scale(.68); }
.brand-mark i:nth-child(4) { background: #f9d293; transform: scale(.68); }
.brand-mark svg { width: 26px; height: 26px; grid-column: span 2; }
.brand-number { color: var(--grape); margin-left: 5px; }
.main-nav { display: flex; align-items: center; gap: 3px; }
.main-nav a {
  padding: 11px 17px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 800; white-space: nowrap;
}
.main-nav a[aria-current="page"] { color: var(--grape-deep); background: #eee5ff; box-shadow: inset 0 0 0 1px #e2d2f9; }
.main-nav .nav-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.main-nav .nav-icon svg { display: block; height: 100%; width: 100%; }
.storage-indicator {
  justify-self: end; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #e0e8dd;
  border-radius: 999px; background: #eff8ee; color: #365e48; font-size: .78rem; font-weight: 800; white-space: nowrap;
}
.storage-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #36845b; }
.storage-indicator.pending { color: #744917; border-color: #f5ddaa; background: #fff2d8; }
.storage-indicator.pending span { background: #b56a0b; }
.main-shell { min-height: 64vh; padding-top: 29px; outline: none; }
.footer {
  margin-top: 54px; padding: 23px 0 34px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem;
}
.footer a, .text-link { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.footer strong { color: var(--ink); }

.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 500px; display: grid; place-items: center start;
  grid-template-columns: minmax(0, 1fr); padding: clamp(32px, 5vw, 68px);
  border-radius: 32px; border: 1px solid #e4d2f6;
  background: radial-gradient(ellipse at 73% 67%, #e8d5fb 0%, transparent 60%), linear-gradient(118deg, #fff2ea 4%, #f1e5ff 65%, #ead9fc);
  box-shadow: inset 0 1px 0 #fff, 0 14px 36px #61379917;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2; opacity: .7; pointer-events: none;
  background-image: radial-gradient(circle, #b489d88f 0 1px, transparent 1.5px), radial-gradient(circle, #db96bc69 0 1px, transparent 1.5px);
  background-size: 23px 23px, 37px 37px; background-position: 0 0, 9px 8px;
  mask-image: linear-gradient(110deg, transparent 44%, #000 90%);
}
.hero-copy { position: relative; z-index: 1; width: min(57%, 570px); }
.hero .eyebrow {
  display: inline-flex; min-height: 34px; align-items: center; gap: 8px; margin: 0 0 17px; padding: 6px 11px;
  border: 1px solid #e2ccf8; border-radius: 10px; color: #5939a6; background: #fffafaed; font-size: .84rem;
}
.eyebrow { color: #62409a; font-weight: 900; font-size: .85rem; margin: 0 0 9px; }
.eyebrow i { width: 8px; height: 8px; background: #9e62e1; border-radius: 50%; box-shadow: 0 0 0 4px #f0e3ff; }
.hero h1, .page-heading h1 {
  margin: 0; color: var(--ink); font-size: clamp(2.5rem, 5.35vw, 4.35rem);
  line-height: 1.13; letter-spacing: -.089em; font-weight: 900; word-break: keep-all;
}
.hero h1 span { color: var(--grape); }
.hero-copy .intro { max-width: 430px; margin: 17px 0 24px; color: #514064; font-size: 1.03rem; line-height: 1.68; word-break: keep-all; }
.mini-meta { color: #56436a; margin: 17px 0 0; font-size: .86rem; font-weight: 750; }
.hero-copy .actions { row-gap: 9px; }
.hero-copy .btn { min-height: 55px; padding-inline: 20px; }
.hero-cta .btn:first-child, .btn.hero-cta { box-shadow: inset 0 1px 0 #ffffff60, 0 3px 0 #4725a8, 0 8px 16px #9353de3c; }
.hero-visual, .hero-illustration {
  position: absolute; z-index: -1; inset: 0 0 0 34%; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 26%);
}
.hero-visual picture { display: contents; }
.hero-visual img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 63% 50%; }
.hero-illustration {
  background: radial-gradient(ellipse at 70% 60%, #d9bef8, transparent 62%);
  background-image: var(--hero-image, none); background-repeat: no-repeat; background-size: cover; background-position: 63% 50%;
}
.hero-stamp {
  z-index: 1; position: absolute; right: 25px; bottom: 22px; padding: 7px 12px;
  border: 1px solid #ecd7f5; border-radius: 999px; background: #fffbf3eb; color: #563484; box-shadow: 0 4px 10px #442c5920;
  font-size: .84rem; font-weight: 900;
}
.hero-orbit { display: none; }
.hero-art { display: none; }
.hero-copy .mini-meta span + span::before { content: '·'; margin-inline: 6px; }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn {
  min-height: 48px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff; background: linear-gradient(160deg, #7a4ae7, var(--grape) 75%); border: 1px solid #5830c4;
  border-radius: 14px; box-shadow: inset 0 1px 0 #ffffff60, 0 3px 0 #4725a8;
  font-size: .96rem; font-weight: 900; line-height: 1.33; text-decoration: none; text-align: center; word-break: keep-all;
  transition: transform .14s ease-out, box-shadow .14s ease-out, filter .14s ease-out;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 #ffffff60, 0 1px 0 #4725a8; }
.btn:disabled { color: #6a5d82; background: #e9e2f0; border-color: #dad0e4; box-shadow: none; }
.btn-dark { background: linear-gradient(150deg, #7542e4, var(--grape-deep)); }
.btn-quiet {
  color: #472897; background: #fffcf8; border: 1px solid #d8c4ef; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e4d5f0;
}
.btn-quiet:active:not(:disabled) { box-shadow: inset 0 1px 0 #fff, 0 0 0 #e4d5f0; }
.btn-danger { color: #84244d; background: #ffe8ef; border-color: #edbad3; box-shadow: 0 2px 0 #efc4d9; }
.btn svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.text-link {
  background: none; border: 0; min-height: 34px; padding: 5px 0; color: #5637a2; font-size: .91rem; font-weight: 850;
  text-decoration: underline; text-align: left;
}
a.text-link { display: inline-flex; align-items: center; }

.content-section { margin-top: 35px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-heading h2, .panel h2 { margin: 0; font-size: clamp(1.25rem, 2.7vw, 1.78rem); letter-spacing: -.06em; }
.section-heading p, .subtle { color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.section-heading > .text-link { flex: 0 0 auto; align-self: center; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.skill-0, .tile-0 { --skill-ink: #145f56; --skill-paper: #e5f7ef; --skill-tile: #a7e4d6; --skill-line: #b6ded7; }
.skill-1, .tile-1 { --skill-ink: #8a3c1b; --skill-paper: #fff0e4; --skill-tile: #ffd7b0; --skill-line: #eed2be; }
.skill-2, .tile-2 { --skill-ink: #4d30a1; --skill-paper: #f1ecff; --skill-tile: #d6c3ff; --skill-line: #d9cef5; }
.skill-3, .tile-3 { --skill-ink: #903064; --skill-paper: #ffeff8; --skill-tile: #f8c5e3; --skill-line: #efcfe1; }
.skill-4, .tile-4 { --skill-ink: #21577d; --skill-paper: #eaf5ff; --skill-tile: #b8def8; --skill-line: #c7e1ef; }
.skill-5, .tile-5 { --skill-ink: #745015; --skill-paper: #fff6d9; --skill-tile: #fee198; --skill-line: #efdfad; }
.skill-6, .tile-6 { --skill-ink: #9a3450; --skill-paper: #ffedf0; --skill-tile: #fbbed0; --skill-line: #f0cbd5; }
.skill-7, .tile-7 { --skill-ink: #3f478a; --skill-paper: #eef0ff; --skill-tile: #cbd1ff; --skill-line: #d3d7f1; }
.skill-8, .tile-8 { --skill-ink: #356029; --skill-paper: #eff7e4; --skill-tile: #cee9a8; --skill-line: #d5e6bd; }
.skill-9, .tile-9 { --skill-ink: #8e4138; --skill-paper: #fff1e8; --skill-tile: #fec7b8; --skill-line: #f0d6c9; }
.game-card {
  min-width: 0; position: relative; display: flex; align-items: center; gap: 14px; min-height: 108px;
  padding: 16px; border-radius: 19px; color: var(--ink); background: linear-gradient(125deg, var(--surface) 60%, var(--skill-paper));
  border: 1px solid var(--skill-line, var(--line)); box-shadow: 0 3px 0 var(--skill-paper, #f1e7f7), var(--shadow);
  text-align: left; transition: transform .16s ease, box-shadow .16s ease;
}
.game-card .meta { color: var(--skill-ink, #604391); display: block; font-size: .78rem; font-weight: 900; margin-bottom: 3px; }
.game-card strong { display: block; color: var(--ink); font-size: 1.08rem; letter-spacing: -.05em; line-height: 1.35; }
.game-card .game-desc { display: block; margin-top: 4px; color: #60536c; font-size: .88rem; line-height: 1.42; word-break: keep-all; }
.tile {
  flex: 0 0 53px; height: 53px; display: grid; place-items: center; color: var(--skill-ink, #593c97);
  background: linear-gradient(140deg, var(--skill-paper, #f0e6ff), var(--skill-tile, #d6b9ff));
  border: 1px solid var(--skill-line, #e1d3f4); border-radius: 16px; font-size: 1.38rem; font-weight: 900;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--skill-line, #e5d9ee); transform: rotate(-4deg);
}
.tile svg { width: 26px; height: 26px; }
.today-journey { position: relative; margin: 0; padding: 0; list-style: none; }
.today-journey > li { min-width: 0; }
.today-journey > li > .game-card { width: 100%; height: 100%; }
.journey-card { min-width: 0; }
.journey-card .card-copy { padding-inline-end: 15px; }
.journey-index {
  position: absolute; z-index: 1; top: -9px; right: 12px; min-width: 28px; height: 26px; padding: 3px 6px;
  display: grid; place-items: center; border: 1px solid #e2cef0; border-radius: 8px; color: #553487; background: #fcf2ff;
  font-size: .78rem; font-weight: 900; box-shadow: 0 2px 0 #e6d2f1; transform: rotate(4deg);
}
.game-card .card-copy { min-width: 0; }
.game-card .game-card-play { margin-inline-start: auto; flex: 0 0 auto; color: var(--grape); font-size: .85rem; font-weight: 900; }

.page-heading { max-width: 750px; margin: 5px 0 23px; }
.page-heading h1 { font-size: clamp(2.1rem, 5.3vw, 3.5rem); }
.page-heading > p:last-child { margin: 10px 0 0; color: var(--muted); line-height: 1.6; word-break: keep-all; }
.filters { display: grid; grid-template-columns: minmax(145px, 350px) minmax(122px, 200px); gap: 10px; margin: 17px 0; }
.field { display: grid; gap: 6px; min-width: 0; color: #524365; font-size: .87rem; font-weight: 800; }
.field input, .field select, .share-link input {
  width: 100%; min-width: 0; min-height: 47px; padding: 10px 12px; border: 1px solid #d5c1e2; border-radius: 12px;
  color: var(--ink); background: #fffcfa;
}
.field input::placeholder { color: #756781; opacity: 1; }
.field select {
  appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 48%, #7359a5 50%), linear-gradient(135deg, #7359a5 50%, transparent 52%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center; background-size: 5px 5px; background-repeat: no-repeat;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.chip {
  padding: 8px 13px; min-height: 44px; border: 1px solid #e1d2eb; border-radius: 13px;
  color: #514065; background: #fffcfa; font-size: .89rem; font-weight: 800; white-space: nowrap;
}
.chip[aria-pressed="true"] { color: #fff; background: var(--grape); border-color: #522cb6; box-shadow: 0 2px 0 #4e2ba1; }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 18px; border: 1px dashed #cdb5df; border-radius: 14px; color: var(--muted); line-height: 1.6; }
.catalog-list { margin-top: 12px; }

.play-shell, .results-shell { max-width: 740px; margin-inline: auto; }
.play-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.play-top p { margin: 0; color: #5b427a; font-size: .87rem; font-weight: 900; }
.progress-track { height: 11px; margin-bottom: 18px; overflow: hidden; border: 1px solid #e2d3ed; border-radius: 99px; background: #eee5f5; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, #9b6dea, #7445da); border-radius: inherit; transition: width .24s ease-out; }
.panel {
  padding: clamp(19px, 4.4vw, 31px); border: 1px solid #e8dcec; border-radius: 23px; background: var(--surface); box-shadow: var(--shadow);
  min-width: 0;
}
.panel + .panel { margin-top: 15px; }
.panel p { line-height: 1.65; overflow-wrap: anywhere; }
.panel .prompt { font-size: clamp(1.07rem, 2.5vw, 1.22rem); line-height: 1.64; font-weight: 800; white-space: pre-line; word-break: keep-all; }
.play-panel {
  min-height: 350px; border-color: var(--skill-line, #e2cced);
  background: linear-gradient(160deg, var(--skill-paper, #f3eaff) 1%, #fffefa 44%);
  box-shadow: 0 4px 0 var(--skill-line, #ead9f0), var(--shadow);
}
.game-play-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.round-title .tile { flex: 0 0 45px; height: 45px; border-radius: 12px; }
.round-title :is(h1,h2) { margin: 0; font-size: clamp(1.28rem, 3.4vw, 1.78rem); line-height: 1.25; letter-spacing: -.058em; }
.round-steps { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 0; margin: 0; list-style: none; }
.round-steps li {
  min-width: 28px; min-height: 28px; padding: 4px 6px; display: grid; place-items: center;
  border: 1px solid #e2d3ed; border-radius: 9px; background: #f4eaf9; color: #66537e; font-size: .76rem; font-weight: 900;
}
.round-steps .is-current { border-color: #955bd5; color: #fff; background: #7446c5; box-shadow: 0 2px 0 #6033ad; }
.round-steps .is-done { border-color: #b9dac8; color: #226047; background: #e7f5e9; }
.puzzle-actions { margin-top: 15px; }
.puzzle-actions #submit-answer { min-width: min(145px, 100%); }
.game-play-heading .mode-badge {
  flex: 0 0 auto; max-width: 44%; padding: 6px 9px; color: var(--skill-ink, #5e3c98); border-radius: 8px;
  border: 1px solid var(--skill-line, #ded0f1); background: var(--skill-paper, #f1eaff); font-size: .77rem; font-weight: 900; text-align: right;
}
.choice-stack, .sequence-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.sequence-options { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.answer-choice {
  min-width: 0; min-height: 54px; padding: 9px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #33214c; background: linear-gradient(160deg, #fffcfa, #f8f1fc);
  border: 1px solid #ddcaec; border-radius: 13px; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e8d9f2;
  font-weight: 800; line-height: 1.26; text-align: center; white-space: pre-line; overflow-wrap: anywhere;
  transition: border-color .13s ease, background .13s ease, transform .13s ease;
}
.answer-choice:active:not(:disabled) { transform: translateY(1px); }
.answer-choice[aria-pressed="true"] {
  color: #3b1d80; background: #e7d9ff; border: 2px solid #8051db; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #c5abee;
}
.answer-choice:disabled { color: #893454; background: repeating-linear-gradient(140deg, #fff1f5 0 7px, #fae4ec 7px 14px); border-color: #e2b4ca; box-shadow: none; }
.answer-choice.is-correct, .answer-choice[data-outcome="correct"] { color: #155744; background: #ddf5e8; border-color: #5ca58b; box-shadow: 0 2px 0 #b8e3d1; }
.answer-choice.is-missed, .answer-choice[data-outcome="missed"] { color: #832a51; background: #ffe4ed; border-color: #dc92b1; box-shadow: 0 2px 0 #f4c8d8; }
.puzzle-grid {
  --columns: 4;
  display: grid; grid-template-columns: repeat(var(--columns), minmax(44px, 1fr)); gap: 7px;
  width: min(100%, 520px); padding: 4px; margin: 8px 0 16px; overflow-x: auto; scrollbar-color: #bea3d8 #f7effa;
  scrollbar-width: thin; overscroll-behavior-inline: contain;
}
.puzzle-grid .answer-choice { position: relative; width: 100%; min-height: 52px; aspect-ratio: 1.3; padding: 8px 3px; }
.grid-swipe { margin: -9px 0 11px; color: #685479; font-size: .82rem; }
.puzzle-grid .answer-choice i {
  position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 2px 4px; border-radius: 10px;
  color: #fff; background: #5d33be; font-size: .67rem; line-height: 1.1; font-style: normal;
}
.static-cell {
  min-width: 0; display: grid; place-items: center; min-height: 44px; padding: 6px 4px; color: #372150;
  border: 1px solid #ead9f3; border-radius: 9px; background: #f2e7fa; font-size: .94rem; font-weight: 850;
  text-align: center; white-space: pre-line; overflow-wrap: anywhere;
}
.stimulus-panel { margin: 13px 0; padding: 10px 13px; border: 1px solid #e2d3ed; border-radius: 14px; background: #f5edfc; color: #493365; }
.stimulus-panel p { margin: 4px 0; white-space: pre-line; }
.stimulus-timer { height: 8px; overflow: hidden; border-radius: 99px; background: #e7d7ee; margin: 13px 0 2px; }
.stimulus-timer i { width: 100%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #935bdc, #cf78b2); transform-origin: left; animation: stimulus-count var(--stimulus-duration, 3s) linear both; }
@keyframes stimulus-count { to { transform: scaleX(0); } }
.selection-log { min-height: 23px; margin: 8px 0 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; }
.selection-log span { padding: 3px 7px; border: 1px solid #e1d0ee; border-radius: 7px; color: #523478; background: #f3e9fa; }
.play-feedback {
  display: flex; align-items: center; gap: 10px; margin: 0 0 13px; padding: 10px 13px; border: 1px solid #e4d1f2; border-radius: 16px;
  background: #f6eafd; color: #532e82; box-shadow: 0 2px 0 #ead6f5;
}
.play-feedback .feedback-icon { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: inherit; background: #ffffffa0; font-weight: 900; }
.feedback-icon svg { width: 19px; height: 19px; }
.play-feedback.is-correct { color: #1a5547; border-color: #b1ddca; background: #e8f8ef; box-shadow: 0 2px 0 #d1ebde; }
.play-feedback.is-missed { color: #722746; border-color: #f0c6d4; background: #fff0f3; box-shadow: 0 2px 0 #fae3ec; }
.play-feedback p { margin: 0; }
.play-feedback h3 { margin: 0; font-size: 1.05rem; }
.play-feedback .actions { margin-top: 12px; }

.result-banner {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(22px, 4vw, 34px);
  padding-right: clamp(99px, 22vw, 153px); border-radius: 24px; border: 1px solid #ddcaee;
  background: linear-gradient(129deg, #f5e6ff, #efe4ff 58%, #f8e0f8); box-shadow: 0 4px 0 #ebd8f6, var(--shadow);
}
.result-banner.is-perfect { background: linear-gradient(130deg, #fff4cf, #ffe8b9 54%, #ffddeb); border-color: #f1d29d; box-shadow: 0 4px 0 #f7e2b9, var(--shadow); }
.result-banner h1 { position: relative; margin: 0; color: #38205a; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.17; letter-spacing: -.08em; word-break: keep-all; }
.result-banner .eyebrow { color: #694099; }
.result-banner.is-perfect .eyebrow { color: #7b4d18; }
.result-banner .result-copy > p:last-child, .result-banner > p:last-child { margin: 11px 0 0; color: #64477a; line-height: 1.55; font-weight: 700; }
.result-banner.is-perfect .result-copy > p:last-child, .result-banner.is-perfect > p:last-child { color: #714d23; }
.result-actions { margin-top: 17px; }
.result-status { color: #654680; font-size: .9rem; font-weight: 850; }
.result-status.is-correct, .result-status .is-correct { color: #19614c; }
.result-status.is-missed, .result-status .is-missed { color: #873454; }
.result-emblem {
  position: absolute; z-index: -1; top: 50%; right: 8%; width: clamp(63px, 13vw, 110px); height: clamp(63px, 13vw, 110px);
  display: grid; place-items: center; border: 1px solid #b995ea; border-radius: 27%;
  color: #5b3a97; background: radial-gradient(circle at 28% 15%, #f2dcff 0%, transparent 50%), linear-gradient(140deg, #e6c9ff, #b88cf2);
  box-shadow: inset 0 1px 0 #fff9, 0 4px 0 #a779d8, 0 9px 20px #68299a32;
  transform: translateY(-50%) rotate(12deg); animation: emblem-arrive .36s ease-out both;
}
.is-perfect .result-emblem {
  color: #8b4a15; border-color: #e9a661; background: radial-gradient(circle at 27% 16%, #fff6ba 0%, transparent 46%), linear-gradient(139deg, #ffe286, #ffc157);
  box-shadow: inset 0 1px 0 #fff9, 0 4px 0 #e7a04c, 0 9px 20px #995e3936;
}
.result-emblem span { font-size: clamp(1.7rem, 5.7vw, 3rem); text-shadow: 0 1px 0 #fffb; }
.result-emblem svg { width: 55%; height: 55%; }
.result-emblem:has(.result-mascot) {
  right: 3.5%; width: clamp(88px, 22vw, 155px); height: clamp(88px, 22vw, 155px);
  border: 0; border-radius: 50%; background: radial-gradient(ellipse, #fff3c9 5%, #fae6fd 50%, transparent 74%);
  box-shadow: none; transform: translateY(-50%); animation: mascot-arrive .4s cubic-bezier(.2, .75, .3, 1.2) both;
}
.result-mascot { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 6px 7px #522d7837); }
@keyframes emblem-arrive { from { opacity: 0; transform: translateY(-50%) scale(.84) rotate(5deg); } to { opacity: 1; transform: translateY(-50%) scale(1) rotate(12deg); } }
@keyframes mascot-arrive { from { opacity: 0; transform: translateY(-48%) scale(.86); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.results-shell > .panel { margin-top: 15px; }
.results-shell #share-area { margin-top: 12px; }
.share-panel { background: linear-gradient(130deg, #fffefa 36%, #f8effc 100%); }
.solution-details { border-top: 1px solid #e9d9f1; border-bottom: 1px solid #e9d9f1; }
.solution-details summary {
  min-height: 46px; padding: 9px 0; display: grid; grid-template-columns: 19px minmax(0, 1fr) auto auto;
  align-items: center; gap: 8px; color: #694397; cursor: pointer; font-weight: 800; list-style: none;
}
.solution-details summary::-webkit-details-marker { display: none; }
.solution-details summary::before {
  content: '+'; display: grid; place-items: center; width: 19px; height: 19px;
  color: #694397; background: #f2e6fb; border-radius: 5px; font-weight: 900;
}
.solution-details[open] summary::before { content: '−'; }
.solution-details[open] { padding-bottom: 7px; }
.solution-details summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 5px; }
.friend-heading { background: linear-gradient(125deg, #fff1e7, #f0e5ff); border: 1px solid #e7d2ef; border-radius: 21px; padding: clamp(17px, 4vw, 27px); }
.friend-panel { border-color: #e4d4ec; }
.result-list, .history-list { padding: 0; list-style: none; margin: 10px 0 0; }
.result-item, .history-item { padding: 11px 0; border-top: 1px solid #ebdff0; }
.result-item:first-child, .history-item:first-child { border-top: 0; }
.result-item > div, .history-item > div { display: flex; justify-content: space-between; align-items: baseline; gap: 13px; }
.result-item p, .history-item p { margin: 5px 0 0; color: var(--muted); font-size: .91rem; }
.score { color: #61418f; font-weight: 900; white-space: nowrap; }
.score.is-correct { color: #1a6955; }
.comparison-detail { border: 1px solid #e3d2ee; border-radius: 12px; padding: 9px 11px; background: #f3e9fa; color: #52396f; }
.share-link { display: flex; gap: 8px; align-items: end; margin: 11px 0; }
.share-link .field { flex: 1; }
.share-link .btn { min-height: 45px; white-space: nowrap; }

.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.stat { padding: 15px 17px; background: #fff3d8; border: 1px solid #f0d7a6; border-radius: 17px; box-shadow: 0 3px 0 #f7e7c3; }
.stat:nth-child(2) { background: #eaf8ee; border-color: #cbe8d6; box-shadow: 0 3px 0 #d9ebdf; }
.stat:nth-child(3) { background: #f4eaff; border-color: #e4d0f3; box-shadow: 0 3px 0 #eadcf3; }
.stat span { display: block; color: #614777; margin-bottom: 7px; font-size: .87rem; font-weight: 750; }
.stat strong { color: var(--ink); font-size: clamp(1.15rem, 3.4vw, 1.8rem); letter-spacing: -.06em; }
.record-layout { display: grid; grid-template-columns: 1.15fr .85fr; align-items: start; gap: 14px; }
.record-layout > * { min-width: 0; }
.settings label { margin: 14px 0 8px; }
.settings .actions { margin-top: 11px; }
.settings .code { padding: 8px 10px; border: 1px solid #e4d3ef; border-radius: 9px; background: #f1e6fa; color: #503279; font-family: ui-monospace, monospace; font-weight: 800; }
.import-toggle { display: flex; gap: 7px; min-height: 37px; align-items: center; font-size: .88rem; }
.import-toggle input { width: 19px; height: 19px; accent-color: var(--grape); }
.puzzle-profile { margin-bottom: 15px; }
.profile-count {
  color: #613897; background: #f1e5fa; border: 1px solid #ead8f5; border-radius: 9px; padding: 5px 8px; font-size: .84rem; font-weight: 900; white-space: nowrap;
}
.profile-level { max-width: 190px; margin-bottom: 12px; }
.profile-areas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 0; margin: 0 0 13px; list-style: none; }
.profile-areas li { min-width: 0; padding: 10px 8px; color: #60467b; border: 1px solid #eadbef; border-radius: 10px; background: #f9f0fc; }
.profile-areas li:nth-child(3n + 2) { background: #f0f8f4; border-color: #deece3; }
.profile-areas li:nth-child(3n) { background: #fff5e2; border-color: #f4e6c9; }
.profile-areas strong, .profile-areas span { display: block; text-align: center; font-size: .83rem; line-height: 1.45; }
.profile-areas span { color: #675678; margin-top: 3px; }
.profile-next { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; padding: 12px; border: 1px dashed #d7bde8; border-radius: 12px; background: #fbf3fe; }
.profile-next h3 { margin: 0; font-size: 1.05rem; }
.profile-next p { margin: 3px 0 0; color: #59466d; font-size: .9rem; }
.puzzle-profile > .subtle { margin-top: 11px; font-size: .88rem; }
.loading, .noscript { padding: 20px 14px; color: var(--muted); }
.toast {
  z-index: 14; position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 25px); padding: 10px 14px; border: 1px solid #804dc7; border-radius: 13px;
  color: #fff; background: #51318d; box-shadow: 0 6px 20px #41276b37; text-align: center; font-size: .91rem;
}

@media (hover: hover) {
  .main-nav a:hover { background: #f3e9fc; }
  .btn:hover:not(:disabled) { filter: brightness(1.065); }
  .btn-quiet:hover:not(:disabled) { background: #f5eaff; }
  .game-card:hover { transform: translateY(-3px); box-shadow: 0 5px 0 var(--skill-paper, #f1e7f7), 0 10px 22px #45276318; }
  .answer-choice:hover:not(:disabled) { border-color: #9a77cb; background-color: #f0e3fa; }
  .chip:hover:not([aria-pressed="true"]) { color: var(--grape-deep); border-color: #c9afe9; }
}
@media (max-width: 930px) {
  .hero { min-height: 420px; gap: 17px; padding: 31px 37px; }
  .hero-copy .intro { margin: 14px 0 20px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-journey .game-grid, .game-grid.today-journey { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-journey .game-card { gap: 10px; padding: 13px; }
}
@media (max-width: 680px) {
  .top-inner, .main-shell, .footer { width: calc(100% - 28px); }
  .top-inner { position: relative; grid-template-columns: 1fr auto; gap: 5px; min-height: 61px; padding: 9px 0; }
  .wordmark { font-size: 1.12rem; gap: 9px; }
  .brand-mark { flex-basis: 34px; width: 34px; height: 34px; border-radius: 12px; }
  .storage-indicator { grid-column: 2; grid-row: 1; padding: 5px 7px; gap: 5px; }
  .main-nav {
    position: fixed; z-index: 9; inset: auto 12px max(10px, env(safe-area-inset-bottom)) 12px;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 5px;
    border: 1px solid #e4d4f1; border-radius: 17px; background: #fffbf9; box-shadow: 0 9px 25px #39245f30;
  }
  .main-nav a { min-height: 45px; padding: 6px 4px; gap: 2px; font-size: .81rem; border-radius: 11px; flex-direction: column; }
  .main-nav .nav-icon { width: 16px; height: 16px; }
  body[data-view="play"] .main-nav { position: static; grid-column: 1 / -1; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; display: none; }
  .main-shell { padding-top: 15px; }
  .footer { margin-top: 33px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body[data-view="play"] .footer { padding-bottom: calc(21px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
  body[data-view="play"] .toast { bottom: max(14px, env(safe-area-inset-bottom)); }
  .hero {
    display: block; min-height: 0; padding: 22px 20px 178px; border-radius: 23px;
    background: linear-gradient(145deg, #fff2e9, #f4e8ff 45%, #e7cef6);
  }
  .hero-copy { width: 100%; }
  .hero .eyebrow { min-height: 29px; margin-bottom: 13px; padding: 5px 9px; font-size: .79rem; }
  .hero h1 { font-size: clamp(2.03rem, 9.65vw, 3.35rem); }
  .hero-copy .intro { max-width: 100%; font-size: .94rem; margin: 11px 0 15px; line-height: 1.59; }
  .hero-copy .btn { min-height: 47px; padding: 8px 12px; font-size: .91rem; }
  .mini-meta { margin-top: 11px; font-size: .79rem; }
  .hero-visual, .hero-illustration { inset: auto 0 0; height: 212px; mask-image: linear-gradient(180deg, transparent 0%, #000 35%); }
  .hero-visual img { object-position: 64% 49%; }
  .hero-illustration { background-position: 64% 49%; }
  .hero-stamp { right: 14px; bottom: 12px; font-size: .75rem; }
  .content-section { margin-top: 27px; }
  .section-heading { gap: 8px; }
  .game-grid, .today-journey .game-grid, .game-grid.today-journey { grid-template-columns: 1fr; gap: 9px; }
  .game-card, .today-journey .game-card { min-height: 78px; padding: 11px 12px; gap: 11px; border-radius: 14px; }
  .game-card strong { font-size: 1.03rem; }
  .game-card .game-desc { font-size: .84rem; line-height: 1.36; }
  .tile { flex-basis: 40px; height: 40px; border-radius: 11px; font-size: 1.15rem; }
  .tile svg { width: 20px; height: 20px; }
  .journey-index { top: 10px; right: 10px; }
  .game-card.journey-card .card-copy, .journey-card .game-card .card-copy { padding-inline-end: 17px; }
  .filters { gap: 9px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline-end: -12px; padding: 4px 11px 7px 3px; }
  .record-layout { grid-template-columns: 1fr; }
  .record-grid { gap: 7px; }
  .stat { padding: 11px 10px; }
  .stat span { font-size: .75rem; }
  .profile-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .round-title .tile { flex-basis: 38px; height: 38px; }
  .play-panel .actions > .btn { min-height: 48px; }
  .result-emblem:has(.result-mascot) { width: clamp(95px, 26vw, 126px); height: clamp(95px, 26vw, 126px); right: 1.5%; }
}
@media (max-width: 373px) {
  .top-inner, .main-shell, .footer { width: calc(100% - 21px); }
  .hero { padding-inline: 15px; }
  .hero-copy .actions { gap: 7px; }
  .filters { grid-template-columns: 1.25fr 1fr; }
  .choice-stack { grid-template-columns: 1fr; }
  .puzzle-grid .answer-choice { padding: 6px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}
