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

body {
    font-family: 'Arial', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #61AECF;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: -1;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F59776;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: -1;
}

body.player1-turn::before {
    opacity: 1;
}

body.player2-turn::after {
    opacity: 1;
}

/* Green-Purple Theme */
body[data-theme="green-purple"]::before {
    background: #6ee7b7;
}

body[data-theme="green-purple"]::after {
    background: #d8b4fe;
}

/* Pink-Grey Theme */
body[data-theme="pink-grey"]::before {
    background: #fbcfe8;
}

body[data-theme="pink-grey"]::after {
    background: #d1d5db;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

.player-score-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    display: none;
}

.player1-score-display {
    bottom: 40px;
}

.player2-score-display {
    top: 40px;
    transform: translateX(-50%) rotate(180deg);
}

.player-score-display.active {
    opacity: 1;
}

.score-text {
    font-weight: 700;
    font-size: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.player1-score-display .score-text {
    color: #1e40af;
}

.player2-score-display .score-text {
    color: #dc2626;
}

.menu-container {
    position: fixed;
    top: 15%;
    right: 0;
    transform: translateY(-50%);
    width: 25px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px 0 0 25px;
    border: 1px solid #e9ecef;
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 4px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.menu-btn {
    background: transparent;
    color: #636e72;
    padding: 2px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 8px;
    width: 12px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    letter-spacing: 0.1px;
    transform: rotate(270deg);
}

.menu-btn:hover {
    background: rgba(221, 214, 254, 0.9);
    color: #7c3aed;
    transform: rotate(270deg) scale(1.1);
    border-color: #7c3aed;
}

/* Left menu button - hidden by default, shown on mobile */
.menu-container-left {
    display: none;
}

.score-display-left {
    background: transparent;
    padding: 2px;
    font-weight: 800;
    cursor: default;
    border: none;
    font-size: 12px;
    width: 12px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    letter-spacing: 0.1px;
    transform: rotate(90deg);
}

.score-p1 {
    color: #3b82f6;
}

.score-dot {
    color: #000000;
    margin: 0 3px;
}

.score-p2 {
    color: #ef4444;
}

body[data-theme="green-purple"] .score-p1 {
    color: #10b981;
}

body[data-theme="green-purple"] .score-p2 {
    color: #a855f7;
}

body[data-theme="pink-grey"] .score-p1 {
    color: #ec4899;
}

body[data-theme="pink-grey"] .score-p2 {
    color: #6b7280;
}

.game-board {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    min-height: 0;
    position: relative;
}

.game-grid-container {
    background: white;
    transition: background 0.6s ease-in-out;
    border-radius: 0;
    padding: 50px;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
}

body.player1-turn .game-grid-container {
    background: #e0f0ff;
}

body.player2-turn .game-grid-container {
    background: #ffe0e0;
}

body[data-theme="green-purple"].player1-turn .game-grid-container {
    background: #d1fae5;
}

body[data-theme="green-purple"].player2-turn .game-grid-container {
    background: #f3e8ff;
}

body[data-theme="pink-grey"].player1-turn .game-grid-container {
    background: #fce7f3;
}

body[data-theme="pink-grey"].player2-turn .game-grid-container {
    background: #e5e7eb;
}

#game-svg {
    width: 100%;
    height: 100%;
    max-width: 500px;
    max-height: 500px;
    min-width: 250px;
    min-height: 250px;
}

/* Force solid black dots with maximum specificity */
svg circle,
#game-svg circle,
svg#game-svg circle {
    fill: #000000 !important;
    stroke: none !important;
    stroke-width: 0 !important;
    opacity: 1 !important;
    pointer-events: none !important;
}

/* Override any potential browser defaults */
circle {
    fill: #000000 !important;
    stroke: none !important;
}

.line {
    stroke: white;
    stroke-width: 20;
    stroke-linecap: round;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s ease;
}

.line:hover {
    opacity: 0.8;
    stroke-width: 24;
}

.line.player1-hover:hover {
    stroke: #3b82f6;
}

.line.player2-hover:hover {
    stroke: #ef4444;
}

