:root {
  color-scheme: light;
  --paper: #eee8dc;
  --paper-soft: #f8f3ea;
  --ink: #10141a;
  --ink-soft: #5d6570;
  --blue: #0b64bd;
  --blue-dark: #061b37;
  --gold: #b9934d;
  --line: rgba(16, 20, 26, .14);
  --line-strong: rgba(16, 20, 26, .26);
  --radius: 8px;
  --shadow: 0 28px 90px rgba(20, 24, 30, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic", "Yu Gothic UI", "Hiragino Sans", Meiryo, system-ui, sans-serif;
}

body {
  min-width: 1120px;
  background:
    linear-gradient(90deg, rgba(38, 34, 29, .028) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, #f4f0e7 0%, #e7dfd1 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  width: 46vw;
  height: 46vw;
  left: 32vw;
  top: 18vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 30, 45, .2) 0 7%, rgba(11, 30, 45, .08) 14%, rgba(11, 30, 45, .02) 34%, transparent 60%);
  filter: blur(18px);
  opacity: .62;
  pointer-events: none;
  animation: sumi-drift 18s ease-in-out infinite alternate;
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 118px 1fr;
  width: 100vw;
  height: 100dvh;
}

.brand-rail {
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(246, 242, 232, .72);
  backdrop-filter: blur(22px);
}

.play-screen.is-active ~ * {
  pointer-events: auto;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}

.brand-seal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 21, 28, .18);
  border-radius: 50%;
  background: #0a2a50;
  box-shadow: 0 14px 34px rgba(11, 36, 74, .18);
}

.brand-seal img {
  width: 108%;
  height: 108%;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-weight: 800;
  line-height: 1.05;
}

.brand-copy span {
  writing-mode: vertical-rl;
}

.brand-copy span:first-child {
  font-size: 22px;
  letter-spacing: .06em;
}

.brand-copy span:last-child {
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .18em;
}

.game-root {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: 34px;
  opacity: 0;
}

.screen.is-active {
  display: grid;
  opacity: 1;
  animation: screen-in .45s cubic-bezier(.19, 1, .22, 1) both;
}

.start-screen {
  grid-template-columns: minmax(680px, 1fr) 270px;
  align-items: center;
  gap: 36px;
}

.brand-visual {
  position: relative;
  height: min(82vh, 760px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #061426;
  box-shadow: var(--shadow);
}

.brand-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.04) brightness(.84);
  transform: scale(1.02);
  animation: image-breathe 15s ease-in-out infinite alternate;
  will-change: transform;
}

.brand-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 8, 14, .18), transparent 34%, rgba(4, 8, 14, .44)),
    linear-gradient(180deg, transparent 42%, rgba(4, 8, 14, .72));
}

.brand-title {
  position: absolute;
  left: 44px;
  bottom: 42px;
  color: #fff9e8;
}

.brand-title p,
.eyebrow {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand-title p {
  color: rgba(255, 249, 232, .72);
}

.brand-title h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(70px, 9vw, 138px);
  line-height: .85;
  letter-spacing: 0;
  text-shadow: 0 22px 44px rgba(0, 0, 0, .54);
}

.brand-title span {
  display: block;
  margin-top: 18px;
  color: rgba(255, 249, 232, .78);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.start-game-button,
.ghost-button,
.scene-card {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background-color .22s ease, color .22s ease, opacity .22s ease;
}

.start-game-button {
  min-height: 62px;
  padding: 0 34px;
  background: var(--ink);
  color: var(--paper-soft);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: .2em;
  text-transform: uppercase;
  box-shadow: 0 20px 48px rgba(16, 20, 26, .2);
}

.start-game-button:hover,
.ghost-button:hover,
.scene-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 100, 189, .44);
}

.start-game-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

.lobby-screen {
  grid-template-columns: 360px minmax(360px, 1fr) 330px;
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-items: stretch;
}

.lobby-copy,
.score-panel,
.ranking-panel,
.gameover-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(248, 243, 234, .64);
  box-shadow: 0 18px 54px rgba(20, 24, 30, .11);
  backdrop-filter: blur(22px);
}

.lobby-copy {
  grid-column: 1;
  padding: 28px;
}

