/* ============================================================
   GOON WITH FRIENDS — all styling. Neon "degenerate casino" vibe.
   No external assets; every visual is CSS / gradients / emoji.
   ============================================================ */

:root {
  --bg0: #0a0612;
  --bg1: #160a26;
  --bg2: #24123f;
  --neon: #ff2e88;       /* hot pink */
  --neon2: #00e5ff;      /* cyan */
  --gold: #ffd23f;
  --green: #38ff9b;
  --red: #ff4d6d;
  --purple: #b14bff;
  --ink: #f3e9ff;
  --muted: #b9a7d6;
  --panel: rgba(40, 18, 70, 0.72);
  --panel-bd: rgba(177, 75, 255, 0.45);
  --shadow: 0 10px 40px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(177,75,255,0.25), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, rgba(0,229,255,0.18), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(255,46,136,0.20), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 55%, var(--bg2));
  background-attachment: fixed;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

/* subtle animated grain/glow on background */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0,0,0,0.5));
  pointer-events: none;
  z-index: 0;
}

#fx {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}

.hidden { display: none !important; }

/* ---------------- Mute button ---------------- */
.mute {
  position: fixed; top: 12px; right: 14px; z-index: 60;
  background: var(--panel);
  border: 1px solid var(--panel-bd);
  color: var(--ink);
  font-size: 20px;
  width: 44px; height: 44px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .1s, background .2s;
}
.mute:hover { transform: scale(1.08); }
.mute:active { transform: scale(0.94); }

/* ---------------- HUD ---------------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: center;
  padding: 10px 64px 10px 14px;
  background: linear-gradient(180deg, rgba(10,6,18,0.95), rgba(10,6,18,0.65));
  border-bottom: 1px solid var(--panel-bd);
  backdrop-filter: blur(8px);
  font-weight: 700;
}
.hud-item {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 5px 10px; border-radius: 10px;
  font-size: 15px;
  min-width: 0;
}
.hud-ico { font-size: 16px; }
.hud-urge, .hud-goal { gap: 8px; }
.bar {
  width: 120px; height: 12px;
  background: rgba(0,0,0,0.45);
  border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.bar-fill { height: 100%; width: 0%; transition: width .18s ease; border-radius: 8px; }
.bar.urge .bar-fill  { background: linear-gradient(90deg, #ffb347, var(--red)); }
.bar.goal .bar-fill  { background: linear-gradient(90deg, var(--neon2), var(--gold)); }
.bar.climax .bar-fill{ background: linear-gradient(90deg, var(--neon), var(--purple)); }
.bar.work .bar-fill  { background: linear-gradient(90deg, var(--green), var(--neon2)); }

.tag-clarity {
  color: var(--gold); font-size: 12px; letter-spacing: 1px;
  text-shadow: 0 0 8px var(--gold);
  animation: pulseGlow 1.2s infinite;
}

/* ---------------- Stage / screens ---------------- */
#stage {
  position: relative; z-index: 10;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(860px, 96vw);
  max-height: 100%;
  overflow-y: auto;
  gap: 18px;
  padding: 8px;
  animation: fadeIn .35s ease;
}
.screen.active { display: flex; }
/* push gameplay screens below HUD */
body:not(.title-mode) .screen { padding-top: 64px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity:1; transform:none; } }

/* ---------------- Title ---------------- */
.logo {
  font-size: clamp(40px, 9vw, 84px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 0.95;
  background: linear-gradient(90deg, var(--neon), var(--gold), var(--neon2), var(--neon));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(255,46,136,0.45));
  animation: hue 6s linear infinite;
}
.logo-amp {
  display: inline-block;
  font-size: 0.42em;
  vertical-align: middle;
  margin: 0 .25em;
  -webkit-text-fill-color: var(--ink);
  opacity: 0.8;
}
@keyframes hue { to { background-position: 300% 0; } }

