/* =========================================================
   minefield.css | PUCK MINEFIELD
   Aspecto de ventana de escritorio de los 2000 (tema azul tipo
   XP): barra de título azul, panel gris en relieve, contadores
   LED rojos, carita en el centro y casillas que se hunden al
   destaparse. Todo dibujado con CSS, sin imágenes.
   ========================================================= */

.hidden { display: none !important; }

.game-wrapper {
    display: flex; flex-direction: column; align-items: center;
    padding: 0 10px 40px; box-sizing: border-box;
}

/* --- Navegación de días (estilo de la web) --- */
.daily-nav { display: flex; align-items: center; justify-content: center; gap: 15px; width: 100%; max-width: 400px; margin: 20px 0; }
.btn-nav { padding: 5px 15px; font-size: 1.2rem; border-radius: 8px; cursor: pointer; background: transparent; border: 1px solid var(--neon-blue); color: var(--neon-blue); transition: all .3s; }
.btn-nav:hover:not(:disabled) { background: rgba(0, 242, 255, .1); box-shadow: 0 0 10px var(--neon-blue-glow); }
.btn-nav:disabled { opacity: .3; cursor: not-allowed; border-color: var(--text-secondary); color: var(--text-secondary); }
.day-info { text-align: center; min-width: 150px; }
.day-text { font-size: 1.5rem; font-weight: 900; color: var(--neon-blue); letter-spacing: 2px; text-shadow: 0 0 10px var(--neon-blue-glow); }

/* =========================================================
   Ventana
   ========================================================= */
.xp-window {
    --xp-face: #c0c0c0;
    --xp-light: #ffffff;
    --xp-shadow: #808080;
    --xp-font: Tahoma, "Segoe UI", Verdana, Geneva, sans-serif;
    font-family: var(--xp-font);
    color: #000;
    background: #ece9d8;
    border: 1px solid #0831d9;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 0 0 2px #166aee, 0 18px 40px rgba(0, 0, 0, .55);
    padding: 0 3px 3px;
    box-sizing: border-box;
}
.mf-window { width: 100%; max-width: 640px; }

