/* Pufferfish Hunt: square canvas sea, overlay cards, touch d-pad. */

.sn-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16.5rem;
    gap: clamp(1rem, 3vw, 1.75rem);
    align-items: start;
}

.sn-main { display: grid; gap: 1rem; justify-items: center; min-width: 0; }

.sn-stage {
    position: relative;
    width: min(100%, 34rem);
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #0b3f6b;
    box-shadow: 0 0 0 4px #0d2f52, 0 22px 40px -20px rgba(4, 20, 45, 0.85);
}
.sn-stage canvas {
    display: block;
    touch-action: none;
    outline: none;
}
.sn-stage canvas:focus-visible { box-shadow: inset 0 0 0 3px #7dd3fc; }

.sn-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(4, 22, 44, 0.55);
    backdrop-filter: blur(2px);
    animation: sn-in 0.2s ease-out;
}
@keyframes sn-in { from { opacity: 0; } }

.sn-card {
    width: min(100%, 20rem);
    padding: 1.4rem 1.3rem 1.2rem;
    border-radius: 1.1rem;
    text-align: center;
    color: #eaf6ff;
    background: linear-gradient(160deg, rgba(20, 86, 140, 0.92), rgba(10, 46, 88, 0.95));
    border: 1px solid rgba(125, 211, 252, 0.35);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
}
.sn-card-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 0.5rem; }
.sn-card-title {
    font-family: var(--gm-head);
    font-weight: 800;
    font-size: 1.35rem;
    margin: 0 0 0.4rem !important;
}
.sn-card-body { color: #bfe3fb; line-height: 1.55; margin: 0 0 1rem !important; }
.sn-card-body strong { color: #fff; }
.sn-best-tag {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #fcd34d;
    color: #4a3200;
    font-weight: 800;
    font-size: 0.85rem;
}

/* ---------- d-pad (touch screens) ---------- */
.sn-pad {
    display: none;
    grid-template-columns: repeat(3, 3.6rem);
    grid-template-rows: repeat(2, 3.6rem);
    gap: 0.45rem;
    justify-content: center;
}
.sn-pad button {
    display: grid;
    place-items: center;
    border: 1px solid var(--gm-line);
    border-radius: 1rem;
    background: var(--gm-card);
    color: var(--gm-ink);
    box-shadow: 0 4px 0 var(--gm-line);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sn-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gm-line); }
.sn-pad svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sn-pad-up { grid-column: 2; grid-row: 1; }
.sn-pad-left { grid-column: 1; grid-row: 2; }
.sn-pad-down { grid-column: 2; grid-row: 2; }
.sn-pad-right { grid-column: 3; grid-row: 2; }
html.gm-touch .sn-pad { display: grid; }

/* ---------- side ---------- */
.sn-side { display: grid; gap: 0.8rem; min-width: 0; }
.sn-side .gm-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.sn-side .gm-stat { min-width: 0; text-align: center; }
.sn-option { display: grid; gap: 0.35rem; }
.sn-option-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gm-muted);
}
.sn-option .gm-seg { display: flex; }
.sn-option .gm-seg button { flex: 1; }
.sn-option .gm-seg button:disabled { cursor: not-allowed; opacity: 0.6; }

@media (max-width: 860px) {
    .sn-layout { grid-template-columns: minmax(0, 1fr); }
    .sn-side { width: min(100%, 34rem); justify-self: center; }
}

/* full screen: the sea takes the free height, leaving room for the touch buttons */
.gm.is-full .sn-stage { width: min(100%, var(--gm-h)); }
html.gm-touch .gm.is-full .sn-stage { width: min(100%, calc(var(--gm-h) - 8.5rem)); }
