/* ===== fill-puzzle · 扫雷填色 ===== */

.fp-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fdf4ff 0%, #faf5ff 60%, #f5f3ff 100%);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #ede9fe;
}

.fp-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    width: 460px;
    height: 460px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

/* ---- HUD ---- */
.fp-hud {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.fp-hud-item {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e9d5ff;
    text-align: center;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.08);
}
.fp-hud-label {
    font-size: 11px;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.fp-hud-value {
    font-size: 20px;
    font-weight: 900;
    color: #5b21b6;
    margin-top: 2px;
    line-height: 1.2;
}
.fp-lives { color: #ef4444; letter-spacing: 2px; }

/* ---- Controls ---- */
.fp-controls {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.fp-difficulty {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.fp-diff-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #ddd6fe;
    background: #fff;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fp-diff-btn:hover { background: #f5f3ff; }
.fp-diff-btn.active {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
}

.fp-btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid #ddd6fe;
    background: #fff;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fp-btn:hover { background: #f5f3ff; transform: translateY(-1px); }
.fp-btn:active { transform: translateY(0); }
.fp-btn.primary {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(139, 92, 246, 0.35);
}
.fp-btn.primary:hover { background: linear-gradient(135deg, #9333ea, #7c3aed); }

/* ---- Color picker ---- */
.fp-color-picker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e9d5ff;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.fp-color-label {
    font-size: 13px;
    color: #6d28d9;
    font-weight: 700;
    margin-right: 4px;
}
.fp-color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.fp-color-btn:hover { transform: scale(1.1); }
.fp-color-btn.active {
    border-color: #1e1b4b;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* ---- Board ---- */
.fp-board-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
}
.fp-board {
    display: grid;
    gap: 4px;
    padding: 10px;
    background: #1e1b4b;
    border-radius: 14px;
    touch-action: none;
    user-select: none;
    box-shadow: 0 16px 40px rgba(91, 33, 182, 0.3);
}
.fp-cell {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #312e81;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: clamp(12px, 3.5vw, 20px);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.08s ease, background 0.18s ease;
    position: relative;
    overflow: hidden;
}
.fp-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.18s ease;
    mix-blend-mode: multiply;
}
.fp-cell[data-color]::after { opacity: 0.55; }
.fp-cell[data-color="red"]::after { background: #ef4444; }
.fp-cell[data-color="blue"]::after { background: #3b82f6; }
.fp-cell[data-color="green"]::after { background: #22c55e; }
.fp-cell[data-color="yellow"]::after { background: #eab308; }
.fp-cell[data-color="purple"]::after { background: #a855f7; }

.fp-cell:active { transform: scale(0.92); }
.fp-cell.is-wrong {
    animation: fp-shake 0.35s ease;
    box-shadow: inset 0 0 0 2px #ef4444;
}
.fp-cell.is-correct {
    animation: fp-pop 0.2s ease;
}

@keyframes fp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
@keyframes fp-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ---- Overlay ---- */
.fp-overlay {
    position: absolute;
    inset: 10px;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(30, 27, 75, 0.72);
    backdrop-filter: blur(3px);
    border-radius: 14px;
    animation: fp-fade 0.25s ease;
}
.fp-overlay[hidden] { display: none; }
@keyframes fp-fade { from { opacity: 0; } to { opacity: 1; } }

.fp-overlay-card {
    text-align: center;
    padding: 28px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(91, 33, 182, 0.3);
    max-width: 86%;
}
.fp-overlay-emoji { font-size: 48px; line-height: 1; margin-bottom: 10px; }
.fp-overlay-title { font-size: 26px; font-weight: 900; color: #5b21b6; letter-spacing: -0.02em; }
.fp-overlay-text { font-size: 14px; color: #6d28d9; margin: 8px 0 18px; }
.fp-overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.fp-hint {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    font-size: 12.5px;
    color: #7c3aed;
    font-weight: 500;
}

/* ---- Info ---- */
.fp-info { margin-bottom: 28px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .fp-hero { padding: 24px 14px 20px; }
    .fp-hud-item { min-width: 72px; padding: 8px 10px; }
    .fp-hud-value { font-size: 17px; }
    .fp-controls { gap: 8px; }
    .fp-diff-btn { padding: 7px 10px; font-size: 12px; }
    .fp-color-btn { width: 28px; height: 28px; }
}
@media (max-width: 420px) {
    .fp-hud { gap: 6px; }
    .fp-hud-item { min-width: 62px; }
}

@media (prefers-reduced-motion: reduce) {
    .fp-cell.is-wrong, .fp-cell.is-correct { animation: none; }
    .fp-cell { transition: none; }
}
