:root {
  --bg: #0b1020;
  --panel: #131a31;
  --ink: #f7f8fc;
  --sub: #9ea7c2;
  --accent: #e0b64b;
  --ok: #4ad991;
  --warn: #ff8a65;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 15% 15%, #1a274d, var(--bg) 55%);
  font-family: "Trebuchet MS", "Noto Sans JP", sans-serif;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  letter-spacing: 0.5px;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stats span {
  background: #1e2a4f;
  border: 1px solid #31457a;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--sub);
}

#timerLabel.timer-danger {
  color: #ff5b5b;
  border-color: #ff5b5b;
}

.timer-center {
  min-width: 140px;
  text-align: center;
}

.timer-center #timerLabel {
  display: inline-block;
  background: #1e2a4f;
  border: 1px solid #31457a;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--sub);
}

.timer-bar {
  width: 140px;
  height: 8px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: rgba(126, 145, 197, 0.25);
  overflow: hidden;
}

.timer-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #53d38f, #ffd86f);
  transition: width 0.2s linear, background-color 0.2s ease;
}

.timer-bar-fill.timer-danger {
  background: #ff5b5b;
}

/* ゲーム中以外は上部ゲームUIを非表示 */
body:not(.in-game) .stats,
body:not(.in-game) .timer-center {
  display: none;
}

.panel {
  margin-top: 20px;
  background: color-mix(in srgb, var(--panel), transparent 5%);
  border: 1px solid #2b3d73;
  border-radius: 14px;
  padding: 16px;
}

.legal-links {
  margin-top: 12px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.legal-links a {
  color: var(--sub);
  font-size: 0.9rem;
}

.legal-links a:hover {
  color: var(--accent);
}

.settings-button {
  display: none;
  position: fixed;
  right: 14px;
  top: 128px;
  z-index: 940;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(140, 171, 253, 0.5);
  background: rgba(8, 13, 28, 0.82);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.settings-menu {
  position: fixed;
  right: 14px;
  top: 176px;
  z-index: 940;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(140, 171, 253, 0.4);
  background: rgba(8, 13, 28, 0.92);
}

.settings-menu a {
  color: var(--sub);
  font-size: 0.9rem;
}

.settings-menu a:hover {
  color: var(--accent);
}

.settings-menu-link {
  color: var(--sub);
  font-size: 0.9rem;
  text-decoration: none;
}

.settings-menu-link:hover {
  color: var(--accent);
}

.score-info-panel {
  border: 1px solid rgba(140, 171, 253, 0.3);
  border-radius: 8px;
  padding: 8px;
  color: var(--sub);
  font-size: 0.84rem;
  line-height: 1.4;
}

.score-info-panel code {
  color: #d6def9;
}

.center {
  text-align: center;
}

#startScreen:not(.hidden),
#endScreen:not(.hidden) {
  display: flex;
  flex-direction: column;
}

#startScreen {
  position: relative;
  overflow: hidden;
  gap: 12px;
  align-items: center;
  margin: 36px auto 0;
  padding: 34px 24px 30px;
  max-width: 840px;
  border: 1px solid rgba(104, 141, 244, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 16%, rgba(220, 148, 61, 0.2), transparent 38%),
    radial-gradient(circle at 10% 82%, rgba(90, 139, 252, 0.26), transparent 44%),
    linear-gradient(180deg, rgba(14, 22, 45, 0.96), rgba(9, 13, 28, 0.96));
}

#startScreen::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(154, 182, 255, 0.16);
  border-radius: 14px;
  pointer-events: none;
}

#startScreen::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -44px;
  top: -58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2) 20%, transparent 34%),
    radial-gradient(circle at 64% 62%, rgba(78, 186, 118, 0.78), rgba(57, 146, 97, 0.14) 36%, transparent 58%),
    radial-gradient(circle at 46% 70%, rgba(103, 206, 146, 0.72), rgba(77, 168, 125, 0.12) 30%, transparent 52%),
    radial-gradient(circle at 60% 40%, rgba(74, 154, 242, 0.95), rgba(31, 92, 179, 0.72) 52%, rgba(15, 46, 100, 0.2) 78%, transparent 92%),
    radial-gradient(circle at 38% 34%, rgba(163, 215, 255, 0.76), rgba(36, 101, 193, 0.2) 68%);
  filter: blur(0.3px);
  opacity: 0.9;
  pointer-events: none;
}

#startScreen > * {
  position: relative;
  z-index: 1;
}

#startScreen .start-eyebrow {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(176, 199, 255, 0.35);
  background: rgba(14, 20, 38, 0.72);
  font-size: 0.72rem;
  letter-spacing: 1.4px;
  color: #cdd9ff;
}

