/* ============================================================
   ARTBID — Jackbox / Gartic Phone Style
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }
html { font-size: 16px; }

:root {
  --bg:      #0d0b1e;
  --bg2:     #151228;
  --pink:    #f72585;
  --blue:    #4cc9f0;
  --orange:  #f8961e;
  --yellow:  #ffd60a;
  --green:   #43aa8b;
  --purple:  #7b2d8b;
  --white:   #ffffff;
  --muted:   rgba(255,255,255,0.5);
  --border:  rgba(255,255,255,0.12);
  --card-bg: rgba(255,255,255,0.06);
  --radius:  20px;
  --radius-sm: 12px;
}

/* ─── BASE ──────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Kill scrollbars */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

/* Prevent mobile zoom on inputs */
input, select, textarea { font-size: 16px !important; }

/* ─── ANIMATED BG ───────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 10%, rgba(247,37,133,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 90% 90%, rgba(76,201,240,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(123,45,139,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Floating dots */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ─── SCREENS ───────────────────────────────── */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  min-height: 100vh;
}
/* Animation ONLY on .active — WebKit/Safari won't restart an animation that was
   already associated with the element while display:none; putting it here ensures
   it fires fresh every time showScreen() adds the .active class. */
.screen.active {
  display: flex;
  flex-direction: column;
  -webkit-animation: screenIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
          animation: screenIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@-webkit-keyframes screenIn {
  from { opacity: 0; -webkit-transform: translateY(8px) scale(0.99); transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; -webkit-transform: translateY(0) scale(1);       transform: translateY(0) scale(1); }
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ─── TYPOGRAPHY ────────────────────────────── */
.game-font {
  font-family: 'Bangers', cursive;
  letter-spacing: 2px;
}

/* ─── JACKBOX LOGO ──────────────────────────── */
.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  user-select: none;
}
.logo-eyebrow {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 4px;
}
.logo-main {
  font-family: 'Bangers', cursive;
  font-size: clamp(5rem, 20vw, 10rem);
  line-height: 0.9;
  letter-spacing: 4px;
  padding: 0 0.15em;
  background: linear-gradient(160deg, #ffffff 0%, #ffd60a 40%, #f72585 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 60px rgba(247,37,133,0.35));
}
.logo-sub {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 8px;
}

/* ─── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
  border-radius: inherit;
}
.btn:active { transform: scale(0.96) !important; }
@media (hover: hover) {
  .btn:hover::after  { background: rgba(255,255,255,0.08); }
  .btn:hover  { transform: translateY(-2px); }
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; filter: none !important; }

/* Sizes */
.btn-xl  { font-size: 1.3rem;  padding: 20px 40px; letter-spacing: 0.5px; }
.btn-lg  { font-size: 1.1rem;  padding: 16px 32px; }
.btn-md  { font-size: 0.95rem; padding: 12px 24px; }
.btn-sm  { font-size: 0.8rem;  padding: 8px  18px; }

/* Colors */
.btn-pink   { background: var(--pink);   color: #fff;    box-shadow: 0 6px 24px rgba(247,37,133,0.45); }
.btn-blue   { background: var(--blue);   color: #001a2e; box-shadow: 0 6px 24px rgba(76,201,240,0.4); }
.btn-orange { background: var(--orange); color: #1a0800; box-shadow: 0 6px 24px rgba(248,150,30,0.4); }
.btn-yellow { background: var(--yellow); color: #1a1000; box-shadow: 0 6px 24px rgba(255,214,10,0.4); }
.btn-green  { background: var(--green);  color: #001a10; box-shadow: 0 6px 24px rgba(67,170,139,0.4); }
.btn-ghost  {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
}
@media (hover: hover) {
  .btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }
}
.btn-danger {
  background: #450a0a;
  color: #fca5a5;
  border: 2px solid #dc2626;
  box-shadow: 0 4px 16px rgba(220,38,38,0.3);
}

@media (hover: hover) {
  .btn-pink:hover   { box-shadow: 0 8px 32px rgba(247,37,133,0.6); }
  .btn-blue:hover   { box-shadow: 0 8px 32px rgba(76,201,240,0.55); }
  .btn-yellow:hover { box-shadow: 0 8px 32px rgba(255,214,10,0.55); }
  .btn-green:hover  { box-shadow: 0 8px 32px rgba(67,170,139,0.55); }
}

.w-full { width: 100%; }

/* ─── CARDS ─────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card-pink   { border-color: rgba(247,37,133,0.4);  box-shadow: 0 0 40px rgba(247,37,133,0.08),  inset 0 1px 0 rgba(255,255,255,0.05); }
.card-blue   { border-color: rgba(76,201,240,0.4);   box-shadow: 0 0 40px rgba(76,201,240,0.08),   inset 0 1px 0 rgba(255,255,255,0.05); }
.card-yellow { border-color: rgba(255,214,10,0.4);   box-shadow: 0 0 40px rgba(255,214,10,0.08),   inset 0 1px 0 rgba(255,255,255,0.05); }
.card-green  { border-color: rgba(67,170,139,0.4);   box-shadow: 0 0 40px rgba(67,170,139,0.08),   inset 0 1px 0 rgba(255,255,255,0.05); }
.card-orange { border-color: rgba(248,150,30,0.4);   box-shadow: 0 0 40px rgba(248,150,30,0.08),   inset 0 1px 0 rgba(255,255,255,0.05); }

/* ─── INPUTS ────────────────────────────────── */
.field-label {
  display: block;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
}
input[type=text], input[type=number], textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, textarea:focus {
  border-color: var(--blue);
  background: rgba(76,201,240,0.06);
  box-shadow: 0 0 0 3px rgba(76,201,240,0.15);
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.2); font-weight: 700; }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

/* Code input */
.input-code {
  font-family: 'Bangers', cursive !important;
  font-size: 3rem !important;
  text-align: center;
  letter-spacing: 14px;
  text-transform: uppercase;
  color: var(--yellow) !important;
  border-color: rgba(255,214,10,0.4) !important;
  padding: 20px !important;
  border-radius: 16px !important;
}
.input-code:focus {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 0 3px rgba(255,214,10,0.2) !important;
  background: rgba(255,214,10,0.05) !important;
}

/* Price input */
.price-wrap {
  position: relative;
}
.price-wrap .dollar {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Bangers', cursive;
  font-size: 2.5rem;
  color: var(--yellow);
  pointer-events: none;
  line-height: 1;
}
.price-wrap input {
  padding-left: 52px !important;
  padding-right: 20px !important;
  font-family: 'Bangers', cursive !important;
  font-size: 2.8rem !important;
  font-weight: 400 !important;
  height: 88px;
  color: var(--yellow) !important;
  border-color: rgba(255,214,10,0.35) !important;
  border-radius: 20px !important;
  letter-spacing: 2px;
  text-align: right;
}
.price-wrap input:focus {
  border-color: var(--yellow) !important;
  box-shadow: 0 0 0 4px rgba(255,214,10,0.15) !important;
  background: rgba(255,214,10,0.05) !important;
}

/* ─── ROOM CODE DISPLAY ─────────────────────── */
.roomcode-panel {
  background: #000;
  border: 3px solid var(--yellow);
  border-radius: 20px;
  padding: 20px 32px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,214,10,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}
.roomcode-panel::before {
  content: '● LIVE';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--green);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.roomcode-eyebrow {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--yellow);
  opacity: 0.7;
  margin-bottom: 4px;
}
.roomcode-text {
  font-family: 'Bangers', cursive;
  font-size: clamp(4rem, 18vw, 8rem);
  letter-spacing: 16px;
  color: var(--yellow);
  line-height: 1;
  text-shadow:
    0 0 20px rgba(255,214,10,0.6),
    0 0 60px rgba(255,214,10,0.3);
  animation: codeGlow 3s ease-in-out infinite;
}
@keyframes codeGlow {
  0%,100% { text-shadow: 0 0 20px rgba(255,214,10,0.6), 0 0 60px rgba(255,214,10,0.3); }
  50%      { text-shadow: 0 0 30px rgba(255,214,10,0.9), 0 0 80px rgba(255,214,10,0.5); }
}
.roomcode-hint {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ─── AVATAR GRID (Jackbox lobby style) ─────── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
}
.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  animation: avatarIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  cursor: default;
}
@media (hover: hover) {
  .avatar-card:hover { transform: scale(1.04); transition: transform 0.15s; }
}
.avatar-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #0d0b1e;
  font-weight: 400;
  flex-shrink: 0;
  border: 3px solid rgba(0,0,0,0.2);
}
.avatar-name {
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes avatarIn {
  0%   { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  70%  { transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ─── SCORE CHIPS ───────────────────────────── */
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 50px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.06);
}
.score-name { font-weight: 800; flex: 1; font-size: 0.95rem; }
.score-pts  { font-family: 'Bangers', cursive; font-size: 1.5rem; color: var(--yellow); letter-spacing: 1px; }

/* ─── PHASE HEADER (Jackbox game-state bar) ──── */
.phase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.phase-pill-round { background: rgba(76,201,240,0.15); border: 1.5px solid rgba(76,201,240,0.4); color: var(--blue); }
.phase-pill-guess { background: rgba(255,214,10,0.15);  border: 1.5px solid rgba(255,214,10,0.4);  color: var(--yellow); }
.phase-pill-host  { background: rgba(247,37,133,0.15); border: 1.5px solid rgba(247,37,133,0.4); color: var(--pink); }

/* ─── RESULT ROWS ───────────────────────────── */
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  animation: resultSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}
.result-row.winner {
  background: rgba(255,214,10,0.1);
  border-color: rgba(255,214,10,0.5);
  box-shadow: 0 0 30px rgba(255,214,10,0.15);
}
.result-row.winner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
}
.result-rank   { font-family: 'Bangers', cursive; font-size: 1.4rem; width: 32px; text-align: center; color: var(--muted); flex-shrink: 0; }
.result-row.winner .result-rank { color: var(--yellow); }
.result-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Bangers', cursive; font-size: 1rem; flex-shrink: 0; color: #0d0b1e; }
.result-name   { font-weight: 800; flex: 1; font-size: 0.95rem; }
.result-guess  { font-family: 'Bangers', cursive; font-size: 1.5rem; letter-spacing: 1px; }
.result-diff   { font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.result-badge  { background: var(--yellow); color: #1a1000; font-weight: 900; font-size: 0.72rem; padding: 4px 10px; border-radius: 50px; white-space: nowrap; letter-spacing: 0.5px; }
.result-noguess{ font-size: 0.82rem; color: var(--muted); font-style: italic; }

@keyframes resultSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── REAL PRICE REVEAL ─────────────────────── */
.reveal-panel {
  text-align: center;
  padding: 32px 24px;
  background: radial-gradient(ellipse at center, rgba(255,214,10,0.12) 0%, transparent 70%);
  border-radius: 20px;
  border: 2px solid rgba(255,214,10,0.4);
}
.reveal-label {
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--yellow);
  opacity: 0.7;
  margin-bottom: 8px;
}
.reveal-price {
  font-family: 'Bangers', cursive;
  font-size: clamp(3.5rem, 12vw, 7rem);
  letter-spacing: 3px;
  color: var(--yellow);
  line-height: 1;
  animation: priceReveal 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  text-shadow: 0 0 40px rgba(255,214,10,0.5);
}
@keyframes priceReveal {
  0%  { transform: scale(0.2) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(2deg);  opacity: 1; }
  100%{ transform: scale(1)   rotate(0deg);  opacity: 1; }
}
.reveal-art-name {
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 8px;
}

/* ─── WAITING STATE ─────────────────────────── */
.waiting-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
}
.spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(76,201,240,0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-text { font-weight: 800; color: var(--muted); font-size: 0.95rem; }

/* ─── ARTWORK DISPLAY ───────────────────────── */
.artwork-display {
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: rgba(0,0,0,0.3);
  animation: artworkIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes artworkIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.artwork-img-area {
  background: rgba(255,255,255,0.03);
  min-height: 160px;
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.artwork-img-area img { width: 100%; height: 100%; object-fit: contain; max-height: 280px; }
.artwork-img-area .art-emoji { font-size: 6rem; }
.artwork-meta { padding: 16px 20px; }
.artwork-title-text { font-family: 'Bangers', cursive; font-size: 1.8rem; letter-spacing: 1px; line-height: 1.1; }
.artwork-desc-text  { color: var(--muted); font-size: 0.88rem; font-weight: 700; margin-top: 6px; line-height: 1.5; }

/* ─── GUESS COUNT PROGRESS ──────────────────── */
.guess-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.guess-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 50px;
  overflow: hidden;
}
.guess-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  border-radius: 50px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.guess-progress-text {
  font-family: 'Bangers', cursive;
  font-size: 1.6rem;
  color: var(--blue);
  letter-spacing: 1px;
}
.guess-progress-label { font-size: 0.78rem; font-weight: 800; color: var(--muted); letter-spacing: 1px; }

/* ─── TABS ──────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 50px;
  padding: 4px;
  border: 1.5px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: 10px 10px;
  background: transparent;
  border: none;
  border-radius: 50px;
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn.active { background: var(--yellow); color: #1a1000; }
@media (hover: hover) {
  .tab-btn:hover:not(.active) { color: var(--white); }
}

/* ─── LEADERBOARD TABLE ─────────────────────── */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.03); font-weight: 700; vertical-align: middle; }
@media (hover: hover) {
  .lb-table tr:hover td { background: rgba(255,255,255,0.02); }
}
.lb-rank { font-family: 'Bangers', cursive; font-size: 1.4rem; color: var(--muted); text-align: center; width: 44px; }
.lb-table tr:nth-child(1) .lb-rank { color: #ffd700; }
.lb-table tr:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-table tr:nth-child(3) .lb-rank { color: #cd7f32; }
.lb-wins { font-family: 'Bangers', cursive; font-size: 1.5rem; color: var(--yellow); text-align: right; }
.lb-games { color: var(--muted); font-size: 0.82rem; text-align: right; }
.lb-empty { text-align: center; padding: 48px 24px; color: var(--muted); font-weight: 700; }

/* ─── PODIUM ────────────────────────────────── */
.podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}
.podium-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium-name  { font-weight: 800; font-size: 0.8rem; text-align: center; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-family: 'Bangers', cursive; font-size: 1.3rem; color: var(--yellow); }
.podium-stand {
  border-radius: 8px 8px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.podium-1st { background: linear-gradient(160deg, #ffd700, #f59e0b); width: 82px; height: 90px; }
.podium-2nd { background: linear-gradient(160deg, #94a3b8, #64748b); width: 70px; height: 68px; }
.podium-3rd { background: linear-gradient(160deg, #b45309, #78350f); width: 62px; height: 52px; }

/* ─── CONFETTI ──────────────────────────────── */
.confetti-layer {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999; overflow: hidden;
}
.confetto {
  position: absolute;
  top: -20px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ─── TOAST ─────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%; transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column-reverse; gap: 8px; align-items: center;
  pointer-events: none; width: 90%;
}
.toast {
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 900;
  font-size: 0.9rem;
  text-align: center;
  animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1), toastOut 0.3s ease 2.7s forwards;
  max-width: 400px;
}
.toast-error   { background: #450a0a; color: #fca5a5; border: 2px solid #dc2626; }
.toast-success { background: #052e16; color: #86efac; border: 2px solid #16a34a; }
.toast-info    { background: rgba(20,20,40,0.95); color: var(--white); border: 2px solid var(--border); }
@keyframes toastIn  { from { opacity:0; transform:translateY(20px); } to   { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to   { opacity:0; } }

/* ─── HELPERS ───────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1     { flex: 1; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-yellow { color: var(--yellow); }
.text-blue   { color: var(--blue); }
.text-pink   { color: var(--pink); }
.text-green  { color: var(--green); }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.mt-auto { margin-top: auto; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 0.85rem;
  color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 8px 0; transition: color 0.2s;
}
.back-btn:hover { color: var(--white); }

/* Submitted check */
.lock-in-state {
  text-align: center;
  padding: 32px 24px;
  background: rgba(67,170,139,0.08);
  border: 2px solid rgba(67,170,139,0.35);
  border-radius: 20px;
}
.lock-in-emoji { font-size: 4rem; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.lock-in-title { font-family: 'Bangers', cursive; font-size: 2rem; letter-spacing: 1px; color: var(--green); margin-top: 8px; }
.lock-in-sub   { color: var(--muted); font-weight: 700; margin-top: 4px; }

@keyframes popIn {
  0%  { transform: scale(0.4) rotate(-20deg); }
  60% { transform: scale(1.25) rotate(5deg); }
  100%{ transform: scale(1) rotate(0deg); }
}

/* ─── SCREENS: HOME ─────────────────────────── */
#screen-home {
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 0;
  min-height: 100dvh;
}
.home-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 400px;
}
.home-btns { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.home-bottom { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-align: center; letter-spacing: 0.5px; }

/* ─── SCREENS: LOBBY / GAME ─────────────────── */
.game-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 32px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ─── HOW TO PLAY ───────────────────────────── */
.how-card {
  background: rgba(255,255,255,0.025);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
}
.how-card p { font-weight: 800; font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.how-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.how-card li { font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.65); display: flex; gap: 8px; align-items: flex-start; }
.how-card li::before { content: '→'; color: var(--blue); flex-shrink: 0; }

/* ─── MOBILE SAFE AREA ──────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .game-layout { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  #screen-home { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 480px) {
  .btn-xl { font-size: 1.1rem; padding: 18px 32px; }
  .roomcode-text { letter-spacing: 10px; }
  .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
  .avatar-card { padding: 12px 6px 10px; }
  .avatar-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .tabs .tab-btn { font-size: 0.72rem; padding: 8px 6px; }
}

/* ─── AVATAR PICKER ─────────────────────────── */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  padding: 4px 0;
}
.avatar-pick-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
@media (hover: hover) {
  .avatar-pick-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.12);
  }
}
.avatar-pick-btn.selected {
  border-color: var(--yellow);
  background: rgba(255,214,10,0.15);
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255,214,10,0.3);
}

/* ─── AVATAR EMOJI ICON (in grids) ──────────── */
.avatar-icon-emoji {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* ─── PLAYER GAME: PHONE CONTROLLER FEEL ───── */
.controller-screen {
  background: rgba(0,0,0,0.4);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px;
}
.controller-screen .round-label {
  text-align: center;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ─── STREAK CALLOUT ────────────────────────── */
.streak-callout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: streakIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.7s both;
}
@keyframes streakIn {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.streak-line {
  font-family: 'Bangers', cursive;
  font-size: clamp(1rem, 4vw, 1.25rem);
  letter-spacing: 1px;
  text-align: center;
  padding: 14px 20px;
  border-radius: 16px;
  line-height: 1.3;
}
.streak-hot {
  background: linear-gradient(135deg, rgba(248,150,30,0.15), rgba(247,37,133,0.12));
  border: 1.5px solid rgba(248,150,30,0.45);
  color: var(--orange);
  text-shadow: 0 0 20px rgba(248,150,30,0.4);
}
.streak-roast {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  color: var(--muted);
}

/* ─── LEADERBOARD POINTS BADGE ──────────────── */
.lb-pts-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(255,214,10,0.2), rgba(248,150,30,0.15));
  border: 1.5px solid rgba(255,214,10,0.4);
  border-radius: 50px;
  padding: 2px 14px;
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  color: var(--yellow);
  letter-spacing: 1px;
  min-width: 52px;
  text-align: center;
}

/* ─── END-GAME STATS ────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.stat-tile {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
@media (hover: hover) {
  .stat-tile:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.2);
  }
}
.stat-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}
.stat-title {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 1.5px;
  color: var(--yellow);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.stat-desc {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.45;
}

/* ─── RPS TIE-BREAKER BUTTONS ───────────────── */
.rps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.rps-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--white);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .rps-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--pink);
    background: rgba(247,37,133,0.12);
  }
}

.rps-btn:active:not(:disabled) {
  transform: translateY(-1px) scale(0.97);
}

.rps-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rps-btn.selected {
  border-color: var(--yellow);
  background: rgba(255,214,10,0.15);
  box-shadow: 0 0 16px rgba(255,214,10,0.3), inset 0 0 8px rgba(255,214,10,0.1);
  transform: translateY(-2px) scale(1.03);
}

.rps-emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.rps-label {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--muted);
}

/* ─── RPS REVEAL OVERLAY ─────────────────────── */
.rps-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 11, 30, 0.92);
  backdrop-filter: blur(8px);
  animation: rpsOverlayIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rpsOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rps-reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 36px 32px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 90%;
  animation: rpsCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.05s;
}

@keyframes rpsCardIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rps-reveal-title {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  letter-spacing: 3px;
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(255,214,10,0.4);
}

.rps-reveal-moves {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.rps-reveal-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 100px;
  animation: rpsPlayerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.15s;
  transition: border-color 0.3s, box-shadow 0.3s;
}

@keyframes rpsPlayerIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rps-reveal-player.rps-winner {
  border-color: var(--yellow);
  box-shadow: 0 0 24px rgba(255,214,10,0.25), inset 0 0 16px rgba(255,214,10,0.08);
  background: rgba(255,214,10,0.07);
  animation: rpsPlayerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both, rpsWinnerPulse 1s ease-in-out 0.6s infinite alternate;
}

@keyframes rpsWinnerPulse {
  from { box-shadow: 0 0 16px rgba(255,214,10,0.2); }
  to   { box-shadow: 0 0 32px rgba(255,214,10,0.5); }
}

.rps-reveal-avatar {
  font-size: 2rem;
  line-height: 1;
}

.rps-reveal-name {
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rps-reveal-move {
  font-size: 2.4rem;
  line-height: 1;
  animation: rpsMoveIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.3s;
}

@keyframes rpsMoveIn {
  from { opacity: 0; transform: scale(0.3) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.rps-reveal-result {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  letter-spacing: 2px;
  padding: 10px 28px;
  border-radius: 50px;
  animation: rpsResultIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.5s;
}

@keyframes rpsResultIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.rps-reveal-result.rps-win {
  background: linear-gradient(135deg, rgba(255,214,10,0.2), rgba(248,150,30,0.15));
  border: 2px solid rgba(255,214,10,0.5);
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255,214,10,0.4);
}

.rps-reveal-result.rps-tie {
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--border);
  color: var(--muted);
}
