:root {
    --bg-dark: #1a1f3d;
    --bg-surface: #242b4d;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --accent: #06b6d4;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.15);
    --surface-elevated: #2d3761;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: radial-gradient(circle at center, #1a1f3d 0%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background bonitinho para o menu */
#mainMenu {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

#mainMenu::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.floating-hex {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.03);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: 0;
    animation: float 20s infinite linear;
    pointer-events: none;
}

@keyframes float {
    from { transform: translateY(100vh) rotate(0deg); }
    to { transform: translateY(-100px) rotate(360deg); }
}

#mainMenu .menu-container {
    position: relative;
    z-index: 10;
}

#game {
    background: #0f1229; /* Fundo original escuro */
    position: relative;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.sky-bg {
    position: absolute;
    inset: 0;
    background: #89CFF0; /* Azul Bebê */
    background: linear-gradient(to bottom, #B0E2FF 0%, #89CFF0 100%);
    transition: opacity 1s ease;
    z-index: 0;
    opacity: 0; /* Começa invisível por padrão */
    pointer-events: none;
}

#game.placeBlocks-phase .sky-bg {
    opacity: 1; /* Só aparece na fase de construção */
}

#game.buyBlocks-phase .sky-bg,
#game.buyCards-phase .sky-bg {
    opacity: 0;
}

.screen {
    width: 100vw;
    height: 100vh;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen.hidden {
    display: none !important;
}

/* Tela de Perfil */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.search-profile-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px;
}

