/* === PAC-MONEY™ — arcade cabinet skin ===
   Loaded after styles.css; body.arcade overrides the cream site chrome. */

/* Screen switching must not depend on the Tailwind CDN being reachable. */
.hidden { display: none !important; }

/* Text colour comes from Tailwind utilities in the markup; restate the essentials
   here so a dark page never degrades to black-on-black if the CDN is unreachable. */
body.arcade { color: #FAF6E8; }
#briefName, header h1 { color: #B8860B; }

body.arcade {
  background-color: #0B0A09;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(184,134,11,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(139,0,0,0.25) 0%, transparent 55%);
  min-height: 100vh;
}

.neon {
  text-shadow: 0 0 10px rgba(184,134,11,0.55), 0 0 34px rgba(184,134,11,0.3), 3px 3px 0 #1a1a1a;
}

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

/* --- controls / buttons --- */
.arcade-input {
  background: #15130F;
  color: #FAF6E8;
  border: 2px solid rgba(184,134,11,0.45);
}
.arcade-input:focus { outline: none; border-color: #B8860B; }
.arcade-input option { background: #15130F; }

.btn-brass, .btn-money, .btn-ghost {
  border: 2px solid #1a1a1a;
  letter-spacing: 1px;
  transition: transform .12s, box-shadow .12s, background .12s;
  cursor: pointer;
}
.btn-brass { background: linear-gradient(180deg,#E7B83A,#B8860B); color: #1a1a1a; box-shadow: 3px 3px 0 #1a1a1a; }
.btn-money { background: linear-gradient(180deg,#3FA76A,#1F6B41); color: #FAF6E8; box-shadow: 3px 3px 0 #1a1a1a; border-color: #0B0A09; }
.btn-ghost { background: rgba(250,246,232,0.06); color: #FAF6E8; border-color: rgba(184,134,11,0.5); }
.btn-brass:hover, .btn-money:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #1a1a1a; }
.btn-ghost:hover { background: rgba(250,246,232,0.14); }
.btn-brass:active, .btn-money:active, .btn-ghost:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 #1a1a1a; }

/* --- picker grid --- */
.pick-card {
  position: relative;
  background: #15130F;
  border: 2px solid rgba(184,134,11,0.35);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.pick-card:hover, .pick-card:focus-visible {
  transform: translateY(-3px);
  border-color: #B8860B;
  box-shadow: 0 6px 0 rgba(139,0,0,0.8);
  outline: none;
}
.pick-card img, .pick-card .pick-silhouette {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block;
  filter: sepia(20%) contrast(1.05) saturate(0.9);
  background: #2a2622;
}
.pick-card .pick-silhouette { display: flex; align-items: center; justify-content: center; color: #B8860B88; font-size: 34px; }
.pick-card .pick-name {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; line-height: 1.25;
  padding: 5px 6px 6px;
  color: #FAF6E8;
  background: #100E0B;
  min-height: 38px;
}
.pick-card .pick-tag {
  position: absolute; top: 4px; left: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700;
  background: rgba(11,10,9,0.85); color: #B8860B;
  padding: 2px 4px; border-radius: 2px; letter-spacing: .5px;
}
.quick-pick {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(184,134,11,0.14); color: #FAF6E8;
  border: 2px solid rgba(184,134,11,0.55);
}
.quick-pick:hover { background: #B8860B; color: #1a1a1a; }

/* --- briefing --- */
.brief-card {
  background: #15130F;
  border: 3px solid #B8860B;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 6px 6px 0 rgba(139,0,0,0.85);
}
.pac-head-preview {
  width: 104px; height: 104px; flex: 0 0 auto;
  position: relative;
}
.pac-head-preview img, .pac-head-preview .fallback {
  width: 104px; height: 104px; object-fit: cover;
  /* the chomp: a circle with a wedge bitten out, mouth pointing right */
  clip-path: polygon(50% 50%, 100% 28%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 72%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F6D047, #B8860B);
  filter: sepia(20%) contrast(1.05);
  animation: chompPreview 0.55s steps(2, jump-none) infinite alternate;
}
.pac-head-preview .fallback { display: flex; align-items: center; justify-content: center; font-size: 44px; color: #1a1a1a; }
@keyframes chompPreview {
  from { clip-path: polygon(50% 50%, 100% 28%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 72%); }
  to   { clip-path: polygon(50% 50%, 100% 48%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 52%); }
}
@media (prefers-reduced-motion: reduce) {
  .pac-head-preview img, .pac-head-preview .fallback { animation: none; }
}

.donor-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(250,246,232,0.05);
  border: 2px dashed rgba(184,134,11,0.45);
  border-radius: 8px;
  padding: 10px 12px;
}
.donor-card svg { flex: 0 0 auto; }
.donor-name { font-family: 'Rozha One', serif; font-size: 19px; line-height: 1.1; color: #FAF6E8; }
.donor-sector { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #B8860B; letter-spacing: 1px; }
.donor-ask { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(250,246,232,0.65); margin-top: 4px; line-height: 1.45; }
.donor-amount { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #6FCF97; margin-top: 4px; }

/* --- HUD --- */
.hud {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.hud-block {
  background: #15130F;
  border: 2px solid rgba(184,134,11,0.5);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.hud-block-wide { flex: 1 1 200px; }
.hud-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 1.5px; color: #B8860B; }
.hud-value { font-family: 'Rozha One', serif; font-size: 20px; color: #FAF6E8; line-height: 1; }
.hud-funds {
  font-family: 'Rozha One', serif; font-size: 26px; line-height: 1;
  color: #6FCF97; text-shadow: 0 0 12px rgba(111,207,151,0.45);
}
.hud-funds.bump { animation: fundsBump .25s ease-out; }
@keyframes fundsBump { 0%{transform:scale(1)} 40%{transform:scale(1.14)} 100%{transform:scale(1)} }
.hud-lives { display: flex; gap: 4px; align-items: center; min-height: 22px; }
.life-head {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  clip-path: polygon(50% 50%, 100% 30%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 70%);
  background: radial-gradient(circle at 35% 30%, #F6D047, #B8860B);
  filter: sepia(20%) contrast(1.05);
}
.hud-donors { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; min-height: 24px; }
.hud-donors .hd { transition: opacity .3s, filter .3s; }
.hud-donors .hd.eaten { opacity: .25; filter: grayscale(1); }

.arcade-meter { border-color: #B8860B; background: #15130F; margin-bottom: 2px; height: 16px; }
.arcade-readout { color: rgba(250,246,232,0.45); margin-bottom: 12px; }

/* --- the board --- */
.stage-wrap { display: flex; justify-content: center; }
.stage {
  position: relative;
  width: min(100%, 504px);
  line-height: 0;
}
#board {
  width: 100%; height: auto; display: block;
  background: #08100C;
  border: 3px solid #B8860B;
  border-radius: 8px;
  box-shadow: 0 0 0 3px #1a1a1a, 0 14px 40px rgba(0,0,0,0.65), inset 0 0 60px rgba(0,0,0,0.6);
  touch-action: none;
}
.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  background: rgba(8,10,9,0.82);
  border-radius: 8px;
  padding: 18px;
  line-height: 1.4;
  backdrop-filter: blur(2px);
}
.overlay h3 { font-family: 'Rozha One', serif; font-size: clamp(26px, 7vw, 44px); color: #B8860B; line-height: 1; }
.overlay p { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: rgba(250,246,232,0.8); max-width: 34ch; }
.overlay .big-money { font-family: 'Rozha One', serif; font-size: clamp(24px,6vw,38px); color: #6FCF97; }
.overlay .rank { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #FAF6E8; border: 2px dashed #B8860B; padding: 6px 12px; border-radius: 4px; }
.toast {
  position: absolute; left: 50%; top: 16%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: 1px;
  background: #1a1a1a; color: #F6D047;
  border: 2px solid #B8860B;
  padding: 6px 12px; border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 0 rgba(139,0,0,0.9);
  max-width: 92%;
  overflow: hidden; text-overflow: ellipsis;
}
.toast.show { animation: toastPop 1.8s ease-out forwards; }
@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.9); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -12px); }
}

/* --- touch controls --- */
.controls {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: center;
  margin-top: 14px;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
}
.dbtn {
  background: rgba(250,246,232,0.07);
  border: 2px solid rgba(184,134,11,0.5);
  border-radius: 8px;
  color: #B8860B; font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.dbtn:active { background: #B8860B; color: #1a1a1a; }
.dbtn.up { grid-area: 1 / 2; }
.dbtn.left { grid-area: 2 / 1; }
.dbtn.right { grid-area: 2 / 3; }
.dbtn.down { grid-area: 3 / 2; }
.ctrl-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
@media (hover: hover) and (pointer: fine) {
  .dpad { display: none; }
  .ctrl-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

/* --- legend --- */
.legend {
  margin: 18px auto 0;
  max-width: 640px;
  display: grid; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(250,246,232,0.62);
}
.legend strong { color: #F6D047; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; background: #6FCF97; box-shadow: 0 0 8px #6FCF97; flex: 0 0 auto; }
.lg-logo { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg,#E7B83A,#8B0000); flex: 0 0 auto; }
.lg-ghost { width: 14px; height: 14px; border-radius: 7px 7px 2px 2px; background: #C9455E; flex: 0 0 auto; }
.lg-fruit { font-size: 14px; flex: 0 0 auto; }

.fact-box {
  border: 2px solid rgba(184,134,11,0.4);
  border-radius: 8px; padding: 14px;
  background: rgba(250,246,232,0.04);
}
.fact-box-red { border-color: rgba(220,20,60,0.55); }
