.home { height: min(720px, calc(100svh - 44px)); padding: 0 6px 32px; display: grid; grid-template-rows: auto minmax(0, 1fr) 54px 46px 22px auto; gap: 6px; align-content: center; }
.home-heading h1 { margin: 0 0 6px; font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.02; }
.home .journey-map { width: 100%; height: 100%; max-height: 270px; margin: 0 auto; gap: 12px; align-self: center; }
.map-entry { min-height: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 3px; }
.home .map-stop { min-height: 0; width: 100%; height: 100%; position: relative; padding: 0; border-radius: 22px; overflow: hidden; display: block; cursor: pointer; font: inherit; }
.home .map-stop:focus-visible { outline: 3px solid #ffe2a0; outline-offset: 3px; }
.map-level-label { color: #fff0cf; font: 700 clamp(.82rem, 1.6vw, 1.05rem)/1.1 'PT Serif', Georgia, serif; text-shadow: 0 2px 6px #020817; }
.home .difficulty-stars { margin-top: -46px; }
.home .map-stop:nth-child(even) { transform: none; }
.home .map-stop { container-type: size; }
.map-hero { position: absolute; height: auto; width: min(76cqw, 72cqh); aspect-ratio: 1; left: 50%; bottom: 15%; transform: translateX(-50%); background-size: 200% 100%; background-position: left center; background-repeat: no-repeat; filter: drop-shadow(0 5px 8px #040917aa); }
.map-hero.has-reward { background-position: right center; }
.home .map-stop strong { position: absolute; inset: auto 0 0; padding: 14px 5px 8px; background: linear-gradient(transparent, #0b142bf2 45%); font-size: clamp(.8rem, 1.8vw, 1.15rem); }
.map-stop.completed::after { content: '✓'; position: absolute; top: 7px; right: 8px; color: #fff3ba; text-shadow: 0 0 7px #ffcf67; }
.difficulty-stars { display: flex; justify-content: center; align-items: center; gap: 8px; }
.difficulty-stars button { height: 54px; width: 52px; padding: 0; border: 0; background: none; color: #66677a; font: 48px/1 Georgia, serif; cursor: pointer; touch-action: manipulation; transition: color .15s, transform .15s; }
.difficulty-stars button.is-filled { color: #ffda89; filter: drop-shadow(0 0 5px #e7af484d); }
.difficulty-stars button[aria-pressed="true"] { transform: scale(1.13); }
.difficulty-stars button:focus-visible { outline: 2px solid #ffe7aa; outline-offset: 0; border-radius: 8px; }
.difficulty-name { margin-left: 10px; color: #eddbb3; font-size: 1rem; line-height: 1.2; }
.home .home-actions { flex-wrap: nowrap; gap: 10px; width: min(100%, 440px); margin: auto; }
.home .home-actions button { flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; white-space: nowrap; font-size: .95rem; }
.home-record { margin: 0; font-size: .8rem; line-height: 22px; }
#loading-status { margin: 0; font-size: .8rem; }
#loading-status:empty { display: none; }
.help-button { position: fixed; left: 14px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 15; width: 36px; height: 36px; border: 1px solid #e8ca8b80; border-radius: 50%; background: #151f34eb; color: #ffe1a4; font: 700 1.1rem Georgia, serif; cursor: pointer; }
.help-dialog[open] { display: block; max-width: 620px; }
.help-dialog p { line-height: 1.6; font-size: .95rem; }
.total-card { display: grid; gap: 3px; text-align: center; min-width: 54px; font-variant-numeric: tabular-nums; }
.total-card span { font-size: .6rem; letter-spacing: .08em; color: #dbcda9; }
.total-card output { font-size: 1rem; font-weight: 700; }
.quest-bar { width: min(100%, 520px); margin-inline: auto; }
.quest-level { display: block; color: #e8d6af; font-size: .78rem; margin-bottom: 4px; }
.quest-row { display: flex; align-items: center; gap: clamp(4px, 1vw, 12px); }
.quest-row { justify-content: space-between; }
.quest-targets { display: flex; align-items: center; gap: clamp(4px, 1vw, 10px); min-width: 0; }
.quest-target { display: flex; align-items: center; gap: 3px; padding: 3px 5px; border: 1px solid #d2b77e4d; border-radius: 10px; background: #141e33d6; color: #ffedc7; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.quest-target img { width: clamp(22px, 4.8vw, 34px); height: auto; }
.quest-target.is-done { border-color: #8ddfa2; color: #bdf7cc; }
.score-task { font-size: .84rem; color: #ffe9b8; }
.difficulty-indicator { color: #ffdc91; font: 700 1.25rem/1 Georgia, serif; letter-spacing: .12em; text-shadow: 0 0 8px #f4c97066; }
.level-time { min-width: 45px; color: #ffe2a0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.level-time.is-urgent { color: #ffb0a3; }
.reaction { height: 32px; }
.board-frame { --board-size: min(560px, calc(100svh - 230px), calc(100vw - 40px)); }
@media (max-width: 600px) {
  .home { height: calc(100svh - 28px); padding-bottom: 32px; gap: 4px; grid-template-rows: auto minmax(0, 1fr) 50px 44px 20px auto; }
  .home .journey-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 310px; }
  .home .map-stop { border-radius: 16px; }
  .map-level-label { font-size: .9rem; }
  .home .difficulty-stars { margin-top: -24px; }
  .home .map-stop strong { padding-top: 12px; padding-bottom: 6px; }
  .home-record { line-height: 20px; }
  .home-heading h1 { font-size: clamp(1.95rem, 8vw, 2.8rem); margin-bottom: 4px; }
  .toolbar { gap: 6px; }
  .total-card { min-width: 43px; }
  .difficulty-indicator { font-size: 1.05rem; }
  .quest-target { font-size: .74rem; padding: 3px; }
  .quest-target img { width: 23px; }
  .level-time { font-size: 1.05rem; min-width: 39px; }
  .board-frame { --board-size: min(560px, calc(100svh - 248px), calc(100vw - 30px)); }
}
@media (orientation: landscape) and (max-height: 550px) {
  .home { height: calc(100svh - 24px); max-width: 850px; grid-template-columns: minmax(140px, .8fr) minmax(0, 1.4fr); grid-template-rows: auto 54px 46px 20px; gap: 4px 16px; padding: 0 35px 6px; }
  .home-heading { grid-column: 1; grid-row: 1; align-self: end; }
  .home-heading h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
  .home .journey-map { grid-column: 2; grid-row: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .difficulty-stars, .home-actions, .home-record { grid-column: 1; }
  .home .difficulty-stars { margin-top: 0; }
  .home .home-actions { gap: 5px; }
  .home .home-actions button { padding-inline: 7px; font-size: .78rem; }
  .home .map-stop strong { font-size: .78rem; }
  .quest-bar { position: absolute; bottom: 100%; padding-right: 0; width: 100%; }
  .quest-level { font-size: .65rem; }
  .quest-target { font-size: .63rem; padding: 1px; }
  .quest-target img { width: 18px; }
  .level-time { font-size: .95rem; }
  .board-frame { --board-size: min(560px, calc(100svh - 125px), calc(100vw - 190px)); }
  .game-header .toolbar { flex-wrap: wrap; }
}
