:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #536069;
  --paper: #f7f5f0;
  --panel: #ffffff;
  --line: #dfd9cc;
  --amber: #f2b84b;
  --amber-dark: #8d5d08;
  --green: #1f7a5a;
  --red: #b83f3f;
  --blue: #1f5f8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  background: var(--paper);
}

.hero {
  position: relative;
  min-height: min(44svh, 390px);
  display: flex;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  object-position: center;
}

.hero__shade {
  background:
    linear-gradient(180deg, rgba(16, 24, 32, 0.18), rgba(16, 24, 32, 0.72) 58%, rgba(16, 24, 32, 0.94)),
    linear-gradient(90deg, rgba(16, 24, 32, 0.8), rgba(16, 24, 32, 0.18) 70%);
}

.hero__content {
  position: relative;
  width: 100%;
  padding: 16px 18px 22px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(5, 40px);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.35);
  backdrop-filter: blur(12px);
}

.language-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: #181007;
  background: var(--amber);
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.25rem, 10vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 18ch;
  margin-bottom: 16px;
  font-size: clamp(1.25rem, 5.8vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero__route,
.tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.button,
.tool {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  color: #181007;
  background: var(--amber);
}

.button--secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(12px);
}

.button--check-zone {
  width: 100%;
  margin-top: 14px;
  color: #181007;
  background: var(--amber);
}

.button.is-loading::after {
  content: "...";
  display: inline-block;
  width: 1.4em;
  margin-left: 2px;
  text-align: left;
  animation: loadingDots 900ms ease-in-out infinite;
}

@keyframes loadingDots {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(0);
  }

  50% {
    opacity: 1;
    transform: translateX(4px);
  }
}

.notice,
.status-panel,
.map-section,
.steps,
.waiting-panel,
.accessibility-panel,
.tools {
  margin: 14px;
}

.notice {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-left: 5px solid var(--amber);
  background: #fff7df;
}

.notice strong {
  color: var(--amber-dark);
}

.notice > div {
  display: grid;
  gap: 4px;
}

.next-show {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.next-show strong {
  flex: 0 0 auto;
  min-width: 74px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  padding: 0 10px;
  color: #181007;
  background: var(--amber);
  font-size: 1rem;
}

.status-panel,
.map-section,
.steps {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.waiting-panel details,
.accessibility-panel details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.waiting-panel summary,
.accessibility-panel summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.waiting-panel details[open] summary,
.accessibility-panel details[open] summary {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.waiting-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
}

.waiting-tabs button,
.game-button,
.snake-controls button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f9f7f2;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.waiting-tabs button[aria-selected="true"] {
  border-color: rgba(31, 95, 143, 0.42);
  color: var(--blue);
  background: #eef5fa;
}

.waiting-content,
.accessibility-content {
  padding: 16px;
  color: var(--muted);
  line-height: 1.48;
}

.waiting-content p,
.waiting-lead {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.show-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.show-times li {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.mini-game {
  color: var(--ink);
}

.accessibility-map {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #d7e2dc;
}

.game-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.game-heading h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.game-heading strong {
  min-width: 46px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #181007;
  background: var(--amber);
}

.score-stack {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.score-stack small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.snake-stage {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  cursor: pointer;
}

.snake-board {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1b21;
}

.snake-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(16, 24, 32, 0.44);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.snake-overlay span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #181007;
  background: var(--amber);
  box-shadow: 0 10px 24px rgba(16, 24, 32, 0.28);
}

.snake-overlay small {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.58);
}

.snake-overlay[hidden] {
  display: none;
}

.snake-controls {
  width: min(100%, 220px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px auto 0;
}

.snake-controls button {
  min-height: 44px;
  font-size: 1.15rem;
}

.snake-controls button[data-snake-dir="up"] {
  grid-column: 2;
}

.snake-controls button[data-snake-dir="left"] {
  grid-column: 1;
}

.snake-controls button[data-snake-dir="down"] {
  grid-column: 2;
}

.snake-controls button[data-snake-dir="right"] {
  grid-column: 3;
}

.status-message {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-message.is-good {
  color: var(--green);
  font-weight: 800;
}

.status-message.is-far {
  color: var(--red);
  font-weight: 800;
}

.distance {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #eef6f3;
}

.distance span {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

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

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.text-link {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.map-frame {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #d7e2dc;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.steps ol {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
}

.steps span {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #181007;
  background: var(--amber);
  font-weight: 900;
}

.steps p {
  margin: 0;
  line-height: 1.4;
}

.tools {
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.tool {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.tool--primary {
  color: #181007;
  background: var(--amber);
  border-color: transparent;
}

@media (min-width: 620px) {
  body {
    background: #e8e3d8;
  }

  .app-shell {
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(16, 24, 32, 0.18);
  }

  .hero__content {
    padding: 30px 34px 32px;
  }

  .hero {
    min-height: min(54svh, 520px);
  }

  .hero__route,
  .tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero__route {
    display: inline-flex;
    width: auto;
  }

  .tools {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .notice,
  .status-panel,
  .map-section,
  .steps,
  .waiting-panel,
  .accessibility-panel,
  .tools {
    margin-inline: 24px;
  }
}
