:root {
  color-scheme: light;
  --pine: #132b28;
  --pine-deep: #0c201d;
  --basalt: #283735;
  --basalt-soft: #3b514d;
  --mist: #8faeaa;
  --mist-pale: #cbdeda;
  --cloud: #eef2ef;
  --cloud-bright: #f8faf8;
  --bamboo: #c89f3d;
  --bamboo-dark: #866b28;
  --persimmon: #d45b3f;
  --persimmon-dark: #a93f2b;
  --ink: #152724;
  --muted: #526965;
  --line: #7f9b96;
  --focus: #f1c75b;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --z-header: 20;
  --z-dropdown: 30;
  --z-feedback: 12;
  --z-skip: 60;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow: hidden;
  background: var(--pine);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--pine);
  font-family:
    "Noto Sans TC",
    "Noto Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select {
  color: inherit;
  font: inherit;
}

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

button {
  border: 0;
}

button:not(:disabled),
summary,
select,
a {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
select:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: var(--z-skip);
  top: 8px;
  left: 50%;
  min-height: 44px;
  padding: 11px 18px;
  color: var(--cloud-bright);
  background: var(--pine-deep);
  border: 2px solid var(--focus);
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-decoration: none;
  transform: translate(-50%, -160%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

#game-root {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  min-height: 100svh;
  overflow: hidden;
  background: var(--cloud);
}

.app-header {
  position: relative;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--header-height);
  padding: 0 18px;
  color: var(--pine);
  background: var(--cloud-bright);
  border-bottom: 2px solid var(--pine);
}

.back-link,
.settings > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--pine);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.back-link {
  grid-column: 1;
}

.back-link:hover,
.settings > summary:hover {
  color: var(--persimmon-dark);
  background: #e0eae7;
}

.back-link > span:first-child {
  color: var(--persimmon);
  font-size: 1.25rem;
  line-height: 1;
}

.header-mark {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
}

.header-mark span {
  width: 22px;
  height: 7px;
  background: var(--bamboo);
  border: 1px solid var(--bamboo-dark);
}

.header-mark span:nth-child(2) {
  width: 29px;
}

.header-mark span:nth-child(3) {
  width: 18px;
}

.header-mark span:nth-child(4) {
  width: 9px;
  background: var(--persimmon);
  border-color: var(--persimmon-dark);
}

.settings {
  position: relative;
  grid-column: 3;
  justify-self: end;
}

.settings > summary {
  justify-content: flex-end;
  list-style: none;
}

.settings > summary::-webkit-details-marker {
  display: none;
}

.settings-panel {
  position: absolute;
  z-index: var(--z-dropdown);
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  width: min(260px, calc(100vw - 24px));
  padding: 14px;
  background: var(--cloud-bright);
  border: 2px solid var(--pine);
  border-radius: var(--radius-sm);
  box-shadow: 5px 5px 0 rgba(12, 32, 29, 0.22);
}

.settings-panel label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.settings-panel select {
  width: 100%;
  min-height: 44px;
  padding: 8px 36px 8px 11px;
  color: var(--ink);
  background: var(--cloud-bright);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.settings-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding-top: 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.settings-version strong {
  color: var(--pine);
  font-family: ui-monospace, monospace;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(290px, 31vw, 370px);
  min-height: 0;
  overflow: hidden;
}

.trail-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 14px;
  color: var(--cloud);
  background: var(--pine);
  border-right: 2px solid var(--pine-deep);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 4px 12px;
}

.stage-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stage-emblem {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--pine);
  background: var(--bamboo);
  border-radius: 50%;
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 1rem;
  font-weight: 900;
}

.stage-heading h2,
.stage-heading p {
  margin: 0;
}

.stage-heading h2 {
  color: var(--cloud-bright);
  font-size: 1rem;
  line-height: 1.25;
}

.stage-heading p {
  margin-top: 2px;
  color: #b9cdc9;
  font-size: 0.78rem;
  line-height: 1.35;
  text-wrap: pretty;
}

