/* デフォルトテーマ（既存のスタイルと同じ） */
body.theme-default {
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --cell-bg: #c0c0c0;
    --cell-border-light: #fff;
    --cell-border-dark: #808080;
    --cell-opened: #e0e0e0;
    --cell-hover: #d0d0d0;
    --grid-bg: #999;
    --grid-container-bg: #ddd;
    --button-bg: #667eea;
    --button-hover: #764ba2;
    --info-bg: #f0f0f0;
    --info-text: #666;
    --focus-color: #667eea;
}

/* ダークモード */
body.theme-dark {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --container-bg: rgba(30, 30, 30, 0.95);
    --text-color: #e0e0e0;
    --cell-bg: #4a4a4a;
    --cell-border-light: #6a6a6a;
    --cell-border-dark: #2a2a2a;
    --cell-opened: #333;
    --cell-hover: #5a5a5a;
    --grid-bg: #222;
    --grid-container-bg: #2a2a2a;
    --button-bg: #4a5568;
    --button-hover: #2d3748;
    --info-bg: #2a2a2a;
    --info-text: #a0a0a0;
    --focus-color: #667eea;
}

/* ネオンテーマ */
body.theme-neon {
    --bg-gradient-start: #0f0f0f;
    --bg-gradient-end: #1a1a1a;
    --container-bg: rgba(20, 20, 20, 0.95);
    --text-color: #00ff00;
    --cell-bg: #1a1a1a;
    --cell-border-light: #00ff00;
    --cell-border-dark: #008800;
    --cell-opened: #0a0a0a;
    --cell-hover: #2a2a2a;
    --grid-bg: #000;
    --grid-container-bg: #0a0a0a;
    --button-bg: #00ff00;
    --button-hover: #00cc00;
    --info-bg: #1a1a1a;
    --info-text: #00ff00;
    --focus-color: #ff00ff;
}

/* パステルテーマ */
body.theme-pastel {
    --bg-gradient-start: #ffd4e5;
    --bg-gradient-end: #d4e5ff;
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #555;
    --cell-bg: #f0f0f0;
    --cell-border-light: #fff;
    --cell-border-dark: #ddd;
    --cell-opened: #fafafa;
    --cell-hover: #e8e8e8;
    --grid-bg: #eee;
    --grid-container-bg: #f5f5f5;
    --button-bg: #ffb3d9;
    --button-hover: #ff99cc;
    --info-bg: #fff0f5;
    --info-text: #888;
    --focus-color: #ff69b4;
}

/* レトロテーマ */
body.theme-retro {
    --bg-gradient-start: #8b4513;
    --bg-gradient-end: #a0522d;
    --container-bg: rgba(245, 222, 179, 0.95);
    --text-color: #3e2723;
    --cell-bg: #d2b48c;
    --cell-border-light: #f5deb3;
    --cell-border-dark: #8b7355;
    --cell-opened: #deb887;
    --cell-hover: #cdaa7d;
    --grid-bg: #8b7355;
    --grid-container-bg: #bc9a6a;
    --button-bg: #8b4513;
    --button-hover: #654321;
    --info-bg: #f5deb3;
    --info-text: #5d4037;
    --focus-color: #ff6347;
}

/* テーマ共通のスタイル調整 */
body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

.game-container {
    background: var(--container-bg);
    color: var(--text-color);
}

h1, h3 {
    color: var(--text-color);
}

.cell {
    background: var(--cell-bg);
    border-color: var(--cell-border-light) var(--cell-border-dark) var(--cell-border-dark) var(--cell-border-light);
}

.cell:hover:not(.opened):not(.game-over) {
    background: var(--cell-hover);
}

.cell.opened {
    background: var(--cell-opened);
    border-color: var(--grid-bg);
}

.cell.focused {
    outline-color: var(--focus-color);
}

.grid {
    background: var(--grid-bg);
}

.grid-container {
    background: var(--grid-container-bg);
}

.difficulty-btn, .game-btn {
    background: var(--button-bg);
}

.difficulty-btn:hover, .game-btn:hover {
    background: var(--button-hover);
}

.difficulty-btn.active {
    background: var(--button-hover);
}

.info-box, .stat-item {
    background: var(--info-bg);
}

.info-label, .stat-label {
    color: var(--info-text);
}

.info-value, .stat-value {
    color: var(--text-color);
}

/* モーダル用のテーマ調整 */
.modal-content {
    background: var(--container-bg);
}

.modal-close {
    color: var(--info-text);
}

.modal-close:hover {
    color: var(--text-color);
}

/* ネオンテーマ特有のエフェクト */
body.theme-neon .cell {
    box-shadow: inset 0 0 5px rgba(0, 255, 0, 0.3);
}

body.theme-neon .key {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

body.theme-neon .cell:hover:not(.opened) {
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

body.theme-neon .difficulty-btn,
body.theme-neon .game-btn {
    color: #000;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

body.theme-neon .cell.flag::after {
    filter: hue-rotate(120deg) brightness(2);
}

/* ダークモード特有の調整 */
body.theme-dark .mine-counter.warning .info-value {
    color: #ffa500;
}

body.theme-dark .mine-counter.danger .info-value {
    color: #ff4444;
}

body.theme-dark .message.win {
    color: #4CAF50;
}

body.theme-dark .message.lose {
    color: #ff4444;
}