/*
 * Quick bites: wheel, scratch, drop, pick, hi-lo, dice and keno.
 * Shared deck pieces (.ed-deck, .ed-stake, .ed-go, .ed-chipbtn, .ed-msg) live
 * in ediners.css; this file only styles what sits inside each play view.
 */

/* ---------------------------------------------------------------- shared */

.ed-wh-view,
.ed-sc-view,
.ed-dr-view,
.ed-pk-view,
.ed-hl-view,
.ed-dc-view,
.ed-kn-view {
    position: relative;
    display: grid;
    gap: 16px;
    justify-items: center;
    align-content: center;
    padding: clamp(14px, 3vw, 28px);
    background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--game-accent) 18%, transparent), transparent 70%);
}

.ed-bite-stub {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 4px;
    border-radius: var(--ed-r-sm);
    background: var(--ed-surface-2);
    color: var(--ed-muted);
    font-size: .72rem;
    line-height: 1.2;
    text-align: center;
}

.ed-bite-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ed-bite-pays {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.ed-bite-pays caption {
    padding: 0 0 10px;
    color: var(--ed-muted);
    text-align: left;
}

.ed-bite-pays th,
.ed-bite-pays td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ed-line);
    text-align: left;
    vertical-align: middle;
}

.ed-bite-pays thead th {
    color: var(--ed-muted);
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ----------------------------------------------------------------- wheel */

.ed-wh {
    --wh-size: min(440px, 82vw, calc(100svh - 400px));
}

.ed-wh-dish {
    position: relative;
    width: var(--wh-size);
    aspect-ratio: 1;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55));
}

.ed-wh-rotor {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
    transition: transform 4200ms cubic-bezier(.12, .72, .16, 1);
    will-change: transform;
}

.ed-wh-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ed-wh-crust {
    fill: #c98a4b;
    stroke: #7a4720;
    stroke-width: 4;
}

.ed-wh-slice {
    stroke: rgba(255, 240, 210, .55);
    stroke-width: 2;
}

.ed-wh-slice.is-hit {
    stroke: #fff;
    stroke-width: 6;
}

.ed-wh-label {
    fill: #fff8ec;
    font: 700 19px/1 var(--ed-font-num);
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: rgba(40, 18, 6, .55);
    stroke-width: 3px;
}

.ed-wh-label.is-top {
    fill: #2a1405;
    stroke: rgba(255, 255, 255, .5);
}

.ed-wh-hubring {
    fill: #2a1a10;
    stroke: var(--ed-butter);
    stroke-width: 4;
}

.ed-wh-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    z-index: 2;
    width: 34px;
    height: 42px;
    translate: -50% 0;
    background: var(--ed-butter);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}

.ed-wh-result {
    position: absolute;
    left: 50%;
    bottom: -8px;
    margin: 0;
    translate: -50% 0;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--ed-surface-2);
    color: var(--ed-butter);
    font: 700 1rem/1.4 var(--ed-font-num);
}

.ed-wh-result:empty {
    display: none;
}

.ed-wh-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.ed-wh-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    background: var(--ed-surface-2);
    font-size: .85rem;
}

.ed-wh-legend li::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--slice);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}

.ed-wh-legend b {
    font-family: var(--ed-font-num);
    color: var(--ed-butter);
}

/* --------------------------------------------------------------- scratch */

.ed-sc-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    color: var(--ed-muted);
    font-size: .92rem;
}

.ed-sc-mini {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
}

.ed-sc-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2vw, 14px);
    width: min(420px, 100%);
    padding: clamp(10px, 2.4vw, 18px);
    border-radius: var(--ed-r-lg);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--game-accent) 85%, #000), color-mix(in srgb, var(--game-accent) 45%, #120a18));
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .15);
}

.ed-sc-field {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--ed-r);
    background: #fff9ef;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
    transition: box-shadow 200ms var(--ed-ease), transform 200ms var(--ed-ease);
}

