:root {
    --bg-dark: #121214;
    --bg-panel: rgba(30, 30, 35, 0.7);
    --color-white: #ffffff;
    --text-main: var(--color-white);
    --text-muted: #a0a0a5;

    --color-primary: #8b5cf6;
    --color-primary-hover: #7c3aed;
    --color-secondary: #ec4899;
    --color-secondary-hover: #db2777;
    --color-neutral: #3f3f46;

    --color-red-team: #ef4444;
    --color-red-bg: rgba(239, 68, 68, 0.15);
    --color-blue-team: #3b82f6;
    --color-blue-bg: rgba(59, 130, 246, 0.15);
    --color-tie: #f59e0b;

    --color-warning: #eab308;
    --color-warning-bg: rgba(234, 179, 8, 0.15);
    --color-warning-hover: rgba(234, 179, 8, 0.3);
    --color-success: #22c55e;
    --color-dark-dice: #1e1e24;

    /* RGBA Transparencies */
    --white-03: rgba(255, 255, 255, 0.03);
    --white-05: rgba(255, 255, 255, 0.05);
    --white-10: rgba(255, 255, 255, 0.1);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-30: rgba(255, 255, 255, 0.3);

    --black-20: rgba(0, 0, 0, 0.2);
    --black-30: rgba(0, 0, 0, 0.3);
    --black-40: rgba(0, 0, 0, 0.4);
    --black-50: rgba(0, 0, 0, 0.5);
    --black-80: rgba(0, 0, 0, 0.8);

    /* RGBA Shadows & Backgrounds */
    --bg-header: rgba(18, 18, 20, 0.9);
    --shadow-primary: rgba(139, 92, 246, 0.4);
    --shadow-secondary: rgba(236, 72, 153, 0.4);
    --shadow-super-jackpot: rgba(139, 92, 246, 0.6);
    --shadow-red: rgba(239, 68, 68, 0.5);
    --shadow-blue: rgba(59, 130, 246, 0.5);
    --shadow-tie: rgba(245, 158, 11, 0.5);

    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../assets/rollageddon_splash.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px) brightness(0.4);
    transform: scale(1.1);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
.team-name-input {
    font-family: 'Outfit', sans-serif;
}

/* Utils */
.hidden {
    display: none !important;
}

.mt-2 {
    margin-top: 1.5rem;
}

.full-width {
    width: 100%;
}

.text-danger {
    color: var(--color-red-team) !important;
}

.text-green {
    color: var(--color-success) !important;
}

.text-red {
    color: var(--color-red-team) !important;
}

.text-gold {
    color: var(--color-tie) !important;
}

.team-text-red {
    color: var(--color-red-team);
}

.team-text-blue {
    color: var(--color-blue-team);
}



.spacer {
    flex: 1;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}


/* Splash Screen */
#splash-screen {
    background-image: url('../assets/rollageddon_splash.jpeg');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 10vh;
}

.splash-logo {
    width: 90vw;
    max-width: 450px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
    animation: pulse 2s infinite ease-in-out;
}

/* Main Menu */
#main-menu {
    padding: 2rem;
    justify-content: center;
    align-items: center;
}

.menu-header {
    margin-bottom: 3rem;
}

.header-logo {
    width: 70vw;
    max-width: 300px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    max-width: 350px;
}

/* Buttons */
.btn {
    border: none;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    box-shadow: 0 4px 15px var(--shadow-primary);
}

.btn.secondary {
    background: linear-gradient(135deg, var(--color-secondary), #f43f5e);
    box-shadow: 0 4px 15px var(--shadow-secondary);
}

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

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* Headers */
.top-bar,
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--white-05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar h2,
.game-header h2 {
    font-size: 1.3rem;
    margin: 0;
    flex: 2;
    text-align: center;
}

/* Gameplay Header Custom Sizes */
.game-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.game-header .btn-icon {
    font-size: 2rem;
}

/* Containers */
.setup-container,
.game-container {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.input-modern {
    background: var(--bg-panel);
    border: 1px solid var(--white-10);
    color: var(--color-white);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}

.input-modern:focus {
    border-color: var(--color-primary);
}

/* Setup Teams */
.teams-setup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.team-setup-card {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--white-05);
}

.team-red {
    border-top: 4px solid var(--color-red-team);
}

.team-blue {
    border-top: 4px solid var(--color-blue-team);
}

.team-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--white-20);
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 700;
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    outline: none;
}

.team-name-input:focus {
    border-color: var(--color-primary);
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.player-input-row input {
    width: 100%;
    background: var(--black-30);
    border: 1px solid transparent;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: 0.95rem;
}

.player-input-row input:focus {
    border-color: var(--white-30);
    outline: none;
}

/* Glass Panels */
.glass-panel {
    background: var(--white-03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--white-05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

/* Game Screen Elements */
.objective-section label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-massive {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-white);
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    width: 100%;
    outline: none;
    padding: 0.5rem;
}

.teams-battlefield {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.teams-battlefield.disabled {
    pointer-events: none;
    opacity: 0.3;
    filter: grayscale(0.8);
    transition: all 0.3s ease;
}

@media (max-width: 380px) {
    .teams-battlefield {
        grid-template-columns: 1fr;
    }
}

.team-game-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.team-game-card.team-red {
    background: var(--color-red-bg);
}

.team-game-card.team-blue {
    background: var(--color-blue-bg);
}

.team-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.team-red .team-title {
    color: var(--color-red-team);
}

.team-blue .team-title {
    color: var(--color-blue-team);
}

.game-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex: 1;
    min-width: 0;
}

.point-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--black-40);
    border-radius: var(--radius-md);
    padding: 0.4rem;
    min-width: 0;
}

