:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Player Colors */
    --p1-color: #ef4444;
    /* Red */
    --p2-color: #3b82f6;
    /* Blue */
    --p3-color: #22c55e;
    /* Green */
    --p4-color: #eab308;
    /* Yellow/White representation */
    --p5-color: #a855f7;
    /* Purple/Black rep */
    --p6-color: #f97316;
    /* Orange */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    /* Prevent text selection during rapid clicking */
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* App-like feel */
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.app-title {
    text-align: center;
    font-size: 2.0rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Setup Screen */
#setup-screen {
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    overflow-y: auto;
    /* Allow scrolling if tall */
    display: flex;
    /* Keep flex context */
    height: 100%;
    /* Ensure full height availability */
    padding-bottom: 40px;
    /* Space for safety */
    box-sizing: border-box;
}

.setup-group {
    margin-bottom: 2rem;
    width: 100%;
}

.setup-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn:active {
    transform: scale(0.95);
}

.format-options,
.player-count-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.format-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
}

.count-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    border: none;
    font-size: 1.2rem;
    padding: 16px;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    font-family: 'Cinzel', serif;
}

/* Game Screen */
.game-header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 20;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.timer-container {
    font-family: 'Inter', monospace;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Players Grid */
.players-grid {
    flex: 1;
    display: grid;
    gap: 8px;
    padding: 10px 0;
    height: calc(100% - 70px);
}

/* Grid Layouts based on player count */
/* 1 Player */
.players-grid[data-count="1"] {
    grid-template-rows: 1fr;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* 2 Players: Split vertically */
.players-grid[data-count="2"] {
    grid-template-rows: 1fr 1fr;
}

.players-grid[data-count="2"] .player-card:nth-child(1) {
    transform: rotate(180deg);
}

/* 3 Players */
.players-grid[data-count="3"] {
    grid-template-rows: 1fr 1fr 1fr;
}

/* 4 Players: 2x2 */
.players-grid[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 5 Players */
.players-grid[data-count="5"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.players-grid[data-count="5"] .player-card:last-child {
    grid-column: span 2;
}

/* 6 Players */
.players-grid[data-count="6"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

/* Player Card */
.player-card {
    position: relative;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    /* Highlight border */
}

/* 3D Dice & Coin Styles */
.scene {
    width: 100%;
    /* Adapts to content */
    min-width: 100px;
    height: 100px;
    perspective: 800px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    gap: 40px;
    /* Space between dice */
}

/* CUBE (D6) */
.cube {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-50px);
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    backface-visibility: hidden;
}

/* Face positions */
.cube-face.front {
    transform: rotateY(0deg) translateZ(50px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(50px);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(50px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(50px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(50px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(50px);
}

/* COIN */
.coin {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    backface-visibility: hidden;
    border: 4px solid #f59e0b;
    /* Gold */
    background: radial-gradient(circle at 30% 30%, #fcd34d, #d97706);
    color: #78350f;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.coin-face.heads {
    transform: rotateY(0deg);
}

.coin-face.tails {
    transform: rotateY(180deg);
}

/* D20 (Icosahedron) */
.d20 {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.d20-face {
    position: absolute;
    width: 100px;
    height: 86.6px;
    top: 50%;
    left: 50%;
    margin-top: -43.3px;
    margin-left: -50px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    /* Use drop-shadow for edges since border doesn't work with clip-path */
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3));
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 12px;
    font-size: 20px;
    font-weight: 800;
    color: white;
    backface-visibility: hidden;
    /* 
    Icosahedron Geometry
    (Using transform-origin at centroid)
    Angle: 52.62 deg
    Z: ~60-70px depending on overlap desire. 
    Strict Math: 0.75 * a = 75px. 
*/

    /* Top 5 (Up) */
    .d20-face:nth-child(1) {
        transform: rotateY(0deg) translateZ(76px) rotateX(53deg);
    }

    .d20-face:nth-child(2) {
        transform: rotateY(72deg) translateZ(76px) rotateX(53deg);
    }

    .d20-face:nth-child(3) {
        transform: rotateY(144deg) translateZ(76px) rotateX(53deg);
    }

    .d20-face:nth-child(4) {
        transform: rotateY(216deg) translateZ(76px) rotateX(53deg);
    }

    .d20-face:nth-child(5) {
        transform: rotateY(288deg) translateZ(76px) rotateX(53deg);
    }

    /* Bottom 5 (Down) */
    .d20-face:nth-child(16) {
        transform: rotateY(36deg) translateZ(76px) rotateX(-53deg) rotateZ(180deg);
    }

    .d20-face:nth-child(17) {
        transform: rotateY(108deg) translateZ(76px) rotateX(-53deg) rotateZ(180deg);
    }

    .d20-face:nth-child(18) {
        transform: rotateY(180deg) translateZ(76px) rotateX(-53deg) rotateZ(180deg);
    }

    .d20-face:nth-child(19) {
        transform: rotateY(252deg) translateZ(76px) rotateX(-53deg) rotateZ(180deg);
    }

    .d20-face:nth-child(20) {
        transform: rotateY(324deg) translateZ(76px) rotateX(-53deg) rotateZ(180deg);
    }

    /* Middle Upper (Down) */
    .d20-face:nth-child(6) {
        transform: rotateY(36deg) translateZ(76px) rotateX(11deg) rotateZ(180deg);
    }

    .d20-face:nth-child(7) {
        transform: rotateY(108deg) translateZ(76px) rotateX(11deg) rotateZ(180deg);
    }

    .d20-face:nth-child(8) {
        transform: rotateY(180deg) translateZ(76px) rotateX(11deg) rotateZ(180deg);
    }

    .d20-face:nth-child(9) {
        transform: rotateY(252deg) translateZ(76px) rotateX(11deg) rotateZ(180deg);
    }

    .d20-face:nth-child(10) {
        transform: rotateY(324deg) translateZ(76px) rotateX(11deg) rotateZ(180deg);
    }

    /* Middle Lower (Up) */
    .d20-face:nth-child(11) {
        transform: rotateY(0deg) translateZ(76px) rotateX(-11deg);
    }

    .d20-face:nth-child(12) {
        transform: rotateY(72deg) translateZ(76px) rotateX(-11deg);
    }

    .d20-face:nth-child(13) {
        transform: rotateY(144deg) translateZ(76px) rotateX(-11deg);
    }

    .d20-face:nth-child(14) {
        transform: rotateY(216deg) translateZ(76px) rotateX(-11deg);
    }

    .d20-face:nth-child(15) {
        transform: rotateY(288deg) translateZ(76px) rotateX(-11deg);
    }
}

/* Animations */
@keyframes spinCube {
    0% {
        transform: translateZ(-50px) rotateX(0) rotateY(0);
    }

    100% {
        transform: translateZ(-50px) rotateX(720deg) rotateY(720deg);
    }
}

@keyframes spinCoin {
    0% {
        transform: rotateY(0);
    }

    100% {
        transform: rotateY(1800deg);
    }

    /* 5 flips */
}

@keyframes spinD20 {
    0% {
        transform: rotateX(0) rotateY(0) rotateZ(0);
    }

    100% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(360deg);
    }
}

.rolling-cube {
    animation: spinCube 0.5s linear infinite;
}

.rolling-coin {
    animation: spinCoin 0.5s linear infinite;
}

.rolling-d20 {
    animation: spinD20 0.5s linear infinite;
}

/* Modifiers */
.modifiers-container {
    position: absolute;
    bottom: 50px;
    /* Above Utils */
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
    /* Let clicks pass through spacer */
}

.mod-group {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.mod-spacer {
    flex: 1;
}

.mod-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    transition: transform 0.1s;
}

.mod-btn:active {
    transform: scale(0.9);
}

.mod-btn.red {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.mod-btn.blue {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

/* MANA SCREEN STYLES (Compact) */
.mana-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    padding: 4px;
    height: calc(100vh - 60px);
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

.mana-card {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 0;
}

/* Color Themes */
.mana-card.white {
    background: radial-gradient(circle at top right, rgba(255, 255, 224, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #fef3c7;
}

.mana-card.blue {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #3b82f6;
}

.mana-card.black {
    background: radial-gradient(circle at top right, rgba(161, 161, 170, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #a1a1aa;
}

.mana-card.red {
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #ef4444;
}

.mana-card.green {
    background: radial-gradient(circle at top right, rgba(34, 197, 94, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #22c55e;
}

.mana-card.colorless {
    background: radial-gradient(circle at top right, rgba(203, 213, 225, 0.2), rgba(30, 41, 59, 0.4));
    border-top: 2px solid #cbd5e1;
}

.mana-card.storm {
    grid-column: span 2;
    background: rgba(124, 58, 237, 0.1);
    border: 1px dashed #7c3aed;
    flex-direction: row;
    gap: 15px;
}

/* Responsive text scaling */
.mana-icon {
    font-size: clamp(1rem, 2.5vh, 1.5rem);
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mana-count {
    font-size: clamp(1.8rem, 4vh, 2.8rem);
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

.mana-controls {
    display: flex;
    gap: 8px;
    /* Reduced gap */
    justify-content: center;
    align-items: center;
}

.mana-btn {
    width: clamp(30px, 4.5vh, 45px);
    height: clamp(30px, 4.5vh, 45px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: clamp(0.9rem, 1.8vh, 1.2rem);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    padding: 0;
}

.mana-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}


/* TOOLS RESULT OVERLAY */
.tool-result {
    position: fixed;
    /* Ensures it covers viewport even if scrolled */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    /* Slightly darker */
    backdrop-filter: blur(8px);
    z-index: 9999;
    /* Max z-index */
    pointer-events: auto;
}

.tool-result.hidden {
    display: none;
}


/* Landscape/Desktop adjustments */
@media (min-width: 768px) {
    .mana-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        max-width: 900px;
        margin: 0 auto;
        padding: 20px;
        gap: 15px;
    }

    .mana-card.storm {
        grid-column: span 3;
    }

    .mana-card {
        padding: 10px;
    }
}

/* Tools Screen Styles */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.tool-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 1;
}

.tool-card:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.tool-card.full-width {
    grid-column: span 2;
    aspect-ratio: auto;
    height: 100px;
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tool-result-display {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    padding: 20px 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

#result-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
}

#result-subtext {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dynamic colors for players */
.player-card[data-id="1"] {
    --p-color: var(--p1-color);
}

.player-card[data-id="2"] {
    --p-color: var(--p2-color);
}

.player-card[data-id="3"] {
    --p-color: var(--p3-color);
}

.player-card[data-id="4"] {
    --p-color: var(--p4-color);
}

.player-card[data-id="5"] {
    --p-color: var(--p5-color);
}

.player-card[data-id="6"] {
    --p-color: var(--p6-color);
}

.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, var(--p-color) 0%, transparent 70%);
    opacity: 0.15;
    pointer-events: none;
}

.player-card.dead {
    opacity: 0.5;
    filter: grayscale(1);
}

.life-total {
    font-size: 6rem;
    font-weight: 800;
    z-index: 2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    /* Let clicks pass through to buttons */
}

.player-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    /* Safe distance */
    display: flex;
    flex-direction: row;
    /* Left | Middle | Right */
    justify-content: space-between;
    align-items: center;
    z-index: 1;
    pointer-events: none;
}

/* Control Columns */
.control-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    pointer-events: auto;
    /* Enable buttons inside */
    height: 100%;
}

.control-spacer {
    flex: 1;
    /* Pushes columns to edges */
}

/* New Round Buttons */
.life-mod-btn {
    width: clamp(40px, 6vh, 60px);
    height: clamp(40px, 6vh, 60px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: transform 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.life-mod-btn:active {
    transform: scale(0.9);
}

.life-mod-btn.blue {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.6);
}

.life-mod-btn.red {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Hide old styles */
.modifiers-container {
    display: none;
}

/* Commander/Utility Button overlay */
.player-utils {
    position: absolute;
    bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 5;
}

.util-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.player-name {
    position: absolute;
    top: 15px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
    pointer-events: none;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Sheet style on mobile */
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1e293b;
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    z-index: 101;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal-btn {
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
}

/* Responsive Font Sizes */
@media (max-width: 600px) {
    .life-total {
        font-size: 4rem;
    }

    .players-grid[data-count="5"] .life-total,
    .players-grid[data-count="6"] .life-total {
        font-size: 3rem;
    }
}