.ed-sc-sym {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
    object-fit: contain;
}

.ed-sc-foil,
.ed-sc-foil-idle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 260ms var(--ed-ease);
}

.ed-sc-foil-idle {
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .0) 0 10px, rgba(255, 255, 255, .22) 10px 16px),
        linear-gradient(135deg, #dcdfe8, #9ca2b6 55%, #e7e9f0);
}

.ed-sc-tap {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
}

.ed-sc-tap:focus-visible {
    outline: 3px solid var(--ed-butter);
    outline-offset: -3px;
}

.ed-sc-field.is-open .ed-sc-foil {
    opacity: 0;
}

.ed-sc-field.is-open .ed-sc-tap {
    pointer-events: none;
    cursor: default;
}

.ed-sc-field.is-match {
    box-shadow: inset 0 0 0 4px var(--ed-butter), 0 0 0 3px rgba(255, 209, 102, .35);
    transform: translateY(-2px);
}

.ed-sc-field.is-boost {
    box-shadow: inset 0 0 0 4px var(--ed-mint);
}

/* ------------------------------------------------------------------ drop */

.ed-dr-board {
    position: relative;
    width: min(620px, 100%, calc((100svh - 450px) * 1.11));
    aspect-ratio: 10 / 9;
    margin-bottom: 8px;
}

