/* UNO Online — estilo idêntico ao WAR Online (navy + dourado, botões 3D, glass) */
:root {
  --bg: #081223;
  --bg2: #0f1f38;
  --panel: #152847;
  --panel2: #1e3760;
  --border: #2e4d7d;
  --text: #f2f6ff;
  --muted: #98b0d4;
  --gold: #ffcc33;
  --gold-dark: #c98a00;
  --red: #ff5252;
  --red-dark: #b32424;
  --green: #2ed573;
  --green-dark: #169649;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --uno-red: #e0312e;
  --uno-red-dark: #a61b1b;
  --font-ui: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Fredoka', 'Outfit', system-ui, sans-serif;
  --app-h: 100dvh;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; }
body {
  font-family: var(--font-ui);
  background: radial-gradient(1300px 800px at 50% -10%, #1d3b6b 0%, var(--bg) 65%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

/* ================= BOTÕES TÁTEIS 3D (ESTILO WAR) ================= */
.btn {
  font-family: var(--font-display);
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #274472 0%, #1a3054 100%);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: 0 3px 0 #0d1a30, 0 6px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), filter .15s, box-shadow .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.14); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0d1a30, 0 2px 6px rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .42; cursor: not-allowed; filter: saturate(.5); }
.btn.primary {
  background: linear-gradient(180deg, #4da3ff 0%, #2563eb 100%);
  border-color: #7cc0ff;
  box-shadow: 0 3px 0 #153e99, 0 6px 16px rgba(37, 99, 235, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.success {
  background: linear-gradient(180deg, #3ae374 0%, #1ea84f 100%);
  border-color: #7bed9f;
  color: #062812;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 3px 0 #106930, 0 6px 16px rgba(46, 213, 115, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn.gold {
  background: linear-gradient(180deg, #ffdd59 0%, #f59e0b 100%);
  border-color: #fff2a6;
  color: #2b1800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  box-shadow: 0 3px 0 #b45309, 0 6px 18px rgba(245, 158, 11, .42), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.danger {
  background: linear-gradient(180deg, #ff6b6b 0%, #dc2626 100%);
  border-color: #ffa8a8;
  box-shadow: 0 3px 0 #991b1b, 0 6px 16px rgba(220, 38, 38, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn.danger-ghost {
  background: rgba(220, 38, 38, .2);
  border-color: rgba(255, 107, 107, .55);
  color: #ffc9c9;
  box-shadow: none;
}
.btn.ghost {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .15);
  box-shadow: none;
}
.btn.glass {
  background: rgba(14, 26, 48, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(120, 165, 235, .32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.big { padding: 14px 36px; font-size: 18px; border-radius: 16px; }
.btn.big-cta { padding: 12px 20px; font-size: 16px; border-radius: 14px; margin-top: 4px; }

.pulse-cta { animation: pulseBtn 1.8s infinite ease-in-out; }
@keyframes pulseBtn {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.15); transform: scale(1.03); }
}

input {
  width: 100%;
  font-family: var(--font-ui);
  background: rgba(9, 18, 34, .85);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); }
.error { color: #ff7b7b; min-height: 20px; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }
.mini { color: var(--muted); font-size: 12px; }

.badge {
  font-family: var(--font-display);
  background: rgba(14, 26, 48, .82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(120, 165, 235, .35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.user-pill {
  background: linear-gradient(135deg, rgba(37, 99, 235, .28), rgba(15, 31, 56, .85));
  border-color: rgba(96, 165, 250, .45);
  color: #dbeafe;
}
.timer-badge { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.timer-badge.urgent { color: #ffb3b3; border-color: rgba(255, 107, 107, .6); animation: pulseUrgent 1s infinite; }
@keyframes pulseUrgent { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ================= LOGIN SCREEN ================= */
.screen { height: 100vh; height: var(--app-h); display: flex; flex-direction: column; position: relative; }
#screen-login { align-items: center; justify-content: center; overflow: hidden; }

.bg-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(75px); opacity: .45;
  animation: floatOrb 12s infinite alternate ease-in-out;
}
.orb-1 { width: 420px; height: 420px; background: #2563eb; top: -120px; left: -100px; }
.orb-2 { width: 360px; height: 360px; background: #f59e0b; bottom: -110px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 280px; height: 280px; background: #e0312e; top: 40%; left: 65%; animation-delay: -8s; opacity: .3; }
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -25px) scale(1.1); }
}
.float-card {
  position: absolute; font-size: 54px; opacity: .16;
  animation: floatCard 9s infinite alternate ease-in-out;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5));
}
.fc-1 { top: 16%; left: 12%; transform: rotate(-16deg); }
.fc-2 { top: 62%; left: 6%; transform: rotate(12deg); animation-delay: -3s; }
.fc-3 { top: 22%; right: 10%; transform: rotate(18deg); animation-delay: -6s; font-size: 70px; }
@keyframes floatCard {
  0% { translate: 0 0; rotate: -6deg; }
  100% { translate: 18px -26px; rotate: 8deg; }
}

.login-box {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, rgba(25, 45, 78, .92) 0%, rgba(16, 30, 54, .95) 100%);
  backdrop-filter: blur(18px);
  border: 2px solid rgba(110, 160, 235, .35);
  border-radius: 26px;
  padding: 36px 38px 30px;
  width: min(410px, calc(100vw - 28px));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .2);
  text-align: center;
}
.brand-emblem {
  width: 64px; height: 64px; margin: 0 auto 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffdd59, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, .45), inset 0 2px 0 rgba(255, 255, 255, .6);
}
.brand-emblem.uno-emblem {
  background: linear-gradient(135deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  box-shadow: 0 8px 24px rgba(224, 49, 46, .5), inset 0 2px 0 rgba(255, 255, 255, .45);
}
.brand-emblem.uno-emblem span {
  font-family: var(--font-display); font-weight: 700; font-size: 34px; color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  transform: skewX(-8deg);
}
.logo {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff5c0 0%, #ffca3a 55%, #e08e00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
}
.logo span {
  font-size: .52em;
  letter-spacing: 2px;
  display: inline-block;
  vertical-align: middle;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo.small { font-size: 22px; letter-spacing: 1.5px; }
.tagline { color: var(--muted); margin: 6px 0 22px; font-size: 14px; line-height: 1.4; }
.tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: rgba(8, 16, 30, .65);
  padding: 5px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.tab {
  flex: 1; padding: 9px 6px; background: transparent; border: none;
  color: var(--muted); border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  transition: background .15s, color .15s;
}
.tab.active {
  background: linear-gradient(180deg, #2b4c7e, #1d3559);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.tabpane { display: flex; flex-direction: column; gap: 11px; }

/* ================= LOBBY & SALA ================= */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(100, 150, 225, .22);
  background: rgba(10, 19, 36, .88);
  backdrop-filter: blur(12px);
  z-index: 5;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mini-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #ffdd59, #f59e0b);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(245, 158, 11, .35);
}
.brand-mini-icon.uno-mini {
  background: linear-gradient(135deg, #ff6b5e, var(--uno-red) 55%, var(--uno-red-dark));
  color: #fff;
  font-family: var(--font-display); font-weight: 700;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transform: skewX(-6deg);
  box-shadow: 0 3px 10px rgba(224, 49, 46, .45);
}
.lobby-live-stats { display: flex; gap: 8px; align-items: center; }

.lobby-main, .room-main {
  flex: 1; display: grid; gap: 22px; padding: 26px; overflow: auto;
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.lobby-main { grid-template-columns: 1fr 360px; align-content: start; }

.panel {
  background: linear-gradient(180deg, rgba(23, 42, 74, .92) 0%, rgba(15, 29, 52, .94) 100%);
  border: 1.5px solid rgba(95, 145, 220, .32);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.panel h2 {
  font-family: var(--font-display);
  margin-bottom: 14px; font-size: 18px; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.create-room-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.howto-box { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }

.lobby-left-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lobby-left-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.quick-solo-card { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.qs-info { min-width: 260px; flex: 1; }
.qs-kicker {
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: 2px;
  color: var(--gold); margin-bottom: 6px; font-weight: 600;
}
.qs-info h2 { margin-bottom: 6px; }
.qs-info p { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.qs-controls { display: flex; flex-direction: column; gap: 12px; align-items: stretch; min-width: 300px; }
.qs-size-group { display: flex; gap: 6px; flex-wrap: wrap; }
.qs-size-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  background: rgba(10, 20, 40, .8); color: var(--muted);
  border: 1.5px solid rgba(85, 130, 200, .35);
  border-radius: 999px; padding: 7px 13px; cursor: pointer;
  transition: all .15s;
}
.qs-size-btn:hover { border-color: rgba(120, 175, 255, .6); color: #fff; }
.qs-size-btn.active {
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  color: #2b1800; border-color: #fff2a6;
  box-shadow: 0 3px 0 #b45309;
}
.qs-launch-btn { font-size: 15px; padding: 13px 20px; }

.room-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 320px; overflow-y: auto; padding-right: 4px;
}
.room-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(11, 22, 42, .85);
  border: 1.5px solid rgba(85, 130, 200, .3);
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform .15s, border-color .15s;
}
.room-item:hover { transform: translateY(-2px); border-color: rgba(120, 175, 255, .55); }
.room-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.room-item .rname { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; color: #fff; }
.room-item .rplayers { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rstatus-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rstatus-dot.open { background: #2ed573; box-shadow: 0 0 8px #2ed573; }
.rstatus-dot.playing { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.room-item-actions { display: flex; align-items: center; gap: 8px; }

.empty {
  color: var(--muted); padding: 36px 20px; text-align: center;
  background: rgba(9, 18, 34, .45); border-radius: 16px;
  border: 1px dashed rgba(120, 165, 235, .25);
}
.empty-icon { font-size: 36px; margin-bottom: 8px; }
.rules-mini { color: #bdd0ee; font-size: 13.5px; padding-left: 18px; display: grid; gap: 8px; line-height: 1.4; }

.lobby-leaderboard { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(11, 22, 42, .75);
  border: 1px solid rgba(85, 130, 200, .25);
  border-radius: 14px; padding: 10px 14px;
}
.lb-rank {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .07); flex: 0 0 auto;
}
.lb-row.top1 .lb-rank { background: linear-gradient(135deg, #ffdd59, #f59e0b); color: #2b1800; }
.lb-row.top2 .lb-rank { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #111827; }
.lb-row.top3 .lb-rank { background: linear-gradient(135deg, #fbbf77, #b45309); color: #2b1800; }
.lb-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.lb-score { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 14px; white-space: nowrap; }

.career-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(10, 20, 40, .7);
  border: 1px solid rgba(85, 130, 200, .3);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
}
.career-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, #ff6b5e, var(--uno-red) 55%, var(--uno-red-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 24px; color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
  box-shadow: 0 4px 12px rgba(224, 49, 46, .4);
  flex: 0 0 auto;
}
.career-info { min-width: 0; flex: 1; }
.career-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.career-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; margin-top: 3px; flex-wrap: wrap; }
.career-stats b { color: var(--gold); }

.room-main { justify-items: center; align-content: center; }
.room-stage {
  background: linear-gradient(180deg, rgba(23, 42, 74, .92), rgba(14, 26, 48, .95));
  border: 2px solid rgba(105, 155, 230, .35);
  border-radius: 26px;
  padding: 28px 32px;
  width: min(900px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  text-align: center;
}
.stage-title { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; color: var(--gold); }
.stage-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.room-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.slot {
  border: 2px solid rgba(90, 135, 205, .32);
  border-radius: 18px;
  padding: 13px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(10, 20, 38, .85);
  text-align: center;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
}
.slot.occupied {
  border-color: var(--slot-color, var(--border));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
.slot.empty-slot { opacity: .55; border-style: dashed; }
.slot-me { outline: 2px solid rgba(255, 204, 51, .55); outline-offset: 2px; }
.slot-avatar {
  position: relative;
  width: 46px; height: 46px; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
}
.slot-crown { position: absolute; top: -12px; right: -8px; font-size: 16px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.slot .sname { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .stag { color: var(--muted); font-size: 11px; }
.room-host-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.room-actions { margin-top: 26px; text-align: center; display: grid; gap: 14px; justify-items: center; }

/* =============== TELA DO JOGO (MESA) =============== */
.game-screen { position: relative; user-select: none; -webkit-user-select: none; }
.table-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 50% 42%, #1d4978 0%, transparent 65%),
    linear-gradient(165deg, #0d223d 0%, #071324 100%);
}
.table-wrap.shake { animation: tableShake .45s ease-out; }
@keyframes tableShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(7px, -5px); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(4px, -2px); }
}
/* feltro da mesa: profundidade atrás das pilhas */
.table-felt {
  position: absolute; left: 50%; top: 45%;
  width: min(92vw, 1150px); height: min(68vh, 580px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, .16) 0%, rgba(23, 52, 94, .28) 52%, rgba(10, 25, 48, .12) 74%, transparent 88%);
  border: 2px solid rgba(120, 165, 235, .10);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .35), 0 20px 60px rgba(0, 0, 0, .25);
  pointer-events: none;
}
/* carta voando (jogada/comprada) */
.fly-card {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.4, 0, .6, .2), opacity .5s ease-in;
  will-change: transform, opacity;
}
.table-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.pile-zone { display: flex; align-items: center; gap: 34px; pointer-events: auto; }

.deck-pile { position: relative; cursor: pointer; transition: transform .15s; border-radius: 16px; }
.deck-pile:hover { transform: translateY(-4px) scale(1.03); }
.deck-pile::before, .deck-pile::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 12px;
  background: linear-gradient(160deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
  z-index: 0;
}
.deck-pile::before { transform: rotate(-6deg) translate(-4px, 3px); opacity: .8; }
.deck-pile::after { transform: rotate(5deg) translate(4px, 2px); opacity: .9; }
.deck-pile .uno-card.back { position: relative; z-index: 1; }
.deck-pile.disabled { opacity: .55; cursor: default; }
.deck-pile.disabled:hover { transform: none; }
/* estado "PRECISA COMPRAR": monte salta com halo dourado + etiqueta */
.deck-pile.need-draw {
  animation: deckBounce 1s infinite ease-in-out;
  box-shadow: 0 0 0 3px rgba(255, 214, 90, .85), 0 0 34px rgba(255, 204, 51, .55);
}
@keyframes deckBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}
.buy-tag {
  position: absolute; top: -38px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
  color: #2b1800;
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  border: 2px solid #fff2a6;
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(245, 158, 11, .5);
  z-index: 4;
  pointer-events: none;
  display: none;
  animation: pillBlink 1.2s infinite ease-in-out;
}
.deck-pile.need-draw .buy-tag { display: block; }
.deck-count {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: rgba(8, 16, 32, .92); border: 1px solid rgba(120, 165, 235, .4);
  border-radius: 999px; padding: 2px 10px; color: #dbeafe; z-index: 3;
  white-space: nowrap;
}
/* chip da cor vigente, logo abaixo das pilhas */
.color-chip {
  position: absolute; top: calc(50% + 118px); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(8, 16, 32, .88);
  border: 1.5px solid rgba(120, 165, 235, .4);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: #dbeafe;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.color-chip .cc-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 0 10px var(--cc-glow, transparent);
  background: var(--cc-color, #888);
  transition: background .3s, box-shadow .3s;
}
/* flash de borda para efeitos (+2, +4, pular, inverter...) */
.edge-flash {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 38;
}
.edge-flash.on { animation: edgeFlash .85s ease-out; }
@keyframes edgeFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
.edge-flash.danger { box-shadow: inset 0 0 130px rgba(224, 49, 46, .6); }
.edge-flash.gold { box-shadow: inset 0 0 130px rgba(255, 204, 51, .55); }
.edge-flash.blue { box-shadow: inset 0 0 130px rgba(59, 130, 246, .55); }
.edge-flash.green { box-shadow: inset 0 0 130px rgba(46, 213, 115, .55); }
.edge-flash.rainbow { box-shadow: inset 0 0 150px rgba(168, 85, 247, .6); }
/* confete */
.confetti-piece {
  position: fixed; top: -24px;
  z-index: 60;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(108vh) rotate(720deg); opacity: .85; }
}
.discard-pile {
  position: relative; width: 120px; height: 180px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .55));
  border-radius: 16px;
  transition: box-shadow .35s;
}
.discard-pile.glowing {
  box-shadow: 0 0 0 3px var(--pile-glow, rgba(120, 165, 235, .4)), 0 0 34px var(--pile-glow-soft, transparent);
}
.discard-pile .uno-card { position: absolute; top: 0; left: 0; }
.discard-pile .uno-card.leave-stack { position: absolute; transition: transform .35s ease, opacity .35s ease; }
.uno-card.pop-in { animation: cardPop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes cardPop {
  from { transform: scale(1.45) rotate(14deg); opacity: .3; }
}
.discard-empty {
  width: 120px; height: 180px; border-radius: 14px;
  border: 3px dashed rgba(120, 165, 235, .35);
  display: flex; align-items: center; justify-content: center;
  color: rgba(152, 176, 212, .5); font-size: 40px;
}

.color-orb {
  position: absolute;
  width: 220px; height: 220px; border-radius: 50%;
  filter: blur(60px); opacity: .5;
  background: var(--orb-color, #3b82f6);
  transition: background .4s;
  pointer-events: none;
}
.direction-ring {
  position: absolute;
  width: 330px; height: 330px; border-radius: 50%;
  border: 2px dashed rgba(120, 165, 235, .18);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.dr-arrow { position: absolute; color: rgba(152, 176, 212, .55); font-size: 22px; transition: transform .4s, opacity .3s; }
.dr-a { top: -13px; left: 50%; margin-left: -10px; }
.dr-b { bottom: -13px; left: 50%; margin-left: -10px; }
.direction-ring.ccw .dr-a { transform: rotate(180deg); }
.direction-ring.ccw .dr-b { transform: rotate(180deg); }
.direction-ring.pulse { animation: ringPulse 2.4s infinite; }
@keyframes ringPulse {
  0%, 100% { border-color: rgba(120, 165, 235, .18); }
  50% { border-color: rgba(255, 204, 51, .45); }
}

/* ================= CARTAS UNO ================= */
.uno-card {
  width: 120px; height: 180px;
  border-radius: 14px;
  background: var(--card-bg, #333);
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(0, 0, 0, .18);
  position: relative;
  flex: 0 0 auto;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s, filter .18s;
}
.uno-card.sm { width: 74px; height: 111px; border-radius: 10px; border-width: 2.5px; }
.uno-card.xs { width: 58px; height: 87px; border-radius: 9px; border-width: 2px; }
.uno-card.red { --card-bg: linear-gradient(155deg, #ff5f52 0%, #e0312e 45%, #b01d1d 100%); }
.uno-card.yellow { --card-bg: linear-gradient(155deg, #ffd977 0%, #f5b312 45%, #d18a00 100%); }
.uno-card.green { --card-bg: linear-gradient(155deg, #6cf19a 0%, #2eb85c 45%, #137a38 100%); }
.uno-card.blue { --card-bg: linear-gradient(155deg, #7cb8ff 0%, #3b82f6 45%, #1d4ed8 100%); }
.uno-card.wildc {
  background:
    conic-gradient(from 220deg, #e0312e 0 25%, #f5b312 0 50%, #2eb85c 0 75%, #3b82f6 0 100%);
}
.uno-card .oval {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.uno-card .oval::before {
  content: '';
  position: absolute; left: -12%; right: -12%; top: 12%; bottom: 12%;
  background: #fff;
  border-radius: 50%;
  transform: rotate(-28deg);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
}
.uno-card.sm .oval::before { left: -14%; right: -14%; }
.uno-card.xs .oval::before { left: -16%; right: -16%; }
.uno-card .oval .big-val {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700;
  font-size: 64px; color: var(--val-color, #111);
  transform: rotate(-28deg);
  text-shadow: 2px 3px 0 rgba(0, 0, 0, .25);
  line-height: 1;
  display: flex; align-items: center; gap: 2px;
}
.uno-card.sm .oval .big-val { font-size: 38px; }
.uno-card.xs .oval .big-val { font-size: 30px; }
.uno-card.red .oval .big-val { --val-color: #c22320; }
.uno-card.yellow .oval .big-val { --val-color: #c78d00; }
.uno-card.green .oval .big-val { --val-color: #178f43; }
.uno-card.blue .oval .big-val { --val-color: #1d4ed8; }
.uno-card.wildc .oval .big-val { --val-color: #111; }
.uno-card .corner {
  position: absolute; z-index: 2;
  font-family: var(--font-display); font-weight: 700;
  font-size: 19px; color: #fff;
  text-shadow: 1px 2px 0 rgba(0, 0, 0, .45);
  line-height: 1;
}
.uno-card .corner.tl { top: 7px; left: 9px; }
.uno-card .corner.br { bottom: 7px; right: 9px; transform: rotate(180deg); }
.uno-card.sm .corner { font-size: 13px; }
.uno-card.sm .corner.tl { top: 5px; left: 6px; }
.uno-card.sm .corner.br { bottom: 5px; right: 6px; }
.uno-card.xs .corner { font-size: 11px; }
.uno-card.xs .corner.tl { top: 4px; left: 5px; }
.uno-card.xs .corner.br { bottom: 4px; right: 5px; }
.uno-card .corner.wild-ico { color: #fff; }
.wild-dot {
  display: inline-block;
  width: .74em; height: .74em;
  border-radius: 50%;
  background: conic-gradient(#e0312e 0 25%, #f5b312 0 50%, #2eb85c 0 75%, #3b82f6 0 100%);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  vertical-align: middle;
}
.wild-dot.small { width: .82em; height: .82em; border-width: 1.5px; }
.card-glyph { display: inline-flex; font-size: .82em; }
.uno-card.back { background: linear-gradient(160deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%); }
.card-back-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-back-inner::before {
  content: '';
  position: absolute; left: -12%; right: -12%; top: 14%; bottom: 14%;
  background: #ffcf3f;
  border-radius: 50%;
  transform: rotate(-28deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.card-back-inner span {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700;
  font-size: 30px; color: #c22320;
  transform: rotate(-28deg) skewX(-6deg);
  letter-spacing: 1px;
  text-shadow: 1px 2px 0 rgba(255, 255, 255, .4);
}
.uno-card.sm .card-back-inner span { font-size: 19px; }
.uno-card.xs .card-back-inner span { font-size: 15px; }

/* ================= HUD ================= */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(7, 13, 26, .72), transparent);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-left-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.round-badge { color: var(--gold); }
.direction-badge { cursor: default; }
.hud-players {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  flex: 1; flex-wrap: wrap; min-width: 0;
}
.player-chip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(14, 26, 48, .82);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(120, 165, 235, .3);
  border-radius: 999px;
  padding: 5px 13px 5px 6px;
  transition: transform .18s, border-color .25s, box-shadow .25s;
  position: relative;
  max-width: 170px;
}
.player-chip .pc-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pc-color, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  border: 2px solid rgba(255, 255, 255, .45);
  flex: 0 0 auto;
  position: relative;
}
.player-chip .pc-avatar .pc-crown { position: absolute; top: -11px; right: -7px; font-size: 12px; }
.player-chip .pc-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.player-chip .pc-name {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: #fff;
  max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-chip .pc-sub { font-size: 10.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.player-chip .pc-cards {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: rgba(255, 255, 255, .1);
  border-radius: 999px; padding: 1px 8px; color: #fff;
}
.player-chip.current-turn {
  border-color: var(--gold);
  animation: chipTurnPulse 1.6s infinite ease-in-out;
}
@keyframes chipTurnPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 204, 51, .35), 0 0 18px rgba(255, 204, 51, .22); transform: scale(1.04); }
  50% { box-shadow: 0 0 0 3px rgba(255, 204, 51, .6), 0 0 30px rgba(255, 204, 51, .45); transform: scale(1.07); }
}
.player-chip.me-chip.current-turn { border-color: #ffe27a; }
.pc-turn-pill {
  font-family: var(--font-display); font-weight: 700; font-size: 9.5px;
  letter-spacing: .5px; color: #2b1800;
  background: linear-gradient(180deg, #ffe27a, #f59e0b);
  border: 1.5px solid #fff2a6;
  border-radius: 999px; padding: 2px 8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .5);
  animation: pillBlink 1.2s infinite ease-in-out;
  white-space: nowrap;
}
@keyframes pillBlink {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.2); transform: translateY(-2px); }
}
.player-chip.me-chip { border-color: rgba(126, 231, 135, .55); }
.player-chip.offline { opacity: .5; }
.pc-uno-btn, .pc-catch-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 10.5px;
  border: none; border-radius: 999px; padding: 3px 9px; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, #ff6b6b, #dc2626);
  box-shadow: 0 2px 0 #991b1b;
  animation: pulseBtn 1s infinite;
}
.pc-uno-btn {
  background: linear-gradient(180deg, #ffdd59, #f59e0b); color: #2b1800;
  box-shadow: 0 2px 0 #b45309;
}
.pc-called-uno {
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  color: #2b1800; background: linear-gradient(180deg, #ffdd59, #f59e0b);
  border-radius: 999px; padding: 2px 8px;
  transform: rotate(-6deg); display: inline-block;
}
.pc-offline-tag { font-size: 10px; color: #ffb3b3; }

.hud-right-actions { display: flex; gap: 8px; }
.hud-btn { position: relative; }
.hb-icon { font-size: 15px; }
.hb-text { font-size: 13px; }
.quit-btn { border-color: rgba(255, 107, 107, .4); }

/* ================= LUGARES AO REDOR DA MESA ================= */
.seats {
  position: absolute; inset: 0;
  z-index: 12;
  pointer-events: none;
}
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: auto;
  transition: transform .3s, filter .3s;
  max-width: 200px;
}
.seat.current-turn { transform: translate(-50%, -50%) scale(1.08); z-index: 13; }
.seat.offline { opacity: .55; }
/* indicador do próximo jogador */
.next-up {
  font-family: var(--font-display); font-weight: 700; font-size: 9.5px;
  letter-spacing: .5px; color: #dbeafe;
  background: rgba(59, 130, 246, .25);
  border: 1px solid rgba(124, 192, 255, .55);
  border-radius: 999px;
  padding: 2px 9px;
  animation: pillBlink 1.6s infinite ease-in-out;
  white-space: nowrap;
}
/* leque de mini-cartas: mostra quantas cartas o jogador tem */
.seat-fan {
  display: flex; align-items: flex-end;
  height: 34px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  transition: filter .3s;
}
.seat-fan .mini-card {
  width: 23px; height: 34px;
  border-radius: 4px;
  background: linear-gradient(160deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  margin-left: -13px;
  transform: rotate(var(--tilt, 0deg)) translateY(var(--lift, 0px));
  transform-origin: bottom center;
  transition: transform .25s;
}
.seat-fan .mini-card:first-child { margin-left: 0; }
.seat-fan .mini-card::after {
  content: '';
  display: block; margin: 4px auto 0;
  width: 12px; height: 16px;
  border-radius: 50%;
  background: #ffcf3f;
  transform: rotate(-25deg);
}
.seat.current-turn .seat-fan { filter: drop-shadow(0 0 10px rgba(255, 204, 51, .8)); }
.seat.current-turn .seat-fan .mini-card { border-color: #ffe27a; }
/* pratinho com avatar + nome */
.seat-tag {
  display: flex; align-items: center; gap: 7px;
  background: rgba(14, 26, 48, .88);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(120, 165, 235, .32);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  max-width: 200px;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.seat.current-turn .seat-tag {
  border-color: var(--gold);
  background: rgba(52, 40, 12, .92);
  animation: chipTurnPulse 1.6s infinite ease-in-out;
}
.seat-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pc-color, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  border: 2px solid rgba(255, 255, 255, .45);
  flex: 0 0 auto;
  position: relative;
}
.seat-avatar .pc-crown { position: absolute; top: -11px; right: -7px; font-size: 12px; }
.seat-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.seat-name {
  font-family: var(--font-display); font-weight: 600; font-size: 12px; color: #fff;
  max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seat-sub { font-size: 10.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.seat-count {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 1px 7px; color: #fff;
}
.seat.current-turn .seat-count { background: rgba(255, 204, 51, .25); color: #ffe27a; }
.seat-count.uno-danger {
  background: linear-gradient(180deg, #ff6b6b, #dc2626);
  color: #fff; animation: dangerBlink .6s infinite;
}
.seat-count.uno-called {
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  color: #2b1800; transform: rotate(-5deg);
}
.pc-called-uno, .pc-offline-tag { font-size: 10px; color: #ffb3b3; }
.pc-called-uno {
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  color: #2b1800; background: linear-gradient(180deg, #ffdd59, #f59e0b);
  border-radius: 999px; padding: 2px 8px;
  transform: rotate(-5deg); display: inline-block;
}
.pc-uno-btn, .pc-catch-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 10.5px;
  border: none; border-radius: 999px; padding: 3px 9px; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, #ff6b6b, #dc2626);
  box-shadow: 0 2px 0 #991b1b;
  animation: pulseBtn 1s infinite;
}
.pc-uno-btn {
  background: linear-gradient(180deg, #ffdd59, #f59e0b); color: #2b1800;
  box-shadow: 0 2px 0 #b45309;
}
.pc-offline-tag { color: #ffb3b3; font-size: 10px; }
/* o meu lugar (canto inferior esquerdo) */
.me-seat {
  position: absolute; left: 14px; bottom: 64px;
  z-index: 16;
  display: flex; align-items: center; gap: 8px;
  background: rgba(14, 26, 48, .88);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(126, 231, 135, .45);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  transition: border-color .3s, box-shadow .3s;
}
.me-seat.current-turn {
  border-color: var(--gold);
  animation: chipTurnPulse 1.6s infinite ease-in-out;
}
.me-seat .me-label {
  font-family: var(--font-display); font-weight: 700; font-size: 9px;
  letter-spacing: 1px; color: var(--muted);
  display: block;
}
.me-seat.current-turn .me-label { color: var(--gold); }

/* ================= SETAS DE SENTIDO ================= */
.dir-arrows {
  position: absolute;
  width: min(52vh, 470px);
  height: min(52vh, 470px);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}
.dir-arrows.ccw { transform: translate(-50%, -50%) scaleX(-1); }
.da-arc {
  fill: none;
  stroke: rgba(255, 204, 51, .28);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 30 34;
  animation: dashFlow 1.5s linear infinite;
}
.da-glow .da-arc {
  stroke: rgba(255, 204, 51, .22);
  stroke-width: 30;
  stroke-dasharray: none;
  animation: none;
  filter: blur(6px);
}
.da-head { fill: rgba(255, 214, 90, .9); }
@keyframes dashFlow {
  to { stroke-dashoffset: -64; }
}
.dir-arrows.flash .da-arc { stroke: rgba(255, 230, 150, 1); }
.dir-arrows.flash .da-head { fill: #fff; }

/* ================= MÃO DO JOGADOR (sempre cabe, sem scroll) ================= */
.hand-zone {
  position: absolute; bottom: 64px; left: 0; right: 0;
  display: flex; justify-content: center;
  padding: 0 12px;
  z-index: 15;
  pointer-events: none;
}
.hand {
  display: flex; justify-content: center; align-items: flex-end;
  max-width: 100%;
  padding: 18px 10px 6px;
  pointer-events: auto;
  /* o overlap entre cartas é calculado no JS (--overlap) para caber sempre */
}
.hand .uno-card {
  margin-left: var(--overlap, -34px);
  cursor: pointer;
  transform: translateY(0) rotate(var(--tilt, 0deg));
  transform-origin: bottom center;
}
.hand .uno-card:first-child { margin-left: 0; }
.hand .uno-card:hover {
  transform: translateY(-16px) rotate(0deg) scale(1.06);
  z-index: 5;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
}
.hand .uno-card.playable {
  animation: playablePulse 1.5s infinite ease-in-out;
}
@keyframes playablePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 214, 90, .8), 0 8px 20px rgba(255, 204, 51, .3); }
  50% { box-shadow: 0 0 0 4px rgba(255, 230, 150, 1), 0 10px 30px rgba(255, 204, 51, .55); }
}
.hand .uno-card.notplayable { filter: brightness(.55) saturate(.65); }
.hand .uno-card.drawn-glow {
  box-shadow: 0 0 0 4px rgba(126, 231, 135, .9), 0 0 24px rgba(46, 213, 115, .5);
  animation: drawnPulse 1.1s infinite ease-in-out;
}
@keyframes drawnPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(126, 231, 135, .9), 0 0 24px rgba(46, 213, 115, .5); }
  50% { box-shadow: 0 0 0 6px rgba(126, 231, 135, 1), 0 0 34px rgba(46, 213, 115, .75); }
}
.hand .uno-card.selected { transform: translateY(-22px) rotate(0deg) scale(1.07); z-index: 6; }
.hand .uno-card.playing-anim {
  transition: transform .4s cubic-bezier(.5, 0, .8, .4), opacity .4s;
  transform: translateY(-260px) scale(.55) rotate(10deg);
  opacity: 0;
}

/* ================= ACTIONBAR ================= */
.actionbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(10, 19, 36, .88);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(100, 150, 225, .22);
  z-index: 18;
  min-height: 56px;
  transition: border-color .3s, box-shadow .3s;
}
.actionbar.my-turn {
  border-top-color: rgba(255, 204, 51, .65);
  box-shadow: 0 -8px 30px rgba(255, 204, 51, .14);
  background: linear-gradient(180deg, rgba(46, 36, 12, .55), rgba(10, 19, 36, .92) 60%);
}
.action-info { flex: 1; font-size: 14px; color: #dbeafe; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.action-info b { color: var(--gold); }
.action-controls { display: flex; gap: 10px; align-items: center; }
.action-controls .btn.big-cta { font-size: 15px; padding: 11px 22px; }

/* brilho de "SUA VEZ" na moldura da tela inteira */
body.my-turn .table-wrap::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 6;
  box-shadow: inset 0 0 130px rgba(255, 204, 51, .14), inset 0 0 30px rgba(255, 204, 51, .1);
  animation: turnFrameGlow 1.8s infinite ease-in-out;
}
@keyframes turnFrameGlow {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ================= BOTÃO UNO GIGANTE ================= */
.uno-button {
  position: absolute; right: 26px; bottom: 110px;
  z-index: 30;
  width: 108px; height: 108px; border-radius: 50%;
  border: 4px solid #fff;
  background: radial-gradient(circle at 32% 28%, #ff8a7d 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 27px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(224, 49, 46, .55), inset 0 3px 0 rgba(255, 255, 255, .4);
  animation: unoPulse 1s infinite;
  transform: skewX(-6deg);
}
.uno-button:active { transform: skewX(-6deg) scale(.93); }
@keyframes unoPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); box-shadow: 0 10px 40px rgba(224, 49, 46, .85), inset 0 3px 0 rgba(255, 255, 255, .4); }
}

.uno-toast-zone {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 32; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.uno-shout {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  color: #2b1800;
  padding: 8px 26px; border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transform: rotate(-4deg);
  animation: shoutIn .45s cubic-bezier(.34, 1.56, .64, 1), shoutOut .4s ease 2.1s forwards;
}
.uno-shout.dark { background: linear-gradient(180deg, #ff8a7d, #dc2626); color: #fff; }
@keyframes shoutIn { from { transform: scale(.3) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
@keyframes shoutOut { to { transform: translateY(-24px) scale(.85); opacity: 0; } }

/* ================= FAIXA DE VEZ ================= */
.turn-banner {
  position: absolute; top: 26%; left: 0; right: 0;
  display: flex; justify-content: center;
  z-index: 26; pointer-events: none;
}
.turn-banner-inner {
  background: linear-gradient(180deg, rgba(255, 221, 89, .97), rgba(245, 158, 11, .97));
  color: #2b1800;
  border-radius: 20px;
  padding: 14px 40px;
  text-align: center;
  border: 3px solid #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(245, 158, 11, .35);
  animation: bannerIn .5s cubic-bezier(.34, 1.56, .64, 1), bannerOut .45s ease 1.9s forwards;
}
.tb-title { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: 1px; }
.tb-sub { font-size: 14px; font-weight: 600; margin-top: 2px; }
@keyframes bannerIn { from { transform: scale(.4) translateY(30px); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bannerOut { to { transform: scale(.85) translateY(-20px); opacity: 0; } }

/* ================= INTRO ================= */
.battle-intro {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 10, 22, .78);
  backdrop-filter: blur(6px);
}
.bi-card {
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .45);
  border-radius: 26px;
  padding: 30px 46px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
  animation: bannerIn .55s cubic-bezier(.34, 1.56, .64, 1);
}
.bi-emblem {
  width: 74px; height: 74px; margin: 0 auto 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  box-shadow: 0 8px 24px rgba(224, 49, 46, .5), inset 0 2px 0 rgba(255, 255, 255, .4);
}
.bi-kicker { font-family: var(--font-display); font-size: 12px; letter-spacing: 3px; color: var(--gold); margin-bottom: 4px; }
.bi-title { font-family: var(--font-display); font-size: 30px; color: #fff; margin-bottom: 12px; }
.bi-order { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 560px; margin: 0 auto; }
.bi-pill {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  background: rgba(10, 20, 40, .8); border: 1.5px solid rgba(120, 165, 235, .4);
  border-radius: 999px; padding: 6px 14px; color: #dbeafe;
}
.bi-pill.first { background: linear-gradient(180deg, #ffdd59, #f59e0b); color: #2b1800; border-color: #fff2a6; }
.bi-mission { color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* ================= OVERLAYS (COR / DESAFIO) ================= */
.color-overlay {
  position: absolute; inset: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 10, 22, .7);
  backdrop-filter: blur(5px);
}
.color-box {
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .45);
  border-radius: 24px;
  padding: 26px 32px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
  animation: bannerIn .4s cubic-bezier(.34, 1.56, .64, 1);
  max-width: min(480px, calc(100vw - 30px));
}
.color-box h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 16px; color: #fff; }
.color-box p { color: #dbeafe; font-size: 14.5px; line-height: 1.45; margin-bottom: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.color-choice {
  border: 3px solid rgba(255, 255, 255, .55);
  border-radius: 16px;
  height: 84px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .55);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .15s, filter .15s;
}
.color-choice:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.15); }
.color-choice:active { transform: translateY(2px); }
.color-choice.red { background: linear-gradient(180deg, #ff6b5e, #c22320); }
.color-choice.yellow { background: linear-gradient(180deg, #ffd977, #d18a00); text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.color-choice.green { background: linear-gradient(180deg, #4ee081, #178f43); }
.color-choice.blue { background: linear-gradient(180deg, #7cb8ff, #1d4ed8); }
.challenge-actions { display: flex; gap: 12px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.challenge-actions .btn { font-size: 15px; padding: 11px 20px; }

/* ================= CHAT ================= */
.chat-panel {
  position: absolute; top: 62px; right: 12px; bottom: 66px;
  width: min(300px, 86vw);
  z-index: 28;
  display: flex;
  transition: transform .25s ease, opacity .25s ease;
}
.chat-panel.hidden-side { transform: translateX(24px); opacity: 0; pointer-events: none; }
.side-log-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 14px 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.side-head h3 { font-family: var(--font-display); font-size: 15px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.chat-msg { font-size: 13px; line-height: 1.35; background: rgba(10, 20, 40, .6); border-radius: 10px; padding: 6px 10px; }
.chat-msg b { color: var(--gold); }
.chat-msg.self b { color: #7ee787; }
.chat-input-row { display: flex; gap: 6px; margin-top: 8px; }
.chat-input-row input { padding: 8px 12px; font-size: 13px; }
.action-log { max-height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.log-line { font-size: 12px; color: var(--muted); line-height: 1.35; }
.log-line.hl { color: #dbeafe; }

/* ================= TOAST ================= */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 22, 40, .96);
  border: 1.5px solid rgba(120, 175, 255, .5);
  color: #dbeafe;
  font-size: 14px; font-weight: 600;
  padding: 11px 22px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  z-index: 100;
  animation: toastIn .25s ease;
  max-width: min(480px, calc(100vw - 40px));
  text-align: center;
}
.toast.err { border-color: rgba(255, 107, 107, .65); color: #ffc9c9; }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ================= OVERLAY DE VITÓRIA ================= */
.win-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 10, 22, .8);
  backdrop-filter: blur(6px);
  overflow: auto;
  padding: 20px;
}
.win-box {
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .45);
  border-radius: 26px;
  padding: 28px 34px;
  width: min(560px, 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
  text-align: center;
  animation: bannerIn .5s cubic-bezier(.34, 1.56, .64, 1);
  max-height: 100%;
  overflow: auto;
}
.win-header { display: flex; align-items: center; gap: 16px; text-align: left; margin-bottom: 14px; }
.win-trophy {
  width: 70px; height: 70px; border-radius: 20px;
  background: linear-gradient(135deg, #ffdd59, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, .45), inset 0 2px 0 rgba(255, 255, 255, .6);
  flex: 0 0 auto;
}
.champion-box .win-trophy {
  background: linear-gradient(135deg, #ff6b5e 0%, var(--uno-red) 55%, var(--uno-red-dark) 100%);
  box-shadow: 0 8px 24px rgba(224, 49, 46, .5), inset 0 2px 0 rgba(255, 255, 255, .4);
}
.win-title-block h1 { font-family: var(--font-display); font-size: 26px; color: #fff; line-height: 1.15; }
.win-summary { color: var(--gold); font-size: 14px; font-weight: 600; margin-top: 2px; }
.win-body { color: #dbeafe; font-size: 14px; margin-bottom: 18px; }
.score-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.score-table th {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 1px;
  color: var(--muted); text-align: left; padding: 6px 8px; font-weight: 600;
}
.score-table td { padding: 8px; border-top: 1px solid rgba(120, 165, 235, .18); font-size: 14px; text-align: left; }
.score-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.score-table tr.winner-row td { color: var(--gold); font-weight: 700; }
.score-table tr.champion-row td { color: #ffd76a; font-weight: 800; }
.score-table tr.me-row td { background: rgba(126, 231, 135, .07); }
.win-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================= AVATARES FLUTUANTES (adversários) ================= */
.opponent-dock {
  position: absolute; z-index: 16;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: auto;
}
.opp-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(14, 26, 48, .85);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(120, 165, 235, .3);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  transition: transform .2s, border-color .25s, box-shadow .25s;
  position: relative;
}
.opp-chip .pc-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pc-color, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  border: 2px solid rgba(255, 255, 255, .45);
  flex: 0 0 auto;
  position: relative;
}
.opp-chip .pc-name { font-family: var(--font-display); font-weight: 600; font-size: 12px; color: #fff; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-chip .pc-cards { font-family: var(--font-display); font-weight: 700; font-size: 11px; color: var(--gold); }
.opp-chip.current-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 204, 51, .3);
}
.opp-chip .mini-hand { display: flex; margin-left: 2px; }
.opp-chip .mini-hand .mini-card {
  width: 15px; height: 22px; border-radius: 3px;
  background: linear-gradient(160deg, #ff6b5e, var(--uno-red-dark));
  border: 1.5px solid #fff; margin-left: -7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.opp-chip .mini-hand .mini-card:first-child { margin-left: 0; }
.opp-uno-tag {
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  color: #2b1800; background: linear-gradient(180deg, #ffdd59, #f59e0b);
  border-radius: 999px; padding: 2px 8px; transform: rotate(-5deg);
}
.uno-danger { animation: dangerBlink .5s infinite; }
@keyframes dangerBlink { 0%, 100% { border-color: rgba(255, 107, 107, .9); } 50% { border-color: rgba(255, 204, 51, .9); } }

/* ================= INSTALAÇÃO PWA ================= */
.install-wrap { margin-top: 14px; }
.install-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; text-align: left;
}
.install-ico { font-size: 26px; }
.install-txt { display: flex; flex-direction: column; line-height: 1.25; }
.install-txt small { color: var(--muted); font-size: 12px; font-family: var(--font-ui); font-weight: 500; }
.ios-install {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 10, 22, .8);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  padding: 20px;
}
.ios-install-card {
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .4);
  border-radius: 22px; padding: 26px 30px; max-width: 430px; text-align: center;
}
.ios-install-card h3 { font-family: var(--font-display); margin: 10px 0 12px; }
.ios-install-card ol { text-align: left; color: #bdd0ee; font-size: 13.5px; display: grid; gap: 10px; padding-left: 18px; margin-bottom: 16px; }
.ios-install-icon img { width: 64px; height: 64px; border-radius: 16px; }
.ios-share { display: inline-block; }

.rotate-hint {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(5, 10, 22, .88);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
body.touch:not(.pwa):not(.rotate-dismissed) .rotate-hint {
  display: flex;
}
@media (orientation: landscape) {
  body.touch:not(.pwa):not(.rotate-dismissed) .rotate-hint { display: none; }
}
.rotate-card {
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .4);
  border-radius: 22px; padding: 28px 32px; max-width: 400px; text-align: center;
  display: grid; gap: 12px; justify-items: center;
}
.rotate-phone { font-size: 46px; animation: rotateAnim 2s infinite ease-in-out; display: inline-block; }
@keyframes rotateAnim { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
.rotate-card h3 { font-family: var(--font-display); }
.rotate-card p { color: var(--muted); font-size: 14px; }

/* ================= RESPONSIVO ================= */
@media (max-width: 980px) {
  .lobby-main { grid-template-columns: 1fr; }
  .lobby-left-grid { grid-template-columns: 1fr; }
  .room-slots { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .hud-top { padding: 8px 8px; gap: 6px; flex-wrap: wrap; }
  .hb-text { display: none; }
  .uno-card { width: 92px; height: 138px; }
  .uno-card .oval .big-val { font-size: 46px; }
  .discard-pile { width: 92px; height: 138px; }
  .deck-pile .uno-card { width: 92px; height: 138px; }
  .hand-zone { bottom: 58px; }
  .hand .uno-card { margin-left: var(--overlap, -46px); }
  .tb-title { font-size: 22px; }
  .uno-button { width: 88px; height: 88px; font-size: 21px; right: 14px; bottom: 92px; }
  .lobby-live-stats { display: none; }
  /* mesa elíptica no celular */
  .dir-arrows { width: min(38vh, 300px); height: min(38vh, 300px); }
  .color-chip { top: 58px; }
  .me-seat { left: 8px; bottom: 54px; transform: scale(.9); transform-origin: bottom left; }
  .seat { max-width: 150px; }
  .seat-name { max-width: 78px; font-size: 11px; }
  .seat-fan { height: 26px; }
  .seat-fan .mini-card { width: 18px; height: 26px; margin-left: -11px; }
  .seat-fan .mini-card::after { width: 9px; height: 12px; margin-top: 3px; }
  .seat-tag { padding: 3px 9px 3px 4px; }
  .seat-avatar { width: 25px; height: 25px; font-size: 11px; }
}

/* ================= MODO COMPACTO (celulares / telas baixas) ================= */
body.compact-seats .seat { max-width: 112px; gap: 2px; }
body.compact-seats .seat-fan { height: 22px; }
body.compact-seats .seat-fan .mini-card { width: 15px; height: 22px; margin-left: -9px; border-width: 1px; }
body.compact-seats .seat-fan .mini-card::after { width: 8px; height: 11px; margin-top: 2px; }
body.compact-seats .seat-tag { padding: 2px 8px 2px 3px; gap: 5px; }
body.compact-seats .seat-avatar { width: 22px; height: 22px; font-size: 10px; border-width: 1.5px; }
body.compact-seats .seat-avatar .pc-crown { font-size: 9px; top: -9px; right: -5px; }
body.compact-seats .seat-name { font-size: 9px; max-width: 58px; }
body.compact-seats .seat-sub { font-size: 9px; gap: 3px; }
body.compact-seats .seat-count { font-size: 9px; padding: 0 5px; }
body.compact-seats .next-up { font-size: 8px; padding: 1px 6px; }
body.compact-seats .pc-called-uno { font-size: 8px; padding: 1px 6px; }
body.compact-seats .pc-catch-btn { font-size: 9px; padding: 2px 7px; }
body.compact-seats .me-seat { transform: scale(.92); transform-origin: bottom left; bottom: 52px; }
@media (max-height: 520px) {
  .uno-card { width: 78px; height: 117px; }
  .uno-card .oval .big-val { font-size: 38px; }
  .uno-card .corner { font-size: 13px; }
  .discard-pile { width: 78px; height: 117px; }
  .deck-pile .uno-card { width: 78px; height: 117px; }
  .dir-arrows { width: min(32vh, 240px); height: min(32vh, 240px); }
  .color-chip { top: 44px; font-size: 11px; padding: 4px 12px; }
  .hand-zone { bottom: 50px; }
  .hand { padding-top: 12px; }
  .table-felt { height: min(58vh, 400px); }
  .turn-banner-inner { padding: 10px 28px; }
  .tb-title { font-size: 20px; }
  .buy-tag { top: -32px; font-size: 12px; padding: 4px 11px; }
  .uno-button { width: 78px; height: 78px; font-size: 19px; bottom: 84px; right: 12px; }
}
