/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt:        #1f6b2e;
  --felt-dark:   #0f3d1a;
  --felt-light:  #2a7d39;
  --card-bg:     #fffef5;
  --card-border: rgba(0,0,0,0.12);
  --card-shadow: 0 2px 4px rgba(0,0,0,0.45), 0 6px 14px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.8);
  --card-shadow-hover: 0 8px 22px rgba(0,0,0,0.55), 0 16px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.8);
  --red:         #cc1f1f;
  --black:       #111;
  --gold:        #f5c518;
  --gold-dark:   #c9a012;
  --gold-glow:   rgba(245,197,24,0.4);
  --radius:      10px;
  --card-radius: 8px;
  --font:        'Cinzel', 'Georgia', serif;
  --font-ui:     'Inter', 'Segoe UI', Arial, sans-serif;
  --card-w:      68px;
  --card-h:      96px;
  --card-sm-w:   44px;
  --card-sm-h:   62px;
}

body {
  font-family: var(--font-ui);
  background: var(--felt-dark);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ===== LOBBY ===== */
#screen-lobby {
  align-items: stretch;
  justify-content: stretch;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(0,0,0,0.06) 28px,
      rgba(0,0,0,0.06) 29px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      rgba(0,0,0,0.06) 28px,
      rgba(0,0,0,0.06) 29px
    ),
    linear-gradient(155deg, #1a6128 0%, #0d3d18 55%, #061a09 100%);
  position: relative;
  overflow: hidden;
}

/* ── Two-panel wrap ── */
.lobby-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: stretch;
}

/* ── Left: Branding ── */
.lobby-brand {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 56px 40px;
  position: relative;
  overflow: hidden;
}

/* Giant watermark suit — controlled via JS for smooth cycling */
.lobby-brand::before { display: none; }

.lobby-bg-suit {
  position: absolute;
  bottom: -120px;
  right: -60px;
  font-size: 560px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  /* Transition diset JS per fase (exit vs enter beda easing) */
  will-change: opacity, transform;
}

/* Thin gold divider on right edge */
.lobby-brand::after {
  content: '';
  position: absolute;
  top: 15%;
  right: 0;
  width: 1px;
  height: 70%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(245,197,24,0.22) 25%,
    rgba(245,197,24,0.22) 75%,
    transparent 100%
  );
}

/* Card stack decoration */
.brand-deco { position: relative; width: 170px; height: 180px; }
.bcs-back, .bcs-mid, .bcs-front {
  position: absolute;
  width: 102px; height: 144px;
  border-radius: 11px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.65), 0 3px 8px rgba(0,0,0,0.4);
}
.bcs-back {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 2px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(145deg, #1c3d8e, #0b1d60);
  border: 1.5px solid rgba(255,255,255,0.08);
  top: 28px; left: 0;
  transform: rotate(-13deg);
}
.bcs-mid {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.04) 0px,
      rgba(255,255,255,0.04) 2px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(145deg, #1f4a9a, #102270);
  border: 1.5px solid rgba(255,255,255,0.1);
  top: 14px; left: 28px;
  transform: rotate(-5deg);
}

.brand-card-stack { perspective: 800px; }

.bcs-front {
  background: #fffef5;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.7) 0%, transparent 65%),
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.04) 0%, transparent 60%);
  border: 1px solid rgba(0,0,0,0.11);
  top: 0; left: 54px;
  transform: rotate(4deg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  will-change: transform, filter;
  backface-visibility: hidden;
}

.bcs-corner {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; gap: 1px;
}
.bcs-tl { top: 7px; left: 8px; }
.bcs-br { bottom: 7px; right: 8px; transform: rotate(180deg); }

.bcs-rank {
  font-family: var(--font); font-size: 1.1rem;
  font-weight: 700; line-height: 1; color: #111;
}
.bcs-suit { font-size: 0.85rem; line-height: 1; color: #111; }

.bcs-suit-center {
  font-size: 3rem; line-height: 1; color: #111;
}

.bcs-front.red .bcs-rank,
.bcs-front.red .bcs-suit,
.bcs-front.red .bcs-suit-center { color: var(--red); }
.bcs-front.black .bcs-rank,
.bcs-front.black .bcs-suit,
.bcs-front.black .bcs-suit-center { color: #111; }

.bcs-joker-hint {
  margin-top: 6px; font-size: 0.65rem;
  color: rgba(245,197,24,0.45); letter-spacing: 0.5px;
  text-align: center; width: 160px;
}

/* Brand text */
.brand-text { text-align: center; }
.brand-tagline {
  font-size: 0.6rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 10px;
}
.brand-title {
  font-family: var(--font);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(175deg, #fff 0%, #f7e08a 35%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.08;
  filter: drop-shadow(0 3px 20px rgba(0,0,0,0.55));
}
.brand-aka {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px; justify-content: center;
}
.brand-line {
  flex: 1; max-width: 44px; height: 1px;
  background: linear-gradient(to right, transparent, rgba(245,197,24,0.45));
}
.brand-aka .brand-line:last-child {
  background: linear-gradient(to left, transparent, rgba(245,197,24,0.45));
}
.brand-aka-text {
  font-family: var(--font);
  font-size: 1.05rem;
  color: rgba(245,197,24,0.72);
  letter-spacing: 2px;
}

/* Stats strip — number + label, no emoji badges */
.brand-stats {
  display: flex;
  align-items: center;
}
.brand-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 26px;
}
.bs-num {
  font-family: var(--font);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245,197,24,0.35);
}
.bs-lbl {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,0.3);
  margin-top: 5px;
  white-space: nowrap;
}
.bs-sep {
  width: 1px;
  height: 36px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(245,197,24,0.25) 30%,
    rgba(245,197,24,0.25) 70%,
    transparent
  );
}

/* Suits — properly colored */
.brand-suits {
  display: flex;
  gap: 24px;
  font-size: 2rem;
}
.suit-black {
  color: rgba(210,235,220,0.7);
  text-shadow: 0 0 14px rgba(210,235,220,0.25);
}
.suit-red {
  color: rgba(220,55,55,0.75);
  text-shadow: 0 0 14px rgba(220,55,55,0.3);
}

/* ── Right: Form panel ── */
.lobby-panel {
  flex: 0 0 410px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 38px;
  background: rgba(4,18,9,0.88);
  backdrop-filter: blur(24px);
  position: relative;
  overflow-y: auto;
  box-shadow: -1px 0 0 rgba(245,197,24,0.1), -8px 0 32px rgba(0,0,0,0.35);
}

