/* ─── UNO Multiplayer — Stylesheet ────────────────────────────────────────── */
/* Premium dark theme with glassmorphism, gradients, and micro-animations     */
/* ────────────────────────────────────────────────────────────────────────── */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #12121f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);

  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #555570;

  --red: #E53935;
  --blue: #1E88E5;
  --green: #43A047;
  --yellow: #FDD835;

  --accent-gradient: linear-gradient(135deg, #E53935 0%, #FDD835 50%, #43A047 75%, #1E88E5 100%);
  --btn-primary-bg: linear-gradient(135deg, #E53935 0%, #d32f2f 100%);
  --btn-secondary-bg: rgba(255, 255, 255, 0.06);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-red: 0 0 30px rgba(229, 57, 53, 0.3);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #0d2847;
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(22, 58, 101, 0.8) 0%, #0d2847 70%);
}

/* ── Screen Management ────────────────────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeIn 0.4s ease;
}

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

/* ── Lobby Container ──────────────────────────────────────────────────────── */
.lobby-container {
  width: 100%;
  max-width: 420px;
  min-height: 100%;
  padding: 40px 20px; /* Increased top/bottom padding to ensure visual breathing room when scrolled */
  margin: 0 auto; /* Horizontally centers the container */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically centers the content when the container is at least 100% height */
  align-items: center;
  gap: 20px;
}

/* ── Logo ──────────────────────────────────────────────────────────────────── */
.logo-section {
  text-align: center;
  margin-bottom: 8px;
}

.uno-logo {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 20px rgba(229, 57, 53, 0.4));
}

.logo-u {
  color: var(--red);
  display: inline-block;
  animation: logoPulse 3s ease-in-out infinite;
}
.logo-n {
  color: var(--yellow);
  display: inline-block;
  animation: logoPulse 3s ease-in-out 0.3s infinite;
}
.logo-o {
  color: var(--green);
  display: inline-block;
  animation: logoPulse 3s ease-in-out 0.6s infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* ── Form Card (glass) ────────────────────────────────────────────────────── */
.form-card {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 18, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── Inputs ────────────────────────────────────────────────────────────────── */
input[type="text"] {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus {
  border-color: rgba(229, 57, 53, 0.5);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  width: 100%;
  height: auto;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover:not(:disabled)::before {
  width: 400px;
  height: 400px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-3px);
}

.btn:active:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn-large {
  height: 54px;
  font-size: 16px;
}

.btn-icon {
  font-size: 20px;
  font-weight: normal;
  position: relative;
  z-index: 1;
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.4);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.6);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.9) 0%, rgba(25, 118, 210, 0.9) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.5);
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-start {
  margin-top: 4px;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.divider span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ── Waiting Room ──────────────────────────────────────────────────────────── */
.room-header {
  text-align: center;
}

.room-header h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 8px;
}

.room-code-display {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 4px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(229, 57, 53, 0.3));
}

.btn-share {
  margin: 6px auto 0;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  border: 1.5px solid rgba(67, 160, 71, 0.45);
  color: rgba(100, 220, 105, 0.85);
  background: rgba(67, 160, 71, 0.08);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-share:hover {
  background: rgba(67, 160, 71, 0.2);
  color: #a5d6a7;
  border-color: rgba(67, 160, 71, 0.7);
}
.btn-share.copied {
  background: rgba(67, 160, 71, 0.35);
  color: #fff;
  border-color: #43a047;
}

.share-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

/* ── Players Card ──────────────────────────────────────────────────────────── */
.players-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 310px;   /* fits the 260px circle + heading + hint */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.players-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(229, 57, 53, 0.2);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

/* ── Player List ──────────────────────────────────────────────────────────── */
#player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0; margin: 0;
}
#player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  border: 1.5px solid transparent;
}
#player-list li .player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
#player-list li .host-badge {
  margin-left: auto;
  font-size: 11px; color: var(--yellow);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
