/* Slot Machine - Jackpot Machine — visual layer. Layout, animation, effects, responsiveness.
   Game math/logic lives entirely in app.js; this file never encodes it. */

:root {
    --bg-deep: #0b0710;
    --bg-panel: #17101f;
    --frame-dark: #241931;
    --frame-darker: #150e1c;
    --gold-1: #ffe9a8;
    --gold-2: #ffc857;
    --gold-3: #d99a2b;
    --gold-4: #7a5717;
    --text-light: #f6ecd9;
    --text-muted: #b9a98a;
    --win-glow: #fff2b0;
    --danger: #ff5d5d;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --cell-size: clamp(44px, 11vw, 100px);
    --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.65);
    --transition-fast: 150ms ease;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--text-light);
    font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}

body {
    min-height: 100vh;
    padding: 16px;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(255, 200, 87, 0.12), transparent 60%),
        radial-gradient(ellipse at 50% 110%, rgba(122, 20, 60, 0.18), transparent 60%),
        var(--bg-deep);
    display: flex;
    justify-content: center;
}

button {
    font-family: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--gold-2);
    outline-offset: 2px;
}

.game {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------------------------------------------------------------- */
/* Top bar                                                           */
/* ---------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(180deg, var(--frame-dark), var(--frame-darker));
    border: 1px solid rgba(255, 200, 87, 0.25);
    border-radius: var(--radius-md);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 1.6rem;
}

.brand-title {
    margin: 0;
    font-size: clamp(1.3rem, 2.9vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(100deg,
        var(--gold-3) 0%, var(--gold-1) 15%, var(--win-glow) 30%, var(--gold-1) 45%,
        var(--gold-3) 60%, var(--gold-1) 75%, var(--win-glow) 90%, var(--gold-3) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    animation: brand-shine 3.2s linear infinite, brand-pulse 1.8s ease-in-out infinite;
}

/* A fast gold shine sweeps across the letters... */
@keyframes brand-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ...while the whole title breathes — glow and a small scale pulse fading
   in and out together, so it reads as clearly "alive" rather than static. */
@keyframes brand-pulse {
    0%, 100% { opacity: 0.82; filter: drop-shadow(0 0 6px rgba(255, 200, 87, 0.3)); transform: scale(1); }
    50% { opacity: 1; filter: drop-shadow(0 0 22px rgba(255, 200, 87, 0.8)); transform: scale(1.04); }
}

.sparkle {
    display: inline-block;
    font-size: 0.85em;
    filter: drop-shadow(0 0 5px rgba(255, 226, 122, 0.8));
    animation: sparkle-twinkle 1.6s ease-in-out infinite;
}

.sparkle-1 { animation-delay: 0s; }
.sparkle-2 { animation-delay: 0.8s; }

@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.25) rotate(20deg); }
}

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

.select-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.select-group select {
    background: var(--frame-darker);
    color: var(--text-light);
    border: 1px solid rgba(255, 200, 87, 0.35);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 200, 87, 0.35);
    background: var(--frame-darker);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 200, 87, 0.15);
    transform: translateY(-1px);
}

.icon-btn:active {
    transform: translateY(0) scale(0.95);
}

/* ---------------------------------------------------------------- */
/* Machine frame + reels                                             */
/* ---------------------------------------------------------------- */

.machine-frame {
    position: relative;
    padding: clamp(10px, 3vw, 26px);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #2c1e3d, #1a1224 60%);
    border: 3px solid transparent;
    border-image: linear-gradient(135deg, var(--gold-1), var(--gold-4), var(--gold-2)) 1;
    box-shadow: var(--shadow-deep), inset 0 0 40px rgba(255, 200, 87, 0.08);
    animation: idle-glow 5s ease-in-out infinite;
}