.sound-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  min-height: 44px;
  padding: 8px 13px;
  color: var(--cloud-bright);
  background: transparent;
  border: 2px solid var(--basalt-soft);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.sound-toggle:hover {
  background: var(--basalt);
  border-color: var(--mist);
}

.sound-toggle:active {
  transform: translateY(1px);
}

.sound-toggle[aria-pressed="false"] {
  color: #b9cdc9;
  border-style: dashed;
}

.sound-icon {
  color: var(--bamboo);
  font-size: 1rem;
}

.game-surface {
  position: relative;
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  background: var(--mist-pale);
  border: 2px solid var(--basalt-soft);
  border-radius: var(--radius-md);
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

#game-canvas:focus-visible {
  outline-offset: -6px;
}

.length-readout {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--cloud-bright);
  background: rgba(19, 43, 40, 0.9);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  pointer-events: none;
}

.length-readout strong {
  min-width: 3ch;
  color: var(--bamboo);
  font-family: ui-monospace, monospace;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hold-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--cloud-bright);
  background: rgba(19, 43, 40, 0.86);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
}

.hold-cue i {
  position: relative;
  width: 42px;
  height: 3px;
  overflow: hidden;
  background: var(--basalt-soft);
}

.hold-cue i::after {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--bamboo);
  transform: translateX(-100%);
}

.game-surface[data-phase="growing"] .hold-cue i::after {
  animation: cue-fill 700ms linear infinite;
}

.game-surface[data-phase="walking"] .hold-cue,
.game-surface[data-phase="dying"] .hold-cue,
.game-surface[data-phase="over"] .hold-cue {
  opacity: 0;
}

@keyframes cue-fill {
  to {
    transform: translateX(100%);
  }
}

.feedback-stamp {
  position: absolute;
  z-index: var(--z-feedback);
  top: 50%;
  left: 50%;
  display: grid;
  min-width: 128px;
  min-height: 62px;
  padding: 10px 16px;
  place-items: center;
  color: var(--cloud-bright);
  background: var(--persimmon);
  border: 3px solid var(--cloud-bright);
  border-radius: 8px;
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-4deg) scale(0.7);
}

.feedback-stamp.show {
  animation: stamp-in 680ms var(--ease-out) both;
}

.game-surface[data-feedback="safe"] .feedback-stamp {
  color: var(--pine);
  background: var(--bamboo);
  border-color: var(--pine);
}

.game-surface[data-feedback="miss"] .feedback-stamp {
  background: var(--pine-deep);
  border-color: var(--persimmon);
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scale(1.45);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-4deg) scale(0.94);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-4deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -65%) rotate(-4deg) scale(0.98);
  }
}

.control-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: clamp(20px, 3.2vw, 38px);
  flex-direction: column;
  overflow: hidden;
  background: var(--cloud);
}

.title-block {
  padding-bottom: 22px;
  border-bottom: 2px solid var(--pine);
}

.trail-label,
.title-block h1,
.app-subtitle {
  margin: 0;
}

.trail-label {
  color: var(--persimmon-dark);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 0.86rem;
  font-weight: 900;
}

