/**
 * Tango Puzzle Game - Settings Modal & Statistics CSS
 * 
 * 機能概要:
 * - 設定モーダルのオーバーレイとコンテナ (.settings-modal, .settings-content)
 * - テーマ切り替えグリッドとカラースウォッチ (.theme-section, .theme-grid, .theme-swatch)
 * - 統計情報セクションとリスト表示 (.stats-section, .stats-select-row, .stats-display, .stats-item)
 * - 特別モードへの導線リンク (.special-mode-section, .special-mode-link)
 * - モーダル閉じるボタン (.settings-close)
 */

.settings-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.settings-modal.open {
    display: flex;
}

.settings-content {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-section {
    margin-bottom: 1rem;
}

.theme-section h4 {
    font-size: 0.9rem;
    color: var(--text);
    margin: 0 0 0.5rem 0;
    opacity: 0.7;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.theme-swatch {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    outline: 3px solid transparent;
    outline-offset: 0;
    transition: transform 0.2s, outline-color 0.2s;
    position: relative;
    overflow: hidden;
}

.theme-swatch:hover {
    transform: scale(1.05);
}

.theme-swatch.active {
    outline-color: var(--primary);
}

.theme-swatch::after {
    content: attr(data-name);
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    color: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.theme-swatch[data-theme="light-purple"] { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; }
.theme-swatch[data-theme="light-ocean"] { background: linear-gradient(135deg, #14b8a6, #5eead4); color: white; }
.theme-swatch[data-theme="light-rose"] { background: linear-gradient(135deg, #ea580c, #fb923c); color: white; }
.theme-swatch[data-theme="dark-midnight"] { background: linear-gradient(135deg, #0f0f1a, #1a1a2e); color: #818cf8; }
.theme-swatch[data-theme="dark-forest"] { background: linear-gradient(135deg, #0d1117, #161b22); color: #3fb950; }
.theme-swatch[data-theme="dark-crimson"] { background: linear-gradient(135deg, #1a1a1a, #262626); color: #ef4444; }

.settings-close {
    width: 100%;
    margin-top: 1rem;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.stats-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--control-border);
}

.stats-section h4 {
    font-size: 0.9rem;
    color: var(--text);
    margin: 0 0 0.5rem 0;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-select-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.stats-select-row select {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.stats-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--cell-bg);
    border-radius: 8px;
}

.stats-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

/* 特別モード切り替えリンク */
.special-mode-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--control-border);
}

.special-mode-section h4 {
    font-size: 0.9rem;
    color: var(--text);
    margin: 0 0 0.5rem 0;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.special-mode-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff7675, #fab1a0);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(255, 118, 117, 0.35);
}

.special-mode-link:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 118, 117, 0.45);
}

.special-mode-link .special-link-arrow {
    margin-left: auto;
    font-size: 1.1rem;
    transition: transform 0.15s;
}

.special-mode-link:hover .special-link-arrow {
    transform: translateX(3px);
}

.special-mode-link.standard-link {
    background: var(--cell-bg);
    color: var(--text) !important;
    border: 1px solid var(--control-border);
    box-shadow: none;
}

.special-mode-link.standard-link:hover {
    background: var(--cell-border);
}