@keyframes idle-glow {
    0%, 100% { box-shadow: var(--shadow-deep), inset 0 0 40px rgba(255, 200, 87, 0.08); }
    50% { box-shadow: var(--shadow-deep), inset 0 0 60px rgba(255, 200, 87, 0.18); }
}

.reels-viewport {
    display: flex;
    gap: clamp(4px, 1.2vw, 10px);
    padding: clamp(8px, 2vw, 16px);
    background: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.55));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 200, 87, 0.2);
}

.reel {
    position: relative;
    flex: 1 1 0;
    height: calc(var(--cell-size) * var(--reel-rows, 3));
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.35));
}

.reel::before,
.reel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 30%;
    pointer-events: none;
    z-index: 2;
}

.reel::before {
    top: 0;
    background: linear-gradient(180deg, rgba(11, 7, 16, 0.85), transparent);
}

.reel::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(11, 7, 16, 0.85), transparent);
}

.reel.is-impact {
    animation: reel-impact 260ms ease-out;
}

@keyframes reel-impact {
    0% { transform: translateY(-6px); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0); }
}

.reel-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.reel-track.is-blurred .cell {
    filter: blur(6px);
}

.cell {
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell-size) * 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cell--fruit { background: radial-gradient(circle, rgba(255, 120, 120, 0.08), transparent 70%); }
.cell--classic { background: radial-gradient(circle, rgba(255, 200, 87, 0.1), transparent 70%); }
.cell--premium { background: radial-gradient(circle, rgba(140, 210, 255, 0.12), transparent 70%); }
.cell--special { background: radial-gradient(circle, rgba(255, 90, 200, 0.14), transparent 70%); }
.cell--filler { opacity: 0.35; }

.cell-image {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.cell.is-winning {
    animation: cell-win-pulse 900ms ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes cell-win-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 226, 122, 0); transform: scale(1); background-color: transparent; }
    50% { box-shadow: 0 0 24px 6px rgba(255, 226, 122, 0.55); transform: scale(1.08); background-color: rgba(255, 226, 122, 0.15); }
}

/* Scatter wins aren't on a directional payline, so they get their own
   (pink, matching the special-category cell tint) pulse instead of the
   gold payline one, to stay visually distinguishable. */
.cell.is-winning-scatter {
    animation: cell-win-pulse-scatter 900ms ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes cell-win-pulse-scatter {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 90, 200, 0); transform: scale(1); background-color: transparent; }
    50% { box-shadow: 0 0 24px 6px rgba(255, 90, 200, 0.55); transform: scale(1.08); background-color: rgba(255, 90, 200, 0.18); }
}

/* ---------------------------------------------------------------- */
/* Controls bar                                                      */
/* ---------------------------------------------------------------- */

.controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--frame-dark), var(--frame-darker));
    border: 1px solid rgba(255, 200, 87, 0.25);
    border-radius: var(--radius-md);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 84px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 200, 87, 0.15);
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-1);
    transition: transform var(--transition-fast);
}

.stat-value.is-shaking {
    animation: shake 400ms ease;
    color: var(--danger);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bet-step-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 200, 87, 0.4);
    background: var(--frame-darker);
    color: var(--gold-1);
    font-size: 1.1rem;
    cursor: pointer;
}

.bet-step-btn:disabled,
.max-bet-btn:disabled,
.spin-btn:disabled,
.auto-spin-btn:disabled,
.modal-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.max-bet-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 200, 87, 0.4);
    background: var(--frame-darker);
    color: var(--gold-1);
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.spin-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auto-spin-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 200, 87, 0.4);
    background: var(--frame-darker);
    color: var(--gold-1);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.auto-spin-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.auto-spin-btn.is-active {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #3a2400;
    box-shadow: 0 0 14px rgba(255, 200, 87, 0.6);
    animation: auto-spin-pulse 1.4s ease-in-out infinite;
}

@keyframes auto-spin-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 200, 87, 0.4); }
    50% { box-shadow: 0 0 20px rgba(255, 200, 87, 0.8); }
}