.lp-header {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.lp-eyebrow {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(245,197,24,0.45);
  margin-bottom: 8px;
  font-weight: 500;
}
.lp-header h2 {
  font-family: var(--font);
  font-size: 1.55rem;
  color: #fff;
  letter-spacing: 1.5px;
  font-weight: 700;
  line-height: 1.15;
}
/* Accent bar below header */
.lp-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 40px; height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* ── Fields ── */
.lp-field { margin-bottom: 20px; }
.lp-label {
  display: block;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 9px;
  font-weight: 600;
}

/* Inputs */
.lobby-panel input[type="text"],
.lobby-panel input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #fff; font-size: 0.92rem;
  outline: none; font-family: var(--font-ui);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lobby-panel input:focus {
  border-color: rgba(245,197,24,0.45);
  background: rgba(245,197,24,0.03);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.09);
}
.lobby-panel input::placeholder { color: rgba(255,255,255,0.18); }

/* Room code input — centered monospace */
.lobby-panel input.input-code {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 16px;
}

/* ── Tabs — underline style ── */
.lp-tabs {
  display: flex;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 22px;
  gap: 0;
  background: none;
  border-radius: 0;
  padding: 0;
}
.lp-tab {
  flex: 1;
  padding: 11px 8px;
  background: none; border: none;
  color: rgba(255,255,255,0.28);
  font-size: 0.72rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-ui);
  text-transform: uppercase; letter-spacing: 1.5px;
  position: relative;
  transition: color 0.2s;
}
.lp-tab:hover:not(.active) { color: rgba(255,255,255,0.55); }
.lp-tab.active { color: var(--gold); }
.lp-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 15%; right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  border-radius: 2px;
}

.lp-section { display: flex; flex-direction: column; gap: 14px; }

/* ── Settings ── */
.settings-card {
  background: rgba(255,255,255,0.025);
  border-radius: 12px;
  padding: 4px 18px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-card-title {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  padding: 13px 0 10px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 2px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  font-size: 0.84rem;
  gap: 12px;
  color: rgba(255,255,255,0.58);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.setting-row:last-child { border-bottom: none; padding-bottom: 4px; }
.setting-row > label { display: flex; align-items: center; flex-shrink: 0; }
.setting-icon { display: none; }

/* Control wrapper — uniform width, right-aligned */
.setting-ctrl {
  width: 120px;
  flex-shrink: 0;
  display: block;
}

/* ── Button ── */
.btn-full {
  flex: none !important;
  width: 100%;
  margin-top: 2px;
  padding: 15px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 10px;
}

/* Legacy compat */
.lobby-buttons, .join-form { display: flex; gap: 10px; }
.join-form .input-wrap { flex: 1; }
.lobby-form { display: flex; flex-direction: column; gap: 12px; }
.lobby-form input[type="text"],
.lobby-form input[type="number"] {
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #fff; font-size: 1rem; outline: none;
  width: 100%; font-family: var(--font-ui);
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}
.lobby-form input:focus {
  border-color: rgba(245,197,24,0.65);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.16);
}
.lobby-form input::placeholder { color: rgba(255,255,255,0.28); }
.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.35); font-size: 0.95rem; pointer-events: none;
}

/* ── Settings legacy ── */
.room-settings {
  background: rgba(0,0,0,0.22);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid rgba(245,197,24,0.14);
}
.settings-title {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  font-weight: 600;
}

.setting-ctrl select,
.setting-ctrl input[type="number"] {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-family: var(--font-ui);
  text-align: center;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.setting-ctrl select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23f5c518' fill-opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.setting-ctrl select:focus,
.setting-ctrl input[type="number"]:not(:disabled):focus {
  outline: none;
  border-color: rgba(245,197,24,0.4);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.08);
}
.setting-ctrl select option { background: #0a2010; color: #fff; }
.setting-ctrl input[type="number"]:disabled { opacity: 0.28; cursor: not-allowed; }

/* Checkbox + number inline — must come after generic .setting-ctrl rule */
.setting-ctrl-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-ctrl-check input[type="number"] {
  flex: 1;
  min-width: 0;
  width: auto;
}
.setting-row input[type="checkbox"] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 22px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  flex: 1;
  letter-spacing: 0.3px;
  font-family: var(--font-ui);
}
/* Squash & Stretch on press (css-animation-creator: micro-interaction 100-200ms) */
.btn:active  { transform: scaleX(0.97) scaleY(0.94) !important; transition-duration: 0.08s !important; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(155deg, #ffe259 0%, #f5c518 48%, #c9920a 100%);
  color: #1a1a1a;
  box-shadow:
    0 4px 18px rgba(245,197,24,0.4),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.25);
  text-shadow: 0 1px 2px rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(155deg, #ffec74 0%, #ffd028 48%, #e0a800 100%);
  box-shadow:
    0 6px 24px rgba(245,197,24,0.58),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.18); }

