/* Ediners — five-reel mains and three-reel classics. Shared deck styles live in ediners.css. */

/* ---------- five-reel mains ---------- */

.ed-reel-view {
    position: relative;
    display: grid;
    gap: 12px;
    padding: clamp(10px, 2.4vw, 22px);
    border-radius: var(--ed-r-lg);
    background:
        linear-gradient(180deg, rgba(15, 11, 26, .55), rgba(15, 11, 26, .88)),
        var(--stage, none) center / cover no-repeat,
        var(--ed-surface);
    isolation: isolate;
}

.ed-reel-view.is-bonus {
    box-shadow: 0 0 0 2px var(--game-accent, var(--ed-cherry)), 0 0 42px -8px var(--game-accent, var(--ed-cherry));
}

.ed-reel-frame {
    position: relative;
    width: 100%;
    max-width: clamp(320px, calc((100svh - 560px) * 1.67), 780px);
    margin: 0 auto;
    padding: clamp(5px, 1vw, 9px);
    border-radius: calc(var(--ed-r) + 6px);
    background: linear-gradient(160deg, #f4f6fb 0%, #8d93a6 22%, #e9ecf3 45%, #6c7286 70%, #d6dae4 100%);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .7);
}

.ed-reel-window {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    border-radius: var(--ed-r);
    background: #0b0814;
}

.ed-reel-col {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 18%, transparent 82%, rgba(0, 0, 0, .45)),
        linear-gradient(180deg, #1f1830, #171125);
}

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

.ed-reel-cell {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    width: 100%;
}

.ed-reel-cell img {
    width: 84%;
    height: 84%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
    user-select: none;
    -webkit-user-drag: none;
}

.ed-reel-tile,
.ed-cl-tile {
    display: grid;
    place-items: center;
    width: 76%;
    aspect-ratio: 1;
    border-radius: 18%;
    background: linear-gradient(150deg, hsl(var(--tile-h) 85% 62%), hsl(var(--tile-h) 70% 38%));
    color: #fff;
    font: 800 clamp(.6rem, 1.6vw, .95rem) / 1 var(--ed-font-head);
    letter-spacing: .04em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.ed-reel-cell.is-hit img,
.ed-reel-cell.is-hit .ed-reel-tile {
    animation: ed-reel-pulse .9s var(--ed-ease) infinite alternate;
}

.ed-reel-cell.is-hit::after {
    content: "";
    position: absolute;
    inset: 4%;
    border-radius: 16%;
    box-shadow: inset 0 0 0 2px var(--game-accent, var(--ed-butter)), 0 0 18px -4px var(--game-accent, var(--ed-butter));
    pointer-events: none;
}

@keyframes ed-reel-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.ed-reel-pins {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    pointer-events: none;
}

.ed-reel-pin {
    display: grid;
    place-items: center;
}

.ed-reel-cell.is-pinned {
    height: 100%;
    background: radial-gradient(circle, rgba(46, 230, 197, .28), rgba(15, 11, 26, .92) 70%);
}

.ed-reel-col::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    box-shadow: inset 0 0 0 2px var(--game-accent, var(--ed-cherry)), inset 0 0 40px -6px var(--game-accent, var(--ed-cherry));
    opacity: 0;
    pointer-events: none;
}

.ed-reel-col.is-expanding::before {
    animation: ed-reel-fade .3s var(--ed-ease) both;
}

.ed-reel-col.is-expanding .ed-reel-cell {
    animation: ed-reel-in .34s var(--ed-ease) both;
}

.ed-reel-col.is-expanding .ed-reel-cell:nth-child(2) { animation-delay: 60ms; }
.ed-reel-col.is-expanding .ed-reel-cell:nth-child(3) { animation-delay: 120ms; }

@keyframes ed-reel-in {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

.ed-reel-lines,
.ed-cl-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ed-reel-path,
.ed-cl-path {
    fill: none;
    stroke: var(--game-accent, var(--ed-butter));
    stroke-width: 5px;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: .9;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, .7));
    animation: ed-reel-fade .25s var(--ed-ease) both;
}

@keyframes ed-reel-fade {
    from { opacity: 0; }
    to { opacity: .9; }
}

.ed-reel-win {
    position: absolute;
    left: 50%;
    bottom: 10%;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(15, 11, 26, .86);
    box-shadow: 0 0 0 2px var(--ed-butter), 0 10px 30px -8px rgba(0, 0, 0, .8);
    color: var(--ed-butter);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 8px) scale(.95);
    transition: opacity .2s var(--ed-ease), transform .2s var(--ed-ease);
}

.ed-reel-win.is-on {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.ed-reel-win__label {
    font: 700 .78rem / 1 var(--ed-font-head);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ed-reel-win__num {
    font: 800 clamp(1.2rem, 3.4vw, 1.9rem) / 1 var(--ed-font-num);
    font-variant-numeric: tabular-nums;
}

.ed-reel-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 14px;
    justify-self: center;
    border-radius: 999px;
    background: rgba(15, 11, 26, .8);
    border: 1px solid var(--game-accent, var(--ed-cherry));
    color: var(--ed-ink);
    font: 700 .82rem / 1.2 var(--ed-font-head);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ed-reel-hud[hidden] { display: none; }

.ed-reel-hud__n {
    min-width: 2ch;
    color: var(--ed-butter);
    font: 800 1.1rem / 1 var(--ed-font-num);
    font-variant-numeric: tabular-nums;
}

.ed-reel-hud__mult {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--game-accent, var(--ed-cherry));
    color: #0f0b1a;
    font-weight: 800;
}

.ed-reel-hud__mult[hidden] { display: none; }

/* pays tables (both engines) */

.ed-reel-paysbox,
.ed-cl-paysbox {
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--ed-r);
    background: var(--ed-surface-2);
    border: 1px solid var(--ed-line);
    overflow-x: auto;
}