#startScreen h2 {
  margin: 2px 0 0;
  font-size: clamp(1.9rem, 4.7vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #f8f9ff;
}

#startScreen .start-lead {
  max-width: 50ch;
  margin: 0;
  color: #c5d0f3;
  line-height: 1.75;
  font-size: 1.03rem;
}

#startScreen .start-rules {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

#startScreen .start-rules span {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(109, 145, 246, 0.45);
  background: rgba(10, 17, 35, 0.72);
  color: #e2e9ff;
  font-size: 0.88rem;
}

#startScreen .start-cta {
  margin-top: 8px;
  min-width: 220px;
  padding: 12px 22px;
  font-size: 1rem;
  box-shadow: 0 8px 24px rgba(228, 182, 75, 0.34);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#startScreen .start-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(228, 182, 75, 0.4);
}

.start-ranking-box {
  width: min(100%, 560px);
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(109, 145, 246, 0.45);
  border-radius: 12px;
  background: rgba(9, 14, 30, 0.72);
  text-align: left;
}

.start-ranking-box h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
  color: #e5ecff;
}

.footer-copyright {
  margin: 4px 0 0;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  color: #8d97b8;
}

.hidden {
  display: none;
}

.imageStage {
  display: grid;
  gap: 8px;
}

.photoFrame {
  overflow: visible;
  border: 1px solid #2d3f72;
  border-radius: 10px;
  background: #0f172d;
  display: grid;
  place-items: center;
  position: relative;
}

#photo {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  transition: max-height 0.22s ease;
  transform-origin: center center;
  touch-action: none;
}

.photo-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(6, 10, 22, 0.72);
  color: #dbe4ff;
  font-size: 0.92rem;
  z-index: 2;
}

.photo-loading.hidden {
  display: none;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffd97f;
  animation: spin 0.9s linear infinite;
  justify-self: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--sub);
  font-size: 0.95rem;
}

.meta a {
  color: var(--accent);
}

.satellite-marker-wrap {
  background: transparent;
  border: 0;
}

.satellite-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255, 179, 71, 0.9);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

#map {
  width: 100%;
  height: 320px;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #2d3f72;
}

#map,
#map.leaflet-container,
#map.leaflet-container * {
  cursor: crosshair !important;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid #3e518a;
  background: #1d2a52;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(90deg, #c09a36, var(--accent));
  border-color: #f4cc67;
  color: #231c0d;
  font-weight: 700;
}

.result {
  margin-top: 12px;
  min-height: 52px;
  border-radius: 10px;
  border: 1px dashed #3d5185;
  padding: 10px;
  color: var(--sub);
}

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

.result.good {
  border-color: color-mix(in srgb, var(--ok), #3d5185 40%);
}

.result.bad {
  border-color: color-mix(in srgb, var(--warn), #3d5185 40%);
}

#finalScore {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  color: #f5f8ff;
  text-shadow: 0 6px 22px rgba(35, 88, 189, 0.35);
}

#summaryMap {
  width: 100%;
  height: 360px;
  border: 1px solid #2d3f72;
  border-radius: 10px;
}

.summary-layout {
  margin: 14px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}

.summary-list {
  order: 1;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

#summaryMap {
  order: 2;
}

.summary-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid #32457d;
  border-radius: 10px;
  background: rgba(16, 24, 46, 0.75);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.summary-item:hover {
  border-color: #6f8fe0;
  transform: translateY(-1px);
}

.summary-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.summary-meta {
  display: grid;
  gap: 4px;
  font-size: 1rem;
  color: var(--sub);
}

.summary-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-tile-post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 217, 127, 0.55);
  background: rgba(8, 13, 28, 0.78);
  color: #ffd97f;
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.summary-meta strong {
  min-width: 0;
  color: var(--ink);
}

.summary-photo-marker-wrap {
  background: transparent;
  border: 0;
}