#player-list li .you-badge {
  font-size: 11px; color: var(--green); font-weight: 700;
}
#player-list li .drag-handle {
  cursor: grab;
  font-size: 16px; color: rgba(255,255,255,0.2);
  margin-right: 2px; flex-shrink: 0;
  user-select: none; transition: color 0.15s;
  line-height: 1; letter-spacing: -2px;
}
#player-list li .btn-kick {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--red);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
#player-list li .btn-kick:hover {
  opacity: 1;
  background: rgba(229, 57, 53, 0.1);
}
#player-list li:hover .drag-handle { color: rgba(255,255,255,0.45); }
#player-list li.drag-over {
  border-color: rgba(100,180,255,0.55);
  background: rgba(30,136,229,0.1);
}
#player-list li.dragging { opacity: 0.4; }
#player-list li .seq-num {
  font-size: 11px; color: rgba(255,255,255,0.28);
  font-weight: 700; min-width: 16px; text-align: center; flex-shrink: 0;
}
.reorder-hint {
  font-size: 11px; color: rgba(255,255,255,0.28);
  text-align: center; margin-top: 6px; letter-spacing: 0.3px;
}



/* wrapper div injected by JS */
.player-circle {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

/* central table disc */
.circle-table {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 88px; height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229,57,53,0.12) 0%, rgba(0,0,0,0.3) 100%);
  border: 1.5px solid rgba(229,57,53,0.25);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.circle-table .ct-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
}
.circle-table .ct-arrow {
  font-size: 22px;
  color: rgba(255,255,255,0.2);
  line-height: 1;
}

/* individual seat */
.circle-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  cursor: default;
}

.circle-seat .c-seq {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  line-height: 1;
}

.circle-seat .c-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
  border: 2.5px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.2s, border-color 0.2s;
}
.circle-seat:hover .c-avatar {
  transform: scale(1.08);
}

/* "You" seat is always gold-bordered */
.circle-seat--me .c-avatar {
  border-color: #FDD835;
  box-shadow: 0 0 14px rgba(253,216,53,0.35), 0 2px 8px rgba(0,0,0,0.4);
}

.circle-seat .c-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.circle-seat--me .c-name {
  color: #FDD835;
}

.circle-seat .c-badges {
  display: flex; gap: 3px; justify-content: center;
}
.c-badge-host {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--yellow);
  background: rgba(253,216,53,0.1);
  border: 1px solid rgba(253,216,53,0.3);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 16px;
}

/* Reorder buttons — shown below avatar for host, only visible on hover */
.circle-seat .c-reorder {
  display: flex; gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  margin-top: 1px;
}
.circle-seat:hover .c-reorder {
  opacity: 1;
}
.c-reorder-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.15s;
}
.c-reorder-btn:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Hint below circle */
.circle-hint {
  text-align: center;
  margin-top: 10px;
  font-size: 10px;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.3px;
}


/* ── Settings Card ─────────────────────────────────────────────────────────── */
.settings-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--red);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Game Screen ───────────────────────────────────────────────────────────── */
#game-screen {
  background: #0a0a14;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#game-screen.active {
  display: block;
}

#game-canvas {
  display: block;
  position: absolute;
  top: 0;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Fullscreen Button ─────────────────────────────────────────────────────── */
.btn-fullscreen {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 800;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  display: none; /* hidden until game screen is active */
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-fullscreen:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
}

.btn-fullscreen:active {
  transform: scale(0.92);
}

#game-screen.active ~ * .btn-fullscreen,
#game-screen.active .btn-fullscreen {
  display: flex;
}

/* ── Landscape / Fullscreen Mode ───────────────────────────────────────────── */
/* When .landscape is added to body, rotate the entire game 90° */
body.landscape {
  overflow: hidden;
}

body.landscape #game-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vh;
  height: 100vw;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
}

body.landscape #anim-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vh;
  height: 100vw;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
}

body.landscape #toast-container {
  transform: translateX(-50%) rotate(90deg);
  top: auto;
  left: 20px;
  bottom: 50%;
}

body.landscape .btn-fullscreen {
  bottom: auto;
  right: auto;
  top: 16px;
  left: 16px;
  transform: rotate(-90deg);
}

body.landscape .btn-fullscreen:active {
  transform: rotate(-90deg) scale(0.92);
}

/* ── Animation Overlay ─────────────────────────────────────────────────────── */
#anim-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 500;
}

.anim-el {
  position: absolute;
  pointer-events: none;
  animation-fill-mode: forwards;
}

/* Card Played — golden pulse */
.anim-card-played {
  top: 30%;
  left: 50%;
  width: 160px;
  height: 160px;
  margin-left: -80px;
  margin-top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.5) 0%, transparent 70%);
  animation: animPulse 0.9s ease-out forwards;
}

