* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Poppins', system-ui, sans-serif;
    background-color: #0a0a0a;
    background-image: radial-gradient(rgba(255, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ===== BOTÃO MENU (CANTO SUPERIOR ESQUERDO) ===== */
#menu-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #c0392b;
    font-size: 28px;
    color: #e74c3c;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(192, 57, 43, 0.5);
    z-index: 1000;
}

#menu-toggle-btn:hover {
    background: #e74c3c;
    color: black;
    transform: scale(1.05);
    box-shadow: 0 0 15px #e74c3c;
}

/* ===== LOGO (CANTO INFERIOR DIREITO) ===== */
#logo-link-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: block;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 6px;
    border: 1px solid #c0392b;
    transition: all 0.2s;
    z-index: 1000;
}

#logo-link-bottom:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px #e74c3c;
}

#site-logo-bottom {
    max-height: 50px;
    width: auto;
    display: block;
    border-radius: 50%;
}

#logo-link {
    display: block;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 6px;
    border: 1px solid #c0392b;
    transition: all 0.2s;
}

#logo-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px #e74c3c;
}

/* ===== MENU LATERAL (DRAWER) ===== */
.side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #111;
    border-right: 2px solid #c0392b;
    box-shadow: 4px 0 20px rgba(192, 57, 43, 0.3);
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.side-drawer.open {
    left: 0;
}

.drawer-header {
    background: #1a1a1a;
    border-bottom: 1px solid #c0392b;
    color: #e74c3c;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-drawer {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 24px;
    cursor: pointer;
}

.drawer-nav {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-btn {
    background: none;
    border: none;
    color: #ccc;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.drawer-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    width: calc(100% - 32px);
    height: 2px;
    background: #e74c3c;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.drawer-btn:hover::after {
    transform: scaleX(1);
}

.drawer-btn:hover {
    color: #e74c3c;
    transform: translateX(4px);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

/* ===== CARDS DA EQUIPE ===== */
.member-card {
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    width: 280px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.member-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(192, 57, 43, 0.4);
}

.card-image-placeholder,
.card-image {
    width: 100%;
    height: 260px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #e74c3c;
    border-bottom: 1px solid #c0392b;
    object-fit: cover;
    overflow: hidden;
}


.card-image {
    object-fit: cover;
}

.member-card h3 {
    font-size: 1.6rem;
    margin: 20px 20px 5px;
    color: #e74c3c;
}

.member-card .role {
    font-weight: 600;
    color: #f0a07c;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.member-card .bio {
    padding: 0 20px 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #bbb;
}

/* ===== CONTEÚDO DAS PÁGINAS (SOBRE, OPALEIROS, SOBRE-NÓS) ===== */
.content-page {
    max-width: 900px;
    margin: 100px auto 60px;
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 10px 30px rgba(192, 57, 43, 0.2);
}

.content-page h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #e74c3c;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.content-page .subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #e74c3c;
    margin-bottom: 32px;
    opacity: 0.9;
    width: 100%;
}

.content-page p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    color: #ddd;
    text-align: justify;
}

.content-page ul,
.content-page ol {
    margin-left: 32px;
    margin-bottom: 24px;
    color: #ccc;

}

.content-page li {
    margin: 8px 0;
}

.content-page strong {
    color: #e74c3c;
}

.back-link-container {
    text-align: center;
    margin-top: 40px;
}

.back-link {
    display: inline-block;
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 10px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.back-link:hover {
    background: #e74c3c;
    color: #0a0a0a;
    box-shadow: 0 0 12px #e74c3c;
}

/* Páginas de equipe (cards)  */
.team-page {
    max-width: 1200px;
    margin: 100px auto 60px;
    padding: 20px;
}

.team-header h1 {
    font-size: 3rem;
    color: #e74c3c;
    text-align: center;
}

.team-header .subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #e74c3c;
    margin-top: 8px;
    opacity: 0.9;
}

.team-description {
    text-align: center;
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    padding: 20px;
    margin: 30px auto;
    max-width: 600px;
    color: #ddd;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.member-card {
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    width: 280px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.member-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(192, 57, 43, 0.4);
}

.card-image-placeholder {
    width: 100%;
    height: 260px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #e74c3c;
    border-bottom: 1px solid #c0392b;
}

.member-card h3 {
    font-size: 1.6rem;
    margin: 20px 20px 5px;
    color: #e74c3c;
}