.fullscreen-menu {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.hidden {
    display: none !important;
    opacity: 0;
}

/* Card Style */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Seções de Login/Registro - Centralizadas */
.menu-section {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-section .menu-form {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.menu-container h1 {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 50px;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    transform: perspective(500px) rotateX(10deg);
}

.menu-section {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

.menu-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.big-btn {
    padding: 20px 32px;
    font-size: 18px;
    border-radius: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.menu-form label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: left;
    display: block;
}

.menu-form {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-actions {
    display: flex;
    gap: 12px;
}

.menu-actions button {
    flex: 1;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: var(--bg-surface);
    transform: translateY(-2px);
}

.link-btn {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    font-size: 14px;
    padding: 8px;
}

.link-btn:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.custom-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

/* Ajustar quando dentro de menu-section */
.menu-section .custom-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    max-width: 100%;
}

.custom-tabs {
    display: flex;
    gap: 8px;
    background: var(--surface-elevated);
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.matchmaking-status {
    padding: 24px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px dashed var(--primary);
    border-radius: 16px;
    align-items: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.match-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Seleção de Personagem */
.character-selection {
    margin: 10px 0 20px 0;
    text-align: center;
}

.character-selection p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.character-options {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.char-option {
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface-elevated);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 80px;
}

.char-option img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.char-option span {
    font-size: 12px;
    font-weight: 600;
}

.char-option:hover {
    background: var(--bg-surface);
    border-color: var(--border);
    transform: translateY(-2px);
}

.char-option.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

input {
    padding: 14px 18px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

button {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(1px);
}

#createRoomBtn, #joinRoomBtn {
    background: var(--primary);
    color: white;
}

#createRoomBtn:hover, #joinRoomBtn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

#testModeBtn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

#testModeBtn:hover {
    background: var(--danger);
    color: white;
}

#startGameBtn {
    width: 100%;
    padding: 16px;
    background: var(--success);
    color: white;
    font-size: 16px;
}

#startGameBtn:hover {
    background: #16a34a;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.4);
}

/* Lobby */
.lobby-container {
    padding: 40px;
    min-width: 520px;
}

.lobby-container h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

#lobbyRoomCode {
    color: var(--primary);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
}

.players-list {
    background: var(--surface-elevated);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.player-item {
    padding: 14px 16px;
    margin: 6px 0;
    background: var(--bg-surface);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.player-item:hover {
    background: var(--surface-elevated);
    border-color: var(--border);
}

.player-item.leader {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.player-item.leader::before {
    content: "👑 ";
}

/* Game Interface */
#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 5; /* Garante que o tabuleiro fique acima do fundo e dos pássaros */
}

/* HUD Components */
.hud-left {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.players-scoreboard h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 700;
}

.player-score-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface-elevated);
    border: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-score-item:hover {
    background: var(--bg-dark);
    border-color: var(--border);
}

.player-score-item.viewing {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.player-score-item.is-me {
    border-left: 4px solid #fbbf24;
}

.player-score-item .score {
    font-weight: 700;
    color: var(--success);
    font-size: 16px;
}

/* Phase Preview Icons */
/* Lista de Cartas Globais */
.global-cards-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.global-cards-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.global-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.global-card-item {
    padding: 10px;
    background: var(--surface-elevated);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

.global-card-item:hover {
    background: var(--bg-dark);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.global-card-item.intent {
    border-color: var(--secondary);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.global-card-item.intent::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--secondary);
    font-size: 16px;
    font-weight: bold;
}

.global-card-preview {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.global-card-preview canvas {
    display: block;
}

.global-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.global-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-card-contested {
    font-size: 10px;
    color: #fbbf24;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.global-card-points {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    gap: 4px;
    align-items: center;
}

.point-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 2px 5px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.phase-preview-icons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.preview-icon {
    flex: 1;
    padding: 12px;
    background: var(--surface-elevated);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.preview-icon:hover {
    background: var(--bg-dark);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.preview-icon:active {
    transform: translateY(0);
}

.preview-icon.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.preview-icon.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.preview-icon.disabled:hover {
    background: var(--surface-elevated);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

/* Inventory */
.hud-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    min-width: 480px;
    pointer-events: none; /* Deixa passar clique se não for no item */
    z-index: 10;
}

.inventory {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 20px;
    justify-content: center;
}

.inventory-blocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    pointer-events: auto;
    background: var(--bg-surface);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    height: 220px; /* Ajustado para 220px de altura */
    min-width: 76px; /* Largura mínima para conter os blocos de 52px + padding */
}

.inventory-item {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface-elevated);
    border: 2px solid transparent;
}

.inventory-item.empty-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    cursor: default;
}

.inventory-item.empty-slot:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.inventory-item:hover {
    transform: translateY(-5px);
    border-color: var(--border);
}

.inventory-item.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.inventory-cards {
    display: flex;
    gap: 16px;
    justify-content: center;
    pointer-events: auto;
    align-items: flex-end;
}

.inventory-item.card {
    width: 220px; /* Ajustado de 200px para 220px */
    height: auto;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: default;
}

.inventory-item.card:hover {
    transform: translateY(-20px) scale(1.05);
    z-index: 100;
    border-color: var(--secondary);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
}

.inventory-item.card.empty-card {
    background: var(--bg-surface); /* Mesma cor das outras cartas */
    border: 1px dashed rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    cursor: default;
    width: 220px; /* Ajustado de 200px para 220px */
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.7; /* Leve transparência apenas para diferenciar, mas com cor de fundo */
}

.inventory-item.card.empty-card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Help Button & Panel */
.help-btn {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--primary);
    border: 1px solid var(--border);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.5);
}

.help-panel {
    position: absolute;
    right: 24px;
    bottom: 80px;
    width: 300px;
    z-index: 1500;
    pointer-events: none;
    animation: slideInUp 0.3s ease-out;
}

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

.help-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    pointer-events: auto;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8);
}

.help-content h3 {
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    box-shadow: none;
}

.close-btn:hover {
    color: var(--danger);
}

.rule-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-item-simple:last-child {
    border-bottom: none;
}

.rule-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rule-visual-container {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-emoji {
    font-size: 20px;
}

.rule-canvas {
    width: 44px;
    height: 44px;
}

.rule-details {
    display: flex;
    flex-direction: column;
}

.rule-name-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.rule-desc-text {
    font-size: 11px;
    color: var(--text-muted);
}

.rule-points-badge {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.inventory-item.card h4 {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.inventory-item.card .card-pattern-canvas {
    background: var(--surface-elevated);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.inventory-item.card .card-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inventory-item.card .card-points {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.inventory-item.card .tier-mini {
    background: var(--surface-elevated);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
}

.inventory-item.card .tier-mini.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.inventory-item.card .card-score-mini {
    font-size: 10px;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Turn Timer */
.hud-turn {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 32px;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.turn-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#turnType {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

#turnTimer {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
    font-variant-numeric: tabular-nums;
}

.skip-btn {
    margin-top: 10px;
    padding: 8px 18px;
    background: var(--warning);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.skip-btn:hover {
    background: #dc2626;
}

/* Overlay de Transição de Fase - Minimalista & Premium */
.phase-overlay {
    position: fixed;
    top: 45%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.phase-overlay.animate {
    visibility: visible;
    animation: overlayFade 1.8s ease-in-out forwards;
}

@keyframes overlayFade {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

.phase-content {
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(15, 23, 42, 0.8) 50%, transparent 100%);
    backdrop-filter: blur(4px);
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phase-content h2 {
    font-size: 32px;
    font-weight: 300; /* Mais fino = mais elegante */
    letter-spacing: 12px; /* Espaçamento grande para estilo premium */
    margin: 0;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    opacity: 0;
    transform: scale(1.1);
}

.phase-overlay.animate h2 {
    animation: textFocus 1.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

@keyframes textFocus {
    0% { opacity: 0; filter: blur(12px); transform: scale(1.2); }
    20% { opacity: 1; filter: blur(0); transform: scale(1); }
    80% { opacity: 1; filter: blur(0); transform: scale(1); }
    100% { opacity: 0; filter: blur(12px); transform: scale(0.9); }
}

/* Removida a linha azul anterior para um visual mais limpo */
.phase-line {
    display: none;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
}

.toast.removing {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-info { border-left: 4px solid var(--primary); }
.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-error { border-left: 4px solid var(--danger); }

/* Tooltip */
.tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: 14px;
    width: 240px;
    pointer-events: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.2s ease-out;
}

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

.tooltip h4 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.tooltip-pattern-container {
    background: var(--surface-elevated);
    border-radius: 10px;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border);
    padding: 8px;
}

.tooltip .pattern-status {
    margin-top: 12px;
}

.tooltip .score-progression {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.tooltip .tier-item {
    flex: 1;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.tooltip .tier-item.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
}

.tooltip .tier-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tooltip .tier-pts {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-secondary);
}

.tooltip .tier-item.active .tier-pts {
    color: var(--success);
}

.tooltip .current-score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    font-weight: 500;
}

.tooltip .current-score-label strong {
    color: var(--success);
    font-weight: 700;
}

/* Minigame */
.minigame {
    pointer-events: none;
}

/* Tela de Fim de Jogo */
#gameOverScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    z-index: 2000;
}

.game-over-container {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.game-over-header h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#gameOverReason {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 16px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.ranking-item.first-place {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    transform: scale(1.05);
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.ranking-item.first-place:hover {
    background: rgba(251, 191, 36, 0.15);
}

.rank-number {
    font-size: 18px;
    font-weight: 800;
    width: 120px;
    color: var(--text-muted);
    text-align: left;
}

.first-place .rank-number {
    color: #fbbf24;
}

.rank-char {
    width: 48px;
    height: 48px;
    margin-right: 20px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.rank-info {
    flex: 1;
    text-align: left;
}

.rank-name {
    font-weight: 700;
    font-size: 18px;
    display: block;
    color: #fff;
}

.rank-score {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.first-place .rank-name {
    color: #fbbf24;
}

.first-place .rank-score {
    color: rgba(251, 191, 36, 0.8);
}

.menu-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.menu-form h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.user-account-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.user-account-btn:hover {
    background: var(--bg-surface);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

.user-menu button {
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
}

.user-menu button:hover {
    background: var(--surface-elevated);
}

/* Menu Superior Fixo */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(26, 31, 61, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    position: relative;
}

.play-nav-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.play-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.shop-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

.profile-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.profile-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.logout-nav-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-nav-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.search-input-nav {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 200px;
    transition: all 0.2s ease;
}

.search-input-nav:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    width: 250px;
}

.search-input-nav::placeholder {
    color: var(--text-muted);
}

.badge-small {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--warning);
    color: white;
    font-size: 8px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Conteúdo Principal Fullscreen */
.main-content-wrapper {
    margin-top: 60px;
    width: 100%;
    height: calc(100vh - 60px);
    padding: 24px;
    overflow-y: auto;
    position: relative;
}

.content-section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.home-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

.content-grid-expanded {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    align-items: stretch;
}

.expanded-panel {
    min-height: 400px;
}

.stats-panel {
    grid-column: 1 / -1;
}

.content-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.version-tag {
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Patch Notes com Collapse */
.patch-notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.patch-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.patch-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
}

.patch-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s ease;
}

.patch-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.patch-version {
    font-weight: 700;
    color: var(--primary);
    margin-right: auto;
}

.patch-date {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 12px;
}

.patch-toggle {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.patch-content {
    padding: 0 16px 12px 16px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.patch-content.hidden {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
}

.patch-line {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    line-height: 1.5;
}

.patch-line:first-child {
    padding-top: 8px;
}

.news-entry {
    padding: 12px 0;
}

.news-headline {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.news-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.news-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Game Info Styles */
.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.info-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.stats-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-display-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.stat-name {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

/* Tela de Seleção Fullscreen */
.fullscreen-panel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.panel-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 200;
    pointer-events: auto;
}

.panel-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-main);
}

.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
    position: relative;
    z-index: 201;
    pointer-events: auto;
}

.mode-tile {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.mode-tile:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.tile-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.tile-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.tile-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.back-btn-large {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 14px;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.back-btn-large:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Responsivo */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 0 16px;
        height: 56px;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .main-content-wrapper {
        margin-top: 56px;
        height: calc(100vh - 56px);
        padding: 16px;
    }
    
    .menu-section .menu-form {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .content-area {
        grid-template-columns: 1fr;
    }
    
    .top-menu-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .menu-left,
    .menu-right {
        width: 100%;
        justify-content: center;
    }
}

/* Tela de Seleção de Modo */
.game-mode-screen {
    text-align: center;
    animation: slideIn 0.3s ease-out;
    width: 100%;
}

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

.screen-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-main);
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mode-card {
    background: var(--surface-elevated);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: var(--primary);
    background: var(--bg-surface);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.mode-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.back-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.back-btn:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .content-area {
        grid-template-columns: 1fr;
    }
    
    .top-menu-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .menu-left,
    .menu-right {
        width: 100%;
        justify-content: center;
    }
    
    .mode-options {
        grid-template-columns: 1fr;
    }
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.match-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
}

.match-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
}

.match-rank {
    font-weight: 700;
}

.match-rank.win { color: var(--success); }
.match-rank.loss { color: var(--danger); }

.match-info-meta {
    flex: 1;
    color: var(--text-secondary);
}

.match-rating-change {
    font-weight: 700;
}

.match-history-collapse {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-collapse-header {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    transition: background 0.2s;
}

.match-collapse-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.match-collapse-content {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.match-collapse-content.hidden {
    display: none;
}

.match-toggle {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.board-preview-svg {
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
}

.board-preview-empty {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.card-item {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cards-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.other-player-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.clickable-player-row {
    cursor: pointer;
    transition: background 0.2s;
}

.clickable-player-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Hover no preview do tabuleiro */
.board-preview-wrapper {
    position: relative;
    display: inline-block;
}

.board-preview-img:hover {
    transform: scale(1.05);
}

.board-preview-wrapper:hover .board-preview-hover {
    opacity: 1;
    pointer-events: auto;
}

/* Badge de colocação */
.match-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.match-rank-badge:hover {
    transform: scale(1.1);
}

.match-rank-badge.win {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(34, 197, 94, 0.5);
    }
}

#logoutBtn {
    color: var(--danger);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* Preview Overlay */
.preview-overlay {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-overlay:not(.hidden) {
    opacity: 1;
}

.preview-header {
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4);
    pointer-events: auto;
}

.preview-header span {
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-preview-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.close-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.close-preview-btn:active {
    transform: scale(0.95);
}

.preview-icon.debug-btn { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); } .preview-icon.debug-btn.active { background: #ef4444; color: white; box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }

/* Overlay para quando a conexão foi substituída */
#connectionReplacedOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.connection-replaced-message {
    color: #ffffff;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    font-family: 'Arial', sans-serif;
}

.connection-replaced-message kbd {
    background-color: #333333;
    border: 2px solid #666666;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    font-size: 36px;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 8px;
}
