/* ═══════════════════════════════════════════════════════════
   SNAKE & LADDER — Game-Specific Styles
   Shared: buttons, modal system, arena card, rejoin banner, tools grid,
   verdict card, share sheet → game-shared-style.css
   Prefix: .snl-  (har id/class is game ki apni hai)
   ═══════════════════════════════════════════════════════════ */

/* ===== HERO ===== */
.snl-hero { padding-top: 44px; padding-bottom: 8px; text-align: center; }
.snl-title { font-family: 'Playfair Display', serif; font-size: clamp(1.9rem, 5.5vw, 3.6rem); margin-bottom: 10px; line-height: 1.1; }
.snl-subtitle { max-width: 560px; margin: 0 auto; color: var(--text-secondary); font-size: 1rem; line-height: 1.55; }
.snl-credit { margin-top: 8px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.snl-credit b { color: #805423; font-weight: 700; }
@media (max-width: 520px) {
    .snl-hero { padding-top: 24px; padding-bottom: 4px; }
    .snl-title { margin-bottom: 6px; }
    .snl-subtitle { font-size: 0.88rem; }
}
.snl-game-section { padding-top: 18px; padding-bottom: 56px; }

/* ===== CHOICE CARDS (landing) ===== */
.snl-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .snl-choice-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.snl-choice-card {
    background: rgba(139, 92, 246, 0.05); border: 1px solid var(--border-card); border-radius: 16px;
    padding: 24px 14px; text-align: center; cursor: pointer; font-family: inherit; position: relative; overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.snl-choice-card::before { content: ''; position: absolute; inset: 0; background: var(--gradient-primary); opacity: 0; transition: opacity 0.3s ease; z-index: 0; }
.snl-choice-card:hover { border-color: var(--brand-primary-light); transform: translateY(-5px); box-shadow: 0 16px 40px rgba(105,73,132,0.115); }
.snl-choice-card:hover::before { opacity: 0.06; }
.snl-choice-icon, .snl-choice-card h3, .snl-choice-card p { position: relative; z-index: 1; }
.snl-choice-icon { font-size: 2.2rem; display: block; margin-bottom: 10px; filter: drop-shadow(0 4px 12px rgba(105,73,132,0.138)); }
.snl-choice-card h3 { color: var(--text-primary); font-size: 1.02rem; margin: 0 0 6px; font-weight: 600; }
.snl-choice-card p { color: var(--text-secondary); font-size: 0.8rem; margin: 0; line-height: 1.4; }
.snl-landing-extras { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.snl-rules-link {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(116,40,69,0.026); border: 1px solid var(--border-card);
    border-radius: 50px; padding: 9px 18px; color: var(--text-secondary); font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: all 0.2s ease;
}
.snl-rules-link:hover { border-color: var(--brand-primary-light); color: var(--text-primary); background: rgba(139, 92, 246, 0.08); }

/* ===== MODAL APP SHELL ===== */
.snl-modal-wide .zg-modal-content { max-width: 600px; }
.snl-app {
    background: var(--bg-card); background-image: linear-gradient(160deg, rgba(139, 92, 246, 0.06), transparent 60%);
    border: 1px solid var(--border-card); border-radius: 22px; padding: 26px 22px; position: relative; min-height: 260px;
    box-shadow: 0 20px 60px rgba(72,38,55,0.17);
}
.snl-view { display: none; }
.snl-view-active { display: block; animation: snl-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes snl-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.snl-view-title { font-family: 'Playfair Display', serif; color: var(--text-primary); font-size: 1.45rem; margin: 0 0 18px; text-align: center; }
.snl-hint { color: var(--text-secondary); font-size: 0.85rem; margin-top: 12px; text-align: center; }

/* ===== FORM / LOBBY ===== */
.snl-form { display: flex; flex-direction: column; gap: 6px; }
.snl-label { color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 16px; margin-bottom: 6px; font-weight: 600; }
.snl-input {
    background: rgba(116,40,69,0.025); border: 1px solid var(--border-card); border-radius: 12px; padding: 13px 15px;
    color: var(--text-primary); font-size: 1rem; font-family: inherit; outline: none; transition: all 0.25s ease;
}
.snl-input:focus { border-color: var(--brand-primary-light); background: rgba(139, 92, 246, 0.05); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
.snl-input-code { letter-spacing: 0.35em; text-align: center; font-size: 1.4rem; font-weight: 700; text-transform: uppercase; }
.snl-btn-block {
    display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 22px; padding: 15px 24px; border: none; border-radius: 14px;
    background: var(--gradient-primary); color: var(--zx-on-berry); font-family: inherit; font-size: 1rem; font-weight: 700; text-align: center; cursor: pointer;
    box-shadow: 0 8px 24px rgba(105,73,132,0.161), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.snl-btn-block:hover:not(:disabled) { transform: translateY(-3px) scale(1.015); box-shadow: 0 16px 40px rgba(105,73,132,0.17), 0 0 34px rgba(105,73,132,0.17); }
.snl-btn-block:active:not(:disabled) { transform: translateY(-1px) scale(0.99); }
.snl-btn-block:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; background: rgba(116,40,69,0.052); color: var(--text-muted); }
.snl-btn-ghost { background: rgba(116,40,69,0.039); box-shadow: none; color: var(--text-primary); border: 1px solid var(--border-card); }
.snl-error { color: #8e343d; font-size: 0.85rem; margin-top: 10px; min-height: 1.2em; text-align: center; }

.snl-count-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 6px; }
.snl-count-btn {
    width: 58px; height: 58px; border-radius: 16px; border: 1px solid var(--border-card); background: rgba(139, 92, 246, 0.07);
    color: var(--text-primary); font-size: 1.35rem; font-weight: 800; font-family: inherit; cursor: pointer; transition: all 0.2s ease;
}
.snl-count-btn:hover { background: var(--gradient-primary); border-color: transparent; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(105,73,132,0.17); }

.snl-lobby-header { text-align: center; margin-bottom: 22px; }
.snl-lobby-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.snl-room-code {
    font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1); border: 1px solid var(--brand-primary-light); border-radius: 16px; padding: 14px 24px; display: inline-block;
    box-shadow: 0 0 40px rgba(105,73,132,0.092);
}
.snl-room-code-small { font-size: 2.1rem; padding: 10px 18px; }
.snl-qr { display: block; margin: 18px auto 0; border-radius: 12px; border: 1px solid var(--border-card); box-shadow: 0 8px 24px rgba(72,38,55,0.086); }
.snl-players-panel { background: rgba(116,40,69,0.025); border: 1px solid rgba(116,69,88,0.1); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.snl-players-heading { color: var(--text-primary); font-size: 0.95rem; margin: 0 0 12px; font-weight: 600; }
.snl-players-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.snl-players-list li { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 0.9rem; padding: 8px 12px; background: rgba(116,40,69,0.025); border-radius: 10px; }
.snl-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 8px var(--c); }
.snl-host-badge { font-size: 0.68rem; background: var(--gradient-primary); color: var(--zx-on-berry); padding: 3px 10px; border-radius: 50px; margin-left: auto; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   GAME VIEW — board, pawns, controls
   ═══════════════════════════════════════════════════════════ */
.snl-topbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.snl-topbar button {
    font-size: 0.8rem; padding: 7px 13px; border-radius: 50px; border: 1px solid var(--border-card); background: rgba(116,40,69,0.033);
    color: var(--text-secondary); font-family: inherit; cursor: pointer; transition: all 0.2s ease;
}
.snl-topbar button:hover { border-color: var(--brand-primary-light); color: var(--text-primary); }

.snl-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 28px; }
.snl-chip {
    padding: 4px 11px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; color: #111; background: var(--c); opacity: 0.55;
    border: 2px solid transparent; transition: all 0.2s ease; white-space: nowrap;
}
.snl-chip.snl-on { opacity: 1; border-color: #b7acac; box-shadow: 0 0 10px var(--c); transform: scale(1.08); }
.snl-chip.snl-off { filter: grayscale(0.6); }
.snl-level { font-size: 0.78rem; font-weight: 700; margin: 8px 0 2px; min-height: 18px; text-align: center; }

.snl-stage { perspective: 1000px; width: min(100%, 520px); margin: 4px auto 44px; }
.snl-board {
    position: relative; width: 100%; aspect-ratio: 1; transform: rotateX(38deg); transform-style: preserve-3d; background: #f1f0ef; border-radius: 10px;
    box-shadow: 0 14px 0 rgba(72,38,55,0.15), 0 40px 40px rgba(72,38,55,0.17);
}
.snl-cell {
    position: absolute; width: 10%; height: 10%; display: flex; align-items: center; justify-content: center; font-weight: 900;
    font-size: clamp(10px, 3.2vw, 19px); color: #1f2937; background: var(--b); border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 -4px 0 rgba(72,38,55,0.107), inset 0 2px 0 rgba(40,31,37,0.17); transform: translateZ(3px);
}
.snl-cell.snl-blink { animation: snl-blink 0.6s infinite alternate; z-index: 2; color: #000; }
@keyframes snl-blink { from { background: var(--b); } to { background: var(--c); box-shadow: 0 0 16px var(--c), inset 0 0 8px #fff; } }
.snl-ov { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateZ(5px); pointer-events: none; }
.snl-ov .snl-mk { pointer-events: auto; cursor: pointer; fill: #805423; fill-opacity: 0.35; stroke: #cebaac; stroke-width: 0.7; animation: snl-pl 0.6s infinite alternate; }
@keyframes snl-pl { to { fill-opacity: 0.8; } }
.snl-tg { transform-box: fill-box; transform-origin: left center; animation: snl-fl 1.1s infinite; }
@keyframes snl-fl { 0%, 60% { transform: scaleX(1); } 75% { transform: scaleX(0.2); } 90%, 100% { transform: scaleX(1); } }
.snl-tok {
    position: absolute; width: 5.4%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fffc, var(--c) 45%, rgba(40,31,37,0.14));
    border: 1.5px solid #b7acac; box-shadow: 0 9px 6px rgba(72,38,55,0.17); transform: translate(-50%, -50%) translateZ(16px) rotateX(-38deg);
    transition: left 0.22s, top 0.22s; z-index: 5; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; color: #000;
}

.snl-ctrl { width: 100%; display: flex; align-items: center; gap: 10px; }
.snl-status { flex: 1; font-size: 0.9rem; min-height: 40px; color: var(--text-primary); line-height: 1.4; }
.snl-die {
    width: 54px; height: 54px; border-radius: 12px; background: linear-gradient(145deg, #fff, #cbd5e1); color: #111; font-size: 38px; display: flex;
    align-items: center; justify-content: center; box-shadow: 0 6px 0 #64748b, 0 10px 14px rgba(72,38,55,0.17); flex: none;
}
.snl-roll-btn {
    font-size: 1rem; padding: 12px 18px; border: 0; border-radius: 10px; background: #f59e0b; color: #111; font-weight: 800; font-family: inherit;
    box-shadow: 0 4px 0 #b45309; cursor: pointer; flex: none;
}
.snl-roll-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #b45309; }
.snl-roll-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.snl-power { display: none; width: 100%; margin-top: 10px; text-align: center; }
.snl-power-title { font-size: 0.82rem; color: var(--text-secondary); }
.snl-power-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 6px 0; }
.snl-power-grid button { padding: 9px 0; font-size: 0.85rem; background: #fde047; color: #111; border: 0; border-radius: 9px; font-weight: 800; box-shadow: 0 3px 0 #a16207; cursor: pointer; font-family: inherit; }
.snl-power-grid button:disabled { opacity: 0.3; cursor: not-allowed; }
.snl-skip-btn { width: 100%; padding: 10px; background: #94a3b8; color: #111; border: 0; border-radius: 10px; font-weight: 800; box-shadow: 0 3px 0 #64748b; cursor: pointer; font-family: inherit; }

.snl-footnote { font-size: 0.7rem; opacity: 0.65; margin-top: 10px; text-align: center; color: var(--text-secondary); }

/* ===== FINISHED VIEW ===== */
.snl-final-list { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 8px; }
.snl-final-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(116,40,69,0.025); border-radius: 10px; color: var(--text-secondary); font-size: 0.9rem; }
.snl-final-list .snl-final-sq { margin-left: auto; font-weight: 700; color: var(--text-primary); }

/* ===== OVERLAYS INSIDE MODAL (confirm / rules / music / toast) ===== */
.snl-layer { display: none; position: fixed; inset: 0; z-index: 100010; align-items: center; justify-content: center; padding: 20px; background: rgba(242,239,237,0.7); }
.snl-layer.snl-layer-open { display: flex; }
.snl-box { background: #efeeee; border: 1px solid var(--border-card); border-radius: 16px; padding: 20px; max-width: 340px; width: 100%; text-align: center; color: #281f25; display: flex; flex-direction: column; gap: 10px; }
.snl-box-row { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.snl-box button, .snl-rules-box button { font-family: inherit; font-size: 0.95rem; padding: 11px 16px; border: 0; border-radius: 10px; background: #f59e0b; color: #111; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 #b45309; }
.snl-box button.snl-alt, .snl-rules-box button.snl-alt { background: #94a3b8; box-shadow: 0 3px 0 #64748b; }
.snl-box input[type=range] { width: 100%; }
.snl-rules-box { background: #f1efef; border: 1px solid var(--border-card); border-radius: 16px; padding: 20px; max-width: 520px; width: 100%; max-height: 88vh; overflow-y: auto; font-size: 0.9rem; line-height: 1.55; color: #281f25; text-align: left; }
.snl-rules-box h2 { margin: 2px 0 10px; font-family: 'Playfair Display', serif; }
.snl-rules-box h3 { margin: 14px 0 4px; color: #805423; font-size: 0.98rem; }
.snl-rules-box ul { margin: 0; padding-left: 20px; }
.snl-rules-box li { margin: 3px 0; }
.snl-rules-box .snl-alt { width: 100%; margin-top: 16px; }
.snl-toast {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #f1efef; border: 1px solid #cebaac; color: #281f25;
    padding: 9px 14px; border-radius: 12px; font-size: 0.82rem; z-index: 100020; display: none; max-width: 90vw; text-align: center;
}

@media (max-width: 520px) {
    .snl-app { padding: 18px 12px; }
    .snl-room-code { font-size: 2.3rem; padding: 10px 16px; }
    .snl-die { width: 46px; height: 46px; font-size: 32px; }
    .snl-roll-btn { padding: 11px 13px; font-size: 0.92rem; }
    .snl-status { font-size: 0.82rem; }
}
