:root {
  --uno-red: #e52521;
  --uno-blue: #0063b3;
  --uno-green: #2ca048;
  --uno-yellow: #fcd116;
  --uno-wild: #1e1e24;
  --bg-gradient: radial-gradient(circle at center, #1b2838 0%, #0c1219 100%);
  --felt-gradient: radial-gradient(ellipse at center, #1e4a38 0%, #0d271c 100%);
  --panel-bg: rgba(22, 33, 49, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-card: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(10, 15, 22, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 50;
}

.uno-brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uno-text {
  font-family: 'Fredoka', cursive;
  font-size: 28px;
  font-weight: 700;
  color: #ffcc00;
  text-shadow: 2px 2px 0px #e52521, 4px 4px 0px #000;
  transform: skewX(-6deg);
  letter-spacing: -1px;
}

.live-pill {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.05); }
}

.header-controls {
  display: flex;
  gap: 12px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* Views Management */
.view {
  display: none;
  flex: 1;
}

.view.active {
  display: flex;
  flex-direction: column;
}

/* Glass Panels & Common Cards */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* VIEW 1: Main Menu & Lobby */
#view-lobby {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.lobby-card {
  max-width: 600px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
}

.game-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fcd116, #e52521, #0063b3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 28px;
}

.input-group {
  margin-bottom: 24px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-group input, .join-inline input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus, .join-inline input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.actions-split {
  display: flex;
  gap: 24px;
  align-items: center;
}

@media (max-width: 640px) {
  .actions-split {
    flex-direction: column;
  }
}

.action-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 14px;
}

.action-box h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.action-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.divider {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
}

.join-inline {
  display: flex;
  gap: 8px;
}

.join-inline input {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

/* Buttons */
.btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #e52521, #b91c1c);
  color: white;
  box-shadow: 0 4px 15px rgba(229, 37, 33, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 6px 20px rgba(229, 37, 33, 0.5);
}

.btn-secondary {
  background: #3b82f6;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #2563eb;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: white;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* VIEW 2: Waiting Room */
#view-waiting {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.waiting-card {
  max-width: 540px;
  width: 100%;
  padding: 32px;
}

.waiting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.room-code-display {
  font-size: 15px;
  color: var(--text-muted);
}

.room-code-display strong {
  color: #fcd116;
  font-size: 20px;
  letter-spacing: 2px;
}

.player-roster {
  margin-bottom: 24px;
}

.player-roster h3 {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.roster-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
}

.roster-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.host-tag {
  background: #fcd116;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.status-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-badge.waiting {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.waiting-actions {
  display: flex;
  gap: 12px;
}

.waiting-actions button {
  flex: 1;
}

/* VIEW 3: In-Game Virtual Table */
#view-game {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  overflow: hidden;
}

.game-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

/* Opponents Area */
.opponents-zone {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  min-height: 80px;
  z-index: 10;
  overflow-x: auto;
}

.opponent-badge {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  transition: all 0.3s ease;
}

.opponent-badge.active-turn {
  border-color: #fcd116;
  box-shadow: 0 0 15px rgba(252, 209, 22, 0.4);
  transform: scale(1.05);
}

.opp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
}

.opp-details {
  display: flex;
  flex-direction: column;
}

.opp-name {
  font-size: 13px;
  font-weight: 600;
}

.opp-cards {
  font-size: 12px;
  color: #94a3b8;
}

.opp-uno-tag {
  background: #e52521;
  color: white;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse-badge 1.5s infinite;
}

.btn-catch-uno {
  background: #dc2626;
  color: white;
  border: none;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 2px;
}

/* Center Table Felt */
.table-felt {
  flex: 1;
  margin: 0 20px;
  background: var(--felt-gradient);
  border-radius: 120px;
  border: 10px solid #2d1810;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 15px 35px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.table-surface {
  display: flex;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 5;
}

.active-color-ring {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  filter: blur(25px);
  pointer-events: none;
  transition: background 0.5s ease;
}

.active-color-ring.color-red { background: var(--uno-red); }
.active-color-ring.color-blue { background: var(--uno-blue); }
.active-color-ring.color-green { background: var(--uno-green); }
.active-color-ring.color-yellow { background: var(--uno-yellow); }

.pile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pile-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.table-info-overlay {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  z-index: 6;
}

.turn-banner {
  font-size: 14px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 16px;
  border-radius: 20px;
  color: #fcd116;
}