.btn-danger { background: linear-gradient(135deg, #e53935, #c62828); color: #fff; }
.btn-danger:hover:not(:disabled) { background: linear-gradient(135deg, #ef5350, #e53935); }
.btn-danger-outline { background: transparent; color: #ef9a9a; border: 1px solid rgba(239,154,154,0.5); }
.btn-danger-outline:hover:not(:disabled) { background: rgba(239,154,154,0.08); }

.btn-success {
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}
.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #66bb6a, #43a047);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(245,197,24,0.4);
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(245,197,24,0.55);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.24);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

.btn-sm    { padding: 7px 13px; font-size: 0.82rem; flex: none; }
.btn-small {
  padding: 4px 10px; font-size: 0.8rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.22); background: transparent;
  color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.15s;
}
.btn-small:hover { background: rgba(255,255,255,0.1); }

.hidden { display: none !important; }

.error-msg {
  background: rgba(198,40,40,0.14);
  border: 1px solid rgba(198,40,40,0.4);
  color: #ef9a9a;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
}

/* ===== WAITING ROOM ===== */
#screen-waiting {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 90%, rgba(245,197,24,0.09) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 10%, rgba(245,197,24,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at center, #1d7a2e 0%, #07240d 100%);
}

.waiting-container {
  background: linear-gradient(165deg, rgba(6,44,16,0.95) 0%, rgba(2,14,6,0.97) 100%);
  border: 1px solid rgba(245,197,24,0.28);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 520px;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(245,197,24,0.06),
    0 32px 80px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(245,197,24,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.4);
}
.waiting-container h2 {
  margin-bottom: 22px;
  font-family: var(--font);
  font-size: 1.55rem;
  color: var(--gold);
}

.room-code-display {
  font-size: 0.95rem;
  margin-bottom: 26px;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.room-code-display strong {
  color: var(--gold);
  font-size: 1.9rem;
  letter-spacing: 10px;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 18px var(--gold-glow), 0 0 36px rgba(245,197,24,0.2);
}

.player-slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

.player-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.player-slot.empty  { opacity: 0.28; font-style: italic; }
.player-slot.bot    { border-color: rgba(245,197,24,0.22); }
.player-slot.me     {
  border-color: rgba(245,197,24,0.55);
  background: rgba(245,197,24,0.06);
  box-shadow: 0 0 18px rgba(245,197,24,0.1), inset 0 0 12px rgba(245,197,24,0.04);
}

.slot-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.player-slot.bot .slot-avatar { background: linear-gradient(135deg, rgba(100,100,255,0.2), rgba(100,100,255,0.05)); }

.slot-info { flex: 1; text-align: left; }
.slot-name { font-weight: 600; font-size: 0.95rem; }
.slot-sub  { font-size: 0.73rem; color: rgba(255,255,255,0.38); margin-top: 1px; }

/* Legacy slot-number / slot-name compatibility */
.slot-number {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}

.slot-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.slot-badge.host      { background: var(--gold); color: #1a1a1a; }
.slot-badge.bot-badge { background: rgba(100,100,255,0.22); border: 1px solid rgba(100,100,255,0.3); }

.room-info-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.room-info-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 5px;
}
.room-info-chip span { color: var(--gold); font-weight: 600; }

/* Host editable settings dalam waiting room */
.ws-settings {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.ws-setting-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
}
.ws-lbl {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
.ws-select, .ws-settings input[type="number"] {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0 2px;
  appearance: auto;
}
.ws-target-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ws-settings input[type="checkbox"] {
  accent-color: var(--gold);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.bot-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.waiting-actions { margin-bottom: 20px; }
.hint { color: rgba(255,255,255,0.42); font-size: 0.84rem; margin-top: 12px; }

/* ===== GAME TABLE ===== */
#screen-game {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(50,140,65,0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(0,0,0,0.6) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #1f6b2e 0%, #164f22 50%, #0f3d1a 100%);
  background-size: auto, auto, 200px 200px, auto;
  /* display: grid set only when active — prevents bleed-through when screen is hidden */
  grid-template-rows: auto 1fr auto auto auto;
  min-height: 100vh;
  position: relative;
}
#screen-game.active { display: grid; }
/* Table border shadow */
#screen-game::before {
  content: '';
  position: fixed; inset: 0;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 50;
}

/* ===== HEADER ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.44) 100%);
  border-bottom: 1px solid rgba(245,197,24,0.1);
  font-size: 0.82rem;
  flex-wrap: nowrap;
  gap: 6px;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
  min-height: 42px;
}

.joker-info {
  display: flex; align-items: center; gap: 6px;
  color: var(--gold); font-weight: 600; font-size: 0.78rem;
  flex-shrink: 0;
}
#joker-rank-display {
  font-size: 0.88rem;
  background: rgba(245,197,24,0.14);
  padding: 1px 8px; border-radius: 4px;
  border: 1px solid rgba(245,197,24,0.38);
}
.joker-ref-card { font-size: 0.68rem; }

.header-center {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  flex: 1; justify-content: center; min-width: 0;
}
.round-info {
  font-weight: 700; color: rgba(255,255,255,0.75); font-size: 0.78rem;
  letter-spacing: 0.3px; white-space: nowrap; flex-shrink: 0;
}

.turn-info {
  background: rgba(255,255,255,0.08);
  padding: 3px 10px; border-radius: 20px; font-size: 0.78rem;
  transition: all 0.35s; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 260px;
}
.turn-info.my-turn {
  background: linear-gradient(135deg, #ffe259, var(--gold-dark));
  color: #1a1a1a;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(245,197,24,0.5), 0 2px 6px rgba(0,0,0,0.3);
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

/* ── TIMER ── */
.timer-wrapper {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.timer-seconds {
  font-size: 1.1rem; font-weight: 700;
  font-family: 'Courier New', monospace;
  color: rgba(255,255,255,0.85);
  line-height: 1; transition: color 0.4s;
  min-width: 28px; text-align: right;
}
.timer-seconds.urgent      { color: #ff5252; animation: timerPulse 0.45s ease infinite alternate; }
.timer-seconds.very-urgent { color: #ff2020; animation: timerShake 0.28s ease infinite; text-shadow: 0 0 12px rgba(255,32,32,0.8); }
.timer-seconds.no-timer { display: none; }

@keyframes timerPulse {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0.5; transform: scale(0.95); }
}
@keyframes timerShake {
  0%, 100% { transform: scale(1.0)  translateX(0);   }
  18%       { transform: scale(1.18) translateX(-4px); }
  36%       { transform: scale(1.12) translateX(4px);  }
  54%       { transform: scale(1.18) translateX(-3px); }
  72%       { transform: scale(1.1)  translateX(3px);  }
}

.btn-mute {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.15s;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 6px;
  flex-shrink: 0;
}
.btn-mute:hover { opacity: 1; transform: scale(1.15); }
.btn-mute.muted { opacity: 0.3; }
.btn-show-scores {
  background: rgba(245,197,24,0.15);
  border: 1px solid rgba(245,197,24,0.4);
  color: var(--gold);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 8px;
  font-family: var(--font-ui); font-weight: 700;
  transition: background 0.18s, border-color 0.18s;
  flex-shrink: 0;
}
.btn-show-scores:hover { background: rgba(245,197,24,0.28); border-color: var(--gold); }

.timer-bar-track {
  width: 60px; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
.timer-bar-fill {
  height: 100%; background: var(--gold);
  border-radius: 3px;
  transition: width 1s linear, background 0.5s;
}
.timer-bar-fill.urgent      { background: #ff5252; }
.timer-bar-fill.very-urgent { background: #ff2020; animation: barFlash 0.28s ease infinite alternate; }
@keyframes barFlash {
  from { opacity: 1; }
  to   { opacity: 0.35; }
}

/* ===== OPPONENTS ===== */
.opponents-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 10px 4px; gap: 8px; flex: 1;
  position: relative; z-index: 1;
}
.side-opponents {
  display: flex; width: 100%; gap: 8px; align-items: stretch; flex: 1;
}

/* UNO-style opponent pod */
.opponent-slot {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.32);
  border-radius: 16px;
  padding: 10px 8px;
  border: 1.5px solid rgba(255,255,255,0.055);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  min-width: 90px;
  backdrop-filter: blur(4px);
}

/* Top opponent: compact horizontal pod */
#opp-top {
  width: auto;
  align-self: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 8px 18px;
  align-items: center;
  min-width: 0;
  max-width: 380px;
  overflow: visible;
}
#opp-top .opp-body {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
#opp-top .opp-name {
  font-size: 0.82rem; font-weight: 700; max-width: 160px;
}
#opp-top .opp-score { font-size: 0.68rem; }

/* Top melds: dedicated strip between pod and center */
.opp-top-meld-strip {
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 8px;
  justify-content: center;
  align-items: center;
  min-height: 0;
}
.opp-top-meld-strip:empty { display: none; }
.opp-top-meld-strip .meld-group + .meld-group {
  border-left: 1.5px solid rgba(255,255,255,0.15);
  padding-left: 6px;
  margin-left: 2px;
}

/* Side opponent pods */
#opp-left, #opp-right { flex: 0 0 108px; }

/* Avatar circle */
.opp-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 100%);
  border: 2px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700;
  color: rgba(255,255,255,0.85);
  position: relative; flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.opp-avatar::before {
  content: attr(data-initial);
  font-size: 1.15rem; font-weight: 700;
  line-height: 1;
}

/* Card count badge on avatar */
.opp-card-badge {
  position: absolute; top: -5px; right: -5px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff; border-radius: 10px;
  min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
  border: 2px solid rgba(0,0,0,0.55);
  padding: 0 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  font-family: var(--font-ui);
}

.opp-name {
  font-size: 0.73rem; font-weight: 600; color: rgba(255,255,255,0.78);
  text-align: center; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 100%;
}
/* opp-cards: hidden — count shown via badge on avatar */
.opp-cards { display: none; }
.opp-melds { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; row-gap: 4px; }
.opp-melds .meld-group + .meld-group {
  border-left: 1.5px solid rgba(255,255,255,0.15);
  padding-left: 5px;
  margin-left: 2px;
}
/* Side meld bar: dedicated row above side-opponent pods */
.opp-side-melds-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 0;
  align-items: start;
}
.side-meld-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 180px;
  align-items: flex-start;
}
.side-meld-panel:empty { display: none; }
.side-meld-right {
  justify-self: end;
  justify-content: flex-end;
  max-width: 180px;
}
.side-meld-panel .meld-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  border-left: none;
  margin-left: 0;
  padding-left: 0;
}
.opp-score {
  font-size: 0.68rem; color: rgba(245,197,24,0.75); font-weight: 700;
  text-align: center;
}
.opp-timer { font-size: 0.68rem; color: rgba(255,255,255,0.38); font-family: monospace; }