@keyframes animPulse {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Skip — red ⊘ symbol */
.anim-skip {
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 900;
  color: #E53935;
  text-shadow: 0 0 30px rgba(229, 57, 53, 0.8), 0 0 60px rgba(229, 57, 53, 0.4);
  animation: animSkip 1.8s ease-out forwards;
}

@keyframes animSkip {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-90deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.2) rotate(0deg); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5) rotate(15deg); opacity: 0; }
}

/* Feature 7: Reverse — 720deg spin with scale pump */
.anim-reverse-spin {
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 0 60px rgba(255, 215, 0, 0.5), 0 0 100px rgba(255, 215, 0, 0.2);
  animation: animReverseSpin 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.anim-reverse-label {
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font);
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  animation: animFadeUp 1.8s ease-out forwards;
}

@keyframes animReverseSpin {
  0%   { transform: translate(-50%, -50%) rotate(0deg)   scale(0.5);  opacity: 0; }
  12%  { transform: translate(-50%, -50%) rotate(80deg)  scale(1.3);  opacity: 1; }
  40%  { transform: translate(-50%, -50%) rotate(360deg) scale(1);    opacity: 1; }
  75%  { transform: translate(-50%, -50%) rotate(620deg) scale(1.1);  opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(720deg) scale(1.4);  opacity: 0; }
}

@keyframes animFadeUp {
  0% { opacity: 0; transform: translate(-50%, -50%) translateY(10px); }
  30% { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-20px); }
}

/* Plus Cards — big red +N */
.anim-plus {
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 72px;
  font-weight: 900;
  font-family: var(--font);
  color: #ff4444;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.4);
  animation: animPlus 2s ease-out forwards;
}

@keyframes animPlus {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) translateY(-50px); opacity: 0; }
}

/* Red flash overlay */
.anim-red-flash {
  inset: 0;
  background: rgba(229, 57, 53, 0.25);
  animation: animFlash 1s ease-out forwards;
}

@keyframes animFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Feature 6: Better UNO burst — scale pump + glow + shake */
.anim-uno-burst {
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 88px;
  font-weight: 900;
  font-family: var(--font);
  color: #E53935;
  text-shadow:
    0 0 20px rgba(229, 57, 53, 1),
    0 0 40px rgba(229, 57, 53, 0.8),
    0 0 80px rgba(229, 57, 53, 0.5),
    0 0 120px rgba(255, 100, 50, 0.3);
  animation: animUnoBurst 1400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes animUnoBurst {
  0%   { transform: translate(-50%, -50%) scale(0);    opacity: 0; }
  25%  { transform: translate(-50%, -50%) scale(1.4);  opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(1) translateX(-4px); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1) translateX(4px);  opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1) translateX(-3px); opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(1) translateX(0px);  opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}

