/* Plats-specific styles. shared/styles.css carries tokens + base + components. */

:root {
  --game: #A4C49A;        /* Geo: Foto signature color */
  --game-ink: #1a1817;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plats-round-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.plats-split > * { min-height: 0; }
@media (max-width: 720px) {
  .plats-split { grid-template-columns: 1fr; }
}

.plats-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 0;
  margin-bottom: 18px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.plats-breakdown-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.plats-breakdown-row:last-child { border-bottom: none; }
/* Distance-tier markers — warm brand heat scale, replaces the glossy emoji on screen.
   (The shareable text string still uses emoji; you can't paste a CSS dot.) */
.plats-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  flex: none;
  align-self: center;
  justify-self: center;
  background: var(--ink-faint);
}
.plats-dot--near   { background: var(--positive); }
.plats-dot--close  { background: var(--warn); }
.plats-dot--region { background: color-mix(in srgb, var(--warn) 45%, var(--danger)); }
.plats-dot--far    { background: var(--danger); }
.plats-dot--off    { background: var(--ink); }
.plats-dot--hit {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--gold); /* bullseye ring */
}
.plats-breakdown-name { color: var(--ink); font-weight: 500; font-family: var(--font-sans); }
.plats-breakdown-km { color: var(--ink-muted); font-weight: 600; }

/* ---------- Photo ---------- */

.plats-image-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Map pins: distinguish guess vs actual. divIcon's outer node has no
   intrinsic size - the inner .plats-pin-body sets the visible circle. */
.plats-pin { background: none; border: none; }
.plats-pin-body {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.plats-pin--guess .plats-pin-body { background: var(--ink); }
.plats-pin--actual .plats-pin-body { background: var(--positive); font-size: 16px; }

.plats-image-wrap.is-loading .plats-image { visibility: hidden; }
.plats-image-wrap.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--ink-muted);
  border-radius: 999px;
  animation: plats-spin 0.8s linear infinite;
}
@keyframes plats-spin { to { transform: rotate(360deg); } }

.plats-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  max-height: 440px;
  object-fit: cover;
  background: var(--surface-hover);
}
.plats-image-wrap { display: flex; flex-direction: column; }

.plats-credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Hint ---------- */

.plats-hint {
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  padding: 4px 8px;
}

/* ---------- Map ---------- */

.plats-map {
  min-height: 320px;
  max-height: 440px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-hover);
  cursor: crosshair;
}

.plats-map .leaflet-control-attribution {
  font-size: 9px;
}

/* ---------- Reveal panel ---------- */

.plats-reveal {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plats-reveal-head {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.plats-reveal-dist {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.plats-reveal-desc {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ---------- Actions ---------- */

.plats-actions {
  display: flex;
  justify-content: center;
}
.plats-actions .action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.plats-actions .action-btn:disabled:hover { background: var(--ink); }

/* ---------- Completion ---------- */

body.is-completed .plats-map { cursor: default; }

/* When the day is done, the play UI (image picker + map + submit row)
   gives way to a vertical review of every round. */
body.is-completed .plats-split,
body.is-completed .plats-hint,
body.is-completed .plats-reveal,
body.is-completed .plats-actions { display: none; }

.plats-review { display: none; }
body.is-completed .plats-review {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plats-review-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.plats-review-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  overflow: hidden;
}
.plats-review-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.plats-review-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plats-review-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.plats-review-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.plats-review-distance {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  margin-top: 2px;
}
.plats-review-km {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.plats-review-bucket { color: var(--ink-muted); }
.plats-review-desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  main { padding: 12px 10px 20px; gap: 10px; }
  .plats-image, .plats-map { min-height: 260px; max-height: 320px; }
}

/* Carousel: plats-specific preview. Generic framework in shared/styles.css. */

.card-preview-plats {
  width: 100%;
  height: 144px;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.card-preview-plats img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-preview-plats-fallback {
  width: 100%;
  height: 144px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--surface-sunken) 0%, var(--game) 100%);
}

@media (max-width: 480px) {
  .card-preview-plats, .card-preview-plats-fallback { height: 124px; }
}
