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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c1810 0%, #4a2c1a 50%, #6b4423 100%);
    height: 100%;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* タイトル画面 */
#title-screen h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

#title-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.mode-selection {
    margin: 20px 0;
}

.mode-selection h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.mode-btn {
    background: linear-gradient(135deg, #8b5a3c 0%, #a0694d 100%);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    padding: 15px 40px;
    margin: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.6);
}

.mode-title {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.mode-desc {
    font-size: 0.9em;
    opacity: 0.8;
}

.instructions {
    background: rgba(139, 90, 60, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-width: 400px;
}

.instructions h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffd700;
}

.instructions ul {
    list-style: none;
    text-align: left;
}

.instructions li {
    padding: 5px 0;
    font-size: 1em;
}

.instructions li:before {
    content: "→ ";
    color: #ffd700;
}

/* ボタン */
.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #f4e5b2 50%, #d4af37 100%);
    color: #2c1810;
    font-size: 1.3em;
    font-weight: bold;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.7);
}

.btn-secondary {
    background: rgba(139, 90, 60, 0.8);
    color: white;
    font-size: 1em;
    font-weight: bold;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(139, 90, 60, 1);
}

/* ゲーム画面 */
#game-screen {
    padding: 20px;
    justify-content: flex-start;
}

#hud {
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 1.1em;
    border-radius: 10px;
    margin-bottom: 20px;
}

.hud-item {
    display: flex;
    gap: 5px;
    align-items: center;
}

#game-board {
    display: grid;
    gap: 2px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 20px;
}

.cell {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #8b5a3c 0%, #a0694d 100%);
    border: 2px outset #a0694d;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.1s;
    user-select: none;
}

.cell:hover {
    filter: brightness(1.2);
}

.cell.revealed {
    background: linear-gradient(135deg, #d4af37 0%, #f4e5b2 100%);
    border: 2px inset #c9a961;
    color: #2c1810;
    cursor: default;
}

.cell.flagged {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.cell.bomb {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: #ff6b6b;
}

.cell.treasure {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2c1810;
    font-size: 1.3em;
}

#controls {
    display: flex;
    gap: 10px;
}

/* 結果画面 */
#result-screen h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

#result-content {
    background: rgba(139, 90, 60, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 30px;
    border-radius: 15px;
    min-width: 300px;
}

.score-large {
    font-size: 3.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item:last-child {
    border-bottom: none;
}

.result-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    #title-screen h1 {
        font-size: 2em;
    }

    .mode-btn {
        font-size: 1em;
        padding: 12px 30px;
        min-width: 180px;
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .score-large {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }

    #hud {
        font-size: 0.9em;
        flex-wrap: wrap;
        gap: 10px;
    }
}
