/* Sin Filtro — Tema Fiesta 🍺🔥 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
    --brand:      #f43f5e;
    --brand-dark: #be123c;
    --party1:     #f43f5e;
    --party2:     #a855f7;
    --party3:     #f59e0b;
    --beer:       #f59e0b;
    --card-red:    #ef4444;
    --card-blue:   #3b82f6;
    --card-green:  #22c55e;
    --card-yellow: #eab308;
    --card-wild:   #a855f7;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', system-ui, sans-serif;
    background: #0d0010;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(168,85,247,.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(244,63,94,.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(245,158,11,.1) 0%, transparent 50%);
    color: #f9fafb;
    min-height: 100vh;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4b1d6b; border-radius: 3px; }

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.9rem; color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.3);
    box-shadow: 0 0 12px rgba(0,0,0,.4);
}
.avatar.sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.5rem; }

.conn-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #0d0010; }
.conn-dot.online  { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.conn-dot.offline { background: #6b7280; }

/* ─── Playing cards (UNO) ────────────────────────────────────────────────── */
.playing-card {
    width: 72px; height: 100px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,.2);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.25rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative; user-select: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.playing-card:hover:not(.disabled) {
    transform: translateY(-10px) scale(1.06);
    box-shadow: 0 12px 28px rgba(0,0,0,.7);
}
.playing-card.playable {
    border-color: #fbbf24;
    box-shadow: 0 0 16px rgba(251,191,36,.6), 0 4px 12px rgba(0,0,0,.5);
}
.playing-card.selected {
    transform: translateY(-18px) scale(1.08);
    border-color: #fff;
    box-shadow: 0 16px 36px rgba(0,0,0,.8);
}
.playing-card.disabled { opacity: .4; cursor: not-allowed; }
.playing-card.back {
    background: linear-gradient(135deg, #4c1d95, #7c3aed, #4c1d95);
    cursor: default;
}
.card-red    { background: linear-gradient(135deg, #9f1239, #ef4444); color: #fff; }
.card-blue   { background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: #fff; }
.card-green  { background: linear-gradient(135deg, #14532d, #22c55e); color: #fff; }
.card-yellow { background: linear-gradient(135deg, #78350f, #f59e0b); color: #1f2937; }
.card-wild   { background: linear-gradient(135deg, #581c87, #a855f7); color: #fff; }

/* ─── Truco cards ────────────────────────────────────────────────────────── */
.truco-card {
    width: 62px; height: 90px;
    border-radius: 8px;
    background: linear-gradient(160deg, #fef9c3, #fde68a);
    border: 2px solid #d97706;
    color: #1c1917;
    display: flex; flex-direction: column;
    align-items: center; justify-content: space-between;
    padding: 4px; font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.truco-card:hover:not(.played) { transform: translateY(-8px); }
.truco-card.played { opacity: .55; transform: none; cursor: default; }

/* ─── Truth or Dare ──────────────────────────────────────────────────────── */
.td-card {
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    min-height: 220px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    font-size: 1.15rem; font-weight: 700; line-height: 1.5;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.td-card::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.td-card.truth {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
    border: 2px solid rgba(96,165,250,.5);
}
.td-card.dare {
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 60%, #ef4444 100%);
    border: 2px solid rgba(252,165,165,.5);
}

.level-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 12px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
}
.level-badge.suave   { background: #064e3b; color: #6ee7b7; }
.level-badge.normal  { background: #713f12; color: #fcd34d; }
.level-badge.picante { background: #7f1d1d; color: #fca5a5; box-shadow: 0 0 8px rgba(239,68,68,.4); }

/* ─── Impostor ───────────────────────────────────────────────────────────── */
.impostor-bg {
    background: radial-gradient(ellipse at top, #0f172a, #020617);
    min-height: 100vh;
}
.task-panel {
    background: rgba(15,23,42,.85);
    border: 1px solid rgba(99,102,241,.3);
    border-radius: 14px; padding: 16px;
    backdrop-filter: blur(10px);
}
.task-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,.05);
    margin-bottom: 6px; cursor: pointer;
    transition: background .15s;
    border: 1px solid transparent;
}
.task-item:hover { background: rgba(99,102,241,.2); border-color: rgba(99,102,241,.3); }
.task-item.completed { opacity: .45; cursor: default; }
.task-item.completed:hover { background: rgba(255,255,255,.05); border-color: transparent; }
.task-progress-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.task-progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #a855f7, #22c55e); transition: width .5s ease; }

/* ─── Lobby / Player cards ───────────────────────────────────────────────── */
.player-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    transition: all .15s;
}
.player-card:hover { background: rgba(255,255,255,.07); }
.player-card.is-host {
    border-color: rgba(251,191,36,.5);
    background: rgba(251,191,36,.05);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: 12px;
    font-weight: 800; font-size: 0.9rem;
    cursor: pointer; transition: all .15s ease;
    border: none; outline: none; text-decoration: none;
    letter-spacing: .02em;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--party1), #e11d48);
    color: white;
    box-shadow: 0 4px 14px rgba(244,63,94,.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(244,63,94,.55); }

.btn-danger { background: linear-gradient(135deg, #b91c1c, #dc2626); color: white; box-shadow: 0 4px 12px rgba(220,38,38,.35); }
.btn-danger:hover { transform: translateY(-1px); }

.btn-ghost {
    background: rgba(255,255,255,.07);
    color: white;
    border: 1px solid rgba(255,255,255,.15);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }

.btn-purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 4px 14px rgba(168,85,247,.4);
}
.btn-purple:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168,85,247,.55); }

.btn-sm  { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg  { padding: 14px 30px; font-size: 1rem; border-radius: 14px; }
.btn-xl  { padding: 18px 40px; font-size: 1.15rem; border-radius: 16px; }

/* UNO button */
.uno-btn {
    background: linear-gradient(135deg, #9f1239, #f43f5e);
    color: white; font-size: 1.5rem; font-weight: 900;
    padding: 12px 28px; border-radius: 14px;
    border: 3px solid rgba(252,165,165,.6);
    animation: pulse-uno 1s ease infinite; cursor: pointer;
}
@keyframes pulse-uno {
    0%,100% { box-shadow: 0 0 10px rgba(244,63,94,.5); }
    50%      { box-shadow: 0 0 28px rgba(244,63,94,.9); }
}

/* Emergency button */
.emergency-btn {
    background: linear-gradient(135deg, #7f1d1d, #dc2626);
    border: 3px solid rgba(252,165,165,.6);
    border-radius: 50%; width: 76px; height: 76px;
    font-size: 2rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s;
    box-shadow: 0 0 20px rgba(220,38,38,.5);
}
.emergency-btn:hover { transform: scale(1.12); box-shadow: 0 0 32px rgba(220,38,38,.8); }
.emergency-btn.cooldown { opacity: .45; cursor: not-allowed; filter: grayscale(.8); box-shadow: none; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
    pointer-events: auto;
    padding: 12px 18px; border-radius: 14px;
    font-size: 0.875rem; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    min-width: 220px; max-width: 340px;
    box-shadow: 0 8px 28px rgba(0,0,0,.6);
    animation: slide-in .3s ease forwards;
    backdrop-filter: blur(10px);
}
.toast.success { background: rgba(5,46,22,.95); border: 1px solid #059669; }
.toast.error   { background: rgba(69,10,10,.95); border: 1px solid #dc2626; }
.toast.info    { background: rgba(30,27,75,.95); border: 1px solid #6366f1; }
.toast.warning { background: rgba(69,26,3,.95);  border: 1px solid #d97706; }
@keyframes slide-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }
.toast.hiding { animation: slide-out .3s ease forwards; }

/* ─── Color picker ───────────────────────────────────────────────────────── */
.color-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.color-picker-btn {
    height: 60px; border-radius: 12px;
    border: 3px solid transparent; cursor: pointer;
    transition: all .15s; font-weight: 800; color: white; font-size: 1rem;
}
.color-picker-btn:hover { transform: scale(1.06); border-color: rgba(255,255,255,.7); }
.color-picker-btn.red    { background: linear-gradient(135deg, #9f1239, #ef4444); }
.color-picker-btn.blue   { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.color-picker-btn.green  { background: linear-gradient(135deg, #14532d, #22c55e); }
.color-picker-btn.yellow { background: linear-gradient(135deg, #78350f, #f59e0b); color: #1c1917; }

/* ─── Vote cards ─────────────────────────────────────────────────────────── */
.vote-player-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px; background: rgba(255,255,255,.05);
    border: 2px solid transparent; border-radius: 14px;
    cursor: pointer; transition: all .15s;
}
.vote-player-card:hover { background: rgba(168,85,247,.15); border-color: rgba(168,85,247,.5); transform: scale(1.03); }
.vote-player-card.voted-for { border-color: #a855f7; background: rgba(168,85,247,.2); }
.vote-player-card.eliminated { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ─── Score boxes ────────────────────────────────────────────────────────── */
.score-box {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px; padding: 12px 20px; text-align: center;
}
.score-number { font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ─── Room code ──────────────────────────────────────────────────────────── */
.room-code {
    font-family: 'Fredoka One', monospace;
    font-size: 2.8rem; font-weight: 400;
    letter-spacing: .2em;
    background: linear-gradient(90deg, #f43f5e, #a855f7, #f59e0b);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Settings panel ─────────────────────────────────────────────────────── */
.settings-panel {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px; padding: 20px;
}
.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.settings-row:last-child { border-bottom: none; }

/* Toggle */
.toggle {
    width: 46px; height: 26px; background: #374151;
    border-radius: 13px; position: relative; cursor: pointer; transition: background .2s;
}
.toggle.on { background: var(--brand); }
.toggle::after {
    content: ''; position: absolute; top: 4px; left: 4px;
    width: 18px; height: 18px; background: white;
    border-radius: 50%; transition: transform .2s;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.toggle.on::after { transform: translateX(20px); }

/* ─── Timer ──────────────────────────────────────────────────────────────── */
.timer-ring { position: relative; width: 64px; height: 64px; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .timer-number {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.timer-ring.urgent .timer-number { color: #ef4444; animation: blink .5s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes card-deal {
    from { transform: translateY(-120px) rotate(-12deg); opacity: 0; }
    to   { transform: translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
@keyframes bounce-in {
    0%   { transform: scale(0.3); opacity: 0; }
    50%  { transform: scale(1.08); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.animate-deal    { animation: card-deal .4s ease both; }
.animate-fade-in { animation: fade-in .35s ease both; }
.animate-shake   { animation: shake .4s ease; }
.animate-bounce-in { animation: bounce-in .5s cubic-bezier(.36,.07,.19,.97) both; }
.animate-float   { animation: float 3s ease infinite; }

/* ─── Hand container ─────────────────────────────────────────────────────── */
.hand-container {
    display: flex; overflow-x: auto;
    padding: 16px 8px 28px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
}
.hand-container .playing-card,
.hand-container .truco-card { scroll-snap-align: center; flex-shrink: 0; }
.hand-container .playing-card { margin-right: -22px; }
.hand-container .playing-card:last-child { margin-right: 0; }
.hand-container .playing-card:hover { z-index: 10; }

/* ─── Party header gradient ──────────────────────────────────────────────── */
.party-title {
    font-family: 'Fredoka One', cursive;
    background: linear-gradient(90deg, #f43f5e, #a855f7, #f59e0b, #f43f5e);
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* ─── Neon glow effect ───────────────────────────────────────────────────── */
.neon-pink  { box-shadow: 0 0 20px rgba(244,63,94,.4), inset 0 0 20px rgba(244,63,94,.05); }
.neon-purple{ box-shadow: 0 0 20px rgba(168,85,247,.4), inset 0 0 20px rgba(168,85,247,.05); }

/* ─── Glass card ─────────────────────────────────────────────────────────── */
.glass {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
    border-radius: 20px;
}

/* ─── Truco score ────────────────────────────────────────────────────────── */
.truco-score-track { display: flex; flex-direction: column; gap: 4px; }
.truco-score-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); }
.truco-score-dot.filled { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .playing-card { width: 58px; height: 82px; font-size: 1rem; }
    .truco-card   { width: 52px; height: 74px; }
}