.point-input-wrapper span {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0.4rem;
    min-width: 0;
}

.point-input-wrapper input {
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 1.2rem;
    font-weight: 700;
    width: 100%;
    text-align: right;
    outline: none;
    padding-right: 0.5rem;
}

.team-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--white-10);
    padding-top: 1rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.winner-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.winner-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.winner-name {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--color-white); /* Colore bianco di default per garantire la visibilità del trattino */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
}

.winner-red {
    color: var(--color-red-team);
    text-shadow: 0 0 10px var(--shadow-red);
}

.winner-blue {
    color: var(--color-blue-team);
    text-shadow: 0 0 10px var(--shadow-blue);
}

.winner-tie {
    color: var(--color-tie);
    text-shadow: 0 0 10px var(--shadow-tie);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black-80);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.modal-content h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin: 0;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--color-red-team);
    transform: scale(1.15);
}

.modal-buttons .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    flex: 1;
}

/* Dice Styles */
.objective-section-clickable {
    cursor: pointer;
    transition: transform var(--transition);
}

.objective-section-clickable:active {
    transform: scale(0.98);
}

.objective-dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    width: 100%;
}

.objective-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.objective-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding-left: 1.2rem;
    border-left: 1px solid var(--white-15);
}

.objective-total-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.objective-total-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-warning);
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.massive-plus {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-warning);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: var(--color-warning-bg);
    border: 2px dashed var(--color-warning);
    transition: var(--transition);
    line-height: 1;
}

.massive-plus:hover {
    background: var(--color-warning-hover);
    transform: rotate(90deg);
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

#dice-zero {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

.dice {
    width: 60px;
    height: 60px;
    background: var(--text-main);
    border-radius: var(--radius-md);
    display: flex;
    position: relative;
    box-shadow: inset 0 -4px 0 var(--black-20), 0 4px 8px var(--black-50);
    cursor: pointer;
    transition: transform 0.1s ease;
    margin: 0 auto;
}

.dice:active {
    transform: translateY(4px);
    box-shadow: inset 0 -2px 0 var(--black-20), 0 2px 4px var(--black-50);
}

/* Dots layout */
.dot {
    width: 12px;
    height: 12px;
    background: var(--color-dark-dice);
    border-radius: 50%;
    position: absolute;
}

.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.top-left {
    top: 12px;
    left: 12px;
}

.top-right {
    top: 12px;
    right: 12px;
}

.bottom-left {
    bottom: 12px;
    left: 12px;
}

.bottom-right {
    bottom: 12px;
    right: 12px;
}

.mid-left {
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
}

.mid-right {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
}

.dice-preview-container {
    background: var(--black-40);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    min-height: 120px;
}

.dice-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Small dice for preview */
.dice-preview-list .dice {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--black-50);
    cursor: pointer;
}

.dice-preview-list .dot {
    width: 8px;
    height: 8px;
}

.dice-preview-list .top-left {
    top: 8px;
    left: 8px;
}

.dice-preview-list .top-right {
    top: 8px;
    right: 8px;
}

.dice-preview-list .bottom-left {
    bottom: 8px;
    left: 8px;
}

.dice-preview-list .bottom-right {
    bottom: 8px;
    right: 8px;
}

.dice-preview-list .mid-left {
    left: 8px;
}

.dice-preview-list .mid-right {
    right: 8px;
}

/* Display on main board */
#objective-container .dice {
    width: 50px;
    height: 50px;
    pointer-events: none;
}

#objective-container .dot {
    width: 10px;
    height: 10px;
}

#objective-container .top-left {
    top: 10px;
    left: 10px;
}

#objective-container .top-right {
    top: 10px;
    right: 10px;
}

#objective-container .bottom-left {
    bottom: 10px;
    left: 10px;
}

#objective-container .bottom-right {
    bottom: 10px;
    right: 10px;
}

#objective-container .mid-left {
    left: 10px;
}

#objective-container .mid-right {
    right: 10px;
}

.dice-total-display {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    font-size: 1.2rem;
}

/* Player Dice Elements */
.player-dice-container {
    cursor: pointer;
    min-width: 40px;
    height: 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.small-plus {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-warning);
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: var(--color-warning-bg);
    border: 2px dashed var(--color-warning);
    transition: var(--transition);
    line-height: 1;
}

.small-plus:hover {
    background: var(--color-warning-hover);
    transform: rotate(90deg);
}

.player-dice-container .dice {
    width: 32px;
    height: 32px;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--black-50);
    margin: 0;
}

