/* ========================================
   SCOPA TWIST - Complete Stylesheet
   ======================================== */

/* CSS Variables - Theme System */
:root {
    /* Forest Theme (Default) */
    --bg-primary: #1a2f1a;
    --bg-secondary: #2d4a2d;
    --bg-tertiary: #3d5c3d;
    --bg-glass: rgba(45, 74, 45, 0.85);
    --text-primary: #e8f5e8;
    --text-secondary: #a8d4a8;
    --text-muted: #7ab87a;
    --accent-primary: #6fcf6f;
    --accent-secondary: #4caf50;
    --accent-glow: rgba(111, 207, 111, 0.4);
    --card-bg: #fffef5;
    --card-border: #8b7355;
    --danger: #e74c3c;
    --success: #27ae60;
    --gold: #f1c40f;
    --table-pattern: radial-gradient(circle at 50% 50%, var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

[data-theme="sky"] {
    --bg-primary: #1a3a5c;
    --bg-secondary: #2d5a8a;
    --bg-tertiary: #4a7ab8;
    --bg-glass: rgba(45, 90, 138, 0.85);
    --text-primary: #e8f4fc;
    --text-secondary: #a8d4f0;
    --text-muted: #7ab8e0;
    --accent-primary: #6fc3ff;
    --accent-secondary: #4aa3df;
    --accent-glow: rgba(111, 195, 255, 0.4);
    --table-pattern: linear-gradient(180deg, #4a7ab8 0%, #2d5a8a 50%, #1a3a5c 100%);
}

[data-theme="night"] {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #2d2d4a;
    --bg-glass: rgba(26, 26, 46, 0.9);
    --text-primary: #e8e8f5;
    --text-secondary: #b8b8d4;
    --text-muted: #8888aa;
    --accent-primary: #a855f7;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --table-pattern: radial-gradient(ellipse at center, #2d2d4a 0%, #1a1a2e 60%, #0d0d1a 100%);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.5s ease, color 0.3s ease;
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
}

/* ========================================
   MAIN MENU
   ======================================== */
#main-menu {
    background: var(--table-pattern);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.menu-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px var(--shadow-color);
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo h1 {
    background: linear-gradient(135deg, var(--accent-primary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px var(--accent-glow);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--gold), #f39c12);
    color: #1a1a1a;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(241, 196, 15, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon {
    font-size: 1.25rem;
}

.currency-display {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.9;
}

.menu-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.theme-toggle,
.lang-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover,
.lang-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.lang-icon {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ========================================
   MODALS
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.4s ease;
}

.modal-large {
    max-width: 700px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

/* Difficulty Selection */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.diff-icon {
    font-size: 2rem;
}

.diff-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.diff-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Host/Join Modals */
.host-content,
.join-content {
    text-align: center;
}

.host-content p,
.join-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#room-code {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    color: var(--accent-primary);
    background: var(--bg-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.btn-copy {
    padding: 0.75rem;
    font-size: 1.25rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--accent-primary);
}

.code-input {
    width: 100%;
    max-width: 200px;
    padding: 1rem;
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 0.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--bg-tertiary);
    border-radius: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s infinite;
}

.connection-status.connected .status-dot {
    background: var(--success);
}

.connection-status.error .status-dot {
    background: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Shop Modal */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.shop-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold);
}

.shop-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.shop-tab {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.shop-tab:hover,
.shop-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.shop-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.shop-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}

.shop-item.owned {
    border-color: var(--success);
    opacity: 0.8;
}

.shop-item.equipped {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

.shop-item-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.shop-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.shop-item-price {
    font-size: 0.85rem;
    color: var(--gold);
}

.shop-item.owned .shop-item-price {
    color: var(--success);
}

/* Settings Modal */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.setting-row label {
    font-weight: 600;
    color: var(--text-secondary);
}

.theme-options,
.lang-options {
    display: flex;
    gap: 0.5rem;
}

.theme-btn,
.lang-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.theme-btn:hover,
.lang-btn:hover,
.theme-btn.active,
.lang-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 26px;
    transition: 0.4s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.4s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: var(--bg-primary);
}

.rules-section {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-tertiary);
}

.rules-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rules-text ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ========================================
   GAME SCREEN
   ======================================== */
#game-screen {
    flex-direction: column;
    background: var(--table-pattern);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--bg-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon-only:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.round-info {
    font-size: 1rem;
    color: var(--text-secondary);
}

.deck-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    overflow: hidden;
}

/* Player Areas */
.opponent-area,
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-glass);
    border-radius: 20px;
    font-size: 0.9rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.captures-mini {
    display: flex;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.scopa-count {
    color: var(--gold);
}

/* Hands */
.hand {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem;
}

.opponent-hand .card {
    transform: rotate(180deg);
}

/* Table Area */
.table-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 180px;
}

.table-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 100%;
    padding: 1rem;
}

.table-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

/* Cards */
.card {
    width: 70px;
    height: 100px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-12px);
}

.card.selectable {
    animation: cardGlow 1.5s infinite;
}

@keyframes cardGlow {

    0%,
    100% {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 4px 20px var(--accent-glow);
    }
}