.ed-dr-peg {
    position: absolute;
    width: clamp(5px, 1.3%, 9px);
    aspect-ratio: 1;
    border-radius: 50%;
    translate: -50% -50%;
    background: radial-gradient(circle at 35% 30%, #fff, #c9c3dd 60%, #8a83a6);
    box-shadow: 0 0 6px rgba(255, 255, 255, .25);
}

.ed-dr-cups {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(var(--cups), 1fr);
    gap: 3px;
    width: calc(var(--cups) * var(--gap));
    translate: -50% 0;
}

.ed-dr-cup {
    display: grid;
    place-items: center;
    min-height: 30px;
    border-radius: 6px 6px 10px 10px;
    font: 700 clamp(.5rem, 1.7vw, .8rem)/1 var(--ed-font-num);
    color: #1b1026;
}

.ed-dr-cup.t1 { background: #6d6585; color: #f2eefc; }
.ed-dr-cup.t2 { background: #2ee6c5; }
.ed-dr-cup.t3 { background: #ffd166; }
.ed-dr-cup.t4 { background: #ff2d55; color: #fff; }

.ed-dr-cup.is-hit {
    animation: ed-dr-pop 280ms var(--ed-ease);
    box-shadow: 0 0 0 2px #fff, 0 0 18px color-mix(in srgb, var(--game-accent) 70%, transparent);
}

@keyframes ed-dr-pop {
    from { transform: translateY(6px) scale(.95); }
    to { transform: none; }
}

.ed-dr-ball {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: clamp(10px, 3.2%, 18px);
    aspect-ratio: 1;
    border-radius: 50%;
    translate: -50% -50%;
    background: radial-gradient(circle at 35% 30%, #fff, var(--game-accent) 55%, color-mix(in srgb, var(--game-accent) 50%, #000));
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    opacity: 0;
}

.ed-dr-ball.is-live {
    opacity: 1;
}

.ed-dr-recent,
.ed-dc-recent {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ed-dr-recent li {
    min-width: 0;
    min-height: 0;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .74rem;
}

.ed-dr-risk,
.ed-dc-mode {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: var(--ed-surface-2);
}

/* ------------------------------------------------------------------ pick */

.ed-pk-meter,
.ed-dc-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.ed-pk-meter div,
.ed-dc-facts div {
    min-width: 110px;
    padding: 8px 14px;
    border-radius: var(--ed-r);
    background: var(--ed-surface-2);
    text-align: center;
}

.ed-pk-meter dt,
.ed-dc-facts dt {
    color: var(--ed-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ed-pk-meter dd,
.ed-dc-facts dd {
    margin: 2px 0 0;
    font: 700 1.15rem/1.3 var(--ed-font-num);
    color: var(--ed-butter);
}

.ed-pk-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    gap: clamp(6px, 1.6vw, 12px);
    width: min(100%, clamp(260px, calc(100svh - 590px), 500px));
}

.ed-pk-tile {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: var(--ed-r);
    background: linear-gradient(160deg, #e8ebf3, #a5aabd 55%, #6f7489);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .35);
    cursor: pointer;
    transition: transform 160ms var(--ed-ease), opacity 200ms var(--ed-ease);
}

.ed-pk-tile:disabled {
    cursor: default;
}

.ed-pk-tile:not(:disabled):hover {
    transform: translateY(-2px);
}

.ed-pk-tile:not(:disabled):active {
    transform: scale(.96);
}

.ed-pk-tile:focus-visible {
    outline: 3px solid var(--ed-butter);
    outline-offset: 2px;
}

.ed-pk-slot {
    width: 56%;
    height: 14%;
    border-radius: 999px;
    background: linear-gradient(#1d1424, #3d3149);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6);
}

.ed-pk-tile.is-gold {
    background: radial-gradient(circle at 50% 40%, #ffe6a3, #e9a63a);
}

.ed-pk-tile.is-burnt {
    background: radial-gradient(circle at 50% 40%, #5a2a1e, #1b0d0a);
}

.ed-pk-tile.is-dim {
    opacity: .45;
}

.ed-pk-tile.is-shake {
    animation: ed-pk-shake 320ms var(--ed-ease);
}

@keyframes ed-pk-shake {
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

.ed-pk-art {
    width: 86%;
    height: 86%;
    object-fit: contain;
}

/* ----------------------------------------------------------------- hi-lo */

.ed-hl-meter,
.ed-kn-meter {
    margin: 0;
    color: var(--ed-muted);
}

.ed-hl-meter b,
.ed-kn-meter b {
    color: var(--ed-butter);
    font: 700 1.2rem/1 var(--ed-font-num);
}

.ed-hl-plate {
    display: grid;
    place-items: center;
    width: clamp(200px, 46vw, 280px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, #fbfcff 0 58%, #2f63d9 58% 62%, #fbfcff 62% 66%, #2f63d9 66% 69%, #dfe5f3 69%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
}

.ed-hl-card {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(96px, 22vw, 136px);
    aspect-ratio: 5 / 7;
    border-radius: 12px;
    background: #fff;
    color: #17121f;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(0, 0, 0, .1);
    font-family: var(--ed-font-head);
}

.ed-hl-card.is-red {
    color: #d3123a;
}

.ed-hl-card.is-deal {
    animation: ed-hl-deal 240ms var(--ed-ease);
}

@keyframes ed-hl-deal {
    from { opacity: 0; transform: translateY(-14px) scale(.95); }
    to { opacity: 1; transform: none; }
}

.ed-hl-corner {
    position: absolute;
    top: 8px;
    left: 9px;
    display: grid;
    justify-items: center;
    font-weight: 800;
    font-size: clamp(.9rem, 2.6vw, 1.25rem);
    line-height: 1;
}

.ed-hl-corner.is-flip {
    top: auto;
    left: auto;
    right: 9px;
    bottom: 8px;
    transform: rotate(180deg);
}

.ed-hl-pip {
    width: .9em;
    height: .9em;
    fill: currentColor;
}

.ed-hl-face {
    width: 46%;
    height: 46%;
    fill: currentColor;
}

.ed-hl-trail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 62px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ed-hl-card.is-small {
    width: 42px;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}

.ed-hl-card.is-small .ed-hl-corner {
    top: 4px;
    left: 5px;
    font-size: .72rem;
}

.ed-hl-card.is-small .ed-hl-corner.is-flip {
    display: none;
}

.ed-hl-calls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ------------------------------------------------------------------ dice */

.ed-dc-result {
    display: block;
    color: var(--ed-ink);
    font: 800 clamp(2.6rem, 9vw, 4.2rem)/1 var(--ed-font-num);
    letter-spacing: -.02em;
}

.ed-dc-track {
    --t: 50%;
    position: relative;
    width: min(560px, 100%);
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ed-mint) 0 var(--t), var(--ed-cherry) var(--t) 100%);
}

.ed-dc-track[data-mode="over"] {
    background: linear-gradient(90deg, var(--ed-cherry) 0 var(--t), var(--ed-mint) var(--t) 100%);
}

.ed-dc-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}

.ed-dc-marker {
    --x: 0%;
    position: absolute;
    inset: -8px 0;
    transform: translateX(var(--x));
    transition: transform 280ms var(--ed-ease);
    pointer-events: none;
}

.ed-dc-marker::before {
    content: "";
    position: absolute;
    top: 0;
    left: -3px;
    width: 6px;
    height: 100%;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(15, 11, 26, .6);
}

.ed-dc-slider {
    width: min(560px, 100%);
    accent-color: var(--game-accent);
}

.ed-dc-recent li {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--ed-surface-2);
    color: var(--ed-muted);
    font: 600 .78rem/1.2 var(--ed-font-num);
}

.ed-dc-recent li.is-won {
    color: #10221d;
    background: var(--ed-mint);
}

/* ------------------------------------------------------------------ keno */

.ed-kn-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 230px);
    gap: 16px;
    width: 100%;
    align-items: start;
}

.ed-kn-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: clamp(4px, 1.1vw, 8px);
}

.ed-kn-num {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--ed-line);
    border-radius: 50%;
    background: var(--ed-surface-2);
    color: var(--ed-ink);
    font: 700 clamp(.72rem, 2.2vw, 1rem)/1 var(--ed-font-num);
    cursor: pointer;
    transition: transform 140ms var(--ed-ease), background-color 160ms var(--ed-ease);
}

.ed-kn-num:hover {
    transform: translateY(-1px);
}

.ed-kn-num:active {
    transform: scale(.94);
}

.ed-kn-num:focus-visible {
    outline: 3px solid var(--ed-butter);
    outline-offset: 2px;
}

.ed-kn-num.is-picked {
    background: var(--game-accent);
    border-color: transparent;
    color: #0f1a15;
}

.ed-kn-num.is-drawn {
    box-shadow: inset 0 0 0 3px var(--ed-ink);
}

.ed-kn-num.is-hit {
    background: var(--ed-butter);
    color: #241606;
    box-shadow: inset 0 0 0 3px #fff, 0 0 14px rgba(255, 209, 102, .6);
}

.ed-kn-pays {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 10px;
    border-radius: var(--ed-r);
    background: var(--ed-surface-2);
    list-style: none;
    font-size: .88rem;
}

.ed-kn-pays li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 8px;
    border-radius: var(--ed-r-sm);
}

.ed-kn-pays li.is-hit {
    background: var(--ed-butter);
    color: #241606;
}

.ed-kn-pays li.is-empty {
    color: var(--ed-muted);
}

.ed-kn-pays b {
    font-family: var(--ed-font-num);
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 640px) {
    .ed-kn-split {
        grid-template-columns: 1fr;
    }

    .ed-hl-calls {
        width: 100%;
    }

    .ed-hl-calls .ed-chipbtn {
        flex: 1 1 calc(50% - 8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ed-wh-rotor,
    .ed-dc-marker,
    .ed-sc-field,
    .ed-sc-foil,
    .ed-pk-tile,
    .ed-kn-num {
        transition: none;
    }

    .ed-dr-cup.is-hit,
    .ed-pk-tile.is-shake,
    .ed-hl-card.is-deal {
        animation: none;
    }
}
