/* ==========================================================================
   PLIXWIN – Random game (v2): Plixwin-green card, sliding row of covers
   ========================================================================== */
.rgx { display: none; }
html[data-theme="teal"] body.home-mode .rgx {
  --rg-w: 148px; --rg-gap: 14px;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); align-items: center;
  margin: 8px 0 28px; border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 18px 40px rgba(0, 0, 0, .35);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .022) 0 1px, rgba(0, 0, 0, .02) 1px 3px),
    radial-gradient(90% 120% at 0% 0%, rgba(255, 255, 255, .12), transparent 60%),
    linear-gradient(125deg, #00402B 0%, #007A52 34%, #00B175 52%, #00804F 68%, #003322 100%);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #FFFFFF;
}
/* slow light sweep across the metal */
html[data-theme="teal"] body.home-mode .rgx::after {
  content: ""; position: absolute; inset: -40% -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .13) 50%, transparent 58%);
  transform: translateX(-60%); animation: rgxSheen 7s ease-in-out infinite;
}
@keyframes rgxSheen { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }

/* ---------- copy ---------- */
.rgx-copy { padding: 26px 8px 26px 28px; display: flex; flex-direction: column; align-items: flex-start; }
.rgx-title {
  margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em;
  color: #FFFFFF;
}
.rgx-sub { margin: 8px 0 0; color: rgba(255, 255, 255, .82); font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.rgx-sub b { color: #FFFFFF; font-weight: 800; }
.rgx-pick { display: none; }
.rgx.is-done .rgx-pick { display: grid; gap: 2px; margin-top: 14px; }
.rgx-pick small { color: rgba(255, 255, 255, .7); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rgx-pick strong { font-size: 17px; font-weight: 800; }
.rgx-pick em { font-style: normal; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.rgx-spin {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; height: 46px; padding: 0 22px 0 18px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: #00261A; color: #FFFFFF;
  font: 800 15px/1 'Manrope', system-ui, sans-serif;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25); transition: transform .15s, background .15s;
}
.rgx-spin svg { width: 18px; height: 18px; }
.rgx-spin:hover { transform: translateY(-1px); background: #00331F; }
.rgx-spin:disabled { opacity: .7; cursor: default; transform: none; }
.rgx-spin:disabled svg { animation: rgxTurn .9s linear infinite; }
@keyframes rgxTurn { to { transform: rotate(360deg); } }
.rgx-spin:focus-visible, .rgx-play:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.rgx-fair { display: flex; align-items: flex-start; gap: 7px; margin: 16px 0 0; color: rgba(255, 255, 255, .72); font-size: 12px; font-weight: 600; line-height: 1.45; max-width: 290px; }
.rgx-fair svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: #FFFFFF; }
.rgx-fair b { color: rgba(255, 255, 255, .85); }

/* ---------- reel ---------- */
.rgx-reel {
  position: relative; overflow: hidden; height: 100%; min-height: calc(var(--rg-w) * 4 / 3 + 44px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.rgx-track { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; column-gap: var(--rg-gap); will-change: transform; }
.rgx-tile {
  position: relative; flex: none; width: var(--rg-w); aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #00261A;
  transform: scale(.84); opacity: .6; transition: transform .35s ease, opacity .35s ease, box-shadow .35s ease;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35); cursor: pointer;
}
.rgx-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rgx.is-spinning .rgx-tile { opacity: .9; }
.rgx-tile.is-center { transform: none; opacity: 1; box-shadow: 0 0 0 2px #FFFFFF, 0 16px 34px rgba(0, 0, 0, .45); }
.rgx-pointer {
  position: absolute; z-index: 2; left: 50%; top: 4px; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 11px solid #FFFFFF;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.rgx-play {
  position: absolute; left: 10px; right: 10px; bottom: 10px; height: 38px; border: 0; border-radius: 10px; cursor: pointer;
  background: #00B175; color: #00140D; font: 800 14.5px/1 'Manrope', system-ui, sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35); animation: rgxIn .3s ease both;
}
.rgx-play:hover { background: #00C482; }
@keyframes rgxIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  html[data-theme="teal"] body.home-mode .rgx { --rg-w: 128px; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); }
  .rgx-title { font-size: 22px; }
}
/* ---------- phone: compact ---------- */
@media (max-width: 700px) {
  html[data-theme="teal"] body.home-mode .rgx { --rg-w: 100px; --rg-gap: 10px; grid-template-columns: 1fr; margin: 4px 0 22px; border-radius: 16px; }
  .rgx-copy {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
    padding: 16px 14px 4px;
  }
  .rgx-title { grid-column: 1; font-size: 18px; }
  .rgx-sub { grid-column: 1; margin-top: 3px; font-size: 12.5px; }
  .rgx-spin { grid-column: 2; grid-row: 1 / span 2; margin: 0; height: 40px; padding: 0 14px 0 12px; font-size: 13.5px; border-radius: 11px; gap: 7px; }
  .rgx-spin svg { width: 16px; height: 16px; }
  .rgx.is-done .rgx-pick, .rgx-pick { display: none; }
  .rgx-fair { display: none; }
  .rgx-reel { min-height: calc(var(--rg-w) * 4 / 3 + 30px); }
  .rgx-pointer { top: 2px; border-left-width: 7px; border-right-width: 7px; border-top-width: 9px; }
  .rgx-play { left: 7px; right: 7px; bottom: 7px; height: 32px; font-size: 13px; border-radius: 8px; }
  .rgx-tile { border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="teal"] body.home-mode .rgx::after, .rgx-spin:disabled svg { animation: none; }
}