/* Kartu belakang mini */
.card-back-mini {
  width: 16px; height: 24px;
  background: linear-gradient(155deg, #1d3d90 0%, #0c1e5e 100%);
  border-radius: 2px; border: 1px solid rgba(255,255,255,0.18);
  display: inline-block; box-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

/* ===== CENTER AREA ===== */
.center-area {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; flex: 1;
}
.card-piles { display: flex; gap: 28px; align-items: center; }

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

.card-pile {
  width: 82px; height: 116px;
  border-radius: 10px;
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s;
}
.card-pile:hover {
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
}

/* Stock depth illusion */
.stock-pile {
  background: rgba(0,0,0,0.3);
}
.stock-pile .card-back {
  width: 100%; height: 100%;
  border-radius: 8px;
}
.stock-pile::before, .stock-pile::after {
  content: '';
  position: absolute; width: 100%; height: 100%;
  border-radius: var(--card-radius);
  background: linear-gradient(155deg, #1d3d90, #0c1e5e);
  border: 1px solid rgba(255,255,255,0.09); z-index: -1;
}
.stock-pile::before { transform: translate(-2px,-2px); opacity: 0.65; }
.stock-pile::after  { transform: translate(-4px,-4px); opacity: 0.3; }

.discard-pile {
  background: rgba(0,0,0,0.2);
  width: var(--card-w);
  height: var(--card-h);
}
.discard-dropzone-wrap {
  padding: 12px;
  border-radius: 14px;
  border: 2px dashed transparent;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.discard-dropzone-wrap.discard-drag-over {
  border-color: var(--red) !important;
  background: rgba(204,31,31,0.08);
  box-shadow: 0 0 22px rgba(204,31,31,0.35);
}
.discard-dropzone-wrap.discard-drag-over .discard-pile {
  border-color: transparent;
  box-shadow: none;
}
.discard-pile.discard-drag-over {
  border-color: var(--red) !important;
  border-style: solid !important;
  box-shadow: 0 0 22px rgba(204,31,31,0.55);
  background: rgba(204,31,31,0.08);
}

.pile-count {
  position: absolute; bottom: -20px;
  font-size: 0.65rem; color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.55); padding: 1px 7px; border-radius: 10px;
}
.pile-count-label { font-size: 0.65rem; color: rgba(255,255,255,0.35); margin-top: 1px; }
.pile-label {
  margin-top: 22px; font-size: 0.66rem; color: rgba(255,255,255,0.35);
  text-align: center; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}

/* Joker ref: floating chip style */
.joker-ref-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 30px;
  padding: 5px 12px 5px 6px;
  backdrop-filter: blur(6px);
}
.joker-chip-label {
  font-size: 0.62rem; color: rgba(245,197,24,0.6);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}
/* Legacy: keep old ref wrapper for compat */
.joker-ref-wrapper { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.joker-ref-label { font-size: 0.66rem; color: rgba(255,255,255,0.38); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== KARTU ===== */
.card {
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.55) 0%, transparent 70%);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; position: relative;
  font-weight: 700; font-family: var(--font);

  /* Fan layout via CSS custom props (set inline per card) */
  --card-rot: 0deg;
  --card-y:   0px;
  transform: rotate(var(--card-rot)) translateY(var(--card-y));
  transform-origin: bottom center;
  transition: box-shadow 0.2s;
}
/* Subtle inner border */
.card::before {
  content: ''; position: absolute; inset: 3px;
  border-radius: calc(var(--card-radius) - 2px);
  border: 1px solid rgba(0,0,0,0.055);
  pointer-events: none;
}

/*
 * ── FAN HAND: wrapper-based hover (fixes flicker) ──
 *
 * Architecture: each card is wrapped in .card-hit-zone
 * The WRAPPER handles fan rotation and has an extended bottom hit-area
 * (padding-bottom: 34px) so it never leaves the cursor when the CARD lifts.
 * The card inside lifts via CSS wrapper:hover — no element-moves-away-from-cursor loop.
 */

/* Wrapper: fan rotation + extended hit area */
.card-hit-zone {
  position: relative;
  flex-shrink: 0;
  margin-left: -18px;
  /* Extended bottom hit area prevents hover flicker when card lifts */
  padding-bottom: 34px;
  margin-bottom: -34px;
  transform: rotate(var(--card-rot, 0deg)) translateY(var(--card-y, 0px));
  transform-origin: bottom center;
  cursor: pointer;
}
.card-hit-zone:first-child { margin-left: 0; }

/* Card inside wrapper: no fan rotation (wrapper handles it) */
.my-hand .card {
  flex-shrink: 0;
  margin-left: 0;
  will-change: transform;
  /* Override fan props — rotation is on wrapper now */
  --card-rot: 0deg;
  --card-y:   0px;
  transform: none;
  transition: transform 0.22s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.22s ease-out;
}

/* Lift card when WRAPPER is hovered (wrapper stays put → no cursor-escape loop) */
.card-hit-zone:hover .card:not(.selected):not(.dragging) {
  transform: translateY(-28px) scale(1.06);
  box-shadow: var(--card-shadow-hover);
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.2s ease-out;
}
/* Hovered zone sits above all siblings */
.card-hit-zone:hover {
  z-index: 200 !important;
}

/* Selected card — hitZone gets z-index boost so card sits above siblings */
.card-hit-zone:has(.card.selected) {
  z-index: 150 !important;
}
.my-hand .card.selected {
  transform: translateY(-20px) scale(1.05) !important;
  box-shadow: 0 14px 32px rgba(245,197,24,0.6), var(--card-shadow);
  outline: 2.5px solid var(--gold);
}

/* Original card while ghost is active — invisible but holds space */
.my-hand .card.dragging {
  opacity: 0;
  pointer-events: none;
}

/* Placeholder shown at insertion point during drag preview */
.my-hand .card.drag-placeholder {
  opacity: 1 !important;
  background-color: rgba(255,255,255,0.05) !important;
  background-image: none !important;
  border: 2px dashed rgba(255,255,255,0.28) !important;
  box-shadow: none !important;
  outline: none !important;
  animation: slotPulse 1.2s ease-in-out infinite !important;
}
.my-hand .card.drag-placeholder > * { visibility: hidden; }
/* Dashed slot where dragged card came from — suppressed when placeholder is shown */
.card-hit-zone:has(.card.drag-placeholder)::after { display: none !important; }
.card-hit-zone:has(.card.dragging)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w, 68px);
  height: var(--card-h, 96px);
  border: 2px dashed rgba(255,255,255,0.28);
  border-radius: var(--card-radius);
  pointer-events: none;
  background: rgba(255,255,255,0.04);
  animation: slotPulse 1.2s ease-in-out infinite;
}
@keyframes slotPulse {
  0%, 100% { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); }
  50%       { border-color: rgba(255,255,255,0.42); background: rgba(255,255,255,0.06); }
}