.xp-titlebar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    height: 30px; margin: 0 -3px; padding: 0 5px 0 8px;
    border-radius: 7px 7px 0 0;
    background: linear-gradient(to bottom,
        #0997ff 0%, #0053ee 8%, #0050ee 40%, #0066ff 88%, #0055ea 93%, #003dd7 100%);
    color: #fff; font-weight: 700; font-size: 13px; text-shadow: 1px 1px 0 #0f1089;
    user-select: none;
}
.xp-title { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-icon { font-size: 14px; text-shadow: none; }
.xp-controls { display: flex; gap: 2px; padding: 0; border: 0; background: none; }
.xp-controls i {
    position: relative; display: block; width: 21px; height: 21px; border-radius: 3px;
    border: 1px solid #fff; box-sizing: border-box;
    background: radial-gradient(circle at 30% 30%, #5d9bff, #2663de 70%);
}
.xp-controls i::before, .xp-controls i::after { content: ""; position: absolute; background: #fff; }
.xp-min::before { left: 4px; bottom: 4px; width: 7px; height: 3px; }
.xp-max::before { inset: 3px; background: transparent !important; border: 1px solid #fff; border-top-width: 3px; }
.xp-controls i.xp-close { background: radial-gradient(circle at 30% 30%, #f0a08a, #e0482a 70%); }
.xp-close::before, .xp-close::after { left: 50%; top: 50%; width: 12px; height: 2px; }
.xp-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.xp-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.xp-close-btn { cursor: pointer; }
.xp-close-btn:hover i { filter: brightness(1.15); }

.xp-menubar { display: flex; gap: 2px; padding: 2px 4px; font-size: 12px; background: #ece9d8; border-bottom: 1px solid #d6d2c2; }
.xp-menubar span { padding: 1px 6px; }

/* --- Bisel clásico --- */
.mf-body {
    margin-top: 3px; padding: 8px;
    background: var(--xp-face);
    border: 3px solid; border-color: var(--xp-light) var(--xp-shadow) var(--xp-shadow) var(--xp-light);
}

/* Panel con contadores y carita */
.mf-panel {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 6px; margin-bottom: 8px;
    border: 2px solid; border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow);
}
.led {
    min-width: 54px; padding: 2px 4px; background: #000; text-align: right;
    border: 1px solid; border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow);
}
.led span {
    font-family: "Courier New", Consolas, monospace;
    font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: 1px;
    color: #ff0000; text-shadow: 0 0 4px rgba(255, 0, 0, .6);
}
.mf-face {
    width: 38px; height: 38px; padding: 0; cursor: pointer;
    font-size: 22px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--xp-face);
    border: 3px solid; border-color: var(--xp-light) var(--xp-shadow) var(--xp-shadow) var(--xp-light);
    outline: 1px solid var(--xp-shadow);
}
.mf-face:active { border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow); padding-top: 2px; }
.mf-face.big { width: 46px; height: 46px; font-size: 28px; cursor: default; flex: 0 0 auto; }

/* Pregunta en un recuadro hundido */
.mf-question-box {
    margin-bottom: 8px; padding: 8px 10px; text-align: center; background: #fff;
    border: 2px solid; border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow);
}
.mf-kicker { font-size: 11px; color: #555; }
.mf-kicker b { color: #c00000; }
.mf-question { margin: 3px 0 0; font-size: clamp(15px, 3.6vw, 19px); font-weight: 700; color: #000080; line-height: 1.2; }

/* --- Campo de minas --- */
.mf-grid {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
    border: 3px solid; border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow);
}

.mf-cell {
    position: relative; min-height: 64px; padding: 6px 4px 18px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    cursor: pointer; font-family: var(--xp-font); color: #000;
    font-size: 11px; font-weight: 700; line-height: 1.15; overflow-wrap: break-word;
    background: var(--xp-face);
    border: 3px solid; border-color: var(--xp-light) var(--xp-shadow) var(--xp-shadow) var(--xp-light);
    border-radius: 0; -webkit-tap-highlight-color: transparent;
}
.mf-name { max-width: 100%; }
.mf-cell:focus-visible { outline: 1px dotted #000; outline-offset: -6px; }
.mf-cell:disabled { cursor: default; }
.mf-cell:active:not(:disabled) { border-color: var(--xp-shadow) var(--xp-light) var(--xp-light) var(--xp-shadow); }

.mf-cell .mf-val { position: absolute; right: 4px; bottom: 2px; font-size: 13px; font-weight: 700; opacity: 0; }
.mf-cell .mf-ico { position: absolute; left: 4px; bottom: 2px; font-size: 12px; opacity: 0; }
.mf-cell.revealed .mf-val, .mf-cell.revealed .mf-ico { opacity: 1; }

/* Marcado: bandera, como en el clásico */
.mf-cell.sel::before { content: "🚩"; position: absolute; top: 2px; right: 3px; font-size: 12px; }

/* Destapadas: planas y hundidas */
.mf-cell.revealed {
    border-style: solid; border-color: var(--xp-shadow); border-width: 0 1px 1px 0;
    padding: 9px 7px 21px; background: #bdbdbd;
}
.mf-cell.hit .mf-val, .mf-cell.hit .mf-ico { color: #007b00; }
.mf-cell.boom { background: #ff0000; }
.mf-cell.boom .mf-val { color: #000; }
.mf-cell.miss .mf-val { color: #0000ff; }
.mf-cell.miss::after { content: ""; position: absolute; inset: 3px; border: 2px dashed #0000ff; pointer-events: none; }
.mf-cell.safe, .mf-cell.safe .mf-val { color: #6b6b6b; }
.mf-cell.revealing { animation: mfPop .18s ease-out; }
.mf-cell.boom.revealing { animation: mfBoom .45s ease; }
@keyframes mfPop { from { filter: brightness(1.35); } to { filter: none; } }
@keyframes mfBoom { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

.mf-loading { padding: 50px 20px; text-align: center; color: #333; font-weight: 700; background: var(--xp-face); }

/* --- Barra de estado y botones --- */
.mf-statusbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    margin-top: 3px; padding: 5px 6px; font-size: 12px; color: #000;
    background: #ece9d8; border-top: 1px solid #fff;
}
#mf-status b { color: #c00000; }
.mf-actions { display: flex; gap: 6px; margin-left: auto; }

.xp-btn {
    min-width: 76px; padding: 4px 12px; cursor: pointer;
    font-family: Tahoma, "Segoe UI", Verdana, sans-serif; font-size: 12px; color: #000;
    background: linear-gradient(to bottom, #fff 0%, #ecebe6 86%, #d6d0c5 100%);
    border: 1px solid #003c74; border-radius: 3px;
}
.xp-btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px #fbc761, inset 0 -2px 0 #e5a01a; }
.xp-btn:active:not(:disabled) { background: linear-gradient(to bottom, #e3e3db, #f0efe9); }
.xp-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.xp-btn.primary { font-weight: 700; box-shadow: inset 0 0 0 1px #9bb7e6, inset 0 0 0 2px #cfdcf5; }
.xp-btn.primary:hover:not(:disabled) { box-shadow: inset 0 0 0 2px #fbc761, inset 0 -2px 0 #e5a01a; }
.xp-btn:disabled { color: #a19f97; border-color: #c9c7ba; cursor: default; box-shadow: none; background: #f4f3ee; }

/* =========================================================
   Diálogo de resultado
   ========================================================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .6);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; overflow-y: auto; padding: 15px; box-sizing: border-box;
}
.xp-dialog { width: 100%; max-width: 380px; margin: auto; animation: dlgPop .18s ease-out; }
@keyframes dlgPop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.xp-dialog-body { padding: 12px 12px 10px; font-size: 12px; }

.mf-verdict-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-verdict { font-size: 14px; font-weight: 700; }
.modal-verdict.win { color: #007b00; }
.modal-verdict.lose { color: #c00000; }

.modal-top-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.stat-big-box {
    display: flex; flex-direction: column; align-items: center; padding: 5px 2px; background: #fff;
    border: 2px solid; border-color: #808080 #fff #fff #808080;
}
.big-number { font-size: 20px; font-weight: 700; line-height: 1.1; color: #000; }
.big-number.good { color: #007b00; }
.big-number.bad { color: #c00000; }
.big-number.warn { color: #0000ff; }
.big-label { font-size: 10px; color: #444; margin-top: 2px; }

.mini-grid { display: grid; grid-template-columns: repeat(5, 18px); gap: 0; justify-content: center; margin-bottom: 10px; }
.mini-cell {
    width: 18px; height: 18px; box-sizing: border-box; background: #c0c0c0;
    border: 2px solid; border-color: #fff #808080 #808080 #fff;
}
.mini-cell.hit, .mini-cell.boom, .mini-cell.miss, .mini-cell.safe { border-style: solid; border-color: #808080; border-width: 0 1px 1px 0; }
.mini-cell.hit { background: #2fb12f; }
.mini-cell.boom { background: #ff0000; }
.mini-cell.miss { background: #7a7aff; }
.mini-cell.safe { background: #bdbdbd; }

.xp-group { margin: 0 0 10px; padding: 6px 8px 8px; border: 1px solid #d0d0bf; border-radius: 3px; }
.xp-group legend { padding: 0 4px; color: #0046d5; font-size: 12px; }
.modal-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
.stat-box { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 16px; font-weight: 700; color: #000; }
.stat-text { font-size: 10px; color: #555; }

.modal-countdown { text-align: center; margin-bottom: 10px; font-size: 12px; }
.modal-countdown b { font-family: "Courier New", monospace; font-size: 15px; color: #c00000; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 6px; }

.toast {
    position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 2000;
    background: #ffffe1; color: #000; border: 1px solid #000; padding: 6px 12px;
    font-family: Tahoma, sans-serif; font-size: 12px; box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
}

/* --- Cómo se juega (estilo de la web) --- */
.faq-section {
    width: 100%; margin: 2rem 0 0; padding: 4rem 2rem; box-sizing: border-box;
    border-top: 1px solid rgba(0, 242, 255, .2); border-bottom: 1px solid rgba(0, 242, 255, .2);
    background: rgba(13, 17, 26, .4);
}
.faq-container { max-width: 800px; margin: 0 auto; text-align: left; }
.faq-title { font-size: 1.6rem; font-weight: 900; color: #fff; margin-bottom: 2rem; letter-spacing: -.5px; }
.faq-title .accent { color: var(--neon-blue); }
.faq-question { font-size: 1.1rem; font-weight: 800; color: var(--neon-blue); margin: 1.8rem 0 .6rem; }
.faq-answer { font-size: .95rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.faq-answer strong { color: #fff; }

/* Móvil: al final para que gane a las reglas de arriba */
@media (max-width: 560px) {
    .mf-body { padding: 5px; }
    .mf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mf-cell { min-height: 58px; padding: 5px 2px 16px; font-size: 9.5px; border-width: 2px; }
    .mf-cell.revealed { padding: 6px 3px 17px; }
    .mf-cell .mf-val { font-size: 11px; right: 3px; }
    .mf-cell .mf-ico { font-size: 10px; left: 3px; }
    .led { min-width: 46px; }
    .led span { font-size: 22px; }
    .mf-statusbar { justify-content: center; }
    .mf-actions { margin-left: 0; width: 100%; }
    .mf-actions .xp-btn { flex: 1; padding: 7px 8px; }
    .modal-top-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .mf-cell.revealing, .xp-dialog { animation: none !important; }
}