body[data-theme="green-purple"] .line.player1-hover:hover {
    stroke: #10b981;
}

body[data-theme="green-purple"] .line.player2-hover:hover {
    stroke: #a855f7;
}

body[data-theme="pink-grey"] .line.player1-hover:hover {
    stroke: #ec4899;
}

body[data-theme="pink-grey"] .line.player2-hover:hover {
    stroke: #6b7280;
}

.line.drawn {
    opacity: 1;
    cursor: default;
    stroke: #2d3436;
    stroke-width: 20;
}

.line.player1-line {
    stroke: #3b82f6;
    opacity: 1;
}

.line.player2-line {
    stroke: #ef4444;
    opacity: 1;
}

body[data-theme="green-purple"] .line.player1-line {
    stroke: #10b981;
}

body[data-theme="green-purple"] .line.player2-line {
    stroke: #a855f7;
}

body[data-theme="pink-grey"] .line.player1-line {
    stroke: #ec4899;
}

body[data-theme="pink-grey"] .line.player2-line {
    stroke: #6b7280;
}

.line.current-player-line {
    stroke-width: 20;
}

.box {
    opacity: 0;
    transition: all 0.4s ease;
}

.box.filled {
    opacity: 1;
}

.player1-box {
    fill: #60a5fa;
}

.player2-box {
    fill: #f87171;
}

body[data-theme="green-purple"] .player1-box {
    fill: #34d399;
}

body[data-theme="green-purple"] .player2-box {
    fill: #c084fc;
}

body[data-theme="pink-grey"] .player1-box {
    fill: #f472b6;
}

