* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #fff;
    padding: 0;
    margin: 0;
    padding-bottom: 80px; /* Space for fixed ad banner */
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    margin: 0 auto; /* Center the container */
    min-height: calc(100vh - 80px); /* Full height minus ad space */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    transition: all 0.3s ease;
}

header h1 {
    font-size: 4em;
    font-weight: 900;
    letter-spacing: 8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00c853 0%, #ff1744 25%, #ffd600 50%, #00b8d4 75%, #00c853 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 10px;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% auto;
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

/* Hide header when game is active */
.game-active header h1 {
    display: none;
}

.game-active header {
    margin-bottom: 10px;
}

.game-wrapper {
    position: relative;
    min-height: 600px;
}

/* Menu Screen */
.menu-screen {
    display: none;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 60px 40px;
    backdrop-filter: blur(10px);
}

.menu-screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.menu-screen h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
}

.menu-settings {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.setting-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.setting-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #fff;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.menu-btn {
    padding: 20px 40px;
    font-size: 1.3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    border-radius: 15px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.menu-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.menu-btn:active {
    transform: scale(0.98);
}

/* Game Screen */
.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.game-info {
    margin-bottom: 20px;
}

.score-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(10px);
}

.score-item {
    font-size: 1.5em;
    font-weight: bold;
}

.mode-indicator {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: bold;
}

.turn-indicator {
    display: none;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 15px;
    margin-top: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.turn-indicator.active {
    display: block;
    animation: pulse 1.5s ease infinite;
}

.turn-indicator.player-turn {
    color: #00c853;
    border: 2px solid #00c853;
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.3);
}

.turn-indicator.ai-turn {
    color: #ff1744;
    border: 2px solid #ff1744;
    box-shadow: 0 0 20px rgba(255, 23, 68, 0.3);
}

.game-board {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
}

.genius-circle {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    position: relative;
    background: #1a1a1a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}


.color-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 10px solid #1a1a1a;
}

/* 4-color layout (positions 0-3) */
.color-segment.green {
    top: 0;
    right: 0;
    background: #00c853;
    border-top-right-radius: 100%;
    transform-origin: bottom left;
}

.color-segment.red {
    top: 0;
    left: 0;
    background: #ff1744;
    border-top-left-radius: 100%;
    transform-origin: bottom right;
}

.color-segment.yellow {
    bottom: 0;
    left: 0;
    background: #ffd600;
    border-bottom-left-radius: 100%;
    transform-origin: top right;
}

.color-segment.blue {
    bottom: 0;
    right: 0;
    background: #00b8d4;
    border-bottom-right-radius: 100%;
    transform-origin: top left;
}

/* 6 and 8-color layouts - positioned in a circle */
.color-segment.purple,
.color-segment.orange,
.color-segment.pink,
.color-segment.cyan {
    width: 25%;
    height: 25%;
    border-radius: 50%;
    border: 5px solid #1a1a1a;
}

.color-segment.purple {
    background: #9c27b0;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.color-segment.orange {
    background: #ff6f00;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.color-segment.pink {
    background: #e91e63;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}

.color-segment.cyan {
    background: #00e5ff;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
}

/* Hidden state for colors outside selected difficulty */
.color-segment.hidden {
    display: none;
}

/* Inactive state for colors not in current difficulty */
.color-segment.inactive {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.color-segment:hover:not(.disabled):not(.inactive) {
    filter: brightness(1.2);
}

.color-segment.green:hover:not(.disabled):not(.inactive),
.color-segment.red:hover:not(.disabled):not(.inactive),
.color-segment.yellow:hover:not(.disabled):not(.inactive),
.color-segment.blue:hover:not(.disabled):not(.inactive) {
    transform: scale(1.02);
}

.color-segment.purple:hover:not(.disabled):not(.inactive),
.color-segment.orange:hover:not(.disabled):not(.inactive),
.color-segment.pink:hover:not(.disabled):not(.inactive),
.color-segment.cyan:hover:not(.disabled):not(.inactive) {
    transform: scale(1.1);
}

.color-segment.active {
    filter: brightness(1.8) !important;
    box-shadow: 0 0 30px currentColor;
}

.color-segment.green.active,
.color-segment.red.active,
.color-segment.yellow.active,
.color-segment.blue.active {
    transform: scale(1.05) !important;
}

.color-segment.purple.active,
.color-segment.orange.active,
.color-segment.pink.active,
.color-segment.cyan.active {
    transform: scale(1.2) !important;
}

.color-segment.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 50%;
    border: 5px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.logo {
    text-align: center;
}

.logo-star {
    background: linear-gradient(135deg, #ff1744 0%, #00c853 50%, #ffd600 75%, #00b8d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin-bottom: 5px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.logo-genius {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-start {
    font-size: 1em;
    color: #ccc;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.control-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex: 1;
    max-width: 200px;
}

.control-btn.primary {
    background: linear-gradient(135deg, #00c853 0%, #00b8d4 100%);
    border-color: #fff;
    font-size: 1.2em;
    padding: 18px 35px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.control-btn.primary:hover {
    background: linear-gradient(135deg, #00d85e 0%, #00c4e0 100%);
    box-shadow: 0 8px 20px rgba(0, 200, 83, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

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

/* Game Over Screen */
.game-over-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.game-over-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.game-over-content {
    text-align: center;
    animation: slideUp 0.6s ease;
}

.game-over-title {
    font-size: 3em;
    margin-bottom: 30px;
    animation: pulse 1s ease infinite;
    color: #ff1744;
    text-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
}

.game-over-stats {
    font-size: 1.5em;
    margin-bottom: 40px;
    line-height: 2;
}

.game-over-stats p {
    margin: 10px 0;
}

#winnerMessage {
    color: #ffd600;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 20px;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* Ad Banner - Always at bottom of screen */
.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    min-height: 70px;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.6);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5em;
        letter-spacing: 4px;
    }

    .genius-circle {
        width: 350px;
        height: 350px;
    }

    .center-circle {
        width: 140px;
        height: 140px;
    }

    .logo-genius {
        font-size: 1.4em;
    }

    .logo-star {
        font-size: 1.5em;
    }

    .score-panel {
        flex-direction: column;
        gap: 10px;
    }

    .controls {
        flex-wrap: wrap;
    }

    .control-btn {
        max-width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .setting-btn {
        min-width: auto;
    }

    .game-over-buttons {
        flex-direction: column;
    }

    body {
        padding-bottom: 75px; /* Less space on mobile */
    }

    .container {
        min-height: calc(100vh - 75px);
    }

    .ad-banner {
        min-height: 65px;
        padding: 3px 0;
    }
}

