@font-face {
    font-family: "Twemoji Country Flags";
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E0073, U+E0074, U+E0077, U+E007F;
    src: url('https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.3/dist/TwemojiCountryFlags.woff2') format('woff2');
}

:root {
    --primary-color: #2ecc71;
    --secondary-color: #27ae60;
    --accent-color: #f1c40f;
    --text-color: #2c3e50;
    --bg-color: #ecf0f1;
    --dice-bg: #fff;
    --danger-color: #e74c3c;
    --blue-color: #3498db;
}

body {
    font-family: 'Twemoji Country Flags', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('stadium_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 15px;
    max-width: 1100px;
    width: 100%;
    margin: 100px auto 20px;
    /* Space for fixed header */
    display: block;
    color: var(--text-color);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.6em;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.game-icon-small {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.back-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.screen {
    display: none;
    flex-direction: column;
    padding: 15px;
    align-items: center;
    flex: 1;
    animation: fadeIn 0.3s ease-out;
}

.screen.main-screen {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    margin: 10px 0;
}

.screen.main-screen h1 {
    display: none;
    /* Already in header */
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    width: 100%;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    margin-top: 10px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Gameplay Styles */
.match-header {
    margin-bottom: 30px;
    text-align: center;
}

#roundName {
    background: var(--text-color);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 40px;
    position: relative;
}

.team-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    text-align: center;
}

.team-flag {
    font-size: 3rem;
    margin-bottom: 10px;
    background-color: #eee;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: "Twemoji Country Flags", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.team-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 10px;
    height: 2.4em;
    /* fix height for 2 lines */
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dice {
    width: 60px;
    height: 60px;
    background: var(--dice-bg);
    border: 2px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s;
}

.dice.rolling {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(10deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(-10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.vs {
    font-weight: 900;
    font-size: 1.5rem;
    color: #bbb;
}

.game-controls {
    width: 100%;
    text-align: center;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message {
    min-height: 40px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.game-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s;
    flex: 1;
    max-width: 150px;
    color: white;
}

.game-btn.higher {
    background-color: var(--blue-color);
    box-shadow: 0 4px 0 #2980b9;
}

.game-btn.lower {
    background-color: var(--danger-color);
    box-shadow: 0 4px 0 #c0392b;
}

.game-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.hidden {
    display: none !important;
}

/* End Screen */
#trophy-container {
    font-size: 6rem;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-30px);
    }

    60% {
        transform: translateY(-15px);
    }
}

.bottom-ad {
    margin-top: 25px;
    text-align: center;
    width: 100%;
}

/* Responsive */
@media (max-width: 1100px) {
    .game-container {
        width: 95%;
        margin-top: 90px;
    }
}

@media (max-width: 768px) {
    .game-container {
        margin: 80px 10px 10px 10px;
        padding: 15px;
        max-width: 100%;
        width: auto;
    }

    .header h1 {
        font-size: 1.3em;
    }

    .back-btn {
        padding: 8px 15px;
        font-size: 0.8em;
    }

    .team-flag {
        width: 50px;
        height: 50px;
        font-size: 2.2rem;
    }

    .dice {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        margin-top: 70px;
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .scoreboard {
        gap: 5px;
    }

    .team-container {
        width: 48%;
    }

    .vs {
        font-size: 1rem;
    }

    .game-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    #trophy-container {
        font-size: 4rem;
    }
}