.title-block h1 {
  margin-top: 4px;
  color: var(--pine);
  font-family:
    "Iowan Old Style",
    "Noto Serif TC",
    "Songti TC",
    Georgia,
    serif;
  font-size: clamp(2.15rem, 4vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.app-subtitle {
  max-width: 34ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.55;
  text-wrap: pretty;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.score-strip > div {
  min-width: 0;
  padding: 0 11px;
  border-right: 1px solid var(--line);
}

.score-strip > div:first-child {
  padding-left: 0;
}

.score-strip > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.score-strip dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-strip dd {
  margin: 5px 0 0;
  color: var(--pine);
  font-family: ui-monospace, monospace;
  font-size: clamp(1.15rem, 2.7vw, 1.9rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.phase-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 750;
}

.phase-row strong {
  overflow: hidden;
  color: var(--pine);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-indicator {
  width: 9px;
  height: 9px;
  background: var(--bamboo);
  border: 2px solid var(--bamboo-dark);
  border-radius: 50%;
  transition:
    background-color 180ms ease,
    transform 180ms var(--ease-out);
}

#game-root[data-phase="growing"] .phase-indicator {
  background: var(--persimmon);
  border-color: var(--persimmon-dark);
  transform: scale(1.25);
}

#game-root[data-phase="walking"] .phase-indicator {
  background: var(--mist);
  border-color: var(--pine);
}

#game-root[data-phase="dying"] .phase-indicator,
#game-root[data-phase="over"] .phase-indicator {
  background: var(--pine-deep);
  border-color: var(--persimmon);
}

.start-panel,
.result-panel {
  display: flex;
  min-height: 0;
  margin-top: auto;
  padding-top: 18px;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: flex-end;
}

.start-panel[hidden],
.result-panel[hidden] {
  display: none;
}

.start-panel p,
.result-label,
.new-record {
  margin: 0;
}

.start-panel p {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
  text-wrap: pretty;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--cloud-bright);
  background: var(--pine);
  border-bottom: 4px solid var(--bamboo);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 850;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.primary-action:hover {
  background: var(--basalt-soft);
}

.primary-action:active {
  transform: translateY(2px);
}

.primary-action > span:last-child {
  color: var(--bamboo);
  font-size: 1.2rem;
}

.result-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.result-score {
  display: block;
  margin-top: 2px;
  color: var(--persimmon-dark);
  font-family: ui-monospace, monospace;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0;
}

.result-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  background: #dde8e5;
  border-radius: 6px;
}

.result-stats span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-stats strong {
  color: var(--pine);
  font-family: ui-monospace, monospace;
  font-size: 1rem;
}

.new-record {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 5px 8px;
  color: var(--cloud-bright);
  background: var(--persimmon-dark);
  border-radius: 5px;
  font-size: 0.69rem;
  font-weight: 900;
}

.input-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
}

.space-key {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: var(--pine);
  background: var(--cloud-bright);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
  font-size: 0.62rem;
}

.version-corner {
  position: fixed;
  z-index: 18;
  right: 5px;
  bottom: 4px;
  color: rgba(238, 242, 239, 0.62);
  font-family: ui-monospace, monospace;
  font-size: 0.58rem;
  pointer-events: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#fa-help-btn {
  min-width: 44px !important;
  min-height: 44px !important;
}

