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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    position: relative;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.game-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.timer {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.timer-value {
    font-size: 24px;
    margin: 0 5px;
}

/* Player Selection */
.player-select {
    text-align: center;
    padding: 20px;
}

.player-select h2 {
    margin-bottom: 20px;
    color: #333;
}

.player-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.player-btn {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.player-btn:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.player-btn:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.player-btn:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.player-btn:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.player-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.player-btn:active {
    transform: translateY(-2px);
}

/* Game Board */
.game-board {
    margin: 20px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: #8b6914;
    padding: 10px;
    border-radius: 15px;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3);
}

.plot {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    border: 3px solid #5c3317;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.plot:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.plot.selected {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.plot .miner {
    font-size: 28px;
    animation: bounce 1s infinite;
}

.plot.player1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.plot.player2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.plot.player3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.plot.player4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.plot .bomb {
    position: absolute;
    font-size: 32px;
    animation: bombDrop 1s ease-in;
    z-index: 10;
}

@keyframes bombDrop {
    0% {
        transform: translateY(-200px) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.plot .explosion {
    position: absolute;
    font-size: 40px;
    animation: explode 0.5s ease-out;
}

@keyframes explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.player-stat {
    background: white;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
}

.player-stat.active {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.player1-stat { border-top: 4px solid #667eea; }
.player2-stat { border-top: 4px solid #f5576c; }
.player3-stat { border-top: 4px solid #4facfe; }
.player4-stat { border-top: 4px solid #43e97b; }

.player-icon {
    font-size: 24px;
}

.player-name {
    flex: 1;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.gold-amount {
    font-size: 18px;
    font-weight: bold;
    color: #ffa500;
}

.gold-icon {
    font-size: 20px;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.control-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: white;
}

.place-btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.remove-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.control-btn.active {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    border: 3px solid #ffd700;
}

.btn-icon {
    font-size: 24px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

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

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

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

.winner-announcement {
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 10px;
    color: #333;
}

.final-scores {
    margin: 20px 0;
    text-align: left;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 16px;
}

.score-item.winner {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: bold;
    transform: scale(1.05);
}

.restart-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

/* Mobile Optimization */
@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 24px;
    }

    .timer {
        font-size: 16px;
        padding: 8px 16px;
    }

    .timer-value {
        font-size: 20px;
    }

    .grid {
        gap: 6px;
        padding: 8px;
    }

    .plot {
        font-size: 24px;
    }

    .player-stat {
        padding: 8px;
        gap: 5px;
    }

    .player-icon {
        font-size: 20px;
    }

    .player-name {
        font-size: 12px;
    }

    .gold-amount {
        font-size: 16px;
    }

    .control-btn {
        padding: 12px;
        font-size: 14px;
    }

    .btn-icon {
        font-size: 20px;
    }
}