/* Drop insertion indicator — glowing left-border line + target card tint */
.card-hit-zone.drag-over-card {
  z-index: 500 !important;
}
/* Gold insertion bar to the left of target card */
.card-hit-zone.drag-over-card::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 38px; /* above extended hit area */
  width: 4px;
  background: linear-gradient(180deg, transparent 0%, var(--gold) 15%, var(--gold) 85%, transparent 100%);
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(245,197,24,0.9), 0 0 28px rgba(245,197,24,0.5);
  z-index: 10;
  pointer-events: none;
  animation: insertPulse 0.5s ease-in-out infinite alternate;
}
@keyframes insertPulse {
  from { opacity: 0.75; transform: scaleX(1); }
  to   { opacity: 1;    transform: scaleX(1.5); }
}
/* Target card dims slightly to show it's the drop zone */
.card-hit-zone.drag-over-card .card {
  opacity: 0.72;
  transition: opacity 0.12s ease !important;
}

/* Small card */
.card-sm {
  width: var(--card-sm-w); height: var(--card-sm-h);
  border-radius: 5px;
  background: var(--card-bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.5) 0%, transparent 70%);
  border: 1px solid rgba(0,0,0,0.11);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; font-family: var(--font); position: relative;
}

.card.red   .card-rank, .card.red   .card-suit,
.card-sm.red   .card-rank, .card-sm.red   .card-suit { color: var(--red); }
.card.black .card-rank, .card.black .card-suit,
.card-sm.black .card-rank, .card-sm.black .card-suit { color: var(--black); }

.card.joker-card, .card-sm.joker-card {
  /* Fix: use separate background-color + background-image
     background: gradient shorthand resets background-color to transparent,
     then background-image: none removes the gradient → invisible card. */
  background-color: #fff8e1;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,210,80,0.12) 100%);
  outline: 2px solid rgba(245,197,24,0.55);
  box-shadow: 0 0 14px rgba(245,197,24,0.28), var(--card-shadow);
}
.card.joker-card .card-rank,
.card-sm.joker-card .card-rank { color: #7b1fa2; }

.card-rank { font-size: 1.1rem; line-height: 1; }
.card-suit { font-size: 1.3rem; line-height: 1; }

.card-corner-tl, .card-corner-br {
  position: absolute; font-size: 0.64rem; line-height: 1; font-weight: 700;
}
.card-corner-tl { top: 4px; left: 5px; text-align: left; }
.card-corner-br { bottom: 4px; right: 5px; text-align: right; transform: rotate(180deg); }

.card-back {
  background:
    repeating-linear-gradient(45deg, #1a3a8a 0px, #1a3a8a 4px, #1565c0 4px, #1565c0 8px);
  color: rgba(255,255,255,0.4); font-size: 1.5rem;
  cursor: default; border: 3px solid rgba(255,255,255,0.14);
  background-image: none;
}
.card-back::after {
  content: '♠'; position: absolute; font-size: 1.8rem; color: rgba(255,255,255,0.12);
}

/* ===== MELD AREA ===== */
.my-melds-area {
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.32) 100%);
  border-top: 1px solid rgba(255,255,255,0.055);
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; overflow-x: auto;
  position: relative; z-index: 1;
}
.melds-label {
  font-size: 0.64rem; color: rgba(255,255,255,0.32);
  white-space: nowrap; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.melds-container { display: flex; gap: 10px; overflow-x: auto; }
.meld-group {
  display: flex; gap: 2px;
  background: rgba(255,255,255,0.035);
  border-radius: 6px; padding: 5px 8px;
  border: 1px solid rgba(255,255,255,0.075);
  animation: meldSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
/* Meld group entrance: bounceIn (cards-containers: follow through principle) */
@keyframes meldSlideIn {
  0%   { opacity: 0; transform: scale(0.6) translateY(14px); }
  55%  { opacity: 1; transform: scale(1.06) translateY(-4px); }
  75%  { transform: scale(0.97) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}

/* Meld dropzone: always visible, always stable height — zero layout shift */
.meld-dropzone {
  margin: 0 10px;
  padding: 8px 16px;
  min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed rgba(255,255,255,0.14);
  border-radius: 10px;
  text-align: center; font-size: 0.75rem; font-weight: 600;
  color: rgba(255,255,255,0.22); cursor: pointer;
  letter-spacing: 0.3px;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.meld-dropzone.drag-over {
  border-color: var(--gold);
  background: rgba(245,197,24,0.1);
  color: var(--gold);
  box-shadow: 0 0 24px rgba(245,197,24,0.2), inset 0 0 16px rgba(245,197,24,0.05);
}

/* ===== MY HAND AREA ===== */
.my-area {
  background: linear-gradient(0deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.36) 100%);
  border-top: 2px solid rgba(255,255,255,0.07);
  padding: 8px 16px 16px;
  position: relative; z-index: 2;
  transition: border-top-color 0.3s, box-shadow 0.3s;
}
.my-info {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px; font-size: 0.84rem;
}
.my-name  { font-weight: 700; color: var(--gold); font-size: 0.9rem; }
.my-score { color: rgba(255,255,255,0.45); font-size: 0.78rem; margin-right: auto; }

/* Fan hand container */
.my-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 32px 10px 10px;
  min-height: 132px;
  position: relative;
  overflow: visible;
}

.selected-info {
  position: fixed;
  left: 18px;
  bottom: 170px;
  z-index: 200;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.55);
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.18s;
}
.selected-info.hidden { opacity: 0; pointer-events: none; }
#selected-count { font-weight: 700; color: var(--gold); font-size: 0.88rem; }
#selection-hint { color: rgba(255,255,255,0.42); font-size: 0.79rem; transition: color 0.2s; }
#selection-hint.hint-valid   { color: #66bb6a; }
#selection-hint.hint-invalid { color: #ff7043; }

/* ── Pointer drag ghost ── */
/* Ghost inherits .card base styles; just ensure cursor & lift shadow */
.my-hand .card { cursor: grab; }
.my-hand .card:active { cursor: grabbing; }

.action-hint {
  position: fixed;
  left: 18px;
  bottom: 130px;
  z-index: 200;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.55);
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  line-height: 1.4;
  transition: opacity 0.2s;
}
.action-hint:empty { opacity: 0; pointer-events: none; }

