/* ==========================================================================
   Emisgame Reels — slot player dialog
   Skin variables come from JS per title: --rx-a (accent), --rx-b (glow),
   --rx-bg (stage tint), --rx-art (cover art), --rx-rows (grid height).
   Modifiers: layout (left/right/top), frame (gilded/neon/glass/carved/ribbon),
   symbol shape (soft/coin/hex/gem).
   ========================================================================== */

dialog.em-dialog.em-player {
  position: fixed; inset: 0; margin: auto; padding: 0;
  width: min(1180px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100dvh - 24px); overflow: auto;
  border: 0; border-radius: 28px; background: transparent; color: #fff;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
}
dialog.em-dialog.em-player::backdrop { background: rgba(0, 6, 14, .82); backdrop-filter: blur(6px); }
.em-player__close {
  position: absolute; top: 14px; right: 14px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 10, 20, .6); color: #fff; font-size: 1.5rem; line-height: 1;
  transition: background-color .2s, transform .2s;
}
.em-player__close:hover { background: var(--em-yellow); color: var(--em-on-yellow); transform: rotate(90deg); }

/* ---------- Cabinet shell ---------- */
.em-rx {
  --rx-ink: #fff;
  --rx-soft: rgba(255, 255, 255, .7);
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: clamp(14px, 1.6vw, 22px); padding: clamp(16px, 2vw, 28px);
  border-radius: 28px; border: 1px solid color-mix(in srgb, var(--rx-a) 45%, transparent);
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--rx-b) 28%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--rx-bg) 88%, #000) 0%, #02070f 100%);
}
.em-rx::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16;
  background: var(--rx-art) center / cover no-repeat; filter: blur(18px) saturate(1.3); transform: scale(1.15);
}
.em-rx--rows-4 { --rx-max: 560px; }
.em-rx--top { --rx-max: 560px; }
.em-rx--top.em-rx--rows-4 { --rx-max: 420px; }

/* ---------- Header ---------- */
.em-rx__top { display: flex; align-items: center; gap: 16px; padding-right: 56px; }
.em-rx__thumb { width: 56px; height: 70px; object-fit: cover; border-radius: 12px; border: 2px solid var(--rx-a); box-shadow: 0 0 18px color-mix(in srgb, var(--rx-a) 50%, transparent); }
.em-rx__origin { color: var(--rx-a); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.em-rx__title { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.2rem); font-weight: 800; line-height: 1.1; color: #fff; }
.em-rx__feat { font-size: .88rem; color: var(--rx-soft); margin-top: 2px; }

/* ---------- Stage layouts ---------- */
.em-rx__stage { display: grid; gap: clamp(14px, 1.6vw, 22px); align-items: stretch; }
.em-rx--left .em-rx__stage { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); }
.em-rx--right .em-rx__stage { grid-template-columns: minmax(0, 1fr) minmax(220px, 260px); }
.em-rx--right .em-rx__side { order: 2; }
.em-rx--top .em-rx__stage { grid-template-columns: 1fr; }
.em-rx--top .em-rx__side { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 14px; }
.em-rx--top .em-rx__hero { display: flex; align-items: center; gap: 12px; }
.em-rx--top .em-rx__hero img { width: 72px; aspect-ratio: 4 / 5; }