.lobby-copy h2,
.gameover-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 42px;
  line-height: .98;
}

.lobby-copy p:last-child,
.gameover-card > p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.6;
}

.score-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
}

.score-panel div {
  padding: 22px 26px;
  background: rgba(255, 255, 255, .28);
}

.score-panel span,
.play-hud span {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.score-panel strong,
.play-hud strong {
  display: block;
  margin-top: 6px;
  color: var(--blue-dark);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 40px;
  line-height: 1;
}

.scene-grid {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  min-height: 0;
}

.scene-card {
  position: relative;
  overflow: hidden;
  width: min(430px, 100%);
  height: min(calc(100dvh - 68px), 860px);
  aspect-ratio: 9 / 16;
  padding: 0;
  border-radius: var(--radius);
  background: #061426;
  color: #fff9e8;
  text-align: left;
  box-shadow: 0 18px 54px rgba(20, 24, 30, .12);
}

.scene-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(.9) brightness(.86);
  transform: scale(1);
  transition: transform .7s cubic-bezier(.19, 1, .22, 1), filter .35s ease;
  will-change: transform;
}

.scene-card:hover img {
  transform: scale(1.025);
  filter: saturate(1) brightness(.88);
}

.scene-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1), transparent 36%, rgba(0, 0, 0, .72));
}

.scene-card div {
  position: absolute;
  z-index: 1;
  left: 22px;
  right: 22px;
  bottom: 20px;
}

.scene-card span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 249, 232, .72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.scene-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 34px;
  line-height: .98;
}

.ranking-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 16px;
  min-height: 0;
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 30px;
  line-height: 1;
}

.ghost-button {
  min-height: 38px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .28);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.player-card {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 10, 16, .42);
  backdrop-filter: blur(12px);
}

.profile-sheet[hidden] {
  display: none;
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 10, 16, .46);
  backdrop-filter: blur(14px);
}

.share-sheet[hidden] {
  display: none;
}

.profile-editor {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(185, 147, 77, .42);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(248, 243, 234, .96);
  box-shadow: 0 28px 80px rgba(20, 24, 30, .34);
}

.share-panel {
  width: min(470px, 100%);
  max-height: calc(100dvh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border: 1px solid rgba(185, 147, 77, .42);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(248, 243, 234, .97);
  box-shadow: 0 28px 80px rgba(20, 24, 30, .34);
}

.profile-editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.share-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.profile-editor-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 25px;
  line-height: 1;
}

.share-panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 25px;
  line-height: 1;
}

.profile-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.profile-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(185, 147, 77, .42);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}

.share-preview {
  width: min(100%, 270px);
  min-height: 0;
  max-height: min(55dvh, 520px);
  justify-self: center;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 1px solid rgba(185, 147, 77, .38);
  border-radius: 8px;
  background: #061426;
  box-shadow: 0 18px 46px rgba(20, 24, 30, .22);
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.share-buttons .start-game-button {
  grid-column: 1 / -1;
  min-height: 58px;
}

.share-buttons .ghost-button {
  min-height: 48px;
  border-color: rgba(185, 147, 77, .32);
  background: rgba(255, 255, 255, .42);
}

.ranking-list {
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.ranking-list strong {
  color: var(--ink);
}

.play-screen {
  --art-h: min(94dvh, 958px);
  --art-w: calc(var(--art-h) * .5625);
  padding: 0;
  background:
    radial-gradient(ellipse at 17% 67%, rgba(30, 34, 36, .13), transparent 18%),
    radial-gradient(ellipse at 92% 88%, rgba(30, 34, 36, .11), transparent 17%),
    radial-gradient(ellipse at 16% 92%, rgba(185, 147, 77, .12), transparent 18%);
}

.play-screen.is-active {
  display: block;
}

.play-screen::before,
.play-screen::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: .32;
  filter: blur(.2px);
}

.play-screen::before {
  left: 54px;
  bottom: 56px;
  width: 310px;
  height: 190px;
  background: radial-gradient(ellipse, rgba(28, 30, 31, .18), transparent 66%);
}

.play-screen::after {
  right: 32px;
  bottom: 72px;
  width: 350px;
  height: 260px;
  background:
    linear-gradient(113deg, transparent 0 45%, rgba(16, 20, 26, .28) 46% 47%, transparent 48%),
    linear-gradient(150deg, transparent 0 50%, rgba(16, 20, 26, .22) 51% 52%, transparent 53%),
    radial-gradient(ellipse at 70% 80%, rgba(16, 20, 26, .1), transparent 58%);
}

.play-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.play-hud > div,
.play-hud .ghost-button {
  position: absolute;
  pointer-events: auto;
}

.play-hud > div {
  min-width: 210px;
  text-align: center;
}

.play-hud span {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .32em;
  text-transform: uppercase;
}

.play-hud span::before,
.play-hud span::after {
  content: "";
  height: 1px;
  background: rgba(185, 147, 77, .38);
}

.play-hud strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 76px;
  font-weight: 500;
  line-height: .95;
  letter-spacing: 0;
}