.insufficient-msg {
    position: absolute;
    top: 100%;
    margin: 6px 0 0;
    white-space: nowrap;
    font-size: 0.72rem;
    color: var(--danger);
    text-align: center;
}

.spin-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #3a2400;
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3));
    box-shadow: 0 8px 24px rgba(255, 200, 87, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 200, 87, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.totals-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px;
}

.totals-bar strong {
    color: var(--gold-1);
}

/* ---------------------------------------------------------------- */
/* Stats / debug panel                                               */
/* ---------------------------------------------------------------- */

.stats-panel {
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--frame-dark), var(--frame-darker));
    border: 1px solid rgba(255, 200, 87, 0.25);
    border-radius: var(--radius-md);
}

.stats-panel h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--gold-1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.stats-grid > div {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.stats-grid dt {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stats-grid dd {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-1);
}

.simulation-controls {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.simulation-controls button {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 200, 87, 0.4);
    background: var(--frame-darker);
    color: var(--gold-1);
    cursor: pointer;
}

#simulationOutput {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.75rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* ---------------------------------------------------------------- */
/* Win overlay + particles                                           */
/* ---------------------------------------------------------------- */

.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 3, 8, 0.75);
    z-index: 50;
    cursor: pointer;
}

/* `display: flex` above has the same origin/specificity tier as the
   browser's default `[hidden] { display: none }`, and author rules beat
   user-agent rules regardless of source order — so without this, the
   overlay stayed visible (showing its static placeholder text) even while
   `hidden`. This wins on specificity ([hidden] + .overlay) to actually hide it. */
.overlay[hidden] {
    display: none;
}

.overlay-content {
    text-align: center;
    animation: overlay-pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes overlay-pop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.overlay-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    background: linear-gradient(180deg, var(--win-glow), var(--gold-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 40px rgba(255, 226, 122, 0.6);
}

.overlay-title--jackpot {
    animation: jackpot-flash 600ms ease-in-out infinite;
}

@keyframes jackpot-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

.overlay-amount {
    margin-top: 10px;
    font-size: clamp(1.5rem, 5vw, 2.6rem);
    font-weight: 800;
    color: var(--gold-1);
}

.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--gold-2);
    animation: particle-burst 1100ms ease-out forwards;
    animation-delay: var(--delay, 0s);
}

.particle--jackpot {
    background: none;
    width: auto;
    height: auto;
    font-size: 22px;
    line-height: 1;
    animation-name: coin-particle-burst;
}

@keyframes particle-burst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) rotate(calc(var(--angle) * -1));
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) rotate(calc(var(--angle) * -1));
        opacity: 0;
    }
}

/* Same outward path as particle-burst, plus an unwound spin at the end so
   the coin glyph itself visibly tumbles instead of just flying out flat. */
@keyframes coin-particle-burst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) rotate(calc(var(--angle) * -1)) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) rotate(calc(var(--angle) * -1)) rotate(720deg);
        opacity: 0;
    }
}

.coin-rain {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 51;
}

.coin {
    position: absolute;
    top: -10%;
    font-size: 24px;
    line-height: 1;
    animation-name: coin-fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    filter: drop-shadow(0 0 4px rgba(255, 200, 87, 0.7));
}

@keyframes coin-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(115vh) rotate(900deg); opacity: 0.85; }
}

.jackpot-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(255, 226, 122, 0.35) 45%, transparent 75%);
    pointer-events: none;
    z-index: 70;
    animation: jackpot-flash-fade 650ms ease-out forwards;
}

@keyframes jackpot-flash-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework-burst 900ms ease-out forwards;
}

@keyframes firework-burst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance));
        opacity: 0;
    }
}