/* ---------- Side panel ---------- */
.em-rx__side { display: grid; gap: 12px; align-content: start; }
.em-rx__side > * {
  border-radius: 18px; padding: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.em-rx__hero { margin: 0; display: grid; gap: 10px; }
.em-rx__hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 25%; border-radius: 12px; }
.em-rx__hero strong { display: block; color: var(--rx-a); font-size: .95rem; }
.em-rx__hero span { display: block; font-size: .8rem; line-height: 1.4; color: var(--rx-soft); }
.em-rx__meter { display: flex; align-items: center; gap: 12px; }
.em-rx__meter svg { width: 64px; height: 64px; flex: 0 0 auto; transform: rotate(-90deg); }
.em-rx__ring-bg, .em-rx__ring { fill: none; stroke-width: 7; }
.em-rx__ring-bg { stroke: rgba(255, 255, 255, .1); }
.em-rx__ring { stroke: var(--rx-a); stroke-linecap: round; transition: stroke-dashoffset .6s var(--em-ease); filter: drop-shadow(0 0 6px var(--rx-a)); }
.em-rx__meter-txt { display: grid; gap: 2px; font-size: .78rem; color: var(--rx-soft); }
.em-rx__meter-txt span { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.em-rx__meter-txt strong { color: #fff; font-size: 1.05rem; }
.em-rx__meter-txt em { font-style: normal; color: var(--rx-b); font-weight: 700; }
.em-rx__pay p { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rx-soft); font-weight: 700; margin-bottom: 8px; }
.em-rx__pay ul { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.em-rx__pay li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; font-size: .84rem; }
.em-rx__pay__icon, .em-rx__pay-icon { font-size: 1.1rem; }
.em-rx__pay li strong { color: var(--rx-a); font-variant-numeric: tabular-nums; }
.em-rx__pay-name, .em-rx__pay li span:nth-child(2) { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Reel window + frames ---------- */
.em-rx__main { display: grid; gap: 10px; align-content: center; min-width: 0; }
.em-rx__frame { position: relative; width: 100%; max-width: var(--rx-max, 760px); margin-inline: auto; padding: clamp(8px, 1vw, 14px); border-radius: 24px; }
.em-rx__reels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(5px, .6vw, 9px); border-radius: 16px; padding: clamp(5px, .6vw, 9px); background: color-mix(in srgb, var(--rx-bg) 80%, #000); }
.em-rx-reel { position: relative; aspect-ratio: 1 / var(--rx-rows); container-type: inline-size; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, .03); }
.em-rx-reel__strip { display: grid; will-change: transform; }
.em-rx-reel.is-blur .em-rx-sym { filter: blur(1.6px); }
.em-rx-reel.is-land { animation: rx-land .32s var(--em-ease); }
@keyframes rx-land { 0% { transform: translateY(-6px); } 60% { transform: translateY(3px); } 100% { transform: none; } }

.em-rx--frame-gilded .em-rx__frame {
  background: linear-gradient(145deg, #fff3b0, var(--rx-a) 30%, #7a4d06 55%, var(--rx-a) 80%, #fff3b0);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5) inset, 0 18px 40px rgba(0, 0, 0, .5), 0 0 40px color-mix(in srgb, var(--rx-a) 30%, transparent);
}
.em-rx--frame-neon .em-rx__frame {
  background: rgba(0, 0, 0, .35); border: 2px solid var(--rx-a);
  box-shadow: 0 0 18px var(--rx-a), inset 0 0 22px color-mix(in srgb, var(--rx-a) 40%, transparent), 0 0 60px color-mix(in srgb, var(--rx-b) 35%, transparent);
  animation: rx-neon 3.6s ease-in-out infinite;
}
@keyframes rx-neon { 50% { box-shadow: 0 0 26px var(--rx-b), inset 0 0 26px color-mix(in srgb, var(--rx-b) 40%, transparent), 0 0 70px color-mix(in srgb, var(--rx-a) 35%, transparent); border-color: var(--rx-b); } }
.em-rx--frame-glass .em-rx__frame {
  background: linear-gradient(160deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 45%, color-mix(in srgb, var(--rx-a) 25%, transparent));
  border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 20px 50px rgba(0, 0, 0, .45);
}
.em-rx--frame-carved .em-rx__frame {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 6px, rgba(0, 0, 0, .08) 6px 12px),
    linear-gradient(180deg, color-mix(in srgb, var(--rx-a) 55%, #2a1a08), color-mix(in srgb, var(--rx-a) 25%, #120a03));
  border: 3px solid color-mix(in srgb, var(--rx-a) 70%, #000);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .55);
}
.em-rx--frame-ribbon .em-rx__frame {
  background: repeating-linear-gradient(45deg, var(--rx-a) 0 14px, #fff 14px 20px, var(--rx-b) 20px 34px, #fff 34px 40px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 30px color-mix(in srgb, var(--rx-a) 35%, transparent);
}

/* ---------- Symbols ---------- */
.em-rx-sym {
  height: 100cqw; display: grid; place-items: center; align-content: center; gap: 2px; position: relative;
  transition: transform .25s var(--em-ease);
}
.em-rx-sym::before {
  content: ""; position: absolute; inset: 6%; z-index: -1; border-radius: 14px;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--rx-a) 38%, #fff 6%), color-mix(in srgb, var(--rx-bg) 70%, #000) 72%);
  border: 1px solid color-mix(in srgb, var(--rx-a) 40%, transparent);
}
.em-rx-sym--lo::before { background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .1), rgba(0, 0, 0, .25) 75%); border-color: rgba(255, 255, 255, .08); }
.em-rx-sym__icon { font-size: 40cqw; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.em-rx-sym__tag { font-size: max(8px, 9cqw); font-weight: 800; letter-spacing: .08em; color: var(--rx-a); }
.em-rx-sym__letter {
  font-size: 50cqw; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, #fff 10%, var(--rx-a) 55%, var(--rx-b)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45));
}
.em-rx--shape-coin .em-rx-sym::before { border-radius: 50%; inset: 7% 9%; }
.em-rx--shape-hex .em-rx-sym::before { border-radius: 0; inset: 4% 6%; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.em-rx--shape-gem .em-rx-sym::before { border-radius: 0; inset: 5%; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.em-rx-sym.is-win { animation: rx-win 1s ease-in-out 2; z-index: 1; }
.em-rx-sym.is-win::before { border-color: var(--rx-a); box-shadow: 0 0 0 2px var(--rx-a), 0 0 22px var(--rx-a); }
@keyframes rx-win { 50% { transform: scale(1.1); } }

.em-rx__burst {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  padding: 10px 26px; border-radius: 999px; font-size: clamp(1.4rem, 1rem + 2vw, 2.6rem); font-weight: 900;
  color: var(--em-on-yellow); background: linear-gradient(180deg, #fff1a8, var(--em-yellow)); box-shadow: 0 0 40px var(--rx-a);
}
.em-rx__burst.is-on { animation: rx-burst 2.2s var(--em-ease) forwards; }
@keyframes rx-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }

.em-rx__status { min-height: 42px; display: grid; place-items: center; text-align: center; padding: 8px 14px; border-radius: 14px; font-size: .92rem; color: var(--rx-soft); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.em-rx__status[data-tone="win"] { color: var(--em-yellow); border-color: rgba(255, 201, 40, .35); }
.em-rx__status[data-tone="info"] { color: var(--rx-a); }
.em-rx__status[data-tone="bad"] { color: #ff8a9b; }

/* ---------- Console ---------- */
.em-rx__console {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: center;
  padding: 12px 12px 12px 20px; border-radius: 20px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .08);
}
.em-rx__read { display: grid; gap: 2px; }
.em-rx__read > span { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--rx-soft); font-weight: 700; }
.em-rx__read > strong { font-size: clamp(1.1rem, .95rem + .5vw, 1.5rem); font-variant-numeric: tabular-nums; }
.em-rx__read .is-win { color: var(--em-yellow); }
.em-rx__stepper { display: inline-flex; align-items: center; gap: 10px; }
.em-rx__stepper button {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1;
  border: 1px solid color-mix(in srgb, var(--rx-a) 60%, transparent); background: transparent; color: var(--rx-a);
}
.em-rx__stepper button:hover { background: var(--rx-a); color: #04172a; }
.em-rx__stepper strong { min-width: 70px; text-align: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.em-rx__spin {
  width: clamp(92px, 9vw, 116px); height: clamp(92px, 9vw, 116px); border-radius: 50%; cursor: pointer; border: 0;
  font-size: 1.15rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #04172a;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, var(--rx-a) 45%, color-mix(in srgb, var(--rx-a) 55%, #000) 100%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .08), 0 0 34px color-mix(in srgb, var(--rx-a) 60%, transparent);
  transition: transform .2s var(--em-ease), filter .2s;
}
.em-rx__spin:hover:not(:disabled) { transform: scale(1.05); }
.em-rx__spin:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; }
.em-rx.is-spinning .em-rx__spin { animation: rx-pulse 1s ease-in-out infinite; }
@keyframes rx-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--rx-a) 20%, transparent), 0 0 44px var(--rx-a); } }

/* ---------- Auth gate ---------- */
.em-rx__gate {
  position: absolute; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center; background: rgba(2, 8, 16, .9); backdrop-filter: blur(8px);
  transition: opacity .3s, visibility .3s;
}
.em-rx__gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.em-rx__gate-art { width: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; border: 2px solid var(--rx-a); box-shadow: 0 0 30px color-mix(in srgb, var(--rx-a) 55%, transparent); }
.em-rx__gate-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 2.1rem); font-weight: 800; }
.em-rx__gate-text { max-width: 520px; color: var(--rx-soft); line-height: 1.5; }
.em-rx__gate-perks { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0; }
.em-rx__gate-perks li { padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--rx-a); border: 1px solid color-mix(in srgb, var(--rx-a) 50%, transparent); }
.em-rx__gate-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .em-rx--left .em-rx__stage, .em-rx--right .em-rx__stage { grid-template-columns: 1fr; }
  .em-rx__side, .em-rx--right .em-rx__side { order: 2; }
  .em-rx__side, .em-rx--top .em-rx__side { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  .em-rx__hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
  .em-rx__hero img { width: 64px; aspect-ratio: 4 / 5; }
}
@media (max-width: 600px) {
  dialog.em-dialog.em-player { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 20px; }
  .em-rx { padding: 14px 10px; border-radius: 20px; }
  .em-rx__side, .em-rx--top .em-rx__side { grid-template-columns: 1fr; }
  .em-rx__pay { display: none; }
  .em-rx__console { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .em-rx__spin { grid-column: 1 / -1; justify-self: center; }
  .em-rx__bet { grid-column: 1 / -1; justify-items: center; }
}