.hud-score {
  left: clamp(60px, 7vw, 132px);
  top: 41%;
}

.hud-score::after,
.hud-stage::after {
  content: "";
  display: block;
  width: 210px;
  height: 1px;
  margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, rgba(185, 147, 77, .54), transparent);
}

.hud-score strong {
  font-size: 82px;
}

.hud-time {
  right: clamp(30px, 4.6vw, 76px);
  top: 30%;
  width: 260px;
  height: 260px;
  display: grid;
  place-content: center;
}

.hud-time::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(185, 147, 77, .66);
  border-radius: 50%;
  background: rgba(248, 243, 234, .22);
}

.hud-time::after {
  content: "";
  position: absolute;
  inset: 22px 9px 5px 34px;
  border: 12px solid rgba(16, 20, 26, .72);
  border-left-color: transparent;
  border-bottom-color: rgba(16, 20, 26, .16);
  border-radius: 50%;
  transform: rotate(-21deg);
  mask-image: linear-gradient(90deg, transparent 0 20%, #000 38% 100%);
}

.hud-time span,
.hud-time strong {
  position: relative;
  z-index: 1;
}

.hud-time span {
  display: block;
  margin-bottom: 8px;
}

.hud-time span::before,
.hud-time span::after {
  display: none;
}

.hud-time strong {
  margin-top: 0;
  font-size: 92px;
}

.hud-stage {
  display: none;
  right: clamp(38px, 5vw, 86px);
  top: 66%;
  min-width: 250px;
}

.hud-stage strong {
  font-size: 48px;
  letter-spacing: .04em;
}

.play-hud .ghost-button {
  right: 38px;
  top: 46px;
  min-width: 120px;
  min-height: 46px;
  border-color: rgba(185, 147, 77, .44);
  background: rgba(248, 243, 234, .36);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.art-frame {
  position: absolute;
  z-index: 2;
  left: 45.5%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  width: var(--art-w);
  height: var(--art-h);
  aspect-ratio: 9 / 16;
  max-width: min(560px, calc(100vw - 690px));
  max-height: calc(100dvh - 56px);
  border: 2px solid rgba(185, 147, 77, .82);
  border-radius: var(--radius);
  background: #061426;
  box-shadow:
    0 26px 72px rgba(20, 24, 30, .3),
    0 0 0 1px rgba(255, 250, 236, .52) inset;
}

.art-hitbox {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #061426;
  cursor: crosshair;
}

.art-hitbox img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  filter: saturate(.92) contrast(1.04) brightness(.92);
  transform: scale(1);
  transition: opacity .35s ease, transform 8s ease, filter .5s ease;
  will-change: opacity, transform;
}

body.is-hunting .art-hitbox img {
  filter: saturate(1.06) contrast(1.08) brightness(.9);
  transform: scale(1.018);
}

body.stage-changing .art-hitbox img {
  opacity: .56;
  transform: scale(1.012);
}

body.stage-image-ready .art-hitbox img {
  opacity: 1;
}

.art-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(2, 10, 18, .06), transparent 18%, transparent 82%, rgba(2, 10, 18, .08)),
    linear-gradient(90deg, rgba(2, 10, 18, .1), transparent 10%, transparent 90%, rgba(2, 10, 18, .1));
  pointer-events: none;
}