.card.face-down {
    background: linear-gradient(135deg, #8b0000, #4a0000);
    border-color: #600;
}

.card.face-down::before {
    content: '🃏';
    font-size: 2rem;
}

.card-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

.card-suit {
    font-size: 1.8rem;
}

.card[data-suit="denari"] .card-suit {
    color: #f1c40f;
}

.card[data-suit="coppe"] .card-suit {
    color: #e74c3c;
}

.card[data-suit="spade"] .card-suit {
    color: #3498db;
}

.card[data-suit="bastoni"] .card-suit {
    color: #27ae60;
}

/* Card Back Designs */
.card.face-down.cardback-classic {
    background: linear-gradient(135deg, #8b0000, #4a0000);
}

.card.face-down.cardback-royal {
    background: linear-gradient(135deg, #1a237e, #4a148c);
}

.card.face-down.cardback-nature {
    background: linear-gradient(135deg, #1b5e20, #33691e);
}

.card.face-down.cardback-gold {
    background: linear-gradient(135deg, #f57f17, #ff6f00);
}

.card.face-down.cardback-cosmic {
    background: linear-gradient(135deg, #4a148c, #880e4f);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-glass);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Turn Indicator */
.turn-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    background: var(--bg-glass);
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.turn-indicator.visible {
    opacity: 1;
    animation: turnPop 0.5s ease;
}

@keyframes turnPop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========================================
   SCORE MODALS
   ======================================== */
.score-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.score-column h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.score-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.score-item.earned {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success);
}

.score-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--accent-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.game-score {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.game-score-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Game Over */
.game-over-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.game-over-header h2 {
    font-size: 2rem;
    color: var(--gold);
}

.game-over-header.defeat h2 {
    color: var(--danger);
}

.final-scores {
    text-align: center;
}

.final-score-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.rewards-earned {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.rewards-earned h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.reward-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reward-total {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.game-over-buttons {
    display: flex;
    gap: 1rem;
}

.game-over-buttons .btn {
    flex: 1;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.info {
    border-color: var(--accent-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ========================================
   PARTICLE EFFECTS CANVAS
   ======================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

/* ========================================
   SCOPA CELEBRATION
   ======================================== */
.scopa-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 1500;
}

.scopa-celebration.active {
    display: flex;
}

.celebration-text {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow:
        0 0 20px var(--gold),
        0 0 40px var(--gold),
        0 0 60px rgba(241, 196, 15, 0.5);
    animation: scopaText 1.5s ease-out forwards;
}

@keyframes scopaText {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: scale(1.5) translateY(-50px);
    }
}

/* Celebration Variants */
.scopa-celebration.celebration-fireworks .celebration-text {
    animation-name: scopaFireworks;
}

@keyframes scopaFireworks {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }

    25% {
        opacity: 1;
        transform: scale(1.3) rotate(5deg);
    }

    50% {
        transform: scale(1) rotate(-3deg);
    }

    100% {
        opacity: 0;
        transform: scale(1.2) rotate(0deg) translateY(-100px);
    }
}

.scopa-celebration.celebration-spin .celebration-text {
    animation-name: scopaSpin;
}

@keyframes scopaSpin {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(360deg);
    }

    100% {
        opacity: 0;
        transform: scale(1.5) rotate(720deg);
    }
}

.scopa-celebration.celebration-shake .celebration-text {
    animation-name: scopaShake;
}

@keyframes scopaShake {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    20% {
        opacity: 1;
        transform: scale(1.2);
    }

    25% {
        transform: scale(1.2) translateX(-20px);
    }

    30% {
        transform: scale(1.2) translateX(20px);
    }

    35% {
        transform: scale(1.2) translateX(-15px);
    }

    40% {
        transform: scale(1.2) translateX(15px);
    }

    45% {
        transform: scale(1.2) translateX(-10px);
    }

    50% {
        transform: scale(1.2) translateX(10px);
    }

    100% {
        opacity: 0;
        transform: scale(1.5) translateY(-50px);
    }
}

/* ========================================
   CAPTURE EFFECTS
   ======================================== */
.capture-effect {
    position: fixed;
    pointer-events: none;
    z-index: 600;
}

.capture-effect.effect-sparkle {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleEffect 0.6s ease-out forwards;
}

@keyframes sparkleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.capture-effect.effect-burst {
    width: 80px;
    height: 80px;
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: burstEffect 0.5s ease-out forwards;
}

@keyframes burstEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ========================================
   TABLE DECORATIONS
   ======================================== */
.table-decoration.decoration-leaves::before {
    content: '🍃';
    position: absolute;
    top: 10%;
    left: 5%;
    font-size: 2rem;
    opacity: 0.3;
}

.table-decoration.decoration-leaves::after {
    content: '🍂';
    position: absolute;
    bottom: 10%;
    right: 5%;
    font-size: 2rem;
    opacity: 0.3;
}

.table-decoration.decoration-stars::before {
    content: '✨';
    position: absolute;
    top: 15%;
    right: 10%;
    font-size: 1.5rem;
    animation: twinkle 2s infinite;
}

.table-decoration.decoration-stars::after {
    content: '⭐';
    position: absolute;
    bottom: 20%;
    left: 15%;
    font-size: 1.5rem;
    animation: twinkle 2.5s infinite 0.5s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

.table-decoration.decoration-candles::before {
    content: '🕯️';
    position: absolute;
    top: 50%;
    left: 3%;
    font-size: 2.5rem;
}

.table-decoration.decoration-candles::after {
    content: '🕯️';
    position: absolute;
    top: 50%;
    right: 3%;
    font-size: 2.5rem;
    transform: scaleX(-1);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .menu-container {
        padding: 2rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .btn {
        padding: 0.875rem 1.25rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .shop-items {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .score-breakdown {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        width: 55px;
        height: 80px;
        font-size: 1.2rem;
    }

    .card-value {
        font-size: 0.9rem;
    }

    .card-suit {
        font-size: 1.4rem;
    }

    .celebration-text {
        font-size: 3rem;
    }

    .game-header {
        padding: 0.75rem 1rem;
    }

    .hand {
        gap: 0.25rem;
    }

    .table-cards {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .menu-container {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .theme-options,
    .lang-options {
        flex-wrap: wrap;
    }

    .theme-btn,
    .lang-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .card {
        width: 48px;
        height: 70px;
    }

    .player-info {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}