/* Croisette or Bust — pixel Riviera design system.
   Palette: cream paper, terracotta, azure, gold, deep navy ink. */

:root {
  --cream: #FBF3E4;
  --paper: #FFFBF1;
  --sand: #F4E9CF;
  --ink: #27314A;
  --ink-soft: #5A6580;
  --terracotta: #E2725B;
  --terracotta-dark: #C95B43;
  --azure: #2E93A8;
  --azure-dark: #20748A;
  --gold: #D8A24A;
  --gold-light: #FFD166;
  --pink: #F25CA2;
  --green: #2F9E68;
  --bad: #D33F49;
  --shadow: #27314A;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(39, 49, 74, 0.05) 1px, transparent 0);
  background-size: 14px 14px;
  min-height: 100dvh;
}

.pixel-h {
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.5px;
  line-height: 1.5;
}

#app { max-width: 1060px; margin: 0 auto; padding: 16px; }

a { color: var(--azure-dark); }

/* ---------- buttons ---------- */

.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--paper);
  background: var(--azure);
  border: 2px solid var(--ink);
  border-radius: 11px;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--shadow);
  transition: transform 0.06s, box-shadow 0.06s;
  text-align: center;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: 0 2px 0 var(--shadow); }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.big { font-size: 14px; padding: 18px 26px; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.night { background: var(--ink); }
.btn small { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 11px; margin-top: 6px; opacity: 0.8; text-transform: none; letter-spacing: 0; }

/* ---------- title screen ---------- */

.title-screen { position: relative; min-height: 88dvh; display: flex; align-items: stretch; }
.title-map {
  position: absolute; inset: 0; overflow: hidden; border: 3px solid var(--ink);
  border-radius: 4px; box-shadow: 8px 8px 0 rgba(39, 49, 74, 0.18);
}
.title-map .board { width: 100%; height: 100%; aspect-ratio: auto; background-size: cover; }
.title-map .hotspot, .title-map #player, .title-map .digs-marker { display: none; }
.title-overlay {
  position: relative; z-index: 2; margin: auto; text-align: center;
  background: rgba(255, 251, 241, 0.93);
  border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 38px 30px 22px; max-width: 560px;
}
.logo { font-size: clamp(22px, 5vw, 38px); margin: 0 0 14px; color: var(--terracotta); text-shadow: 3px 3px 0 rgba(39,49,74,0.15); }
.logo span { color: var(--azure-dark); }
.tagline { font-size: 16px; line-height: 1.6; margin: 0 0 26px; color: var(--ink); }
.title-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.credit { font-size: 12px; color: #7A6F5C; margin-top: 18px; }

.brand-lockup {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 20px; padding: 10px 18px;
  border-top: 2px dashed #D9CBAA;
  text-decoration: none;
}
.brand-lockup canvas {
  width: 44px; height: 44px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(126, 12, 247, 0.45));
}
.brand-words { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.brand-by { font-size: 11px; color: #7A6F5C; }
.brand-name {
  font-family: 'Press Start 2P', monospace; font-size: 13px;
  color: #7E0CF7; text-shadow: 0 0 12px rgba(126, 12, 247, 0.35);
  letter-spacing: 1px;
}
.brand-lockup:hover .brand-name { text-shadow: 0 0 16px rgba(126, 12, 247, 0.6); }

/* ---------- spin screen ---------- */

.spin-screen { padding-top: 8px; }
.spin-head { text-align: center; margin-bottom: 18px; }
.spin-head h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 900;
  font-size: clamp(28px, 5.5vw, 48px); letter-spacing: 0; line-height: 1.05;
  margin: 14px 0 8px; color: var(--ink);
}
.spin-sub { color: #9a8c70; margin: 0; font-style: italic; }

/* Editorial layout: serif values on cream, separated by gold hairlines */
.reels {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  margin-bottom: 22px; padding: 12px 0 2px;
  border-top: 2px solid #C9A95C; border-bottom: 2px solid #C9A95C;
}
.reel {
  min-width: 0; padding: 18px 10px 22px; text-align: center;
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(201, 169, 92, 0.45);
}
.reel:first-child { border-left: 0; }
.reel-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 3px; color: #B8924A; margin-bottom: 14px; text-transform: uppercase;
}
.reel-window {
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: clamp(19px, 2.2vw, 26px);
  display: flex; align-items: center; justify-content: center;
  word-break: break-word; line-height: 1.1;
}
.reel-value { position: relative; }
.reel.spinning .reel-value { filter: blur(0.5px); opacity: 0.8; }
.reel.landed .reel-value { animation: reel-land 0.3s ease-out; }
.reel.jackpot .reel-window { color: var(--terracotta-dark); }
@keyframes reel-land { 0% { transform: translateY(-6px); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.reel-flavour { font-size: 12px; line-height: 1.5; color: #9a8c70; margin-top: 14px; }

@keyframes shake { 0% { transform: translateY(-1px); } 50% { transform: translateY(1px); } 100% { transform: translateY(-1px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.spin-controls { text-align: center; margin-bottom: 22px; }

.fate-card {
  background: none; border-top: 2px solid #C9A95C; border-bottom: 2px solid #C9A95C;
  padding: 26px 16px; max-width: 720px; margin: 0 auto 30px;
}
.fate-kicker { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: 3px; font-size: 11px; color: #B8924A; margin-bottom: 18px; text-align: center; text-transform: uppercase; }
.fate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 16px; }
.fate-grid div { background: none; border-left: 1px solid rgba(201,169,92,0.45); border-radius: 0; padding: 12px 16px; }
.fate-grid div:nth-child(odd) { border-left: 0; }
.fate-grid b { display: block; font-family: 'Fraunces', Georgia, serif; font-weight: 900; font-size: 21px; margin-bottom: 5px; color: var(--ink); line-height: 1.1; }
.fate-grid span { font-size: 13px; color: #6B5F4C; }
.fate-flight { font-size: 13.5px; color: #6B5F4C; border-top: 2px dashed #D9CBAA; padding-top: 12px; }
.fate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- trip screen ---------- */

.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 10px 14px; margin-bottom: 14px;
  flex-wrap: wrap; position: sticky; top: 8px; z-index: 50;
}
.hud-day { font-size: 12px; color: var(--terracotta-dark); }
.hud-zzz { margin-left: 8px; }
.hud-mid { display: flex; gap: 18px; }
.hud-stat label { display: block; font-family: 'Press Start 2P', monospace; font-size: 7px; color: #8A7D63; margin-bottom: 4px; }
.hud-stat b { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--ink); }
.hud-stat.roi b { color: var(--green); }
.hud-meters { display: flex; gap: 12px; flex-wrap: wrap; }
.meter label { display: block; font-family: 'Press Start 2P', monospace; font-size: 6.5px; color: #8A7D63; margin-bottom: 3px; }
.bar {
  width: 74px; height: 10px; border: 2px solid var(--ink); background: #EFE3C6; border-radius: 1px;
}
.bar i {
  display: block; height: 100%; background: var(--green); width: 50%;
  background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255,255,255,0.25) 4px 6px);
  transition: width 0.3s;
}
.bar.low i { background-color: var(--bad); }
.bar.net i { background-color: var(--azure); }
.bar.brand i { background-color: var(--gold); }
.bar.joie i { background-color: var(--pink); }

.trip-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.trip-main > * { min-width: 0; }

.map-wrap {
  border: 3px solid rgba(39, 49, 74, 0.25); border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 30px rgba(39, 49, 74, 0.22); background: #BFE3DF; line-height: 0;
}
/* the illustrated board: image as background, HTML elements positioned with
   percentage left/top so they always land on the same point of the picture */
.board {
  position: relative; width: 100%; aspect-ratio: 1280 / 853;
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
}

/* hotspots — percentage-positioned circular tap targets */
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: clamp(46px, 12%, 96px); aspect-ratio: 1; border-radius: 50%;
  border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.hotspot .hs-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* sr-only */
.hotspot .state-dot {
  width: 36%; aspect-ratio: 1; border-radius: 50%; background: transparent; transition: background 0.15s, box-shadow 0.15s;
}
.hotspot:hover .state-dot { background: rgba(255, 209, 102, 0.5); box-shadow: 0 0 0 3px rgba(255,251,241,0.8); }
.hotspot .closed-ico { position: absolute; display: none; font-size: clamp(13px, 3vw, 22px); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5)); }
.hotspot.closed .state-dot { background: rgba(39, 49, 74, 0.45); }
.hotspot.closed .closed-ico { display: block; }
.hotspot.locked .state-dot { background: rgba(120, 120, 120, 0.55); }

/* sponsor badge — anchored into the top-right hills so it never clips */
.sponsor-spot {
  position: absolute; top: 5%; right: clamp(8px, 2%, 20px); transform-origin: top right;
  background: rgba(126, 12, 247, 0.94); border: 3px solid #FFE49A; border-radius: 14px;
  padding: clamp(5px, 1.2%, 11px) clamp(9px, 1.8%, 16px); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  box-shadow: 0 4px 12px rgba(39,49,74,0.3);
}
.sponsor-spot:hover { filter: brightness(1.08); }
.sponsor-spot .sp-label { font-family: 'Press Start 2P', monospace; font-size: clamp(9px, 1.9vw, 17px); color: #FFE49A; white-space: nowrap; }
.sponsor-spot .sp-sub { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(8px, 1.5vw, 14px); color: #FFFBF1; white-space: nowrap; }
.title-map .sponsor-spot { display: none; }

/* player beacon */
#player {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  width: clamp(26px, 6%, 54px); aspect-ratio: 1;
  transition: left 0.45s ease, top 0.45s ease;
}
#player span { position: absolute; top: 50%; left: 50%; border-radius: 50%; }
#player .p-core { width: 42%; height: 42%; transform: translate(-50%, -50%); background: #FF3D7F; border: 3px solid #FFFBF1; box-sizing: border-box; }
#player .p-ring { width: 42%; height: 42%; border: 3px solid #FF3D7F; box-sizing: border-box; animation: ping 1.6s ease-out infinite; }
#player .p-glow { width: 92%; height: 92%; transform: translate(-50%, -50%); background: #FF3D7F; opacity: 0.2; animation: glowpulse 1.6s ease-in-out infinite; }
@keyframes ping {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  75%, 100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}
@keyframes glowpulse { 0%, 100% { transform: translate(-50%, -50%); opacity: 0.12; } 50% { transform: translate(-50%, -50%); opacity: 0.34; } }

/* digs "home" marker */
.digs-marker { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.digs-marker .dm-core {
  display: flex; align-items: center; justify-content: center;
  width: clamp(20px, 3.6%, 34px); height: clamp(20px, 3.6%, 34px);
  border-radius: 50%; background: #FFFBF1; border: 3px solid #20748A; box-sizing: border-box;
  color: #20748A; font-weight: 700; font-size: clamp(11px, 2vw, 18px);
}

.panel {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 14px;
}
.venue-head h3 { font-size: 12px; color: var(--azure-dark); margin: 2px 0 8px; }
.venue-head p { font-size: 13.5px; line-height: 1.5; color: #6B5F4C; margin: 0 0 14px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.btn.action {
  background: var(--sand); color: var(--ink); text-align: left; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.btn.action:hover:not(:disabled) { background: #F9EDCB; }
.a-label { font-size: 10px; line-height: 1.5; }
.a-meta { font-family: 'Space Grotesk', sans-serif; font-size: 11.5px; color: var(--terracotta-dark); font-weight: 700; }
.a-desc { font-family: 'Space Grotesk', sans-serif; font-size: 12px; color: #6B5F4C; }
.night-row { display: flex; gap: 10px; }
.night-row .btn { flex: 1; font-size: 9.5px; }

.logfeed {
  margin-top: 14px; background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--shadow); padding: 12px 14px; max-height: 250px; overflow-y: auto;
}
.log { font-size: 13px; line-height: 1.5; margin: 0 0 9px; padding-bottom: 9px; border-bottom: 1px dashed #E4D6B4; }
.log:first-child { font-weight: 500; }
.log-t { font-family: 'Press Start 2P', monospace; font-size: 7px; color: #A09276; margin-right: 6px; }
.log.bad { color: var(--bad); }
.log.good { color: var(--green); }
.log.move { color: #8A7D63; }
.log.day { color: var(--azure-dark); font-weight: 700; }
.log.enc { color: var(--ink); }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(39, 49, 74, 0.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 8px 8px 0 var(--shadow); max-width: 520px; width: 100%;
  padding: 22px; max-height: 86dvh; overflow-y: auto;
  animation: modal-in 0.16s ease-out;
}
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-kicker { font-family: 'Press Start 2P', monospace; font-size: 8px; color: var(--azure-dark); margin-bottom: 10px; }
.modal-title { font-family: 'Press Start 2P', monospace; font-size: 13px; margin: 0 0 12px; color: var(--terracotta-dark); line-height: 1.6; }
.modal.bad .modal-title { color: var(--bad); }
.modal.good .modal-title { color: var(--green); }
.modal-body { font-size: 14.5px; line-height: 1.6; }
.modal-body p { margin: 0 0 10px; }
.sponsor-email {
  background: var(--sand); border: 2px dashed #C9B88E; border-radius: 3px;
  padding: 12px; text-align: center; font-size: 15px;
}
.sponsor-email a { color: var(--azure-dark); text-decoration: none; }
.sponsor-email b { font-size: 17px; }
.modal-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.modal-options .btn { text-align: left; font-size: 10px; line-height: 1.5; }
.opt-sub { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 12px; opacity: 0.85; margin-top: 4px; }

/* ---------- reckoning ---------- */

.reckoning { max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 30px; }
.reck-award {
  text-align: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 6px 6px 0 var(--shadow); padding: 26px 18px 18px;
}
.award-icon { font-size: 44px; margin-bottom: 10px; }
.reck-award h2 { font-size: clamp(13px, 3.4vw, 18px); color: var(--gold); text-shadow: 2px 2px 0 rgba(39,49,74,0.2); margin: 0 0 10px; }
.award-line { color: #6B5F4C; margin: 0; }

.reck-roi { text-align: center; padding: 4px 0; }
.roi-big { font-family: 'Press Start 2P', monospace; font-size: clamp(34px, 9vw, 56px); color: var(--green); text-shadow: 3px 3px 0 rgba(39,49,74,0.15); }
.roi-sub { color: #6B5F4C; margin-top: 8px; font-size: 15px; }

.segment-card {
  background: var(--ink); color: var(--cream); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(39,49,74,0.35); padding: 22px; text-align: center;
}
.seg-kicker { font-family: 'Press Start 2P', monospace; font-size: 8px; color: #9FE0DC; margin-bottom: 12px; }
.segment-card h3 { font-size: clamp(13px, 3.4vw, 17px); color: var(--gold-light); margin: 0 0 12px; }
.segment-card p { font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; }
.seg-tip { color: #B9C6E0; font-style: italic; font-size: 13px !important; }

.reck-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.reck-stats div { background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; padding: 10px; text-align: center; box-shadow: 3px 3px 0 var(--shadow); }
.reck-stats label { display: block; font-family: 'Press Start 2P', monospace; font-size: 6.5px; color: #8A7D63; margin-bottom: 6px; }
.reck-stats b { font-family: 'Press Start 2P', monospace; font-size: 11px; }

.reck-leads { background: var(--paper); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--shadow); padding: 16px; }
.reck-leads h4 { font-size: 10px; color: var(--azure-dark); margin: 0 0 12px; }
.reck-leads p { font-size: 13.5px; margin: 0 0 8px; }
.reck-leads .more { color: #8A7D63; font-style: italic; }

.share-box { background: var(--sand); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--shadow); padding: 16px; }
.share-box pre {
  font-family: 'Space Grotesk', monospace; font-size: 13.5px; line-height: 1.6;
  background: var(--paper); border: 2px dashed #C9B88E; border-radius: 3px;
  padding: 12px; white-space: pre-wrap; word-break: break-word; margin: 0 0 12px;
}
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.share-actions .btn { flex: 1; min-width: 130px; }

/* ---------- toast & confetti ---------- */

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 16px); z-index: 200;
  background: var(--ink); color: var(--cream); font-family: 'Press Start 2P', monospace;
  font-size: 9px; padding: 12px 16px; border-radius: 3px; opacity: 0;
  transition: opacity 0.3s, transform 0.3s; max-width: 88vw; line-height: 1.6;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti {
  position: fixed; top: -12px; width: 7px; height: 7px; z-index: 300; pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); }
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .trip-main { grid-template-columns: minmax(0, 1fr); }
  .reels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reels .reel:last-child { grid-column: span 2; }
  .hud { position: static; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hud > * { min-width: 0; }
  .hud-left { display: flex; justify-content: space-between; align-items: center; }
  .hud-mid { justify-content: space-between; gap: 10px; }
  .hud-meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .meter { min-width: 0; }
  .bar { width: 100%; }
  .fate-grid { grid-template-columns: minmax(0, 1fr); }
  .reck-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
