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

:root {
    --board-size: min(85vw, 85vh);
    --square-size: calc(var(--board-size) / 16);
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1f24 0%, #121518 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 10px;
    color: #e4e6eb;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(145deg, #242830, #1e2228);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: var(--board-size);
    height: auto;
}

.game-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.setup-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: #2d3139;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-button:hover {
    background: #3a4149;
    transform: translateY(-2px);
}

.sound-controls {
    display: flex;
    gap: 8px;
}

.turn-indicator {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px;
    border-radius: 8px;
    background: #2d3139;
    text-align: center;
}

.turn-indicator.white {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    color: #2c3e50;
    border: 2px solid #e9ecef;
}

.turn-indicator.black {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: #ffffff;
}

.turn-indicator.red {
    background: linear-gradient(145deg, #ff6b6b, #fa5252);
    color: #ffffff;
}

.turn-indicator.blue {
    background: linear-gradient(145deg, #339af0, #228be6);
    color: #ffffff;
}

.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.captured-container {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.captured-label {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.captured-white, .captured-black, .captured-red, .captured-blue {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 30px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

.captured-red .piece {
    color: #ff0000;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    width: 100%;
    aspect-ratio: 1/1;
    margin: 0 auto;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    background: #242830;
}

.square {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    transform-style: preserve-3d;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

.square .piece {
    position: absolute;
}

/* Base colors for squares */
.square.white {
    background-color: #d2a679;
}

.square.black {
    background-color: #8b5e3c;
}

/* Move indicators */
.square.valid-move::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(24px, 4vw);
    height: min(24px, 4vw);
    background-color: rgba(0, 255, 0, 0.3);
    border: 2px solid rgba(0, 255, 0, 0.5);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

/* Capture indicators */
.square.valid-capture::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255, 0, 0, 0.5);
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
}

/* Hover states */
.square:hover:not(.fog):not(.selected) {
    transform: scale(1.05) translateZ(0);
    z-index: 100;
}

.square:not(:hover) {
    transform: translateZ(0);
    transition: transform 0.2s ease;
}

/* Selected state */
.square.selected {
    background: radial-gradient(circle, rgba(116, 185, 255, 0.4) 0%, rgba(116, 185, 255, 0.8) 100%) !important;
    transform: scale(1.05) translateZ(0);
    z-index: 100;
    box-shadow: 0 0 20px rgba(116, 185, 255, 0.6);
}

/* Ensure content stays visible */
.square > * {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.square::before,
.square::after {
    transform: translateZ(1px);
    backface-visibility: hidden;
}

/* Terrain styles */
.square.forest {
    background: linear-gradient(to bottom, #1e3b1a 0%, #2a4a24 100%) !important;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.square.water {
    background: linear-gradient(45deg, #1a4b82 0%, #2666b0 50%, #1a4b82 100%) !important;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.square.goodie-hut {
    position: relative;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.square.goodie-hut::before {
    content: '🏕️';
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

/* Fog of war styling */
.square.fog:not(.explored) {
    background-color: #0a0a0a !important;
}

.square.fog.explored.white {
    background-color: #3a4149 !important;
}

.square.fog.explored.black {
    background-color: #2d3139 !important;
}

/* Z-index layering */
.square::before {
    z-index: 3;
}

.square.selected {
    z-index: 4;
}

.square.valid-move::after {
    z-index: 5;
}

.square.fog::after {
    z-index: 6;
}

.square.valid-move::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, rgba(116, 185, 255, 0.8) 0%, rgba(116, 185, 255, 0.3) 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(116, 185, 255, 0.4);
    animation: pulse 1.5s infinite;
}

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

.square.fog {
    position: relative;
}

/* Fog of war styling improvements */
.square.fog:not(.explored) {
    background-color: #0a0a0a !important;
}

.square.fog:not(.explored)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.95) 100%);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
    z-index: 4;
}

/* Explored squares */
.square.fog.explored {
    position: relative;
    filter: grayscale(0.8) brightness(0.5);
}

.square.fog.explored.forest,
.square.fog.explored.water {
    filter: grayscale(0.9) brightness(0.4);
}

.square.fog.explored.forest::before,
.square.fog.explored.water::before {
    opacity: 0.3;
}

/* Regular terrain styles */
.square.forest::before {
    content: attr(data-variant);
    font-size: 35px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

.square.mountain::before {
    content: attr(data-variant);
    font-size: 35px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

.square.goodie-hut {
    position: relative;
}

.square.goodie-hut::before {
    content: '🏕️';
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

/* Remove any existing yellow background styles */
.square.goodie-hut {
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Remove the old variant-specific styles since we're using data-variant directly */
.square.forest[data-variant="0"]::before,
.square.forest[data-variant="1"]::before,
.square.forest[data-variant="2"]::before,
.square.mountain[data-variant="0"]::before,
.square.mountain[data-variant="1"]::before,
.square.mountain[data-variant="2"]::before {
    content: attr(data-variant);
}

.square.forest::after {
    content: '';
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: #4a3728;
}

.square.forest:nth-child(2n)::before {
    --tree-rotation: 15deg;
}

.square.forest:nth-child(3n)::before {
    --tree-rotation: -10deg;
}

.square.water::before,
.square.water::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    top: 0;
    left: -50%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 20%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 80%,
        transparent 100%
    );
    animation: waterFlow 12s linear infinite;
    transform-origin: center center;
}

.square.water::after {
    animation-delay: -6s;
    opacity: 0.5;
}

.square.mountain {
    background: linear-gradient(45deg, #4a4a4a 0%, #6a6a6a 50%, #4a4a4a 100%) !important;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
    position: relative;
}

.square.mountain::before {
    content: attr(data-variant);
    font-size: 35px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

.square.mountain[data-variant="0"]::before {
    content: '⛰️';
}

.square.mountain[data-variant="1"]::before {
    content: '🏔️';
}

.square.mountain[data-variant="2"]::before {
    content: '🗻';
}

@keyframes waterFlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Fog of war styling improvements */
.square.fog.explored.forest,
.square.fog.explored.water,
.square.fog.explored.mountain {
    filter: grayscale(0.9) brightness(0.4);
}

.square.fog.explored.forest::before,
.square.fog.explored.water::before,
.square.fog.explored.mountain::before,
.square.fog.explored.forest::after,
.square.fog.explored.water::after,
.square.fog.explored.mountain::after {
    opacity: 0.3;
}

/* Add sliding animation for pieces */
@keyframes slidePiece {
    0% {
        transform: translate(-50%, -50%);
    }
    100% {
        transform: translate(calc(-50% + var(--offset-x)), calc(-50% + var(--offset-y)));
    }
}

.piece {
    width: calc(var(--square-size) * 0.8);
    height: calc(var(--square-size) * 0.8);
    position: absolute;
    cursor: pointer;
    user-select: none;
    font-size: calc(var(--square-size) * 0.7) !important;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
    will-change: transform;
}

/* Piece colors and outlines */
.piece[data-color="white"] {
    color: #ffffff !important;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

.piece[data-color="black"] {
    color: #000000 !important;
    text-shadow: 
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;
}

.piece[data-color="red"] {
    color: #ff3333 !important;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

.piece[data-color="blue"] {
    color: #3333ff !important;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

.piece:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Game message styling */
.message-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.game-message {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.game-message.reward {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.game-message.warning {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.message-icon {
    font-size: 1.8rem;
}

.message-text {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .game-message {
        min-width: auto;
        width: 90vw;
        padding: 1rem 1.5rem;
    }

    .message-text {
        font-size: 1rem;
    }

    .message-icon {
        font-size: 1.5rem;
    }
}

/* Update responsive design */
@media (max-width: 1200px) {
    :root {
        --board-size: min(85vw, 80vh);
    }
    
    .game-container {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --board-size: min(95vw, 80vh);
    }
    
    .tech-container {
        flex-direction: column;
    }
    
    .tech-tree {
        margin-bottom: 20px;
    }

    .game-description {
        padding: 15px 20px;
    }

    .game-description h2 {
        font-size: 1.2em;
    }

    .game-description p,
    .game-description li {
        font-size: 1em;
    }
}

/* iPhone and other mobile devices */
@media (max-width: 480px) {
    :root {
        --board-size: 95vw;
    }

    body {
        padding: 5px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 10px;
    }

    .game-container {
        padding: 8px;
        width: var(--board-size);
        gap: 8px;
        margin-bottom: 20px;
    }

    .chessboard {
        display: grid;
        grid-template-columns: repeat(16, 1fr);
        grid-template-rows: repeat(16, 1fr);
        width: 100%;
        aspect-ratio: 16/20;
        gap: 0;
    }

    .square {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .piece {
        font-size: calc(var(--board-size) / 22) !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .square.goodie-hut::before,
    .square.forest::before,
    .square.water::before {
        font-size: calc(var(--board-size) / 25) !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        height: 80%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .turn-indicator {
        font-size: 0.9rem;
        padding: 6px;
    }

    .control-button {
        padding: 6px 8px;
        font-size: 0.8em;
    }

    .setup-controls label {
        font-size: 0.8em;
    }

    .game-message {
        min-width: auto;
        width: 90vw;
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .controls-container {
        gap: 5px;
    }

    .square.mountain::before {
        font-size: calc(var(--board-size) / 30) !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        height: 80%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Landscape mode and 1080p monitors */
@media (max-height: 1080px) and (min-width: 1200px) {
    :root {
        --board-size: 75vh;
    }

    body {
        align-items: flex-start;
        padding-top: 20px;
    }

    .game-container {
        padding: 15px;
        margin-bottom: 20px;
        width: var(--board-size);
    }

    .chessboard {
        width: 100%;
        aspect-ratio: 1/1;
    }

    .square {
        width: 100%;
        height: 100%;
    }
}

/* 1440p (2K) resolution support */
@media (min-width: 1440px) {
    :root {
        --board-size: min(75vw, 75vh);
    }

    body {
        align-items: center;
        padding: 20px;
        min-height: 100vh;
        overflow-y: auto;
    }

    .game-container {
        padding: 20px;
        margin: 0 auto;
        max-height: 95vh;
        overflow-y: auto;
        width: var(--board-size);
    }

    .chessboard {
        width: 100%;
        aspect-ratio: 1/1;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(16, 1fr);
        grid-template-rows: repeat(16, 1fr);
        gap: 0;
    }

    .square {
        width: 100%;
        height: 100%;
    }

    .game-description {
        margin-top: 20px;
        max-width: var(--board-size);
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    :root {
        --board-size: 80vh;
    }

    .game-container {
        padding: 5px;
    }

    .game-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
    }

    .turn-indicator {
        flex: 1;
        margin-right: 5px;
        font-size: 0.9rem;
        padding: 5px;
    }

    .square {
        height: calc(var(--square-size) * 0.8);
    }
}

/* Moved piece styling */
.piece.moved {
    opacity: 0.5 !important;
    filter: brightness(60%) grayscale(50%) !important;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

/* End turn button blinking animation */
@keyframes blink {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); }
}

.end-turn-button.blink {
    animation: blink 1s ease-in-out infinite;
}

/* Add fade-in animation for turn transition */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.turn-transition {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.turn-transition h2 {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.turn-transition p {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.8;
}

.turn-transition button {
    font-size: 1.3em;
    padding: 15px 40px;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.turn-transition button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.turn-transition::before {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.turn-transition.white::before {
    background-color: #ffffff;
}

.turn-transition.black::before {
    background-color: #000000;
    border: 2px solid #ffffff;
}

.turn-transition.red::before {
    background-color: #ff3333;
}

.turn-transition.blue::before {
    background-color: #3333ff;
}

.piece.moving {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    animation: slidePiece 0.3s ease-out forwards;
}

/* Ensure the clone piece is properly centered */
.piece-clone {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

/* End turn button adjustments */
.end-turn-button {
    padding: 8px 16px;
    font-size: 1em;
    margin-top: 10px;
}

.game-description {
    background: rgba(36, 40, 48, 0.8);
    border-radius: 12px;
    padding: 20px 30px;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-description h2 {
    color: #e4e6eb;
    font-size: 1.4em;
    margin-bottom: 15px;
    text-align: center;
}

.game-description p {
    color: #e4e6eb;
    margin: 12px 0;
    font-size: 1.1em;
}

.game-description ul {
    list-style-position: inside;
    padding-left: 20px;
    margin: 10px 0;
}

.game-description li {
    color: #b0b3b8;
    margin: 8px 0;
    line-height: 1.4;
    position: relative;
    padding-left: 15px;
}

.game-description li::before {
    content: "•";
    color: #4e89ae;
    position: absolute;
    left: -5px;
}

/* Mode Selection Menu Styles */
.mode-selection-menu {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.mode-selection-menu .menu-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #2c3e50;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.mode-selection-menu .menu-content h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #ecf0f1;
    font-size: 1.8rem;
}

.mode-selection-menu .game-modes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-selection-menu .game-description {
    background: rgba(52, 73, 94, 0.6);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    color: #ecf0f1;
}

.mode-selection-menu .game-description h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #3498db;
}

.mode-selection-menu .game-description p {
    margin: 0.8rem 0;
    line-height: 1.5;
}

.mode-selection-menu .game-description ul {
    list-style-type: none;
    padding-left: 1rem;
    margin: 0.8rem 0;
}

.mode-selection-menu .game-description li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.mode-selection-menu .game-description li::before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: 0;
    font-size: 1.2em;
}

.mode-selection-menu button {
    padding: 1rem;
    font-size: 1.2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-selection-menu button:hover {
    transform: translateY(-2px);
    background-color: #2ecc71;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for mode selection menu */
@media (max-width: 768px) {
    .mode-selection-menu .menu-content {
        padding: 1.5rem;
        max-width: 95%;
    }

    .mode-selection-menu .game-description {
        padding: 1rem;
    }

    .mode-selection-menu .game-description h2 {
        font-size: 1.2rem;
    }

    .mode-selection-menu .game-description p,
    .mode-selection-menu .game-description li {
        font-size: 0.9rem;
    }

    .mode-selection-menu button {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Game Over Screen */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-out;
}

.game-over-message {
    background-color: #2c3e50;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.5s ease-out;
    max-width: 90%;
    width: 400px;
}

.game-over-message h2 {
    color: #ecf0f1;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-over-message p {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.game-over-message .button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.game-over-message button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-over-message button:hover {
    background-color: #2ecc71;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .game-over-message {
        padding: 1.5rem;
        width: 90%;
    }

    .game-over-message h2 {
        font-size: 1.5rem;
    }

    .game-over-message p {
        font-size: 1rem;
    }

    .game-over-message button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

.setup-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.player-count-section {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.player-setup-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-type {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.player-type label {
    font-weight: bold;
    min-width: 80px;
}

.player-type select {
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    cursor: pointer;
}

.player-type select:hover {
    background: white;
}

#totalPlayerCount {
    padding: 5px 15px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 1em;
}

#totalPlayerCount:hover {
    background: white;
}

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

/* Improved Game Setup Menu Styles */
.ai-setup-menu {
    background-color: rgba(0, 0, 0, 0.85);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ai-setup-menu .menu-content {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    color: #ecf0f1;
}

.ai-setup-menu h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #3498db;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setup-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.player-count-section {
    background: rgba(52, 73, 94, 0.6);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.player-count-section label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ecf0f1;
}

.player-count-section select {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #2c3e50;
    border: 2px solid #3498db;
    color: #ecf0f1;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-count-section select:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.player-setup-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-type {
    background: rgba(52, 73, 94, 0.6);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.player-type:hover {
    transform: translateX(5px);
    background: rgba(52, 73, 94, 0.8);
}

.player-type label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ecf0f1;
    min-width: 100px;
}

.player-type select {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #2c3e50;
    border: 2px solid #3498db;
    color: #ecf0f1;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
}

.player-type select:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.button-group button {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

#startGameSetup {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: white;
}

#startGameSetup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

#backFromSetup {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

#backFromSetup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* Mobile responsiveness for setup menu */
@media (max-width: 480px) {
    .ai-setup-menu .menu-content {
        padding: 1.5rem;
        width: 95%;
    }

    .ai-setup-menu h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .player-count-section,
    .player-type {
        padding: 0.8rem;
    }

    .player-count-section label,
    .player-type label {
        font-size: 1rem;
    }

    .player-count-section select,
    .player-type select {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .button-group button {
        padding: 0.6rem 1rem;
        font-size: 1rem;
        min-width: 100px;
    }
}

/* Remove multiplayer-related styles */
.multiplayer-menu,
.multiplayer-options,
.join-game-section,
#gameIdInput,
#createGame,
#joinGame,
#backFromMultiplayer {
    display: none;
}
