:root {
    --bg-dark: #0f111a;
    --panel-bg: rgba(26, 29, 46, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f3f9;
    --text-muted: #9ba1b6;
    
    --primary: #ff7b00;
    --primary-glow: rgba(255, 123, 0, 0.35);
    --secondary: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --card-bread: #d97706;
    --card-ingrediente: #10b981;
    
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 1.5rem;
}

/* Background Glow Effects */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
}

.bg-glow-1 {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.bg-glow-2 {
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
}

/* Container & Layout */
.game-container {
    width: 100%;
    max-width: 1200px;
    z-index: 10;
}

.main-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff7b00, #ffb700, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.logo-emoji {
    -webkit-text-fill-color: initial;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    margin-top: 0.2rem;
}

/* Glass Panel Styling */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Buttons */
.btn {
    font-family: var(--font-sans);
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 1.1rem 2.2rem;
    font-size: 1.2rem;
    border-radius: 16px;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7b00 0%, #ff5100 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-primary:disabled {
    background: #4a4e69;
    color: #9299b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-success:disabled {
    background: #4a4e69;
    color: #9299b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* SETUP SCREEN */
#setup-screen {
    max-width: 650px;
    margin: 0 auto;
}

#setup-screen h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label span {
    display: block;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.radio-label input:checked + span {
    background: rgba(255, 123, 0, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 123, 0, 0.15);
}

.opponents-preview {
    background: rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.opponents-preview h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}

.opponent-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.opponent-card .avatar {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.opponent-card .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.opponent-card .strategy {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.setup-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* GAME SCREEN */
.game-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* SIDEBAR */
.game-sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-sidebar h3 {
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    color: var(--text-muted);
}

#players-status-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-status-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.player-status-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.player-status-item .avatar {
    font-size: 1.8rem;
}

.player-status-info {
    flex: 1;
}

.player-status-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.player-status-info .status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-status-score {
    text-align: right;
}

.player-status-score .score-num {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
}

.player-status-score .score-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.round-indicator-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.round-label {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.round-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.2rem 0;
}

.turn-val {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--secondary);
    width: 0;
    transition: width 0.3s ease;
}

/* MAIN DRAFT AREA */
.draft-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.draft-table {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.draft-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

#pass-direction {
    font-weight: 600;
    color: var(--secondary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    perspective: 1000px;
}

/* INDIVIDUAL CARDS — layout mockup (mockupcarta.png):
   cornice bianca, striscia illustrazione a sinistra, corpo crema a destra */
.card-item {
    background: #ffffff;
    border: 2px solid #cfc8bc;
    border-radius: 18px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.2s,
                box-shadow 0.3s;
    height: 275px;
}

.mc-frame {
    flex: 1;
    display: flex;
    border: 3px solid #241a10;
    border-radius: 13px;
    overflow: hidden;
    min-height: 0;
}

.mc-art {
    width: 34%;
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    background: #f2eed3;
    border-right: 3px solid #241a10;
}

.card-item[data-type="Bread"] .mc-art {
    background: #f7e3bd;
}

.mc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 7px 7px;
    color: #4a2617;
    min-height: 0;
    overflow: hidden;
    background-color: #faf3ea;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='none' stroke='%23d8b28f' stroke-opacity='0.28' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M8 14q9-10 18 0t18 0'/%3E%3Cpath d='M46 44q10 8 2 16'/%3E%3Cpath d='M14 50q-8 9 2 14'/%3E%3Ccircle cx='60' cy='22' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.mc-name {
    font-family: 'Luckiest Guy', 'Outfit', cursive;
    font-size: 0.85rem;
    line-height: 1.05;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #4a2617;
}

.mc-cal {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 3px 0 5px;
}

.mc-cal-num {
    font-family: 'Luckiest Guy', 'Outfit', cursive;
    font-size: 1.5rem;
    line-height: 1;
    color: #33200f;
}