body[data-theme="pink-grey"] .player2-box {
    fill: #9ca3af;
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.player1-color {
    background: #3b82f6;
}

.player2-color {
    background: #ef4444;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 35px 30px 30px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 420px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.menu-content {
    max-width: 420px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.menu-option-btn {
    background: #f8f9fa;
    color: #2d3436;
    border: 2px solid #f8f9fa;
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-option-btn:hover {
    background: white;
    border-color: #2d3436;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.grid-size-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f1f3f5;
}

.grid-size-section h3 {
    color: #495057;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid-size-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.grid-size-btn {
    background: white;
    color: #636e72;
    border: 2px solid #e9ecef;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 55px;
}

.grid-size-btn:hover {
    border-color: #2d3436;
    transform: scale(1.05);
}

.grid-size-btn.active {
    background: #2d3436;
    color: white;
    border-color: #2d3436;
}

.grid-size-btn.active:hover {
    background: #2d3436;
    transform: scale(1.05);
}

.modal-content h2 {
    color: #2d3436;
    margin-bottom: 0;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.restart-btn {
    background: #2d3436;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.3);
}

.restart-btn:hover {
    background: #636e72;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 52, 54, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .game-board {
        padding: 0;
    }

    .game-grid-container {
        padding: 30px;
        width: 100vw;
        height: 100vh;
    }

    .player1-score-display {
        bottom: 30px;
    }

    .player2-score-display {
        top: 30px;
    }

    .menu-container {
        width: 35px;
        height: 70px;
        padding-left: 8px;
        border-radius: 35px 0 0 35px;
    }
    
    .menu-btn {
        width: 22px;
        height: 22px;
        font-size: 8px;
    }

    .modal-content {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .game-board {
        padding: 2px;
        flex: 1;
    }

    .game-grid-container {
        padding: 25px;
        max-width: calc(100vw - 4px);
        max-height: calc(100vw - 4px);
    }

    #game-svg {
        min-width: 200px;
        min-height: 200px;
    }

    .player1-score-display {
        bottom: 20px;
    }

    .player2-score-display {
        top: 20px;
    }

    .score-text {
        font-size: 28px;
    }

    .menu-container {
        width: 30px;
        height: 60px;
        padding-left: 6px;
        border-radius: 30px 0 0 30px;
        top: 10%;
    }
    
    .menu-btn {
        width: 18px;
        height: 18px;
        font-size: 12px;
        font-weight: 900;
    }

    /* Show left menu button on mobile */
    .menu-container-left {
        display: flex;
        position: fixed;
        bottom: 6%;
        left: 0;
        transform: translateY(50%);
        width: 30px;
        height: 60px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 0 30px 30px 0;
        border: 1px solid #e9ecef;
        border-left: none;
        align-items: center;
        justify-content: flex-end;
        padding-right: 6px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        z-index: 100;
    }
    
    .score-display-left {
        width: 18px;
        height: 18px;
        font-size: 16px;
        font-weight: 900;
    }
    
    .score-p1,
    .score-p2 {
        font-weight: 900;
    }
    
    .score-dot {
        margin: 0 3px;
        font-weight: 900;
    }

    .modal-content {
        padding: 20px;
    }

    .grid-size-options {
        flex-direction: column;
        gap: 8px;
    }
}

/* Your Turn Display */
.turn-display {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.turn-display.show {
    opacity: 1;
}

body.player1-turn .turn-display {
    bottom: 80px;
    transform: translateX(-50%);
}

body.player2-turn .turn-display {
    top: 80px;
    transform: translateX(-50%) rotate(180deg);
}

@media (max-width: 768px) {
    .turn-display {
        font-size: 20px;
    }
    
    body.player1-turn .turn-display {
        bottom: 70px;
    }
    
    body.player2-turn .turn-display {
        top: 70px;
    }
}

@media (max-width: 480px) {
    .turn-display {
        font-size: 18px;
    }
    
    body.player1-turn .turn-display {
        bottom: 60px;
    }
    
    body.player2-turn .turn-display {
        top: 60px;
    }
}

@media (max-height: 600px) {
    .game-board {
        padding: 2px;
    }

    .game-grid-container {
        max-height: calc(100vh - 40px);
        max-width: calc(100vh - 40px);
        padding: 20px;
    }

    .player1-score-display {
        bottom: 15px;
    }

    .player2-score-display {
        top: 15px;
    }
}
/* Color Theme Options */
.color-theme-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-theme-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 10px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-theme-btn:hover {
    border-color: #2d3436;
    transform: scale(1.05);
}

.color-theme-btn.active {
    border-color: #2d3436;
    background: #2d3436;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.color-theme-btn.active .color-preview {
    border-color: rgba(255, 255, 255, 0.8);
}

    .modal-content {
        padding: 20px 16px 16px;
        border-radius: 20px;
        max-width: 300px;
    }

    .modal-content h2 {
        font-size: 18px;
        margin-bottom: 0;
    }

    .menu-options {
        gap: 8px;
        margin-top: 16px;
    }

    .menu-option-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .grid-size-section {
        margin-top: 16px;
        padding-top: 16px;
    }

    .grid-size-section h3 {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .grid-size-options {
        gap: 6px;
    }

    .grid-size-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 42px;
    }

    .color-theme-options {
        gap: 6px;
    }

    .color-theme-btn {
        padding: 6px 10px;
    }

    .color-preview {
        width: 16px;
        height: 16px;
    }

    .restart-btn {
        padding: 10px 24px;
        font-size: 14px;
    }

/* Copyright */
.copyright {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #ffffff;
    font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 10;
    pointer-events: none;
}

@media (max-width: 480px) {
    .copyright {
        font-size: 10px;
        bottom: 6px;
    }
}

/* Game Over Modal - Premium Style */
.game-over-content {
    padding: 50px 40px 40px;
    max-width: 400px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-over-content h2 {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 30px;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.game-over-content .restart-btn {
    margin-top: 10px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(45, 52, 54, 0.25);
}

.game-over-content .restart-btn:hover {
    box-shadow: 0 8px 25px rgba(45, 52, 54, 0.35);
}

@media (max-width: 480px) {
    .game-over-content {
        padding: 35px 28px 28px;
        max-width: 320px;
    }

    .game-over-content h2 {
        font-size: 28px;
        margin-bottom: 24px;
        letter-spacing: -0.5px;
    }

    .game-over-content .restart-btn {
        padding: 14px 32px;
        font-size: 14px;
    }
}
