/* Five-reel game board (engine "reels"): glossy soda-bar reels on a grape-cola well. */

.dgs-reels-head {
    display: flex;
    justify-content: center;
    min-height: 2.1rem;
    margin-bottom: 10px;
}

.dgs-reels-meta,
.dgs-reels-counter {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35em 0.9em;
    margin: 0;
    padding: 0.4em 1em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--dgs-on-night, #fff4e6);
    font: 600 clamp(0.75rem, 2.4vw, 0.9rem) / 1.25 var(--dgs-body, system-ui, sans-serif);
    text-align: center;
}

.dgs-reels-meta[hidden],
.dgs-reels-counter[hidden] {
    display: none;
}

.dgs-reels-meta-bet {
    color: #ffd23f;
}

.dgs-reels-counter {
    background: linear-gradient(135deg, rgba(255, 138, 0, 0.35), rgba(208, 16, 58, 0.35));
    border-color: rgba(255, 210, 63, 0.5);
    font-variant-numeric: tabular-nums;
}

/* The frame: a candy-coloured rim in the game's tone around the reel window. */
.dgs-reels-frame {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(5px, 1.4vw, 12px);
    border-radius: calc(var(--dgs-radius, 18px) + 4px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 38%),
        linear-gradient(140deg, var(--tone, #d0103a), var(--dgs-grape, #7b2ff7));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}

.dgs-reels-frame::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.85), 0 0 32px rgba(255, 210, 63, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease-out;
}

.dgs-reels-frame.is-glad::after {
    opacity: 1;
}

.dgs-reels-frame.is-bonus {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 38%),
        linear-gradient(140deg, var(--dgs-sun, #ff8a00), var(--dgs-acc, #d0103a) 55%, var(--dgs-grape, #7b2ff7));
}

/* The window holds one column per reel; each column clips a moving band of tiles. */
.dgs-reels-window {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
    gap: clamp(3px, 0.9vw, 8px);
    padding: clamp(4px, 1vw, 10px);
    border-radius: var(--dgs-radius, 18px);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.10) 0 3px, transparent 4px),
        radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.08) 0 5px, transparent 6px),
        radial-gradient(circle at 46% 90%, rgba(255, 255, 255, 0.07) 0 2px, transparent 3px),
        radial-gradient(120% 90% at 50% 0%, var(--dgs-night-2, #2d1450), var(--dgs-night, #1e0b33));
    background-size: 90px 90px, 130px 130px, 70px 70px, auto;
}

.dgs-reels-reel {
    position: relative;
    aspect-ratio: 1 / 3;
    overflow: hidden;
    border-radius: 12px;
    container-type: inline-size;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03) 45%, rgba(0, 0, 0, 0.16));
}

/* Glass highlight and bottom shade over the reel, above the tiles. */
.dgs-reels-reel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(30, 11, 51, 0.55), transparent 9%, transparent 91%, rgba(30, 11, 51, 0.55)),
        linear-gradient(100deg, rgba(255, 255, 255, 0.10) 0 18%, transparent 19%);
}

.dgs-reels-band {
    position: absolute;
    inset: 0 0 auto;
    will-change: transform;
}

.dgs-reels-tile {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 5%;
    transition: opacity 0.2s ease-out;
}

.dgs-reels-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
    user-select: none;
}

/* The symbol name sits under the image and becomes the fallback when art is missing. */
.dgs-reels-name {
    position: absolute;
    inset: 7%;
    display: grid;
    place-items: center;
    padding: 6%;
    border-radius: 22%;
    color: #fff;
    font: 800 clamp(8px, 13cqi, 15px) / 1.1 var(--dgs-display, system-ui, sans-serif);
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    opacity: 0;
}

.dgs-reels-tile.is-bare .dgs-reels-img {
    display: none;
}

.dgs-reels-tile.is-bare .dgs-reels-name {
    opacity: 1;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}