.member-card .role {
    font-weight: 600;
    color: #f0a07c;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.member-card .bio {
    text-align: justify;
    padding: 0 20px 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #bbb;
}

/* Páginas de autenticação (login/registro) */
.auth-card {
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 32px;
    padding: 48px 40px;
    max-width: 440px;
    margin: 80px auto;
    box-shadow: 0 20px 40px rgba(192, 57, 43, 0.25);
    transition: transform 0.2s;
}

.auth-card h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 32px;
    color: #e74c3c;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-card .input-group {
    margin-bottom: 24px;
    position: relative;
}

.auth-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ccc;
    letter-spacing: 0.5px;
}

.auth-card input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 24px;
    background: #1e1e1e;
    border: 1px solid #c0392b;
    border-radius: 16px;
    font-size: 1rem;
    color: #f0f0f0;
    transition: all 0.2s;
}

.auth-card input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.auth-card button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: none;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 12px;
}

.auth-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(192, 57, 43, 0.4);
}

.auth-card p {
    text-align: center;
    margin-top: 24px;
    color: #aaa;
    font-size: 0.9rem;
}

.auth-card a:hover {
    color: #ff6b6b;
    text-decoration: underline;
}

#status {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #e74c3c;
    min-height: 40px;
}


/* ===== SCROLLBAR ===== */
/* Para navegadores WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c0392b;
    border-radius: 10px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: #e74c3c;
}

/* Para Firefox  */
* {
    scrollbar-width: thin;
    scrollbar-color: #c0392b #1a1a1a;
}

/* ===== SEÇÃO "about opaleiros" ===== */
.opaleiros-about {
    max-width: 900px;
    margin: 60px auto 0;
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(192, 57, 43, 0.2);
}

.opaleiros-about h2 {
    font-size: 2rem;
    color: #e74c3c;
    text-align: center;
    margin-bottom: 24px;
    border-left: 4px solid #e74c3c;
    padding-left: 16px;
    display: inline-block;
    width: auto;
}

.opaleiros-about p {
    font-size: 1rem;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 20px;
    text-align: justify;
}

.opaleiros-about strong {
    color: #e74c3c;
}

/* LOBBY - layout 3 colunas */
.lobby-container {
    max-width: 1200px;
    margin: 100px auto 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 32px;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border-bottom: 1px solid #c0392b;
    padding-bottom: 16px;
}

.lobby-content {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.online-users {
    flex: 1;
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    padding: 20px;
}

.online-users h3 {
    color: #e74c3c;
    margin-bottom: 16px;
}

.online-list {
    list-style: none;
    padding: 0;
}

.online-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    color: #ddd;
}

.create-game-panel,
.game-code-panel {
    flex: 1;
    background: #111;
    border: 1px solid #c0392b;
    border-radius: 24px;
    padding: 20px;
}

.game-code {
    background: #1e1e1e;
    padding: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    border-radius: 16px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    border: 1px solid #c0392b;
}

.btn-secondary {
    margin-top: 8px;
    width: 100%;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #ccc;
}

.input-group input {
    width: 100%;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #c0392b;
    border-radius: 12px;
    color: white;
}

/* Botões principais */
.btn-primary {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(192, 57, 43, 0.4);
}

/* Botões secundários (convidar, entrar, sair) */
.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid #c0392b;
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(192, 57, 43, 0.5);
    border-color: #e74c3c;
}

