
@keyframes mf-mult-bump {
    0%   { transform: scale(1.25); }
    100% { transform: scale(1); }
}
@keyframes mf-tile-in {
    from { opacity: 0; transform: translateY(-0.8rem) scale(0.8); }
    to   { opacity: 1; transform: none; }
}
@keyframes mf-gem-pop {
    0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
    70%  { transform: scale(1.25) rotate(6deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes mf-boom-pop {
    0%   { transform: scale(0.4); }
    55%  { transform: scale(1.6); }
    100% { transform: scale(1.15); }
}
@keyframes mf-boom-shake {
    0%, 100% { transform: translate(0, 0); }
    20%      { transform: translate(-3px, 2px) rotate(-2deg); }
    40%      { transform: translate(3px, -2px) rotate(2deg); }
    60%      { transform: translate(-2px, -1px) rotate(-1deg); }
    80%      { transform: translate(2px, 1px) rotate(1deg); }
}

@keyframes mf-flip {
    from { transform: rotateY(82deg); opacity: 0.2; }
    to   { transform: rotateY(0); opacity: 1; }
}
@keyframes mf-cash-pulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35); }
    50%      { box-shadow: 0 6px 26px rgba(16, 185, 129, 0.65); }
}
@scope ([data-iw4m-plugin="Credify"]) to ([data-iw4m-host]) {
/*
 * Credify Minefield table styling. Bespoke `.mf-*` classes only (no generic utility names), served as a
 * plain stylesheet at /_content/credify/minefield/minefield.css — it can't collide with host CSS.
 * Tailwind utilities used in the page come from plugin.css (the `plugins` layer). Host design tokens
 * (--color-*) are referenced where it helps the page match the active theme.
 */

.mf-felt {
    background:
        radial-gradient(130% 110% at 50% -10%, #2a2150 0%, #1b1538 42%, #0c0a1f 100%);
    border-radius: 1rem;
    box-shadow: inset 0 0 130px rgba(0, 0, 0, 0.55);
}

/* ── header chips ──────────────────────────────────────────────────── */
.mf-chip-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 0.85rem;
}
.mf-muted { color: rgba(255, 255, 255, 0.5); font-weight: 500; }

.mf-panel {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.9rem;
    padding: 1.5rem;
}

/* ── live ribbon ───────────────────────────────────────────────────── */
.mf-ribbon {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.mf-ribbon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.mf-ribbon-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.5);
}
.mf-ribbon-value {
    font-weight: 800;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}
.mf-mult { color: #c7d2fe; }
.mf-mult-live {
    color: #a5f3c4;
    text-shadow: 0 0 18px rgba(110, 231, 183, 0.55);
    animation: mf-mult-bump 0.32s ease-out;
}

/* ── the field ─────────────────────────────────────────────────────── */
.mf-grid {
    display: grid;
    gap: 0.5rem;
    max-width: 30rem;
    margin: 0 auto;
    perspective: 1000px;
}

.mf-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 0.7rem;
    border: none;
    padding: 0;
    transform-style: preserve-3d;
    transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease;
    animation: mf-tile-in 0.34s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.mf-tile-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* hidden, un-dug tile: a raised metallic stud the player can press */
.mf-tile-hidden {
    background: linear-gradient(160deg, #3b3470 0%, #2a2455 55%, #211d45 100%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.22),
        inset 0 -3px 6px rgba(0, 0, 0, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
.mf-tile-hidden:not(:disabled):hover {
    filter: brightness(1.18);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        0 8px 18px rgba(99, 102, 241, 0.4);
}
.mf-tile-hidden:not(:disabled):active { transform: translateY(0) scale(0.96); }
.mf-tile-stud {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 9999px;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.5);
}
.mf-tile:disabled { cursor: default; }

/* revealed gem */
.mf-tile-gem {
    background: linear-gradient(160deg, #064e3b 0%, #065f46 60%, #047857 100%);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(5, 150, 105, 0.3);
    animation: mf-flip 0.4s ease-out both;
}
.mf-gem-icon {
    color: #6ee7b7;
    filter: drop-shadow(0 0 8px rgba(110, 231, 183, 0.7));
    animation: mf-gem-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

/* revealed mine */
.mf-tile-mine {
    background: linear-gradient(160deg, #7f1d1d 0%, #991b1b 60%, #b91c1c 100%);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.4), 0 4px 12px rgba(185, 28, 28, 0.3);
    animation: mf-flip 0.4s ease-out both;
}
.mf-mine-icon { color: #fecaca; }

/* the tile the player actually detonated — bigger glow + a shake */
.mf-tile-boom {
    background: radial-gradient(circle at 50% 45%, #fb923c 0%, #ef4444 45%, #991b1b 100%);
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.7), 0 0 32px rgba(248, 113, 113, 0.85);
    animation: mf-boom-shake 0.5s ease-in-out both;
    z-index: 2;
}
.mf-tile-boom .mf-mine-icon {
    color: #fff;
    animation: mf-boom-pop 0.4s ease-out both;
}

/* auto-revealed-on-settle tiles (not chosen by the player) fade back */
.mf-tile-ghost { opacity: 0.42; filter: saturate(0.7); }

/* (win/loss feedback is the shared GameResultToast — see custom.css `.credify-toast*`) */

/* ── controls ──────────────────────────────────────────────────────── */
.mf-controls { min-height: 5rem; }

.mf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.7rem;
    font-weight: 700;
    border: 1px solid transparent;
    color: #fff;
    transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.2s ease;
}
.mf-btn:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); }
.mf-btn:not(:disabled):active { transform: translateY(0); }
.mf-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.mf-btn-primary { background: var(--color-action-primary, #6366f1); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); }

.mf-btn-cash {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    font-variant-numeric: tabular-nums;
}
.mf-btn-cash-live {
    background: linear-gradient(180deg, #10b981, #047857);
    border-color: rgba(110, 231, 183, 0.5);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    animation: mf-cash-pulse 1.6s ease-in-out infinite;
}

/* chips (bet) */
.mf-chip {
    min-width: 3.2rem;
    padding: 0.45rem 0.6rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    background: radial-gradient(circle at 50% 30%, #4f46e5, #3730a3);
    border: 2px dashed rgba(255, 255, 255, 0.45);
    transition: transform 0.08s ease, filter 0.15s ease;
}
.mf-chip:not(:disabled):hover { filter: brightness(1.12); transform: translateY(-2px); }
.mf-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.mf-chip-max { background: radial-gradient(circle at 50% 30%, #d97706, #92400e); }
.mf-chip-clear { background: radial-gradient(circle at 50% 30%, #4b5563, #1f2937); min-width: 2.6rem; }

/* mines stepper + presets */
.mf-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mf-step {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transition: filter 0.12s ease, transform 0.08s ease;
}
.mf-step:not(:disabled):hover { filter: brightness(1.3); }
.mf-step:not(:disabled):active { transform: scale(0.92); }
.mf-step:disabled { opacity: 0.35; cursor: not-allowed; }
.mf-step-value {
    min-width: 3rem;
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.mf-preset {
    min-width: 2.2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.55rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #c7d2fe;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: filter 0.12s ease, transform 0.08s ease, background 0.15s ease;
}
.mf-preset:not(:disabled):hover { filter: brightness(1.2); transform: translateY(-1px); }
.mf-preset-on { background: var(--color-action-primary, #6366f1); color: #fff; border-color: transparent; }

@media (min-width: 640px) {
    .mf-tile-inner { font-size: 1.9rem; }
    .mf-ribbon-value { font-size: 1.2rem; }
}

}