.dgs-reels-tile--h.is-bare .dgs-reels-name { background: linear-gradient(160deg, #ff5c8a, var(--dgs-acc, #d0103a)); }
.dgs-reels-tile--l.is-bare .dgs-reels-name { background: linear-gradient(160deg, #3ddcff, var(--dgs-sky, #1a9be0)); }
.dgs-reels-tile--wild.is-bare .dgs-reels-name { background: linear-gradient(160deg, #ffe066, var(--dgs-sun, #ff8a00)); color: #3a1600; text-shadow: none; }
.dgs-reels-tile--scatter.is-bare .dgs-reels-name { background: linear-gradient(160deg, #b8ff6b, var(--dgs-lime, #7cc520)); color: #173300; text-shadow: none; }

/* Winning cells: a bright ring; the other cells step back while wins are shown. */
.dgs-reels-tile.is-hit::before {
    content: "";
    position: absolute;
    inset: 4%;
    border-radius: 20%;
    background: radial-gradient(circle, rgba(255, 210, 63, 0.28), rgba(255, 210, 63, 0) 70%);
    box-shadow: inset 0 0 0 3px #ffd23f;
}

.dgs-reels-window.has-wins .dgs-reels-tile:not(.is-hit) {
    opacity: 0.42;
}

.dgs-reels-frame.is-glad .dgs-reels-tile.is-hit .dgs-reels-img {
    animation: dgs-reels-pop 0.28s ease-out;
}

@keyframes dgs-reels-pop {
    from { transform: scale(0.94); }
    to { transform: scale(1); }
}

/* Line overlay drawn in pixels by the engine. */
.dgs-reels-lines {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.dgs-reels-path {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.88;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

.dgs-reels-badge text {
    fill: var(--dgs-night, #1e0b33);
    font-family: var(--dgs-display, system-ui, sans-serif);
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

.dgs-reels-badge circle {
    stroke: rgba(30, 11, 51, 0.7);
    stroke-width: 2;
}

/* "Bonus spins" announcement over the reels. */
.dgs-reels-flash {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-content: center;
    gap: 0.3em;
    text-align: center;
    border-radius: inherit;
    background: radial-gradient(farthest-side, rgba(30, 11, 51, 0.94), rgba(30, 11, 51, 0.8));
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.26s ease-out, transform 0.26s ease-out;
    pointer-events: none;
}

.dgs-reels-flash.is-on {
    opacity: 1;
    transform: scale(1);
}

.dgs-reels-flash-title {
    color: #ffd23f;
    font: 900 clamp(1.6rem, 7vw, 3.2rem) / 1 var(--dgs-display, system-ui, sans-serif);
    text-shadow: 0 3px 0 var(--dgs-acc, #d0103a), 0 6px 18px rgba(0, 0, 0, 0.5);
}

.dgs-reels-flash-line {
    color: var(--dgs-on-night, #fff4e6);
    font: 600 clamp(0.85rem, 2.6vw, 1.1rem) / 1.3 var(--dgs-body, system-ui, sans-serif);
}

/* Wins of the last spin: one chip per line, coloured like its line. */
.dgs-reels-wins {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 2rem;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.dgs-reels-win {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.3em 0.75em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--dgs-on-night, #fff4e6);
    font: 500 clamp(0.72rem, 2.3vw, 0.85rem) / 1.2 var(--dgs-body, system-ui, sans-serif);
}

.dgs-reels-win::before {
    content: "";
    width: 0.7em;
    height: 0.7em;
    border-radius: 50%;
    background: var(--hue, #ffd23f);
}

.dgs-reels-win--scatter::before {
    background: var(--dgs-lime, #7cc520);
}

.dgs-reels-win--note::before {
    display: none;
}

.dgs-reels-win-line {
    font-weight: 800;
}

.dgs-reels-win-amt {
    color: #ffd23f;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .dgs-reels-tile,
    .dgs-reels-flash,
    .dgs-reels-frame::after {
        transition: none;
    }

    .dgs-reels-frame.is-glad .dgs-reels-tile.is-hit .dgs-reels-img {
        animation: none;
    }
}