/* Tela de espera (waiting room) */
.waiting-room {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.waiting-card {
    background: #111;
    border: 2px solid #c0392b;
    border-radius: 32px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(192, 57, 43, 0.3);
}

.waiting-card h2 {
    color: #e74c3c;
    margin-bottom: 24px;
}

.game-code-box {
    background: #1e1e1e;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 1.2rem;
    color: #ddd;
}

.game-code-box strong {
    color: #e74c3c;
    font-size: 1.4rem;
    letter-spacing: 2px;
}

.players-count {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #ddd;
}

.waiting-message {
    background: rgba(231, 76, 60, 0.2);
    border-left: 4px solid #e74c3c;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 32px;
    color: #f0a07c;
}

.waiting-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.waiting-actions button {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════
   SALA DE ESPERA — MELHORIAS
═══════════════════════════════════════════════════════════ */

.waiting-header {
    margin-bottom: 24px;
}

.waiting-header h2 {
    color: #e74c3c;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.code-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    display: block;
    margin-bottom: 6px;
}

.code-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.code-row strong {
    color: #e74c3c;
    font-size: 1.6rem;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.btn-copy {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #c0392b;
    color: #e74c3c;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: rgba(231, 76, 60, 0.35);
}

.copy-toast {
    display: inline-block;
    font-size: 0.75rem;
    color: #2ecc71;
    opacity: 0;
    transition: opacity 0.3s;
    margin-top: 4px;
}

.copy-toast.show {
    opacity: 1;
}

/* Barra de progresso */
.progress-bar-track {
    background: #1e1e1e;
    border-radius: 999px;
    height: 8px;
    margin: 12px 0 20px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

/* Contador de jogadores melhorado */
.count-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.count-display {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.count-separator {
    color: #555;
    margin: 0 4px;
}

/* Mensagem de status "ready" */
.waiting-message.ready {
    background: rgba(46, 204, 113, 0.15);
    border-left-color: #2ecc71;
    color: #2ecc71;
}

/* Lista de jogadores na sala */
.players-in-room {
    background: #0d0d0d;
    border: 1px solid #1e1e1e;
    border-radius: 16px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.players-in-room-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 12px;
}

.room-players-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.room-player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #111;
    transition: background 0.2s;
}

.room-player-item:hover {
    background: #1a1a1a;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.player-name {
    color: #ddd;
    font-size: 0.9rem;
    flex: 1;
}

.player-name em {
    color: #888;
    font-style: normal;
}

.owner-badge {
    font-size: 0.7rem;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #c0392b;
    color: #e74c3c;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* Online players melhorado (lobby) */
.online-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #1e1e1e;
    color: #ddd;
    transition: background 0.15s;
}

.online-player-item:hover {
    background: #1a1a1a;
}

.online-player-item.you {
    color: #e74c3c;
    font-weight: 600;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 6px #2ecc71;
    flex-shrink: 0;
}


/*PÁGINA DO JOGO (play.html)*/

.play-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

/* ── HUD Superior ── */
.play-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 2px solid #c0392b;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 500;
    box-shadow: 0 2px 20px rgba(192, 57, 43, 0.3);
}

.hud-left,
.hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 90px;
}

.hud-right {
    align-items: flex-end;
}

.hud-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.hud-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.hud-judge {
    color: #e74c3c;
}

.game-title-hud {
    font-size: 1rem;
    font-weight: 800;
    color: #e74c3c;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Layout principal */
.play-main {
    display: flex;
    flex: 1;
    margin-top: 60px;
    margin-bottom: 200px;
    /* espaço para o hand-tray */
    min-height: calc(100vh - 260px);
    gap: 0;
}

/* ── Placar lateral ── */
.play-scoreboard {
    width: 220px;
    min-width: 220px;
    background: rgba(10, 10, 10, 0.8);
    border-right: 1px solid #1e1e1e;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.scoreboard-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
}

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

.scoreboard-empty {
    color: #555;
    font-size: 0.85rem;
}

.scoreboard-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #111;
    border: 1px solid #1e1e1e;
    transition: border-color 0.3s;
}

.scoreboard-item.leader {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.sb-rank {
    font-size: 1rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.sb-name {
    flex: 1;
    font-size: 0.85rem;
    color: #ddd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-name em {
    color: #777;
    font-style: normal;
}

.sb-score {
    font-size: 1rem;
    font-weight: 800;
    color: #e74c3c;
    min-width: 24px;
    text-align: right;
}

/* Centro do jogo */
.play-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 20px;
    gap: 24px;
    overflow-y: auto;
}

/* Carta pretapereta */
.question-area {
    width: 100%;
    max-width: 480px;
    perspective: 1000px;
}

.black-card {
    background: #000;
    border: 3px solid #fff;
    border-radius: 20px;
    padding: 28px 28px 20px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
    cursor: default;
}

.black-card.animate-in {
    animation: cardFlipIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardFlipIn {
    0% {
        transform: rotateY(-90deg) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.black-card:hover {
    transform: translateY(-4px) rotate(-1deg);
}

.black-card-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.45;
    flex: 1;
}

.black-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.black-card-icon {
    font-size: 1rem;
}

/* Status de jogadas */
.play-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.players-played-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.status-label {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

.players-played-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.played-dot {
    width: 14px;
    height: 14px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71;
    animation: dotPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes dotPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Área do juiz */
.judge-area {
    width: 100%;
    max-width: 860px;
}

.judge-area-title {
    font-size: 1rem;
    color: #e74c3c;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 700;
}

.played-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* Mão do jogador (bottom tray) */
.hand-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.97);
    border-top: 2px solid #1e1e1e;
    backdrop-filter: blur(12px);
    padding: 12px 20px 16px;
    z-index: 400;
    min-height: 180px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.hand-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.hand-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
}

.judge-badge {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #c0392b;
    color: #e74c3c;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hand-hint {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

.hand-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.hand-cards::-webkit-scrollbar {
    height: 4px;
}

/* Cartas brancas */
.white-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 14px 12px;
    min-width: 150px;
    max-width: 150px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    border: 3px solid transparent;
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.2s,
        box-shadow 0.25s;
    scroll-snap-align: start;
    flex-shrink: 0;
    user-select: none;
}

.white-card:hover {
    transform: translateY(-10px) scale(1.04);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.white-card.selected {
    border-color: #e74c3c;
    transform: translateY(-14px) scale(1.06);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.35), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.white-card.played {
    opacity: 0;
    transform: translateY(-30px) scale(0.8);
    transition: all 0.4s ease;
}

.white-card.played-card {
    /* cartas na área do juiz */
    min-width: 180px;
    min-height: 150px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.35s,
        border-color 0.2s,
        box-shadow 0.2s;
}

.white-card.played-card.reveal {
    opacity: 1;
    transform: translateY(0);
}

.white-card.played-card:hover {
    border-color: #e74c3c;
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 16px 40px rgba(231, 76, 60, 0.3);
}

.white-card.winner-selected {
    border-color: #2ecc71 !important;
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.5) !important;
}

.white-card-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    flex: 1;
}

.white-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.6rem;
    color: rgba(0, 0, 0, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.white-card-icon {
    font-size: 0.85rem;
}

/* ── Modais ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 20px;
    animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: #111;
    border: 2px solid #c0392b;
    border-radius: 32px;
    padding: 48px 40px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.trophy-icon {
    animation: trophy-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes trophy-bounce {
    0% {
        transform: scale(0) rotate(-15deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #e74c3c;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.modal-winner-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

.final-winner {
    font-size: 1.5rem;
    color: #f39c12;
    text-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

.modal-winning-card {
    background: #000;
    border: 2px solid #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 0 auto 20px;
    max-width: 300px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: none;
    /* pode ser ativado se quiser mostrar a carta vencedora */
}

.modal-scores {
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    min-width: 160px;
}

/* Tabela de scores */
.scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 8px;
}

.scores-table th {
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 8px;
    border-bottom: 1px solid #1e1e1e;
    text-align: left;
}

.scores-table td {
    padding: 8px;
    color: #ddd;
    border-bottom: 1px solid #0d0d0d;
}

.scores-table tr.top-score td {
    color: #f39c12;
    font-weight: 800;
}

.final-scores-table {
    margin: 16px 0 24px;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #1e1e1e;
    border-top-color: #e74c3c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: #888;
    font-size: 0.9rem;
}

/* Error toast */
.error-toast {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(192, 57, 43, 0.95);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 40px;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Confetti ── */
.confetti-area {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 2px;
    animation: confetti-fall linear both;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(500px) rotate(720deg);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVIDADE
═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .play-scoreboard {
        display: none;
        /* esconde placar lateral em mobile — está no modal */
    }

    .play-main {
        margin-bottom: 190px;
    }
}

@media (max-width: 600px) {

    /* HUD compacto */
    .play-hud {
        padding: 0 12px;
        height: 52px;
    }

    .game-title-hud {
        font-size: 0.75rem;
    }

    .hud-value {
        font-size: 0.9rem;
    }

    /* Carta preta menor */
    .black-card {
        padding: 20px 18px 14px;
        min-height: 170px;
    }

    .black-card-text {
        font-size: 1.1rem;
    }

    /* Modal fullscreen quase */
    .modal-card {
        padding: 32px 24px 28px;
        border-radius: 24px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    /* Cartas brancas na mão */
    .white-card {
        min-width: 130px;
        max-width: 130px;
        min-height: 110px;
    }

    /* Tray menor */
    .hand-tray {
        min-height: 160px;
        padding: 10px 12px 12px;
    }

    /* Play center */
    .play-center {
        padding: 20px 12px 12px;
        gap: 16px;
    }

    /* Waiting card */
    .waiting-card {
        padding: 28px 20px;
    }
}

@media (max-width: 400px) {
    .played-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}