/* ---------------------------------------------------------------- */
/* Settings / Rules modals                                           */
/* ---------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    background: rgba(5, 3, 8, 0.75);
    z-index: 60;
    overflow-y: auto;
}

/* Same [hidden]-vs-display lesson as .overlay above: this must win on
   specificity over `.modal { display: flex }` or the modal never hides. */
.modal[hidden] {
    display: none;
}

.modal-panel {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 22px;
    background: linear-gradient(180deg, var(--frame-dark), var(--frame-darker));
    border: 1px solid rgba(255, 200, 87, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-deep);
}

.modal-panel h2 {
    margin: 0 0 14px;
    color: var(--gold-1);
    font-size: 1.2rem;
}

.modal-panel h3 {
    margin: 18px 0 6px;
    color: var(--gold-1);
    font-size: 0.95rem;
}

.modal-panel p {
    margin: 0 0 8px;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
}

.field-row {
    margin-bottom: 12px;
}

.field-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.field-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-input input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    background: var(--frame-darker);
    color: var(--text-light);
    border: 1px solid rgba(255, 200, 87, 0.35);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.info-btn {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 200, 87, 0.35);
    background: var(--frame-darker);
    color: var(--gold-1);
    cursor: pointer;
    font-size: 0.85rem;
}

.field-info {
    margin: 6px 0 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.field-hint {
    margin: 4px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.field-error {
    margin: 4px 0 0;
    font-size: 0.72rem;
    color: var(--danger);
}

.field-input input.is-invalid {
    border-color: var(--danger);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.modal-btn {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid rgba(255, 200, 87, 0.4);
}

.modal-btn--ghost {
    background: transparent;
    color: var(--gold-1);
}

.modal-btn--primary {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3));
    color: #3a2400;
    border: none;
}

.paylines-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 16px;
}

.payline-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
}

.payline-diagram-grid {
    display: grid;
    grid-template-columns: repeat(var(--pl-reels), 8px);
    grid-template-rows: repeat(var(--pl-rows), 8px);
    gap: 2px;
}

.payline-cell {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.payline-cell.is-active {
    background: var(--gold-2);
    box-shadow: 0 0 4px rgba(255, 200, 87, 0.8);
}

.payline-diagram-label {
    font-size: 0.6rem;
    color: var(--text-muted);
}

#rulesScatterPayout,
#rulesPayoutFormula {
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5;
}

.rules-tiers-list {
    margin: 0 0 8px;
    padding-left: 18px;
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.6;
}

.rules-paytable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.rules-paytable th,
.rules-paytable td {
    padding: 6px 8px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 200, 87, 0.15);
    color: var(--text-light);
}

.rules-paytable th:first-child,
.rules-paytable td:first-child {
    text-align: left;
    color: var(--gold-1);
}

.paytable-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
}

.inline-icon {
    width: 1.1em;
    height: 1.1em;
    object-fit: contain;
    vertical-align: text-bottom;
}

/* ---------------------------------------------------------------- */
/* Responsive breakpoints                                            */
/* ---------------------------------------------------------------- */

@media (max-width: 720px) {
    .controls-bar {
        gap: 10px;
    }
    .spin-wrap {
        order: -1;
        width: 100%;
    }
    .spin-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-controls {
        justify-content: space-between;
    }
    .stat-box {
        min-width: 70px;
        padding: 4px 8px;
    }
}

/* ---------------------------------------------------------------- */
/* Accessibility                                                     */
/* ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .machine-frame {
        animation: none;
    }
    .brand-title {
        animation: none;
        background-position: 50% 50%;
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 200, 87, 0.4));
    }
    .sparkle {
        animation: none;
        opacity: 0.8;
        transform: none;
    }
    .reel.is-impact,
    .overlay-content,
    .overlay-title--jackpot,
    .cell.is-winning,
    .cell.is-winning-scatter,
    .particle,
    .coin,
    .firework-particle,
    .auto-spin-btn.is-active {
        animation: none !important;
    }
    .reel-track {
        transition-duration: 1ms !important;
    }
}