.player-dice-container .dot {
    width: 6px;
    height: 6px;
}

.player-dice-container .top-left {
    top: 6px;
    left: 6px;
}

.player-dice-container .top-right {
    top: 6px;
    right: 6px;
}

.player-dice-container .bottom-left {
    bottom: 6px;
    left: 6px;
}

.player-dice-container .bottom-right {
    bottom: 6px;
    right: 6px;
}

.player-dice-container .mid-left {
    left: 6px;
}

.player-dice-container .mid-right {
    right: 6px;
}

/* Switch Styles */
.switch-container {
    display: flex;
    background: var(--black-40);
    border-radius: var(--radius-lg);
    padding: 0.3rem;
    margin-bottom: 0.5rem;
}

.switch-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 2px 8px var(--shadow-primary);
}

/* Negative Dice */
.dice.negative {
    background: var(--color-dark-dice);
}

.dice.negative .dot {
    background: var(--text-main);
}

/* Jackpot Elements */
.jackpot-badge {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 0 1.2rem;
    border-radius: var(--radius-full);
    text-align: center;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px var(--black-30);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

.jackpot-pulse {
    background: linear-gradient(135deg, var(--color-warning), #f97316);
    color: var(--color-white);
    animation: pulse 1s infinite alternate;
}

.super-jackpot-pulse {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary), var(--color-blue-team));
    color: var(--color-white);
    animation: pulse 0.6s infinite alternate;
    box-shadow: 0 0 20px var(--shadow-super-jackpot);
}

.team-jackpot-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 0.8rem;
}

/* ==========================================================================
   Animations Section
   ========================================================================== */

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.pulse-infinite {
    animation: pulse 1.5s infinite;
    display: inline-block;
}

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

@keyframes pulseTurn {
    0% {
        transform: scale(1);
        color: inherit;
    }
    50% {
        transform: scale(1.3);
        color: var(--color-primary);
    }
    100% {
        transform: scale(1);
        color: inherit;
    }
}

.pulse-turn {
    animation: pulseTurn 0.5s ease;
    display: inline-block;
}

/* ==========================================================================
   Rolling Dice Feature Styles
   ========================================================================== */

@keyframes colorLoop {
    0% { background-color: var(--color-warning); }
    16.6% { background-color: var(--color-blue-team); }
    33.3% { background-color: var(--color-secondary); }
    50% { background-color: var(--color-red-team); }
    66.6% { background-color: var(--color-success); }
    83.3% { background-color: var(--color-primary); }
    100% { background-color: var(--color-warning); }
}

.dice-zero-roll {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    box-shadow: inset 0 -2px 0 var(--black-20), 0 2px 4px var(--black-50) !important;
    animation: colorLoop 3s infinite ease-in-out;
    margin: 0 !important;
    cursor: pointer;
}

.roll-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.btn-roll {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border: none;
    color: var(--color-white);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 0.6rem 2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow-primary);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-roll:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-secondary);
}

.btn-roll:active {
    transform: translateY(1px);
}

.roll-animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    height: 260px; /* Altezza bloccata per evitare variazioni di layout */
    box-sizing: border-box;
}

.rolling-dice-3d {
    display: inline-block;
    transition: none;
}

.rolling-dice-face {
    width: 80px !important;
    height: 80px !important;
    border-radius: 16px !important;
    box-shadow: inset 0 -6px 0 var(--black-20), 0 8px 16px var(--black-50) !important;
    display: flex;
    position: relative;
    margin: 0 auto;
}

/* Ensure dots inside rolling-dice-face are scaled nicely */
.rolling-dice-face .dot {
    width: 14px !important;
    height: 14px !important;
}

.rolling-text {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--color-white);
    letter-spacing: 2px;
    animation: pulse 1s infinite alternate;
    font-family: 'Outfit', sans-serif;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.modal-buttons .btn-roll {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.dice-pulse-final {
    animation: pulse 1.2s infinite ease-in-out !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.roll-element-fade {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    visibility: hidden;
}

.roll-element-fade.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Settings Screen */
.settings-container {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--white-05);
    border-radius: var(--radius-lg);
    gap: 1rem;
    box-shadow: 0 4px 12px var(--black-20);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.option-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.option-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Custom Select Wrapper */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--text-muted);
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.settings-container select.input-modern {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    background-color: var(--bg-panel);
    cursor: pointer;
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-neutral);
    transition: .4s ease;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px var(--black-40);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px var(--black-30);
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    box-shadow: 0 0 10px var(--shadow-primary);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

/* Settings Footer styling */
.settings-container {
    min-height: calc(100vh - 80px);
}

.settings-footer {
    margin-top: auto;
    padding-top: 2rem;
    padding-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border-top: 1px solid var(--white-05);
}

.footer-project {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.footer-version {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-made {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.heart-icon {
    color: #ef4444;
    display: inline-block;
    animation: pulseHeart 1.2s infinite;
}

.footer-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer-link:hover {
    color: #a78bfa;
    text-shadow: 0 0 8px var(--shadow-primary);
}

@keyframes pulseHeart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}