/* Mine Finder — Game Worlds embed */

@media screen and (max-height: 640px) {
    .container.container-single {
        padding-top: 3px !important;
    }
}

.mf-gamebox#gamebox,
#gamebox.mf-gamebox {
    --mf-cell: 26px;
    --mf-border-grid: rgba(15, 23, 42, 0.9);
    --mf-cell-cover: #475569;
    --mf-cell-cover-hi: #64748b;
    --mf-cell-revealed: #1e293b;
    --mf-radius: 12px;

    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-height: 400px;
    margin: 0 auto;
    padding: 0;
    position: relative;

    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        'Helvetica Neue',
        Arial,
        sans-serif;

    color: #e2e8f0;
    background:
        radial-gradient(ellipse 110% 70% at 50% 0%, rgba(34, 211, 238, 0.07) 0%, transparent 52%),
        linear-gradient(165deg, #0b0f14 0%, #111827 48%, #0a0d12 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 44px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#gamebox .mf-shell,
.mf-gamebox #mine {
    margin: 0;
    padding: 14px 16px 18px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.mf-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    width: 100%;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mf-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.mf-difficulty {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mf-difficulty button {
    appearance: none;
    margin: 0;
    padding: 8px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e2e8f0;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid rgba(100, 116, 139, 0.5);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.mf-difficulty button:hover {
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(51, 65, 85, 0.9);
}

.mf-difficulty button.active {
    color: #0f172a;
    border-color: rgba(34, 211, 238, 0.55);
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 6px 20px rgba(34, 211, 238, 0.18);
}

.mf-restart#restart,
#restart.mf-restart {
    appearance: none;
    margin: 0;
    padding: 8px 18px;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f172a;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 4px 14px rgba(0, 0, 0, 0.25);
    transition: filter 0.12s ease, transform 0.12s ease;
}

.mf-restart:hover {
    filter: brightness(1.06);
}

.mf-restart:active {
    transform: translateY(1px);
}

.mf-counter.info,
.info.mf-counter {
    float: none;
    width: auto;
    margin: 0;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    font-size: inherit;
    border-radius: var(--mf-radius);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.1) 0%, rgba(30, 41, 59, 0.65) 100%);
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mf-counter-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7dd3fc;
    opacity: 0.95;
}

.mf-counter-value.remains,
.remains.mf-counter-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #fef08a;
    text-shadow: 0 0 22px rgba(250, 204, 21, 0.2);
}

.mf-board-wrap.gamecontent,
.gamecontent.mf-board-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.mf-board-wrap table,
.gamecontent table {
    border-spacing: 0;
    border-collapse: separate;
    margin: 0 auto;
    background: var(--mf-border-grid);
    border: 1px solid rgba(15, 23, 42, 0.8);
    border-radius: 6px;
    padding: 3px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mf-board-wrap td,
.gamecontent td {
    box-sizing: border-box;
    padding: 0;
    width: var(--mf-cell);
    height: var(--mf-cell);
    min-width: var(--mf-cell);
    min-height: var(--mf-cell);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: center;
    line-height: var(--mf-cell);
    vertical-align: middle;

    background: linear-gradient(165deg, var(--mf-cell-cover-hi) 0%, var(--mf-cell-cover) 100%);
    border: 1px solid rgba(15, 23, 42, 0.45);
    border-radius: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
    user-select: none;
    transition: filter 0.1s ease, transform 0.08s ease;
}

.mf-board-wrap td:active,
.gamecontent td:active {
    transform: scale(0.97);
}

.mf-board-wrap td.zero,
.mf-board-wrap td.one,
.mf-board-wrap td.two,
.mf-board-wrap td.three,
.mf-board-wrap td.four,
.mf-board-wrap td.five,
.mf-board-wrap td.six,
.mf-board-wrap td.seven,
.mf-board-wrap td.eight,
.gamecontent td.zero,
.gamecontent td.one,
.gamecontent td.two,
.gamecontent td.three,
.gamecontent td.four,
.gamecontent td.five,
.gamecontent td.six,
.gamecontent td.seven,
.gamecontent td.eight {
    box-shadow: none;
    border-color: rgba(51, 65, 85, 0.6);
    background: var(--mf-cell-revealed);
    cursor: default;
}

.mf-board-wrap td.zero,
.gamecontent td.zero {
    background: #0f172a;
    border-color: rgba(30, 41, 59, 0.8);
}

.tips {
    color: #f87171;
    font-size: 0.9rem;
}

/* Spiked naval mine (readable at small size) — inline graphic, no external asset */
#gamebox td.mine,
#gamebox .mine {
    background-color: #1e293b !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cdefs%3E%3CradialGradient id='b' cx='32%25' cy='28%25' r='70%25'%3E%3Cstop stop-color='%2394a3b8'/%3E%3Cstop offset='0.55' stop-color='%2352565b'/%3E%3Cstop offset='1' stop-color='%231e293b'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='%23111827' stroke='%230f172a' stroke-width='0.4'%3E%3Ccircle cx='24' cy='5.5' r='3.2'/%3E%3Ccircle cx='36.5' cy='10.5' r='3.2'/%3E%3Ccircle cx='42.5' cy='23' r='3.2'/%3E%3Ccircle cx='36.5' cy='35.5' r='3.2'/%3E%3Ccircle cx='24' cy='42.5' r='3.2'/%3E%3Ccircle cx='11.5' cy='35.5' r='3.2'/%3E%3Ccircle cx='5.5' cy='23' r='3.2'/%3E%3Ccircle cx='11.5' cy='10.5' r='3.2'/%3E%3C/g%3E%3Ccircle cx='24' cy='24' r='13' fill='url(%23b)' stroke='%230f172a' stroke-width='1.2'/%3E%3Cellipse cx='18' cy='18' rx='4' ry='2.5' fill='%23cbd5e1' opacity='0.35'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 72% !important;
    border-color: #0f172a !important;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(15, 23, 42, 0.6) !important;
}

#gamebox td.flag {
    background-color: #3d4f66 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='7' y='5' width='3' height='30' rx='1.2' fill='%2394a3b8'/%3E%3Cpath fill='%23ef4444' stroke='%23991b1b' stroke-width='0.6' stroke-linejoin='round' d='M12.5 7 L35 18.5 L12.5 27 Z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 62% !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15) !important;
}

#gamebox .mf-exploded {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%) !important;
    border-color: #7f1d1d !important;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35) !important;
}

#gamebox td.one {
    color: #60a5fa;
}
#gamebox td.two {
    color: #4ade80;
}
#gamebox td.three {
    color: #f87171;
}
#gamebox td.four {
    color: #c084fc;
}
#gamebox td.five {
    color: #fb923c;
}
#gamebox td.six {
    color: #f472b6;
}
#gamebox td.seven {
    color: #2dd4bf;
}
#gamebox td.eight {
    color: #a3e635;
}

@media (max-width: 640px) {
    .mf-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mf-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .mf-difficulty {
        justify-content: center;
    }

    .mf-restart {
        width: 100%;
    }

    .mf-counter.info {
        align-items: center;
        text-align: center;
    }

    .mf-gamebox#gamebox {
        --mf-cell: 22px;
    }
}

@media (min-width: 900px) {
    .mf-gamebox#gamebox {
        --mf-cell: 28px;
    }

    .mf-board-wrap td,
    .gamecontent td {
        font-size: 14px;
    }
}