.ed-reel-paysbox[hidden],
.ed-cl-paysbox[hidden] { display: none; }

.ed-reel-pt table,
.ed-cl-pt table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.ed-reel-pt caption,
.ed-cl-pt caption {
    caption-side: top;
    padding-bottom: 10px;
    text-align: left;
    color: var(--ed-muted);
    font-size: .88rem;
}

.ed-reel-pt th,
.ed-reel-pt td,
.ed-cl-pt th,
.ed-cl-pt td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--ed-line);
    text-align: center;
}

.ed-reel-pt thead th,
.ed-cl-pt thead th {
    color: var(--ed-muted);
    font: 700 .78rem / 1 var(--ed-font-head);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ed-cl-pt td { text-align: left; }

.ed-reel-pt-sym,
.ed-cl-pt-sym {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto;
}

.ed-reel-pt-sym img,
.ed-cl-pt-sym img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ed-reel-pt-note {
    display: block;
    margin-top: 4px;
    color: var(--ed-mint);
    font: 700 .68rem / 1.2 var(--ed-font-head);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ed-reel-pt-sym .ed-reel-tile,
.ed-cl-pt-sym .ed-cl-tile { width: 100%; font-size: .6rem; }

/* ---------- three-reel classics ---------- */

.ed-cl-view {
    display: grid;
    place-items: center;
    padding: clamp(10px, 2.4vw, 24px);
    border-radius: var(--ed-r-lg);
    background:
        linear-gradient(180deg, rgba(15, 11, 26, .5), rgba(15, 11, 26, .9)),
        var(--stage, none) center / cover no-repeat,
        var(--ed-surface);
}

.ed-cl-machine {
    width: min(100%, 560px, calc((100svh - 300px) * .86));
    padding: clamp(10px, 2vw, 18px);
    border-radius: 28px 28px var(--ed-r-lg) var(--ed-r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 30%),
        var(--game-accent, var(--ed-cherry));
    box-shadow:
        0 0 0 4px #d9dde6,
        0 0 0 6px #6c7286,
        0 24px 50px -20px rgba(0, 0, 0, .85),
        inset 0 2px 0 rgba(255, 255, 255, .35);
}

.ed-cl-plate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f6f7fb, #a7adbd);
    color: #1a1428;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
}

.ed-cl-plate__name {
    overflow: hidden;
    font: 800 clamp(.82rem, 2.4vw, 1.05rem) / 1.1 var(--ed-font-head);
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ed-cl-win {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: #120d1f;
    color: #ffd166;
    font: 700 .82rem / 1.1 var(--ed-font-num);
    font-variant-numeric: tabular-nums;
}

.ed-cl-plate.is-win .ed-cl-win {
    box-shadow: 0 0 0 2px var(--ed-butter), 0 0 16px -2px var(--ed-butter);
}

.ed-cl-bezel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(4px, 1.2vw, 10px);
    padding: clamp(6px, 1.4vw, 10px);
    border-radius: var(--ed-r);
    background: linear-gradient(160deg, #f4f6fb, #858b9f 30%, #e4e7ef 55%, #6c7286 80%, #cfd3dd);
}

.ed-cl-window {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: calc(var(--ed-r) - 4px);
    background: #0b0814;
}

.ed-cl-col {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #d9d4c8, #fffaf0 45%, #fffaf0 55%, #cfc9bc);
}

.ed-cl-col::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 22%, transparent 78%, rgba(0, 0, 0, .35));
    pointer-events: none;
}

.ed-cl-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.ed-cl-cell {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    width: 100%;
}

.ed-cl-cell img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
    user-select: none;
    -webkit-user-drag: none;
}

.ed-cl-blank {
    width: 34%;
    height: 3px;
    border-radius: 2px;
    background: rgba(26, 20, 40, .18);
}

.ed-cl-cell.is-hit img,
.ed-cl-cell.is-hit .ed-cl-tile {
    animation: ed-reel-pulse .9s var(--ed-ease) infinite alternate;
}

.ed-cl-cell.is-hit::after {
    content: "";
    position: absolute;
    inset: 5%;
    border-radius: 14%;
    box-shadow: inset 0 0 0 3px var(--ed-cherry);
}

.ed-cl-lamps {
    display: grid;
    gap: clamp(3px, 1vw, 8px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ed-cl-lamps li {
    display: grid;
    place-items: center;
    width: clamp(18px, 4vw, 26px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: #3b3350;
    color: #c9c2dd;
    font: 800 clamp(.6rem, 1.6vw, .75rem) / 1 var(--ed-font-num);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35);
}

.ed-cl-lamps li.is-on {
    background: var(--ed-butter);
    color: #1a1428;
    box-shadow: 0 0 12px var(--ed-butter);
}

.ed-cl-path { stroke: var(--ed-cherry); stroke-width: 4px; }

@media (prefers-reduced-motion: reduce) {
    .ed-reel-cell.is-hit img,
    .ed-reel-cell.is-hit .ed-reel-tile,
    .ed-cl-cell.is-hit img,
    .ed-cl-cell.is-hit .ed-cl-tile,
    .ed-reel-col.is-expanding::before,
    .ed-reel-col.is-expanding .ed-reel-cell,
    .ed-reel-path,
    .ed-cl-path {
        animation: none;
    }

    .ed-reel-win { transition: none; }
}