.summary-photo-marker {
  width: 56px;
  height: 42px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.summary-photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summary-popup img {
  width: 180px;
  max-width: 40vw;
  border-radius: 6px;
  margin-bottom: 6px;
}

.summary-viewer {
  position: fixed;
  inset: 0;
  z-index: 980;
  background: rgba(4, 7, 14, 0.92);
}

.summary-viewer-meta {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 982;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  max-width: calc(100vw - 70px);
  border-radius: 10px;
  border: 1px solid rgba(142, 171, 252, 0.35);
  background: rgba(8, 13, 28, 0.82);
  color: #e4ebff;
}

.summary-viewer-meta a {
  color: #ffd97f;
}

#summaryViewerPost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 217, 127, 0.72);
  background: linear-gradient(90deg, #ffd775, #ffba4d);
  color: #271802;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(255, 188, 79, 0.35);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.summary-viewer-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.summary-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 983;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(142, 171, 252, 0.48);
  background: rgba(8, 13, 28, 0.84);
  color: #f2f6ff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#summaryViewerImage {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.summary-viewer-map-wrap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 982;
  width: min(34vw, 420px);
  height: min(34vh, 300px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(142, 171, 252, 0.45);
  background: rgba(8, 13, 28, 0.88);
}

#summaryViewerMap {
  width: 100%;
  height: 100%;
}

body.in-game {
  overflow: hidden;
}

body.in-game .app {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.in-game .topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 920;
  pointer-events: none;
}

body.in-game .stats span {
  background: rgba(9, 14, 30, 0.78);
  border: 1px solid rgba(142, 171, 252, 0.35);
  color: #e8edff;
  backdrop-filter: blur(6px);
}

body.in-game .topbar h1 {
  background: rgba(9, 14, 30, 0.78);
  border: 0;
  color: #e8edff;
  backdrop-filter: blur(6px);
  margin-left: 16px;
  margin-top: 8px;
  text-align: left;
}

body.in-game .stats {
  justify-content: flex-end;
  margin-right: 50px;
}

body.in-game .timer-center {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 940;
}

body.in-game .timer-center #timerLabel,
body.in-game .timer-bar {
  backdrop-filter: blur(6px);
}

body.in-game #gameScreen {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

body.in-game .imageStage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 930;
  width: 100vw;
  padding: 40px 12px 84px;
  background: #05070f;
  place-items: center;
}

body.in-game #photo {
  width: 100%;
  max-height: calc(100vh - 170px);
}

body.in-game .photoFrame {
  width: min(96vw, 1500px);
  border-width: 0;
  border-radius: 0;
  background: transparent;
}

body.in-game .meta {
  position: fixed;
  top: 58px;
  left: 28px;
  z-index: 938;
  width: max-content;
  justify-content: flex-start;
  gap: 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  white-space: normal;
  text-align: left;
}

body.in-game .mapPopup {
  position: fixed;
  right: 12px;
  bottom: 86px;
  z-index: 936;
  width: min(74vw, 760px);
  height: min(70vh, 560px);
  border-radius: 12px;
  border: 1px solid rgba(140, 171, 253, 0.38);
  background: rgba(8, 13, 28, 0.86);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transform-origin: right bottom;
  transform: scale(0.48);
  will-change: transform;
  transition: transform 0.18s ease;
}

body.in-game .mapPopup.expanded {
  transform: scale(1);
}

body.in-game .mapPopupHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--sub);
  padding: 6px 8px;
  border-bottom: 1px solid rgba(140, 171, 253, 0.2);
}

.mapStyleControl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d3ddff;
  font-size: 0.75rem;
}

.mapStyleControl select {
  border: 1px solid rgba(142, 171, 252, 0.4);
  border-radius: 6px;
  background: rgba(8, 13, 28, 0.85);
  color: #e8edff;
  padding: 4px 6px;
  font-size: 0.74rem;
}

.start-map-style {
  margin-top: 2px;
}

body.in-game .mapPopup #map {
  width: 100%;
  height: calc(100% - 30px);
  margin: 0;
  border: 0;
  border-radius: 0;
}

body.in-game .actions {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 930;
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 13, 28, 0.8);
  border: 1px solid rgba(140, 171, 253, 0.38);
}

body.in-game .result {
  display: none;
  position: fixed;
  left: 12px;
  bottom: 18px;
  z-index: 930;
  width: min(38vw, 520px);
  margin: 0;
  background: rgba(8, 13, 28, 0.8);
  backdrop-filter: blur(8px);
}

body.in-game.answer-revealed .result {
  display: block;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(72vw, 760px);
  text-align: center;
  font-size: clamp(1.2rem, 2.3vw, 2rem);
  padding: 14px 20px;
  border-width: 2px;
  z-index: 945;
}

body.in-game .legal-links {
  display: none;
}

body.in-game .settings-button {
  display: grid;
  place-items: center;
  top: 18px;
  right: 12px;
  width: auto;
  height: auto;
  padding: 6px 12px;
  line-height: 1;
  font-size: 18px;
  border-radius: 999px;
  background: rgba(9, 14, 30, 0.78);
  border: 1px solid rgba(142, 171, 252, 0.35);
  color: #e8edff;
  backdrop-filter: blur(6px);
}