.mc-cal-unit {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.mc-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mc-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-body .stat-val { color: #4a2617; font-size: 0.75rem; }
.mc-body .stat-val.positive { color: #b3261e; }
.mc-body .stat-val.negative { color: #1a7a3a; }

.mc-combos {
    width: 100%;
    margin-top: auto;
    padding-top: 4px;
    border-top: 2px solid #4a2617;
    text-align: center;
}

.mc-combos-title {
    font-family: 'Luckiest Guy', 'Outfit', cursive;
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 3px;
    color: #4a2617;
}

.mc-combos .card-combo-pills {
    position: static;
    justify-content: center;
    max-width: 100%;
}

.mc-body .card-special-effect {
    width: 100%;
    background: rgba(74, 38, 23, 0.08);
    color: #4a2617;
    border: 1px dashed rgba(74, 38, 23, 0.4);
    margin-top: 4px;
}

/* Versione mini (pool delle carte draftate) */
.mc-frame.mc-mini .mc-art {
    width: 40px;
    min-width: 40px;
    font-size: 1.6rem;
    border-right-width: 2px;
}
.mc-frame.mc-mini { border-width: 2px; }
.mc-frame.mc-mini .mc-body {
    padding: 5px 4px;
    justify-content: center;
}
.mc-frame.mc-mini .mc-name { font-size: 0.66rem; }
.mc-frame.mc-mini .mc-cal { margin: 2px 0 0; }
.mc-frame.mc-mini .mc-cal-num { font-size: 1.05rem; }

.card-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 0 18px var(--primary-glow);
    transform: translateY(-8px) scale(1.02);
    background: #fff7e6;
}

.card-type-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.card-item[data-type="Bread"] .card-type-badge {
    background: rgba(217, 119, 6, 0.2);
    color: #f59e0b;
}

.card-item[data-type="Ingrediente"] .card-type-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.card-name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    flex: 1;
    display: flex;
    align-items: center;
    color: var(--text-main);
}

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem;
    border-radius: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-icon {
    font-size: 0.95rem;
}

.stat-val.positive {
    color: #34d399;
}
.stat-val.negative {
    color: #f87171;
}

.calories-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
    font-weight: 800;
}

.cal-val {
    color: var(--primary);
    font-size: 1.15rem;
}

/* Combo Pills Container */
.card-combo-pills {
    position: absolute;
    top: -10px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: 80%;
    z-index: 10;
}

/* Individual Pill Style */
.card-combo-pill {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* Special Effect styling on cards */
.card-special-effect {
    font-size: 0.7rem;
    padding: 6px 8px;
    border-radius: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
    line-height: 1.2;
    font-weight: 600;
    text-align: center;
}
.card-special-effect small {
    font-weight: 400;
    font-size: 0.6rem;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
}
/* Varianti tarate sul fondo crema del layout mockup */
.card-special-effect.jolly-cheese {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(21, 128, 61, 0.4);
    color: #15803d;
}
.card-special-effect.jolly-meat {
    background: rgba(202, 138, 4, 0.14);
    border: 1px solid rgba(161, 98, 7, 0.4);
    color: #a16207;
}
.card-special-effect.kitchen-horror {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(185, 28, 28, 0.4);
    color: #b91c1c;
}
.card-special-effect.deperibile-effect {
    background: rgba(234, 88, 12, 0.14);
    border: 1px solid rgba(194, 65, 12, 0.4);
    color: #c2410c;
}

/* Specific Combo Colors */
.card-combo-pill.combo-ilpaninodabar { background: #1e3a8a; }
.card-combo-pill.combo-americanclassic { background: #be123c; }
.card-combo-pill.combo-lacolazionedelcampione { background: #b45309; }
.card-combo-pill.combo-hotdogcompleto { background: #c2410c; }
.card-combo-pill.combo-maialinoghiotto { background: #db2777; }
.card-combo-pill.combo-paninorustico { background: #4d7c0f; }
.card-combo-pill.combo-ildolcettosenzarimpianti { background: #6d28d9; }
.card-combo-pill.combo-toscanagourmet { background: #15803d; }
.card-combo-pill.combo-dolcesalato { background: #a21caf; }
.card-combo-pill.combo-paninogourmet { background: #0369a1; }
.card-combo-pill.combo-aperitivoromagnolo { background: #a16207; }
.card-combo-pill.combo-saporedibosco { background: #1e1b4b; }
.card-combo-pill.combo-deliziarustica { background: #701a75; }
.card-combo-pill.combo-pestosalsiccia { background: #065f46; }
.card-combo-pill.combo-merendasublime { background: #991b1b; }
.card-combo-pill.combo-carbonara { background: #eab308; color: #1e2235; text-shadow: none; }
.card-combo-pill.combo-chianinadeluxe { background: #431407; }
.card-combo-pill.combo-scibola { background: #0d9488; }
.card-combo-pill.combo-dakoma { background: #ea580c; }
.card-combo-pill.combo-zozzone { background: #78350f; }
.card-combo-pill.combo-untore { background: #854d0e; }
.card-combo-pill.combo-4formaggi { background: #fef08a; color: #1e2235; text-shadow: none; border: 1px solid #eab308; }
.card-combo-pill.combo-maialoso { background: #ec4899; }
.card-combo-pill.combo-lortolano { background: #16a34a; }
.card-combo-pill.combo-capresesbagliata { background: #dc2626; }
.card-combo-pill.combo-pollocrispy { background: #ca8a04; }
.card-combo-pill.combo-boscaiola { background: #78716c; }
.card-combo-pill.combo-kebabdellanotte { background: #b91c1c; }
.card-combo-pill.combo-morsodelfantino { background: #047857; }
.card-combo-pill.combo-nordicsandwich { background: #f43f5e; }
.card-combo-pill.combo-tartareroyale { background: #8b5cf6; }
.card-combo-pill.combo-tagliatagourmet { background: #4c1d95; }
.card-combo-pill.combo-salsaecotoletta { background: #78350f; }
.card-combo-pill.combo-fugadallagermania { background: #ea580c; }
.card-combo-pill.combo-boscaiolabianca { background: #52525b; }
.card-combo-pill.combo-salmoneepesto { background: #0f766e; }
.card-combo-pill.combo-piadinadelfantino { background: #047857; }
.card-combo-pill.combo-sfizioveg { background: #14532d; }
.card-combo-pill.combo-pannaesalmone { background: #be123c; }
.card-combo-pill.combo-merendaamericana { background: #451a03; }
.card-combo-pill.combo-kebbabecotoletta { background: #991b1b; }
.card-combo-pill.combo-frittomisto { background: #a16207; }

.draft-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* DRAFTED POOL */
.drafted-pool-panel h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.cards-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
}

.cards-grid-small .card-item {
    height: 110px;
    padding: 4px;
    cursor: default;
    border-radius: 14px;
}

.cards-grid-small .card-item:hover {
    transform: none;
}

.cards-grid-small .card-name {
    font-size: 0.85rem;
    flex: 1;
}

.cards-grid-small .card-stats, 
.cards-grid-small .card-type-badge {
    display: none;
}

.cards-grid-small .calories-box {
    font-size: 0.8rem;
    padding-top: 0.3rem;
}

.cards-grid-small .card-combo-pills {
    top: -8px;
    right: 4px;
}
.cards-grid-small .card-combo-pill {
    font-size: 0.52rem;
    padding: 1px 4px;
}

/* EVALUATION SCREEN */
.evaluation-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.eval-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tabs-container {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tabs-header {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--secondary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary);
    border-radius: 3px 3px 0 0;
}

.eval-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

/* SANDWICH VISUAL STACK */
.sandwich-visual-container {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    min-height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sandwich-visual {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    width: 100%;
    max-width: 220px;
}

.sandwich-layer-element {
    width: 100%;
    padding: 0.6rem;
    text-align: center;
    font-weight: 800;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: -10px;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

.sandwich-layer-element:first-child {
    margin-top: 0;
}

/* Style specific layer types */
.sandwich-layer-element[data-ingredient="Hamburger Bun"] { background-color: #d97706; border-radius: 24px 24px 10px 10px; border-bottom: 3px solid #b45309; }
.sandwich-layer-element[data-ingredient="Italian Bread"] { background-color: #b45309; border-radius: 16px; }
.sandwich-layer-element[data-ingredient="Toast"] { background-color: #d97706; border-radius: 8px; border-bottom: 2px solid #b45309; }

/* Ingredients colors */
.sandwich-layer-element.ing-lattuga { background-color: #22c55e; }
.sandwich-layer-element.ing-kebbab { background-color: #a16207; color: white; border-bottom: 3px double #78350f; }
.sandwich-layer-element.ing-pestodicavallo { background-color: #881337; color: white; border-bottom: 2px solid #4c0519; }
.sandwich-layer-element.ing-pestoallagenovese { background-color: #16a34a; color: white; border-bottom: 2px solid #14532d; }
.sandwich-layer-element.ing-cotolettadipollo { background-color: #d97706; color: white; border-bottom: 2px solid #78350f; }
.sandwich-layer-element.ing-pomodoro { background-color: #ef4444; }
.sandwich-layer-element.ing-cipolle { background-color: #c084fc; }
.sandwich-layer-element.ing-salsaspeciale { background-color: #eab308; }
.sandwich-layer-element.ing-salsacaciopepe { background-color: #fef3c7; color: #1e293b; border-bottom: 2px dotted #ca8a04; }
.sandwich-layer-element.ing-chianina { background-color: #7c2d12; }
.sandwich-layer-element.ing-formaggioamericano { background-color: #facc15; }
.sandwich-layer-element.ing-hamburger { background-color: #451a03; }
.sandwich-layer-element.ing-cheddar { background-color: #f59e0b; }
.sandwich-layer-element.ing-salsabarbecue { background-color: #7f1d1d; }
.sandwich-layer-element.ing-pancetta { background-color: #b91c1c; }
.sandwich-layer-element.ing-wurstel { background-color: #f43f5e; }
.sandwich-layer-element.ing-uovofritto { background-color: #fcfcfc; color: #1e293b; border: 2px dashed #f59e0b; }
.sandwich-layer-element.ing-prosciuttocotto { background-color: #fda4af; }
.sandwich-layer-element.ing-maionese { background-color: #fef08a; color: #1e293b; }
.sandwich-layer-element.ing-cetriolosottaceto { background-color: #15803d; }
.sandwich-layer-element.ing-burrodiarachidi { background-color: #ca8a04; }
.sandwich-layer-element.ing-marmellata { background-color: #9d174d; }
.sandwich-layer-element.ing-mela { background-color: #86efac; color: #1e293b; }
.sandwich-layer-element.ing-salsiccia { background-color: #78350f; }
.sandwich-layer-element.ing-porchetta { background-color: #b45309; }
.sandwich-layer-element.ing-mortadella { background-color: #f472b6; }
.sandwich-layer-element.ing-gorgonzola { background-color: #cbd5e1; color: #1e293b; border-left: 5px solid #2563eb; }
.sandwich-layer-element.ing-mozzarellafattaacubetti { background-color: #ffffff; color: #1e293b; }
.sandwich-layer-element.ing-ketchup { background-color: #dc2626; }
.sandwich-layer-element.ing-pestodicavolonero { background-color: #166534; }
.sandwich-layer-element.ing-anellidicipollafritta { background-color: #eab308; }
.sandwich-layer-element.ing-patatinefritte { background-color: #fbbf24; color: #1e293b; }
.sandwich-layer-element.ing-pannocchiadimaisfritta { background-color: #eab308; }

.sandwich-details-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.badge {
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 20px;
}

.badge-valid {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-invalid {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-winner {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid #eab308;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.badge-greenbomb {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid var(--secondary);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.score-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.score-val {
    text-align: right;
    font-weight: 600;
}

.total-row {
    font-weight: 800;
    font-size: 1.25rem;
}

.total-row td {
    border-bottom: none;
    color: var(--primary);
    padding-top: 1rem;
}

.stats-summary {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.stats-summary h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.nutrients-grid {
    display: flex;
    gap: 1rem;
}

.nutrient-item {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.nut-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.nut-val {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

/* KEEP SELECTION PANEL */
.keep-selection-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.keep-instructions {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.highlight-green {
    color: var(--success);
}

.keep-selection-panel .card-item.selected {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.keep-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.keep-counter {
    font-size: 1.05rem;
    font-weight: 600;
}

/* GAME OVER SCREEN */
.game-over-panel {
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.trophy-icon {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-over-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
}

.winner-label {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 800;
}

.table-responsive {
    overflow-x: auto;
}

.final-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.final-results-table th, 
.final-results-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.final-results-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
}

.final-results-table tr:last-child td {
    border-bottom: none;
}

.final-results-table tr.winner-row {
    background: rgba(255, 123, 0, 0.08);
}

/* Majority Bonuses Box */
.majority-bonuses-box {
    text-align: left;
}

.majority-bonuses-box h3 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 1.15rem;
}

.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.bonus-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.2rem;
}

.bonus-card h4 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.bonus-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.bonus-winner {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.05rem;
}

/* Showdown final sandwiches */
.showdown-container {
    text-align: left;
    margin-top: 1rem;
}

.showdown-container h3 {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.final-sandwiches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.final-player-sandwich-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.final-player-sandwich-box h4 {
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.game-over-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* RULES MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 700px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.close-modal-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-main);
}

.modal-content h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.rules-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    overflow-x: auto;
}

.rules-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.8rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.rules-tab-btn.active {
    color: var(--primary);
}

.rules-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

.rules-body h3 {
    margin: 1.2rem 0 0.6rem;
    font-size: 1.15rem;
    color: var(--primary);
}

.rules-body p {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.rules-body ul, .rules-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.rules-body li {
    margin-bottom: 0.4rem;
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.88rem;
}

.rules-table th, .rules-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.rules-table th {
    background: rgba(255, 255, 255, 0.05);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

/* Sidebar Toggle Button for Mobile */
.toggle-sidebar-btn {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(8px);
}
.toggle-sidebar-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .toggle-sidebar-btn {
        display: flex;
    }
    
    .game-sidebar {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        border: none;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.3s ease-out;
    }
    
    .game-sidebar.expanded {
        max-height: 1000px;
        padding: 1.5rem;
        margin-bottom: 0.5rem;
        opacity: 1;
        pointer-events: auto;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .drafted-pool-panel {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        border: none;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.3s ease-out;
    }
    
    .drafted-pool-panel.expanded {
        max-height: 1200px;
        padding: 1.5rem;
        margin-bottom: 0.5rem;
        opacity: 1;
        pointer-events: auto;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .evaluation-layout {
        grid-template-columns: 1fr;
    }
    
    .eval-content {
        grid-template-columns: 1fr;
    }
    
    .sandwich-visual-container {
        min-height: 250px;
    }
}

/* Card Hover Preview Tooltip */
#card-hover-preview {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    width: 200px;
    height: 275px;
    background: #ffffff;
    border: 2px solid #cfc8bc;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

#card-hover-preview.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Deck List Modal & Button Styles */
.deck-list-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.2rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
}

.deck-list-body .card-item {
    height: 210px;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.deck-list-body .card-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.deck-list-btn {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.deck-list-btn:hover {
    transform: scale(1.25);
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

/* Podium Styles */
.podium-container {
    margin: 2rem auto;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    max-width: 600px;
    border-radius: 12px;
}

.podium-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    height: 250px;
    margin: 1rem 0;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    transition: transform 0.3s ease;
}

.podium-spot:hover {
    transform: translateY(-5px);
}

.podium-avatar {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.podium-score {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.pedestal {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.95);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Spot Heights and Pedestal styles */
.spot-first {
    order: 2;
}
.spot-first .pedestal {
    height: 120px;
    background: linear-gradient(to top, #b45309, #d97706, #fbbf24);
    border: 2px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}
.spot-first .podium-avatar {
    font-size: 3.2rem;
    animation: bounce 2s infinite ease-in-out;
}

.spot-second {
    order: 1;
}
.spot-second .pedestal {
    height: 80px;
    background: linear-gradient(to top, #374151, #6b7280, #d1d5db);
    border: 2px solid #d1d5db;
    box-shadow: 0 0 15px rgba(209, 213, 219, 0.3);
}

.spot-third {
    order: 3;
}
.spot-third .pedestal {
    height: 50px;
    background: linear-gradient(to top, #7c2d12, #9a3412, #ea580c);
    border: 2px solid #ea580c;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