.coin-marker {
  position: absolute;
  z-index: 4;
  width: 56px;
  height: 56px;
  left: 50%;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.72);
  border: 1px solid rgba(99, 197, 255, .95);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(242, 250, 255, .95) 0 8%, rgba(22, 124, 222, .55) 9% 32%, transparent 34%),
    radial-gradient(circle, rgba(99, 197, 255, .24), transparent 68%);
  box-shadow: 0 0 0 10px rgba(99, 197, 255, .1), 0 0 34px rgba(99, 197, 255, .72);
  transition: opacity .26s ease, transform .26s ease;
}

.coin-marker.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: coin-breathe 2.2s ease-in-out infinite;
}

.coin-marker.is-found {
  border-color: rgba(255, 244, 196, .95);
  box-shadow: 0 0 0 12px rgba(185, 147, 77, .14), 0 0 42px rgba(99, 197, 255, .86);
}

.click-feedback {
  position: absolute;
  z-index: 4;
  width: 46px;
  height: 46px;
  left: 50%;
  top: 50%;
  opacity: 0;
  border: 1px solid rgba(247, 243, 234, .92);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.8);
}

.click-feedback.is-active {
  animation: ripple .64s ease-out;
}

.stage-location-card {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 46%, rgba(4, 14, 28, .36), rgba(4, 14, 28, .08) 58%, transparent 74%);
  color: #fff9e8;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

body.stage-location-active .stage-location-card {
  opacity: 1;
  visibility: visible;
}

.stage-location-map {
  position: relative;
  width: min(520px, calc(100% - 30px));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 236, .54);
  border-radius: var(--radius);
  background: #061426;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, .34),
    0 0 0 1px rgba(185, 147, 77, .42) inset;
  transform: translateY(-4px) scale(.98);
  transition: transform .2s ease;
}

body.stage-location-active .stage-location-map {
  animation: location-map-in .42s cubic-bezier(.19, 1, .22, 1) both;
}

.stage-location-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(2, 10, 18, .06), transparent 46%, rgba(2, 10, 18, .58)),
    radial-gradient(circle at 50% 52%, transparent 44%, rgba(2, 10, 18, .28));
  pointer-events: none;
}

.stage-location-map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04) brightness(.92);
}

.stage-location-card strong {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  z-index: 3;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255, 250, 236, .28);
  border-radius: 6px;
  background: rgba(4, 14, 28, .72);
  color: #fff9e8;
  font-size: clamp(10px, .9vw, 13px);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .54);
  backdrop-filter: blur(8px);
}

.stage-location-pin {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52%;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -100%) rotate(-45deg);
  border: 1px solid rgba(255, 250, 236, .92);
  border-radius: 50% 50% 50% 0;
  background: #63c5ff;
  box-shadow: 0 0 0 7px rgba(99, 197, 255, .2), 0 0 24px rgba(99, 197, 255, .95);
  transition: left .32s ease, top .32s ease;
}

.stage-location-pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff9e8;
}

.art-caption {
  position: absolute;
  z-index: 5;
  left: 30px;
  right: 30px;
  bottom: 28px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #fff9e8;
  text-align: center;
  pointer-events: none;
}

.play-screen .art-caption {
  display: none;
}

.art-caption p {
  display: none;
  margin: 0 0 7px;
  color: rgba(255, 241, 204, .82);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.art-caption h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(34px, 3.4vw, 58px);
  line-height: .92;
  text-shadow: 0 12px 26px rgba(0, 0, 0, .52);
}

