/* ===== 扫雷 · 专属样式 ===== */

/* ---- Hero 区域 ---- */
.gm-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 32px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fdf8ef 0%, #fbf6ec 60%, #f8f1e3 100%);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #efe3c8;
    transition: background 0.3s ease;
}

.gm-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 480px;
    height: 460px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 180, 76, 0.22) 0%, transparent 70%);
    pointer-events: none;
    transition: background 0.3s ease;
}

/* ---- 顶部信息行 ---- */
.gm-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.gm-brand { display: flex; flex-direction: column; gap: 4px; }
.gm-logo {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #92400e;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gm-tagline {
    font-size: 13px;
    color: #a08a63;
    font-weight: 500;
}

.gm-scores { display: flex; gap: 10px; }
.gm-score-box {
    min-width: 84px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #92400e;
    color: #fff;
    text-align: center;
    box-shadow: 0 6px 16px rgba(146, 64, 14, 0.3);
}
.gm-score-box.best { background: #b45309; box-shadow: 0 6px 16px rgba(180, 83, 9, 0.4); }
.gm-score-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
}
.gm-score-value {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    transition: transform 0.18s ease;
}
.gm-score-value.bump { transform: scale(1.18); }

/* ---- 操作行 ---- */
.gm-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.gm-diff {
    display: flex;
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(146, 64, 14, 0.08);
}
.gm-btn {
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid #e5d5b4;
    background: #fff;
    color: #92400e;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.gm-btn:hover { background: #fdf3e0; transform: translateY(-1px); }
.gm-btn:active { transform: translateY(0); }
.gm-btn.active {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.35);
}
.gm-btn.primary {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.35);
    font-size: 15px;
}
.gm-btn.primary:hover { background: linear-gradient(135deg, #d97706, #dc2626); }
.gm-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 最快/提示行 */
.gm-best-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: #a08a63;
    flex-wrap: wrap;
}
.gm-best { font-weight: 700; }

/* ---- 棋盘 ---- */
.gm-board-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.gm-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
    padding: 8px;
    background: #b8a583;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(120, 90, 40, 0.28);
    touch-action: manipulation;
    user-select: none;
}

.gm-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 5px;
    border: none;
    padding: 0;
    font-size: clamp(12px, 3.4vw, 18px);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    font-family: ui-monospace, monospace;
    transition: transform 0.08s ease, filter 0.15s ease;
}
.gm-cell:active { transform: scale(0.94); }

/* 未翻开 */
.gm-cell.closed {
    background: linear-gradient(180deg, #f5e7c8 0%, #e8d5a8 100%);
    box-shadow: inset 0 -2px 0 rgba(146, 64, 14, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.gm-cell.closed:hover { filter: brightness(1.05); }
.gm-cell.flag { font-size: clamp(13px, 3.8vw, 20px); }
.gm-cell.flag::after {
    content: '';
    position: absolute;
    inset: 18%;
    background: radial-gradient(circle at 35% 35%, rgba(220, 38, 38, 0.28), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* 翻开 */
.gm-cell.open {
    background: #fbf3e1;
    box-shadow: inset 0 0 0 1px rgba(146, 64, 14, 0.08);
    cursor: default;
}
.gm-cell.open:active { transform: none; }
.gm-cell.blank-open { background: #f6ecD6; }

/* 数字配色（经典） */
.gm-cell[data-n="1"] { color: #1d4ed8; }
.gm-cell[data-n="2"] { color: #15803d; }
.gm-cell[data-n="3"] { color: #dc2626; }
.gm-cell[data-n="4"] { color: #7c2d8f; }
.gm-cell[data-n="5"] { color: #a16207; }
.gm-cell[data-n="6"] { color: #0e7490; }
.gm-cell[data-n="7"] { color: #111827; }
.gm-cell[data-n="8"] { color: #6b7280; }

/* 地雷 */
.gm-cell.mine {
    background: #fecaca;
    animation: gm-shake 0.4s ease;
}
@keyframes gm-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}
.gm-cell.mine-hit {
    background: #ef4444;
    color: #fff;
}

/* 插旗的格子被翻开（踩雷/错误旗） */
.gm-cell.mine-wrong { background: #e5e7eb; }

/* 图标尺寸自适应 */
.gm-cell .emoji { font-size: 1em; line-height: 1; }

/* ---- 简介区 ---- */
.gm-info { margin-bottom: 28px; }
.gm-info .detail-title-row { margin-bottom: 16px; }
.gm-info h1 { font-size: 28px; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .gm-hero { padding: 28px 16px 24px; }
    .gm-topbar { gap: 14px; }
    .gm-logo { font-size: 26px; }
    .gm-tagline { display: none; }
    .gm-score-box { min-width: 72px; padding: 8px 10px; }
    .gm-score-value { font-size: 17px; }
    .gm-board { gap: 2px; padding: 6px; }
    .gm-board-wrap { max-width: 400px; }
}

@media (max-width: 420px) {
    .gm-topbar { flex-direction: column; align-items: stretch; }
    .gm-scores { justify-content: center; }
    .gm-actions { flex-direction: column; }
    .gm-diff { flex-wrap: wrap; justify-content: center; }
    .gm-board-wrap { max-width: 340px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gm-cell.mine { animation: none; }
}