@media (max-width: 760px) and (orientation: portrait) {
  :root {
    --header-height: 56px;
  }

  .app-header {
    padding: 0 8px;
  }

  .back-link,
  .settings > summary {
    padding-inline: 8px;
    font-size: 0.8rem;
  }

  .header-mark {
    gap: 2px;
  }

  .header-mark span {
    width: 15px;
  }

  .header-mark span:nth-child(2) {
    width: 20px;
  }

  .header-mark span:nth-child(3) {
    width: 13px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 286px minmax(360px, 1fr);
    overflow: hidden;
  }

  .control-rail {
    grid-row: 1;
    padding: 13px 14px 10px;
    overflow: hidden;
  }

  .trail-stage {
    grid-row: 2;
    padding: 8px 10px 12px;
    border-top: 2px solid var(--pine-deep);
    border-right: 0;
  }

  .title-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 4px 12px;
    padding-bottom: 10px;
  }

  .trail-label {
    grid-column: 1 / -1;
    font-size: 0.7rem;
  }

  .title-block h1 {
    font-size: clamp(1.85rem, 9vw, 2.45rem);
  }

  .app-subtitle {
    max-width: 20ch;
    margin-top: 0;
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: right;
  }

  .score-strip {
    padding: 10px 0;
  }

  .score-strip dd {
    font-size: 1.15rem;
  }

  .phase-row {
    min-height: 35px;
  }

  .start-panel,
  .result-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(142px, 42%);
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding-top: 3px;
    flex: 0 0 auto;
  }

  .start-panel p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .primary-action {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .result-label,
  .result-score,
  .result-stats,
  .new-record {
    display: none;
  }

  .result-panel .primary-action {
    grid-column: 2;
  }

  .input-hint {
    min-height: 30px;
    margin-top: 4px;
    font-size: 0.64rem;
  }

  .stage-toolbar {
    min-height: 52px;
    padding-bottom: 8px;
  }

  .stage-emblem {
    width: 36px;
    height: 36px;
  }

  .stage-heading h2 {
    font-size: 0.88rem;
  }

  .stage-heading p {
    font-size: 0.68rem;
  }

  .sound-toggle {
    min-width: 44px;
    padding-inline: 10px;
  }

  .sound-toggle #sound-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .game-surface {
    min-height: 0;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --header-height: 48px;
  }

  .app-header {
    padding-inline: 8px;
  }

  .back-link,
  .settings > summary {
    min-height: 44px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 34vw, 286px);
  }

  .trail-stage {
    padding: 7px;
  }

  .stage-toolbar {
    min-height: 48px;
    padding: 0 2px 6px;
  }

  .stage-emblem {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }

  .stage-heading {
    gap: 8px;
  }

  .stage-heading h2 {
    font-size: 0.82rem;
  }

  .stage-heading p {
    font-size: 0.63rem;
  }

  .sound-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 5px 9px;
  }

  .sound-toggle #sound-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .game-surface {
    min-height: 0;
  }

  .control-rail {
    padding: 8px 10px 7px;
  }

  .title-block {
    padding-bottom: 7px;
  }

  .trail-label {
    font-size: 0.64rem;
  }

  .title-block h1 {
    margin-top: 1px;
    font-size: clamp(1.45rem, 5.4vh, 2rem);
    line-height: 1;
  }

  .app-subtitle {
    display: none;
  }

  .score-strip {
    padding: 7px 0;
  }

  .score-strip > div {
    padding-inline: 7px;
  }

  .score-strip dt {
    font-size: 0.58rem;
  }

  .score-strip dd {
    margin-top: 3px;
    font-size: 1rem;
  }

  .phase-row {
    min-height: 32px;
    font-size: 0.62rem;
  }

  .start-panel,
  .result-panel {
    margin-top: 0;
    padding-top: 3px;
    flex: 0 0 auto;
  }

  .start-panel p {
    display: none;
  }

  .primary-action {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 0.76rem;
  }

  .result-label {
    font-size: 0.58rem;
  }

  .result-score {
    font-size: 1.5rem;
  }

  .result-stats {
    gap: 4px;
    margin: 4px 0;
  }

  .result-stats > div {
    padding: 4px 5px;
  }

  .result-stats span {
    font-size: 0.54rem;
  }

  .new-record {
    display: none;
  }

  .input-hint {
    min-height: 28px;
    margin-top: 3px;
    font-size: 0.57rem;
  }

  .space-key {
    padding: 3px 5px;
    font-size: 0.54rem;
  }

  .length-readout {
    top: 8px;
    right: 8px;
  }

  .hold-cue {
    bottom: 8px;
  }
}

@media (max-width: 620px) and (max-height: 420px) and (orientation: landscape) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 216px;
  }

  .header-mark span:nth-child(1),
  .header-mark span:nth-child(4) {
    display: none;
  }

  .stage-heading p,
  .space-key {
    display: none;
  }

  .result-stats {
    display: none;
  }

  .result-score {
    margin-bottom: 4px;
  }

  #fa-help-btn {
    right: 224px !important;
    bottom: 8px !important;
  }
}

@media (max-width: 360px) {
  .header-mark {
    display: none;
  }
}

@media (pointer: coarse) {
  #game-canvas {
    cursor: default;
  }

  .space-key {
    display: none;
  }
}

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

  .feedback-stamp.show {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (forced-colors: active) {
  .header-mark span,
  .phase-indicator,
  .stage-emblem {
    border: 2px solid CanvasText;
  }

  .primary-action,
  .sound-toggle,
  .settings-panel,
  .game-surface {
    border: 2px solid CanvasText;
  }
}