.tagline { color: var(--muted); font-size: clamp(15px, 2.4vw, 20px); font-style: italic; }
.fine { color: var(--muted); font-size: 12px; opacity: 0.7; max-width: 520px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-bd);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  width: 100%;
}
.how { text-align: left; max-width: 640px; }
.how h3 { color: var(--neon2); margin-bottom: 10px; text-align: center; }
.how ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.how li { font-size: 14.5px; line-height: 1.45; color: #e7dbff; }
.hl { color: var(--gold); }

/* ---------------- Buttons ---------------- */
.btn {
  font-family: inherit; font-weight: 800;
  font-size: 17px; letter-spacing: .5px;
  color: #1a0b2e;
  background: linear-gradient(135deg, var(--neon2), var(--neon));
  border: none; border-radius: 14px;
  padding: 14px 26px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.35), 0 8px 24px rgba(255,46,136,0.35);
  transition: transform .07s, box-shadow .07s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.btn-big { font-size: 22px; padding: 18px 40px; }
.btn-goon {
  font-size: 30px; padding: 26px 54px; border-radius: 22px;
  background: radial-gradient(circle at 30% 30%, #ff7ab8, var(--neon) 60%, var(--purple));
  color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.4);
  box-shadow: 0 8px 0 rgba(0,0,0,0.4), 0 0 40px rgba(255,46,136,0.5);
}
.btn-warn { background: linear-gradient(135deg, var(--gold), #ff9f1c); color: #2a1500; }
.btn-work { background: linear-gradient(135deg, var(--green), var(--neon2)); font-size: 26px; padding: 22px 48px; }

/* ---------------- Phase headers ---------------- */
.phase-head h2 { font-size: clamp(22px, 4vw, 34px); }
.phase-head .sub, .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }

/* ---------------- Candidates ---------------- */
.candidates { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.card {
  width: 220px;
  background: linear-gradient(180deg, rgba(60,28,100,0.8), rgba(30,12,55,0.85));
  border: 1px solid var(--panel-bd);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 14px 36px rgba(177,75,255,0.4); border-color: var(--neon); }
.card .avatar {
  width: 100%; height: 110px; border-radius: 12px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 54px;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
}
.card .cname { font-size: 19px; font-weight: 800; }
.card .ctag { color: var(--muted); font-size: 13px; font-style: italic; margin: 2px 0 10px; min-height: 32px; }
.card .stat { display: flex; justify-content: space-between; font-size: 13px; margin: 3px 0; }
.card .stat b { color: var(--neon2); }
.badge-both {
  position: absolute; top: 10px; right: -34px;
  transform: rotate(35deg);
  background: var(--gold); color: #2a1500;
  font-weight: 900; font-size: 11px; letter-spacing: .5px;
  padding: 4px 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ---------------- Rizz minigame ---------------- */
.rizz { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rizz-track {
  position: relative; width: 100%; height: 40px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--panel-bd);
  border-radius: 20px; overflow: hidden;
}
.rizz-zone {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(56,255,155,0.55), rgba(56,255,155,0.25));
  border-left: 2px solid var(--green); border-right: 2px solid var(--green);
  box-shadow: 0 0 18px rgba(56,255,155,0.6);
}
.rizz-marker {
  position: absolute; top: -4px; bottom: -4px; width: 6px;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
  border-radius: 3px;
}
.attempts { color: var(--muted); font-size: 14px; }
.attempts .heart { color: var(--neon); }

/* ---------------- Climax / round ---------------- */
.climax-wrap { width: 100%; max-width: 560px; }
.climax-label { font-weight: 800; letter-spacing: 2px; color: var(--neon); margin-bottom: 6px; }
.bar.climax, .bar.work { width: 100%; height: 26px; }
.climax-hint { color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 18px; }
.round-juice { font-size: 20px; font-weight: 800; color: var(--neon2); }
.round-juice span { color: var(--gold); }

.btn-goon.shake { animation: shake .25s; }
@keyframes shake { 0%,100%{transform:none} 25%{transform:translate(-3px,2px)} 75%{transform:translate(3px,-2px)} }

/* ---------------- Skill check ---------------- */
#skillCanvas {
  width: 300px; height: 300px; max-width: 80vw; max-height: 80vw;
  filter: drop-shadow(0 0 24px rgba(177,75,255,0.4));
}

/* ---------------- Result ---------------- */
.result { max-width: 560px; text-align: center; }
.result h2 { font-size: 28px; margin-bottom: 8px; }
.result-body { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; font-size: 16px; }
.result-body .line { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.04); }
.result-body .big { font-size: 20px; font-weight: 800; }
.good { color: var(--green); }
.bad { color: var(--red); }
.warnc { color: var(--gold); }

/* ---------------- Work pay ---------------- */
.pay { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.pay p { font-size: 17px; max-width: 460px; }

/* ---------------- Shop ---------------- */
.shop-items { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; width: 100%; }
.shop-card {
  width: 240px;
  background: linear-gradient(180deg, rgba(60,28,100,0.75), rgba(30,12,55,0.85));
  border: 1px solid var(--panel-bd);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.shop-card .si-top { display: flex; align-items: center; gap: 10px; }
.shop-card .si-ico { font-size: 30px; }
.shop-card .si-name { font-weight: 800; font-size: 16px; }
.shop-card .si-desc { color: var(--muted); font-size: 13px; min-height: 52px; }
.shop-card .si-owned { font-size: 12px; color: var(--neon2); }
.shop-card .buyBtn { padding: 9px 14px; font-size: 14px; margin-top: 4px; }
.flash-bad { animation: flashBad .4s; }
@keyframes flashBad { 0%,100%{} 50%{ box-shadow: 0 0 0 3px var(--red) inset; } }

@keyframes pulseGlow { 0%,100%{opacity:1} 50%{opacity:.45} }

/* scrollbar */
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: var(--panel-bd); border-radius: 8px; }

/* small screens */
@media (max-width: 520px) {
  .bar { width: 80px; }
  .hud { padding: 8px 56px 8px 8px; gap: 6px; }
  .hud-item { font-size: 13px; padding: 4px 7px; }
  .card { width: 46%; min-width: 150px; }
}