.declare-bar { margin-left: auto; }
.return-discard-bar { margin-left: 8px; }
.return-discard-bar .btn { font-size: 0.78rem; padding: 5px 12px; opacity: 0.88; }
.declare-bar .btn-gold {
  padding: 6px 16px; font-size: 0.84rem; letter-spacing: 0.6px;
  border: 2px solid var(--gold); white-space: nowrap;
  animation: declareGlow 1.4s ease-in-out infinite;
}
@keyframes declareGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(245,197,24,0.38), 0 4px 14px rgba(0,0,0,0.3); }
  50%       { box-shadow: 0 0 28px rgba(245,197,24,0.72), 0 8px 22px rgba(0,0,0,0.3); }
}

/* ===== POPUP ===== */
.popup {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(6px);
}
.popup-content {
  background: linear-gradient(155deg, #1e3d2a, #132216);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px; padding: 30px;
  max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  animation: popupIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popupIn {
  from { transform: scale(0.88) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.popup-content h3 { margin-bottom: 10px; color: var(--gold); font-family: var(--font); }
.popup-content p  { color: rgba(255,255,255,0.62); font-size: 0.9rem; margin-bottom: 18px; }
.discard-preview  { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.popup-actions    { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.popup-actions .btn { flex: 1; min-width: 80px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; top: 56px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9); color: #fff;
  padding: 10px 22px; border-radius: 28px;
  font-size: 0.87rem; z-index: 200;
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 90vw; text-align: center;
  pointer-events: none; backdrop-filter: blur(8px);
  animation: toastIn 0.22s ease;
}
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(-10px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);     opacity: 1; }
}
.toast.success { background: rgba(25,90,30,0.96); border-color: rgba(76,175,80,0.38); }
.toast.error   { background: rgba(175,25,25,0.96); border-color: rgba(244,67,54,0.38); }
.toast.warning { background: rgba(175,65,0,0.96);  border-color: rgba(255,152,0,0.38); }
.toast.gold    { background: rgba(130,90,0,0.96);  border-color: rgba(245,197,24,0.38); color: #fff8dc; }

/* ===== SCOREBOARD POPUP OVERLAY ===== */
#screen-scores {
  display: none;
  position: fixed !important;
  inset: 0;
  z-index: 500;
  min-height: unset !important;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#screen-scores.active { display: flex !important; }
.scores-container {
  background: linear-gradient(165deg, rgba(6,44,16,0.97) 0%, rgba(2,14,6,0.99) 100%);
  border: 1px solid rgba(245,197,24,0.28);
  border-radius: 24px; padding: 32px 36px;
  max-width: 600px; width: 94vw;
  max-height: 88vh; overflow-y: auto;
  width: 100%; max-width: 560px; text-align: center;
  backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(245,197,24,0.06),
    0 32px 80px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(245,197,24,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.4);
  contain: style;
}
.scores-container h2 {
  margin-bottom: 28px; color: var(--gold);
  font-size: 1.8rem; font-family: var(--font);
  text-shadow: 0 0 22px var(--gold-glow);
}
.scores-table { width: 100%; margin-bottom: 28px; }
.score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 8px; background: rgba(255,255,255,0.038);
  font-size: 0.95rem; border: 1px solid rgba(255,255,255,0.045);
}
.score-row.winner-row {
  background: rgba(245,197,24,0.1);
  border-color: rgba(245,197,24,0.32);
  box-shadow: inset 3px 0 0 rgba(245,197,24,0.6);
}
/* Game-over: winner row gets a spotlight entrance + persistent glow */
.game-over-winner {
  animation: winnerSpotlight 0.85s cubic-bezier(0.34,1.56,0.64,1) forwards 0.25s,
             winnerGlow 2s ease-in-out infinite 1.1s !important;
  opacity: 0;
}
@keyframes winnerSpotlight {
  0%   { opacity: 0; transform: scale(0.82) translateY(24px); }
  65%  { transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes winnerGlow {
  0%, 100% { box-shadow: inset 3px 0 0 rgba(245,197,24,0.6), 0 0 8px rgba(245,197,24,0.22); }
  50%       { box-shadow: inset 3px 0 0 rgba(245,197,24,0.9), 0 0 28px rgba(245,197,24,0.55); }
}
.score-row { flex-direction: column; align-items: stretch; gap: 6px; }
.score-row-header { display: flex; justify-content: space-between; align-items: center; }
.score-row .player-name { font-weight: 600; flex: 1; text-align: left; }
.score-sub { display: block; font-size: 0.7rem; font-weight: 400; color: rgba(255,255,255,0.38); line-height: 1.3; margin-top: 1px; }
.declare-badge { color: var(--gold); font-weight: 600; }
.score-total-pair { display: flex; gap: 12px; align-items: center; }
.score-row .round-pts   { color: rgba(255,255,255,0.52); font-size: 0.84rem; }
.score-row .total-pts   { color: var(--gold); font-weight: 700; min-width: 50px; text-align: right; font-size: 1.05rem; }
/* Breakdown baris: +meld +valid -invalid */
.score-breakdown { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-part { font-size: 0.72rem; padding: 2px 7px; border-radius: 10px; }
.sc-part.pos { background: rgba(100,210,100,0.12); color: #7ed87e; }
.sc-part.neg { background: rgba(220,80,80,0.12);  color: #f08080; }
.sc-part.pen { background: rgba(200,100,50,0.12);  color: #e8a870; }
/* Mini cards — tangan tersisa grouped by +/- */
.score-hand-cards {
  display: flex; flex-wrap: wrap; gap: 3px; padding: 4px 0 2px;
}
.score-hand-cards .card-sm { transform: scale(0.85); transform-origin: left center; }
.score-hand-group {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 4px 8px; border-radius: 8px; margin-top: 4px;
}
.score-hand-group .card-sm { transform: scale(0.85); transform-origin: left center; }
.score-hand-plus  { border: 1.5px solid rgba(100,210,100,0.55); background: rgba(100,210,100,0.06); }
.score-hand-minus { border: 1.5px solid rgba(220,80,80,0.55);  background: rgba(220,80,80,0.06); }
.score-meld-inner { display: flex; flex-wrap: wrap; gap: 2px; margin-right: 4px; }
.score-meld-inner + .score-meld-inner { border-left: 1.5px solid rgba(255,255,255,0.15); padding-left: 4px; }
.scores-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.scores-actions .btn { min-width: 140px; flex: none; }
.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  font-family: var(--font-ui); font-weight: 600;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.06); }

/* ===== ACTIVE PLAYER HIGHLIGHT ===== */
.opponent-slot.active-turn {
  border-color: rgba(245,197,24,0.65);
  background: rgba(245,197,24,0.07);
  box-shadow: 0 0 28px rgba(245,197,24,0.22), inset 0 0 16px rgba(245,197,24,0.05);
}
.opponent-slot.active-turn .opp-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(245,197,24,0.55);
}
/* Glow ring */
.opponent-slot.active-turn::after {
  content: ''; position: absolute; inset: -2px;
  border-radius: 18px;
  border: 1.5px solid rgba(245,197,24,0.6);
  animation: glowRing 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowRing {
  0%, 100% { opacity: 0.9; box-shadow: 0 0 10px var(--gold-glow); }
  50%       { opacity: 0.25; box-shadow: 0 0 26px var(--gold-glow); }
}

.my-area.my-turn-active {
  border-top-color: var(--gold);
  box-shadow: inset 0 2px 32px rgba(245,197,24,0.09);
}

/* ===== ANIMATIONS ===== */
/* Deal flip (face-down → face-up) */
@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.88); opacity: 0; }
  65%  { transform: rotateY(-6deg) scale(1.02); opacity: 1; }
  100% { transform: rotateY(0deg)  scale(1);    opacity: 1; }
}
.card.deal-flip {
  animation: cardFlip 0.38s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* Simple slide-in for non-flip contexts */
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-28px) scale(0.86); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}
.card.deal-anim { animation: dealIn 0.28s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* Error shake for invalid actions (css-animation-creator: shake attention-seeker) */
@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-7px); }
  30%       { transform: translateX(6px); }
  45%       { transform: translateX(-5px); }
  60%       { transform: translateX(4px); }
  75%       { transform: translateX(-2px); }
}
.card.shake-error {
  animation: cardShake 0.45s ease-in-out !important;
}

/* Tada: celebrate on declare (css-animation-creator: tada) */
@keyframes cardTada {
  0%         { transform: scale(1) rotate(0); }
  10%, 20%   { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80%      { transform: scale(1.1) rotate(-3deg); }
  100%       { transform: scale(1) rotate(0); }
}
.card.tada {
  animation: cardTada 0.6s ease !important;
  z-index: 60 !important;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.score-row { animation: slideUp 0.28s ease forwards; }

/* ── DRAW REVEAL (animasi kartu yang baru diambil) ── */
.draw-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.draw-reveal-card {
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.55));
  animation: drawRevealIn 1.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawRevealIn {
  0%   { opacity: 0; transform: translateY(-80px) scale(0.45) rotateY(90deg); }
  22%  { opacity: 1; transform: translateY(0)     scale(1.18) rotateY(0deg); }
  55%  { opacity: 1; transform: translateY(0)     scale(1.05) rotateY(0deg); }
  80%  { opacity: 1; transform: translateY(0)     scale(1.0)  rotateY(0deg); }
  100% { opacity: 0; transform: translateY(50px)  scale(0.75) rotateY(0deg); }
}

/* Kartu baru di tangan — kilatan emas singkat */
@keyframes newCardGlow {
  0%   { box-shadow: 0 0 0   0px rgba(245,197,24,0.0), var(--card-shadow); }
  20%  { box-shadow: 0 0 28px 10px rgba(245,197,24,0.75), var(--card-shadow-hover); }
  70%  { box-shadow: 0 0 14px 4px  rgba(245,197,24,0.4),  var(--card-shadow); }
  100% { box-shadow: var(--card-shadow); }
}
.card.new-card {
  animation: newCardGlow 1.6s ease-out forwards !important;
  z-index: 55 !important;
}

/* Kartu wajib dipakai dalam kombinasi — glow emas berulang */
@keyframes requiredCardPulse {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(245,197,24,0.55), var(--card-shadow); outline-color: rgba(245,197,24,0.7); }
  50%       { box-shadow: 0 0 28px 10px rgba(245,197,24,0.9), var(--card-shadow-hover); outline-color: var(--gold); }
}
.card.required-card {
  outline: 2.5px solid var(--gold);
  animation: requiredCardPulse 1.1s ease-in-out infinite !important;
  z-index: 56 !important;
}

/* ===== DEAL ANIMATION — flying cards from stock pile to hand ===== */
@keyframes dealFlyCard {
  0%   { opacity: 0; transform: translate(0, 0) scale(1.1) rotateY(-40deg); }
  12%  { opacity: 1; }
  88%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(var(--dest-x), var(--dest-y)) scale(0.7) rotateY(180deg); }
}