/* Feature 8: Color Change — expanding ring from discard pile + table flash */
.anim-color-ring {
  top: 38%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  margin-top: -40px;
  border-radius: 50%;
  border: 6px solid var(--ring-color, #fff);
  box-shadow: 0 0 30px var(--ring-color, #fff), inset 0 0 20px rgba(255,255,255,0.1);
  animation: animColorRing 1200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes animColorRing {
  0%   { transform: scale(0.2);  opacity: 1; }
  50%  { transform: scale(3);    opacity: 0.8; }
  100% { transform: scale(6);    opacity: 0; }
}

.anim-color-flash {
  inset: 0;
  animation: animColorTableFlash 1200ms ease-out forwards;
}
.anim-color-flash--red    { background: rgba(229, 57,  53,  0.18); }
.anim-color-flash--blue   { background: rgba(30,  136, 229, 0.18); }
.anim-color-flash--green  { background: rgba(67,  160, 71,  0.18); }
.anim-color-flash--yellow { background: rgba(253, 216, 53,  0.18); }
.anim-color-flash--wild   { background: rgba(200, 150, 255, 0.15); }

@keyframes animColorTableFlash {
  0%   { opacity: 1; }
  60%  { opacity: 0.6; }
  100% { opacity: 0; }
}

/* Feature 9: Winner confetti bits */
@keyframes confettiFall {
  0%   { transform: translateX(0) translateY(0) rotate(0deg);   opacity: 1; }
  100% { transform: translateX(var(--cx, 0px)) translateY(100vh) rotate(720deg); opacity: 0; }
}

.anim-confetti-bit {
  position: absolute;
  will-change: transform, opacity;
  pointer-events: none;
}

/* Card fly from deck to player */
.anim-card-fly {
  width: 44px;
  height: 64px;
  background: linear-gradient(145deg, #c62828 0%, #b71c1c 100%);
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  font-size: 0;   /* hide text content */
  will-change: transform, opacity;
  z-index: 600;
}

/* ── Toast Notifications ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  background: rgba(20, 20, 35, 0.92);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
  text-align: center;
  max-width: 320px;
}

.toast.error {
  border-color: rgba(229, 57, 53, 0.4);
  color: #ff6b6b;
}

.toast.toast-afk {
  background: linear-gradient(135deg, rgba(180, 100, 0, 0.92), rgba(120, 60, 0, 0.95));
  border-color: rgba(255, 165, 0, 0.5);
  color: #ffe0a0;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  box-shadow: 0 0 18px rgba(255, 165, 0, 0.25);
}

.toast.toast-afk strong {
  color: #ffd700;
}

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

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

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .lobby-container {
    padding: 40px 24px;
  }
  .uno-logo {
    font-size: 96px;
  }
}

@media (max-width: 350px) {
  .uno-logo {
    font-size: 56px;
  }
  .form-card {
    padding: 18px;
  }
  .room-code-display {
    font-size: 28px;
  }
}

/* ── Input Groups ──────────────────────────────────────────────────────────── */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: var(--font);
}

input[type="text"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(138, 180, 248, 0.4);
  box-shadow: 0 0 0 4px rgba(138, 180, 248, 0.1);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* ── Button Groups ─────────────────────────────────────────────────────────── */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-large {
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 700;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Lobby Tabs ────────────────────────────────────────────────────────────── */
.lobby-tabs {
  width: 100%;
  margin-bottom: 20px;
}

.tab-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover:not(.tab-btn--active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn--active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: tabFadeIn 0.2s ease;
}

.tab-panel--hidden {
  display: none;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Private Room Pill Toggle ──────────────────────────────────────────────── */
.private-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, border-color 0.2s;
}

.private-toggle-row:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.private-toggle-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.private-toggle-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.private-toggle-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.private-toggle-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* The pill switch container (sits beside the text) */
.pill-switch {
  flex-shrink: 0;
  position: relative;
}

.pill-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pill-track {
  display: block;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s;
}

.pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Checked state */
.pill-switch input[type="checkbox"]:checked ~ .pill-track {
  background: var(--red);
  border-color: rgba(229, 57, 53, 0.6);
  box-shadow: 0 0 12px rgba(229, 57, 53, 0.3);
}

.pill-switch input[type="checkbox"]:checked ~ .pill-track .pill-thumb {
  transform: translateX(22px);
  background: #fff;
}

/* When checked, highlight the whole row */
.private-toggle-row:has(input:checked) {
  background: rgba(229, 57, 53, 0.06);
  border-color: rgba(229, 57, 53, 0.25);
}

.private-toggle-row:has(input:checked) .private-toggle-title {
  color: #fff;
}

.private-toggle-row:has(input:checked) .private-toggle-icon {
  filter: none;
}



/* ── Browse Rooms Screen ──────────────────────────────────────────────────── */

/* The form-card already provides the glass panel — we just need a modifier
   to let the rooms-list breathe inside without extra padding fighting */
.browse-card {
  gap: 20px;
  max-width: 480px;
}

/* Top row: "Public Rooms" title + refresh icon button */
.browse-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browse-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

/* Small circular icon-only pill button for Refresh */
.btn-icon-pill {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.btn-icon-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-icon-pill:active {
  transform: rotate(180deg) scale(0.92);
  transition: transform 0.3s ease;
}

/* Room list scroll area */
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44vh;
  min-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
  /* Fade mask at bottom to hint at scrollability */
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.rooms-list::-webkit-scrollbar {
  width: 4px;
}

.rooms-list::-webkit-scrollbar-track {
  background: transparent;
}

.rooms-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.rooms-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Empty / loading states */
.loading-text,
.empty-text {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 24px;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.loading-text::before {
  content: '⏳';
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.empty-text::before {
  content: '🎮';
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
}

/* Individual room cards */
.room-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.25s;
}

.room-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

.room-card:hover::before {
  opacity: 1;
}

.room-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.room-code-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  letter-spacing: 1.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-host {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-host::before {
  content: '👑';
  font-size: 11px;
  flex-shrink: 0;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-players {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.room-players::before {
  content: '👥';
  font-size: 10px;
}

.room-status {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-status.lobby {
  background: rgba(253, 216, 53, 0.15);
  color: #FDD835;
  border: 1px solid rgba(253, 216, 53, 0.35);
}

.room-status.playing {
  background: rgba(67, 160, 71, 0.15);
  color: #43A047;
  border: 1px solid rgba(67, 160, 71, 0.35);
}

/* Join / Spectate button on each room card */
.btn-join-room {
  /* Override .btn base which sets width:100% — we need auto here */
  width: auto !important;
  flex-shrink: 0;
  padding: 10px 22px;
  background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  align-self: center;
}

.btn-join-room::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
}

.btn-join-room:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.55);
}

.btn-join-room:hover:not(:disabled)::before {
  background: rgba(255, 255, 255, 0.08);
}

.btn-join-room:active:not(:disabled) {
  transform: translateY(0);
}

.btn-join-room:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Browse Rooms Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .browse-card {
    padding: 24px 20px;
  }

  .room-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .btn-join-room {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  .rooms-list {
    max-height: 55vh;
  }
}



/* ── Ping Indicator ───────────────────────────────────────────────────────── */
.ping-indicator {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(15, 15, 26, 0.75);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  z-index: 1000;
  pointer-events: none;
}

.ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43A047;
  box-shadow: 0 0 8px currentColor;
}

.ping-indicator.yellow .ping-dot {
  background: #FDD835;
}

.ping-indicator.red .ping-dot {
  background: #E53935;
  animation: ping-pulse 1s infinite;
}

@keyframes ping-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Reconnect Overlay ────────────────────────────────────────────────────── */
.reconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.reconnect-card {
  background: rgba(18, 37, 68, 0.95);
  border: 1px solid rgba(138, 180, 248, 0.3);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
}

.reconnect-card h3 {
  margin: 16px 0 8px;
  color: #fff;
  font-size: 20px;
}

.reconnect-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 4px solid rgba(138, 180, 248, 0.2);
  border-top-color: #42A5F5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Manage Players Button ────────────────────────────────────────────────── */
.btn-manage-players {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(18, 37, 68, 0.9);
  border: 1px solid rgba(138, 180, 248, 0.3);
  padding: 8px 14px;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}

.btn-manage-players:hover {
  background: rgba(18, 37, 68, 1);
  border-color: rgba(138, 180, 248, 0.5);
}

/* ── Manage Players Modal ─────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: rgba(18, 37, 68, 0.98);
  border: 1px solid rgba(138, 180, 248, 0.3);
  border-radius: 16px;
  padding: 24px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
}

.btn-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: opacity 0.2s;
}

.btn-close:hover {
  opacity: 0.7;
}

#manage-player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manage-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.manage-player-item .player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E53935 0%, #FDD835 50%, #43A047 75%, #1E88E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.manage-player-item span {
  flex: 1;
  color: #fff;
}

.manage-player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.manage-player-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manage-player-status {
  font-size: 11px;
  color: rgba(229, 57, 53, 0.8);
  font-weight: 500;
}

.manage-player-item .host-badge {
  flex: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(253, 216, 53, 0.2);
  color: #FDD835;
  border-radius: 4px;
  border: 1px solid rgba(253, 216, 53, 0.3);
}

.manage-player-item .btn-kick {
  flex-shrink: 0;
  padding: 7px 14px;
  background: rgba(229, 57, 53, 0.15);
  color: #ef9a9a;
  border: 1px solid rgba(229, 57, 53, 0.35);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}

.manage-player-item .btn-kick:hover {
  background: #E53935;
  color: #fff;
  border-color: #E53935;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}


/* ── Browse Rooms Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .browse-container {
    padding: 24px;
  }

  .browse-header h2 {
    font-size: 20px;
  }

  .browse-actions {
    flex-direction: column;
  }

  .btn-back,
  .btn-refresh {
    width: 100%;
  }

  .room-card {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .room-info {
    width: 100%;
  }

  .btn-join-room {
    width: 100%;
  }

  .rooms-list {
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  .browse-container {
    padding: 20px;
  }

  .room-code-text {
    font-size: 16px;
  }

  .private-room-toggle {
    padding: 10px;
  }
}