.turn-timer-bar {
  width: 140px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.timer-progress-fill {
  height: 100%;
  width: 100%;
  background: #10b981;
  transition: width 1s linear, background-color 0.3s;
}

.timer-progress-fill.warning {
  background: #e52521;
}

.direction-indicator {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 640px) {
  .table-info-overlay {
    gap: 6px;
  }

  .turn-banner {
    font-size: 12px;
    padding: 4px 10px;
  }

  .turn-timer-bar {
    width: 48px;
  }

  .direction-indicator {
    font-size: 11px;
  }
}

/* Local Player Hand & Tray */
.player-tray {
  background: rgba(10, 15, 22, 0.95);
  border-top: 1px solid var(--border-glass);
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.tray-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.my-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-name-badge {
  font-weight: 700;
  font-size: 15px;
}

.my-score-badge {
  font-size: 13px;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 8px 16px;
}

.btn-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.btn-uno {
  background: linear-gradient(135deg, #e52521, #fcd116);
  color: black;
  font-family: 'Fredoka', cursive;
  font-size: 18px;
  font-weight: 800;
  padding: 8px 24px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(229, 37, 33, 0.5);
  transform: skewX(-4deg);
}

.btn-uno.pulse {
  animation: pulse-uno 1.2s infinite;
}

@keyframes pulse-uno {
  0%, 100% { transform: skewX(-4deg) scale(1); }
  50% { transform: skewX(-4deg) scale(1.1); box-shadow: 0 0 25px rgba(252, 209, 22, 0.8); }
}

/* UNO CARDS DESIGN - Authentic Mattel Physical Cards Visuals */
.hand-wrapper {
  overflow-x: auto;
  padding-bottom: 8px;
  display: flex;
  justify-content: center;
}

.card-hand {
  display: flex;
  padding: 10px 20px;
  min-height: 155px;
  align-items: flex-end;
}

.uno-card {
  width: 86px;
  height: 130px;
  border-radius: var(--radius-card);
  background-color: #ffffff; /* Crisp white outer border */
  padding: 4px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-left: -24px;
}

.uno-card:first-child {
  margin-left: 0;
}

.uno-card.card-large {
  width: 108px;
  height: 160px;
  margin-left: 0;
  cursor: default;
  padding: 5px;
}

.card-hand .uno-card:hover {
  transform: translateY(-26px) scale(1.1);
  margin-right: 14px;
  z-index: 100;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.65);
}

.uno-card.playable {
  box-shadow: 0 0 0 3px #fcd116, 0 8px 22px rgba(252, 209, 22, 0.7);
  cursor: pointer;
}

/* Inner Card Body */
.card-inner-frame {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Card Colors matching authentic Mattel print */
.color-red .card-inner-frame { background: #e51d24; }
.color-blue .card-inner-frame { background: #0076ce; }
.color-green .card-inner-frame { background: #26a23a; }
.color-yellow .card-inner-frame { background: #ffd500; }
.color-wild .card-inner-frame { background: #141416; }

/* The Iconic White Tilted Oval Swoosh on Colored Cards */
.card-swoosh-oval {
  position: absolute;
  width: 82%;
  height: 86%;
  top: 7%;
  left: 9%;
  border-radius: 50%;
  border: 4.5px solid #ffffff;
  transform: rotate(-30deg);
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

.card-large .card-swoosh-oval {
  border-width: 6px;
}

/* Center Symbol Container */
.center-symbol-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
}

.center-symbol-text {
  font-family: 'Fredoka', 'Arial Black', Impact, sans-serif;
  font-weight: 800;
  font-size: 52px;
  line-height: 1;
  color: #ffffff;
  text-shadow:
    -2.5px -2.5px 0 #000,
     2.5px -2.5px 0 #000,
    -2.5px  2.5px 0 #000,
     2.5px  2.5px 0 #000,
     3px 4px 0 #000,
     4px 5px 3px rgba(0, 0, 0, 0.85);
  transform: skewX(-5deg);
  position: relative;
}

.card-large .center-symbol-text {
  font-size: 66px;
}

/* Underline for 6 and 9 in center */
.center-digit.with-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 15%;
  width: 70%;
  height: 5px;
  background: #ffffff;
  box-shadow: 0 2px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000;
  border-radius: 2px;
}

.card-large .center-digit.with-underline::after {
  height: 6px;
  bottom: -6px;
}

/* Corner Indicators */
.corner-val {
  position: absolute;
  z-index: 5;
  font-family: 'Fredoka', 'Arial Black', Impact, sans-serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  color: #ffffff;
  text-shadow:
    -1.5px -1.5px 0 #000,
     1.5px -1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px  1.5px 0 #000,
     2px 2px 0 #000;
}

.corner-top {
  top: 4px;
  left: 6px;
}

.corner-bottom {
  bottom: 4px;
  right: 6px;
  transform: rotate(180deg);
}

/* Underline for 6 and 9 in corners */
.corner-val.with-underline::after {
  content: '';
  display: block;
  width: 100%;
  height: 2.5px;
  background: #fff;
  box-shadow: 0 1px 0 #000;
  margin-top: 1px;
  border-radius: 1px;
}

/* Corner Action SVGs */
.corner-indicator {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.corner-skip-svg, .corner-reverse-svg {
  width: 16px;
  height: 16px;
}

/* Center Action SVGs */
.center-skip-svg {
  width: 50px;
  height: 50px;
  filter: drop-shadow(2px 3px 0px rgba(0, 0, 0, 0.85));
}

.card-large .center-skip-svg {
  width: 64px;
  height: 64px;
}

.center-reverse-svg {
  width: 52px;
  height: 58px;
  filter: drop-shadow(2px 3px 0px rgba(0, 0, 0, 0.85));
}

.card-large .center-reverse-svg {
  width: 66px;
  height: 72px;
}

.bold-draw2 {
  font-size: 42px;
}

.card-large .bold-draw2 {
  font-size: 54px;
}

/* Wild Card Authentic Mattel Visuals */
.wild-center-container {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
}

.wild-white-oval {
  width: 78%;
  height: 86%;
  background: #ffffff;
  border-radius: 50%;
  transform: rotate(-30deg);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.wild-wheel-svg {
  width: 88%;
  height: 88%;
}

.wild-text-pill {
  position: absolute;
  font-family: 'Fredoka', 'Arial Black', Impact, sans-serif;
  font-weight: 900;
  font-size: 17px;
  color: #ffffff;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     3px  3px 0 #000;
  transform: rotate(30deg);
  letter-spacing: 1px;
}

.card-large .wild-text-pill {
  font-size: 21px;
}

.mini-wild-wheel {
  width: 14px;
  height: 18px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.draw4-fanned-cards {
  width: 88%;
  height: 88%;
}

/* Authentic UNO Card Back */
.card-back {
  background-color: #ffffff;
  padding: 4px;
  border-radius: 12px;
  cursor: pointer;
}

.card-back .card-inner-frame {
  background: #141416;
  display: grid;
  place-items: center;
  position: relative;
}

.card-back-red-oval {
  position: absolute;
  width: 78%;
  height: 86%;
  background: #e51d24;
  border-radius: 50%;
  transform: rotate(-25deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-back-logo {
  font-family: 'Fredoka', cursive;
  font-size: 34px;
  font-weight: 800;
  color: #ffd500;
  text-shadow:
    -2px -2px 0 #ffffff,
     2px -2px 0 #ffffff,
    -2px  2px 0 #ffffff,
     2px  2px 0 #ffffff,
     3px  3px 0 #000,
     5px  5px 0 #000;
  transform: rotate(-25deg) skewX(-8deg);
  z-index: 3;
}

.card-large .card-back-logo {
  font-size: 42px;
}

.card-back:hover {
  transform: scale(1.05);
}

/* Draw deck: stacked edges, and a glow when it's your turn to draw */
#draw-deck {
  box-shadow:
    2px 2px 0 -1px #ffffff, 2px 2px 0 0 rgba(0, 0, 0, 0.35),
    4px 4px 0 -1px #ffffff, 4px 4px 0 0 rgba(0, 0, 0, 0.35),
    6px 6px 0 -1px #ffffff, 6px 6px 0 0 rgba(0, 0, 0, 0.35),
    0 12px 22px rgba(0, 0, 0, 0.55);
}

#draw-deck.can-draw {
  cursor: pointer;
  box-shadow:
    2px 2px 0 -1px #ffffff, 2px 2px 0 0 rgba(0, 0, 0, 0.35),
    4px 4px 0 -1px #ffffff, 4px 4px 0 0 rgba(0, 0, 0, 0.35),
    6px 6px 0 -1px #ffffff, 6px 6px 0 0 rgba(0, 0, 0, 0.35),
    0 0 0 3px #fcd116, 0 0 24px rgba(252, 209, 22, 0.65);
}

/* Discard pile: recent cards stay visible under the top card */
.discard-stack {
  position: relative;
  width: 108px;
  height: 160px;
  margin: 18px 30px;
}

.discard-stack .uno-card {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  transition: filter 0.4s ease;
}

.pile-caption {
  min-height: 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.caption-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.uno-card.is-hidden {
  visibility: hidden;
}

/* Cards in flight between the deck, hands and the discard pile */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  overflow: hidden;
}

.fly-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 108px;
  height: 160px;
  perspective: 900px;
  will-change: transform, opacity;
}

.fly-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.fly-card .uno-card {
  position: absolute;
  inset: 0;
  margin: 0;
  transition: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55);
}

.fly-card .fly-back {
  transform: rotateY(180deg);
}

/* Event Activity Ticker */
.event-ticker {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 240px;
  max-height: 180px;
  background: rgba(10, 15, 22, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}

.ticker-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
}

.ticker-content {
  padding: 8px 12px;
  font-size: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
}

.ticker-item {
  color: #cbd5e1;
  line-height: 1.3;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #162131;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 28px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.color-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.color-btn {
  height: 80px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  border: 3px solid white;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-btn:hover {
  transform: scale(1.05);
}

.btn-color-red { background: var(--uno-red); color: white; }
.btn-color-blue { background: var(--uno-blue); color: white; }
.btn-color-green { background: var(--uno-green); color: white; }
.btn-color-yellow { background: var(--uno-yellow); color: black; }

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-buttons button {
  flex: 1;
}

/* Leaderboard Modal */
.leaderboard-card {
  max-width: 520px;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-glass);
}

.leaderboard-table th {
  color: var(--text-muted);
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid var(--border-glass);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  transition: all 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}