body.in-game .settings-menu {
  top: 56px;
  right: 12px;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  #startScreen {
    margin-top: 24px;
    padding: 24px 14px 20px;
    gap: 10px;
  }

  #startScreen::after {
    width: 128px;
    height: 128px;
    right: -36px;
    top: -42px;
  }

  #startScreen .start-lead {
    font-size: 0.93rem;
    line-height: 1.6;
  }

  #startScreen .start-rules {
    gap: 8px;
  }

  #startScreen .start-rules span {
    font-size: 0.8rem;
    padding: 7px 10px;
  }

  #startScreen .start-cta {
    width: 100%;
    min-width: 0;
  }

  .start-ranking-box {
    padding: 8px 10px;
  }

  .start-ranking-box h3 {
    font-size: 0.88rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  #map {
    height: 280px;
  }

  .meta {
    flex-direction: column;
  }

  .summary-layout {
    grid-template-columns: 1fr;
  }

  #summaryMap {
    height: 300px;
  }

  .summary-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-height: none;
  }

  .summary-viewer-map-wrap {
    width: min(56vw, 320px);
    height: min(38vh, 240px);
    right: 8px;
    bottom: 8px;
  }

  .summary-viewer-meta {
    top: 8px;
    left: 8px;
    font-size: 0.82rem;
    max-width: calc(100vw - 56px);
    gap: 6px;
  }

  body.in-game .topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  body.in-game .topbar h1 {
    font-size: 0.95rem;
    margin-left: 8px;
    margin-top: 0;
    white-space: nowrap;
  }

  body.in-game .stats {
    flex-wrap: nowrap;
    gap: 6px;
    margin-left: auto;
    margin-right: 0;
    justify-content: flex-end;
  }

  body.in-game .stats span {
    padding: 4px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  body.in-game .timer-center {
    top: 8px;
  }

  body.in-game .timer-bar {
    width: 110px;
    margin-top: 4px;
  }

  body.in-game .imageStage {
    top: 0;
    left: 0;
    right: 0;
    bottom: 50vh;
    width: 100vw;
    padding: 44px 8px 8px;
    place-items: center;
  }

  body.in-game #photo {
    width: 100%;
    max-height: calc(50vh - 90px);
  }

  body.in-game .meta {
    top: auto;
    left: auto;
    right: 8px;
    bottom: calc(50vh + 8px);
    width: auto;
    gap: 8px;
    padding: 0;
    font-size: 0.72rem;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  body.in-game .settings-button {
    top: 40px;
    right: 8px;
    padding: 4px 8px;
    font-size: 16px;
  }

  body.in-game .settings-menu {
    top: 86px;
    right: 8px;
  }

  body.in-game .mapPopup {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 50vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: none;
  }

  body.in-game .mapPopup.expanded {
    transform: none;
  }

  body.in-game .actions {
    left: 8px;
    right: 8px;
    bottom: 8px;
    transform: none;
    justify-content: center;
    z-index: 960;
  }

  body.in-game .result {
    left: 8px;
    right: 8px;
    bottom: 78px;
    width: auto;
  }

  body.in-game.answer-revealed .result {
    left: 50%;
    right: auto;
    top: 60%;
    bottom: auto;
    width: 88vw;
    font-size: 1.15rem;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
  body.in-game .imageStage {
    right: 0;
    bottom: 0;
    width: 100vw;
    padding: 44px 8px 8px;
  }

  body.in-game #photo {
    width: 100%;
    max-height: calc(100vh - 96px);
  }

  body.in-game .meta {
    left: 10px;
    right: auto;
    bottom: 10px;
    max-width: calc(50vw - 20px);
    gap: 6px;
    font-size: 0.72rem;
    overflow: hidden;
  }

  body.in-game .mapPopup {
    top: auto;
    right: 8px;
    left: auto;
    bottom: 74px;
    width: min(48vw, 620px);
    height: min(62vh, 460px);
    border-radius: 12px;
    border: 1px solid rgba(140, 171, 253, 0.38);
    transform: none;
  }

  body.in-game .mapPopup.expanded {
    transform: none;
  }

  body.in-game .actions {
    left: auto;
    right: 8px;
    width: min(48vw, 620px);
    bottom: 8px;
    transform: none;
    justify-content: center;
  }

  body.in-game .result {
    left: 8px;
    right: auto;
    bottom: 76px;
    width: min(42vw, 480px);
  }

  body.in-game.answer-revealed .result {
    left: 50%;
    top: 52%;
    right: auto;
    bottom: auto;
    width: min(72vw, 820px);
  }
}

.ranking-box {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #32457d;
  border-radius: 10px;
  background: rgba(16, 24, 46, 0.55);
}

.ranking-box h3 {
  margin: 0 0 8px;
}

.ranking-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.ranking-form input {
  min-width: 180px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #415a95;
  background: #111a35;
  color: var(--ink);
}

.ranking-status {
  margin: 8px 0;
  color: var(--sub);
  min-height: 1.2em;
}

.ranking-list {
  margin: 0;
  padding-left: 22px;
  text-align: left;
}

.ranking-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  color: var(--sub);
}

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

.ranking-list small {
  color: #8d97b8;
}