.art-caption > span {
  width: min(360px, 100%);
  color: rgba(255, 252, 242, .78);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.gameover-screen {
  grid-template-columns: minmax(540px, 1fr) 360px;
  align-items: center;
  gap: 30px;
}

.gameover-card {
  padding: 42px;
}

.gameover-card h2 {
  font-size: clamp(64px, 8vw, 112px);
}

.gameover-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.gameover-actions .start-game-button {
  flex: 1 1 240px;
  min-height: 68px;
  font-size: 17px;
}

.gameover-actions .ghost-button {
  flex: 0 1 132px;
}

.final-ranking {
  grid-column: auto;
  grid-row: auto;
  min-height: 520px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 243, 234, .9);
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(16, 20, 26, .18);
  backdrop-filter: blur(18px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.stage-found .art-frame {
  animation: found-glow .85s ease-out;
}

@keyframes sumi-drift {
  from {
    transform: translate3d(-5vw, -2vh, 0) scale(.94);
    opacity: .4;
  }
  to {
    transform: translate3d(6vw, 4vh, 0) scale(1.08);
    opacity: .7;
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes image-breathe {
  from {
    transform: scale(1.01);
  }
  to {
    transform: scale(1.06);
  }
}

@keyframes ripple {
  0% {
    opacity: .95;
    transform: translate(-50%, -50%) scale(.58);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.25);
  }
}

@keyframes coin-breathe {
  0%, 100% {
    box-shadow: 0 0 0 8px rgba(99, 197, 255, .08), 0 0 30px rgba(99, 197, 255, .58);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(99, 197, 255, .12), 0 0 46px rgba(99, 197, 255, .82);
  }
}

@keyframes found-glow {
  0% {
    box-shadow: var(--shadow);
  }
  34% {
    box-shadow: 0 0 0 1px rgba(99, 197, 255, .28), 0 28px 96px rgba(11, 100, 189, .28);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes location-card-in {
  from {
    opacity: .3;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes location-map-in {
  from {
    opacity: .2;
    transform: translateY(8px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  body {
    min-width: 980px;
  }

  .lobby-screen {
    grid-template-columns: 300px minmax(320px, 1fr) 290px;
  }

  .scene-card strong {
    font-size: 25px;
  }
}

@media (max-width: 700px) {
  body {
    min-width: 0;
  }

  body::before {
    width: 92vw;
    height: 92vw;
    left: 18vw;
    top: 20vh;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 70px 1fr;
  }

  .brand-rail {
    align-items: center;
    justify-items: start;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand-seal {
    width: 48px;
    height: 48px;
  }

  .brand-copy {
    justify-items: start;
    gap: 3px;
  }

  .brand-copy span {
    writing-mode: horizontal-tb;
  }

  .brand-copy span:first-child {
    font-size: 18px;
    letter-spacing: .08em;
  }

  .brand-copy span:last-child {
    font-size: 9px;
    letter-spacing: .2em;
  }

  .game-root {
    height: calc(100dvh - 70px);
  }

  body[data-screen="play"] .app-shell {
    grid-template-rows: 1fr;
  }

  body[data-screen="play"] .brand-rail {
    display: none;
  }

  body[data-screen="play"] .game-root {
    height: 100dvh;
  }

  .screen {
    padding: 14px;
  }

  .start-screen {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 14px;
    align-items: stretch;
  }

  .brand-visual {
    height: auto;
    min-height: 0;
    border-radius: 8px;
  }

  .brand-visual img {
    object-position: center;
  }

  .brand-title {
    left: 20px;
    right: 18px;
    bottom: 22px;
  }

  .brand-title p,
  .brand-title span {
    font-size: 10px;
  }

  .brand-title h1 {
    font-size: clamp(48px, 18vw, 72px);
  }

  .start-game-button {
    width: 100%;
    min-height: 58px;
  }

  .lobby-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .lobby-copy {
    display: none;
  }

  .score-panel {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(3, 1fr);
    border-radius: 8px;
  }

  .score-panel div {
    padding: 12px 10px;
    text-align: center;
  }

  .score-panel span,
  .play-hud span {
    font-size: 8px;
    letter-spacing: .12em;
  }

  .score-panel strong {
    font-size: 26px;
  }

  .scene-grid {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
    justify-items: center;
  }

  .scene-card {
    width: min(100%, 362px);
    height: 100%;
    aspect-ratio: auto;
    max-height: 100%;
    box-shadow: 0 18px 44px rgba(20, 24, 30, .18);
  }

  .scene-card img {
    object-fit: cover;
  }

  .scene-card div {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .scene-card strong {
    font-size: clamp(22px, 8vw, 34px);
  }

  .ranking-panel {
    grid-column: 1;
    grid-row: 3;
    grid-template-rows: auto auto;
    gap: 8px;
    min-height: 0;
    padding: 12px;
    align-self: end;
  }

  .ranking-panel .panel-heading {
    align-items: center;
  }

  .ranking-panel .eyebrow,
  .player-card,
  .ranking-list li:nth-child(n+4) {
    display: none;
  }

  .panel-heading h3 {
    font-size: 20px;
  }

  .ranking-list li {
    min-height: 30px;
    font-size: 12px;
  }

  .play-screen {
    --art-w: min(104vw, calc((100dvh - 58px) * .5625));
    --art-h: calc(var(--art-w) * 1.7777778);
    grid-template-rows: auto auto;
    align-content: start;
    gap: 3px;
    padding: 3px 0 0;
    background:
      radial-gradient(ellipse at 14% 76%, rgba(30, 34, 36, .12), transparent 20%),
      radial-gradient(ellipse at 96% 88%, rgba(30, 34, 36, .1), transparent 18%);
  }

  .play-screen.is-active {
    display: grid;
  }

  .play-screen::before,
  .play-screen::after {
    opacity: .16;
  }

  .play-hud {
    position: relative;
    inset: auto;
    z-index: 6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 44px;
    gap: 4px;
    align-items: stretch;
    padding: 0 4px;
    pointer-events: auto;
  }

  .play-hud > div,
  .play-hud .ghost-button {
    position: static;
    min-width: 0;
    border: 1px solid rgba(185, 147, 77, .36);
    border-radius: 7px;
    background: rgba(248, 243, 234, .7);
    text-align: center;
    pointer-events: auto;
    backdrop-filter: blur(10px);
  }

  .play-hud span {
    display: block;
    gap: 0;
    color: var(--ink-soft);
    font-size: 8px;
    letter-spacing: .12em;
  }

  .play-hud span::before,
  .play-hud span::after {
    display: none;
  }

  .play-hud strong {
    margin-top: 2px;
    color: var(--blue-dark);
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
  }

  .hud-score,
  .hud-time {
    display: grid;
    min-height: 48px;
    align-content: center;
    padding: 4px 5px 5px;
  }

  .hud-score::after,
  .hud-stage::after,
  .hud-time::before,
  .hud-time::after {
    display: none;
  }

  .hud-score strong {
    font-size: 23px;
  }

  .hud-time {
    width: auto;
    height: auto;
    display: block;
  }

  .hud-time span {
    margin-bottom: 0;
  }

  .hud-time strong {
    margin-top: 2px;
    color: var(--ink);
    font-size: 23px;
  }

  .hud-stage {
    display: none;
  }

  .hud-stage strong {
    font-size: 28px;
  }

  .play-hud .ghost-button {
    min-width: 0;
    width: auto;
    min-height: 48px;
    padding: 0;
    border-color: rgba(185, 147, 77, .36);
    border-radius: 7px;
    background: rgba(248, 243, 234, .7);
    font-size: 0;
  }

  .play-hud .ghost-button::after {
    content: "X";
    font-size: 14px;
    letter-spacing: 0;
  }

  .art-frame {
    position: relative;
    align-self: start;
    justify-self: center;
    left: auto;
    top: auto;
    transform: none;
    width: var(--art-w);
    height: var(--art-h);
    max-width: none;
    max-height: none;
    border-width: 1px;
    box-shadow: 0 18px 46px rgba(20, 24, 30, .25);
  }

  .coin-marker {
    width: 40px;
    height: 40px;
  }

  .stage-location-card {
    padding: 16px;
  }

  .stage-location-card strong {
    left: 10px;
    right: 10px;
    bottom: 9px;
    padding: 8px 9px;
    font-size: 10px;
    line-height: 1.14;
  }

  .stage-location-map {
    width: min(340px, calc(100% - 8px));
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .stage-location-pin {
    width: 13px;
    height: 13px;
  }

  .stage-location-pin::after {
    inset: 4px;
  }

  .gameover-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .gameover-card {
    padding: 26px 20px;
  }

  .gameover-card h2 {
    font-size: clamp(56px, 18vw, 78px);
  }

  .gameover-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .gameover-actions .start-game-button {
    grid-column: 1 / -1;
  }

  .final-ranking {
    min-height: 0;
  }
}

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