.deal-anim-card {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  background: linear-gradient(145deg, #245c2e 0%, #0d3a16 100%);
  border: 1.5px solid rgba(245,197,24,0.45);
  box-shadow: 0 6px 24px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: dealFlyCard 0.44s cubic-bezier(0.2, 0.9, 0.38, 1) forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  /* ── Tokens ── */
  :root {
    --card-w:    50px; --card-h:    72px;
    --card-sm-w: 34px; --card-sm-h: 48px;
  }

  /* ── Typography ── */
  .card-rank { font-size: 0.85rem; }
  .card-suit { font-size: 1rem; }
  .card-corner-tl, .card-corner-br { font-size: 0.54rem; }

  /* ── Header ── */
  .game-header  { font-size: 0.7rem; padding: 4px 8px; gap: 4px; }
  .joker-info   { font-size: 0.68rem; gap: 3px; }
  .joker-ref-card { display: none; }
  .header-center { gap: 4px; }
  .round-info   { font-size: 0.68rem; }
  .turn-info    { font-size: 0.7rem; padding: 2px 8px; max-width: 180px; }
  .timer-seconds { font-size: 0.9rem; }
  .timer-wrapper { min-width: 54px; gap: 2px; }
  .timer-bar-track { width: 50px; height: 4px; }
  .btn-mute     { font-size: 0.92rem; padding: 4px; }

  /* ── Opponents ── */
  #opp-left, #opp-right { flex: 0 0 72px; min-width: 72px; }
  .opp-avatar { width: 36px; height: 36px; }
  .opp-avatar::before { font-size: 0.9rem; }
  .opp-card-badge { width: 17px; height: 17px; font-size: 0.62rem; top: -4px; right: -4px; }
  .opp-name { font-size: 0.62rem; }
  .opp-score { font-size: 0.56rem; }
  .opponents-area { padding: 6px 6px 3px; gap: 4px; }
  .side-opponents { gap: 5px; }

  /* ── Side meld bar (mobile) ── */
  .side-meld-panel { max-width: calc(50vw - 20px); }
  .side-meld-panel .card-sm { width: 28px; height: 40px; }
  .side-meld-panel .card-sm .card-rank { font-size: 0.5rem; }
  .side-meld-panel .card-sm .card-suit { font-size: 0.55rem; }
  .opp-top-meld-strip .card-sm { width: 32px; height: 46px; }

  /* ── Center area ── */
  .center-area  { gap: 8px; }
  .card-piles   { gap: 14px; }
  .joker-ref-chip { padding: 4px 8px 4px 4px; gap: 5px; }
  .joker-chip-label { font-size: 0.56rem; }
  .card-pile    { width: 60px; height: 85px; }
  .discard-pile { width: var(--card-w); height: var(--card-h); }
  .pile-label   { font-size: 0.6rem; }
  .pile-count   { font-size: 0.6rem; }

  /* ── My area ── */
  .my-area      { padding: 6px 10px 10px; }
  .my-info      { font-size: 0.72rem; }
  .my-hand      { padding: 20px 6px 6px; min-height: 105px; }
  .card-hit-zone { margin-left: -16px; }
  .selected-info { font-size: 0.78rem; gap: 4px; flex-wrap: wrap; }
  .btn-sm       { font-size: 0.74rem; padding: 5px 8px; }
  #action-hint  { font-size: 0.7rem; }

  /* ── Meld area ── */
  .my-melds-area { padding: 4px 8px; }
  .melds-label   { font-size: 0.68rem; }
  .meld-group    { gap: 2px; }

  /* ── Lobby ── */
  .lobby-wrap    { flex-direction: column; }
  .lobby-brand   { flex: none; padding: 32px 24px 20px; gap: 16px; }
  .lobby-brand::before { display: none; }
  .lobby-brand::after  { display: none; }
  .brand-title   { font-size: 2.1rem; }
  .brand-deco    { display: none; }
  .lobby-panel   { flex: none; padding: 24px 18px 32px; box-shadow: 0 -1px 0 rgba(245,197,24,0.1); }
  .settings-card { padding: 14px 14px; }
  .lp-header h2  { font-size: 1.1rem; }
  .brand-stats   { gap: 0; }
  .brand-stat    { padding: 0 16px; }
  .bs-num        { font-size: 1.3rem; }

  /* ── Waiting / Scores ── */
  .waiting-container, .scores-container { padding: 24px 16px; }
  .player-slots { gap: 8px; }
  .player-slot  { padding: 8px 10px; }
  .slot-avatar  { width: 34px; height: 34px; font-size: 1.1rem; }

  /* ── Scores ── */
  .score-row { padding: 10px 12px; font-size: 0.86rem; }
  .score-row .total-pts { font-size: 0.92rem; width: 60px; }
  .score-row .round-pts { width: 60px; }

  /* ── Dropzone ── */
  .meld-dropzone { font-size: 0.8rem; padding: 8px 14px; }
}

/* ── Extra small (≤380px) ── */
@media (max-width: 380px) {
  :root { --card-w: 44px; --card-h: 63px; --card-sm-w: 30px; --card-sm-h: 42px; }
  #opp-left, #opp-right { flex: 0 0 48px; }
  .card-hit-zone { margin-left: -18px; }
  .game-header { font-size: 0.66rem; padding: 5px 6px; }
  .timer-seconds { font-size: 0.96rem; }
  .side-meld-panel { max-width: calc(50vw - 14px); }
  .side-meld-panel .card-sm { width: 24px; height: 34px; }
  .side-meld-panel .card-sm .card-rank { font-size: 0.44rem; }
  .side-meld-panel .card-sm .card-suit { font-size: 0.48rem; }
  .opp-top-meld-strip .card-sm { width: 28px; height: 40px; }
}

@media (min-width: 900px) {
  :root { --card-w: 76px; --card-h: 108px; --card-sm-w: 48px; --card-sm-h: 68px; }
  .card-rank { font-size: 1.22rem; }
  .card-suit { font-size: 1.5rem; }
  .my-hand { padding: 36px 14px 12px; min-height: 148px; }
  #opp-left, #opp-right { flex: 0 0 130px; }
  .opp-avatar { width: 52px; height: 52px; }
  .opp-avatar::before { font-size: 1.3rem; }
  .card-pile    { width: 96px; height: 136px; }
  .discard-pile { width: var(--card-w); height: var(--card-h); }
  .card-hit-zone { margin-left: -20px; }
  .side-meld-panel { max-width: 220px; }

  /* Lobby on wide screen */
  .lobby-panel { flex: 0 0 440px; }
}

/* ===== ACCESSIBILITY: Reduced Motion ===== */
/* css-animation-creator skill: always honor prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep visibility transitions (not motion) for usability */
  .toast { transition: opacity 0.15ms !important; }
  .my-hand .card { will-change: auto; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
