/* ==========================================================================
   Gwarden AI — Призовая рулетка (редизайн v2.6)
   Стили колеса в стилистике Studio Interface: графит, лайм, фиолетовый акцент.
   ========================================================================== */

.rou-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
  padding: 0 0 64px;
}

.rou-main { min-width: 0; max-width: 660px; margin-inline: auto; }

.rou-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--hdr-h) + 20px);
}

/* ── Сцена колеса ───────────────────────────────────────────────────── */
.rou-frame {
  position: relative;
  /* Высота билета: JS читает эту переменную, чтобы позиционировать ленту */
  --rou-item-h: 64px;
  height: 430px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, #16171d 0%, #0d0d11 60%, #0a0a0d 100%);
  border: 1px solid var(--line-dim);
  box-shadow: inset 0 30px 60px -30px rgba(0, 0, 0, 0.9), var(--specular);
}

.rou-frame::before,
.rou-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 110px;
  z-index: 3;
  pointer-events: none;
}

.rou-frame::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.98) 20%, transparent);
}

.rou-frame::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(8, 8, 10, 0.98) 20%, transparent);
}

/* Центральная линия + указатели */
.rou-center {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 74px;
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
}

.rou-center .line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, var(--acc) 12%, var(--acc) 88%, transparent 100%);
  box-shadow: 0 0 12px rgba(209, 254, 23, 0.45), 0 0 34px rgba(209, 254, 23, 0.18);
}

.rou-center .notch {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--acc);
  filter: drop-shadow(0 0 8px rgba(209, 254, 23, 0.5));
}

.rou-center .notch.r {
  left: auto;
  right: 10px;
  transform: translateY(-50%) rotate(180deg);
}

.rou-strip {
  position: absolute;
  left: 50%;
  width: 300px;
  margin-left: -150px;
  top: 0;
  will-change: transform;
}

/* ── Билет (приз) ───────────────────────────────────────────────────── */
.rou-item {
  position: absolute;
  left: 0;
  right: 0;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.rou-item::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.rou-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.14) 48%, rgba(255, 255, 255, 0.04) 52%, transparent 62%);
  transform: translateX(-130%);
}

.rou-item.t-epic .rou-shine,
.rou-item.t-jack .rou-shine { animation: rouSheen 3.4s ease-in-out infinite; }

.rou-item.t-gold .rou-shine,
.rou-item.t-cash .rou-shine,
.rou-item.t-plan .rou-shine { opacity: 0.45; }

@keyframes rouSheen {
  0%, 55% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

.rou-l {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  position: relative;
  z-index: 2;
}

.rou-val {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rou-cap {
  font-size: 0.46rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dim);
}

.rou-coin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #26241a;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
  background: linear-gradient(140deg, #eceef2, #9aa1ab);
}

.rou-ser {
  position: absolute;
  right: 12px;
  bottom: 3px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.6;
  color: var(--dim);
}

/* Уровни призов: graphite / gold / violet / lime-jackpot / indigo-plan */
.rou-item.t-cash {
  background: linear-gradient(160deg, #26282e 0%, #1b1d21 60%, #141519 100%);
  border-color: rgba(255, 255, 255, 0.16);
}

.rou-item.t-cash .rou-val { color: #eef0f4; }
.rou-item.t-cash .rou-cap { color: rgba(238, 240, 244, 0.45); }
.rou-item.t-cash .rou-ser { color: rgba(238, 240, 244, 0.5); }

.rou-item.t-gold {
  background: linear-gradient(160deg, #4a3c0a 0%, #332907 60%, #241d05 100%);
  border-color: rgba(201, 162, 39, 0.55);
}

.rou-item.t-gold .rou-val { color: #ffe9a8; }
.rou-item.t-gold .rou-cap { color: rgba(255, 233, 168, 0.5); }
.rou-item.t-gold .rou-ser { color: rgba(255, 233, 168, 0.55); }
.rou-item.t-gold .rou-coin { background: linear-gradient(140deg, #ffe9a8, #c9a227); }

.rou-item.t-epic {
  background: linear-gradient(160deg, #3b2170 0%, #2a1650 60%, #1c0e38 100%);
  border-color: rgba(182, 146, 255, 0.5);
}

.rou-item.t-epic .rou-val { color: #e3d4ff; }
.rou-item.t-epic .rou-cap { color: rgba(227, 212, 255, 0.5); }
.rou-item.t-epic .rou-ser { color: rgba(227, 212, 255, 0.55); }
.rou-item.t-epic .rou-coin { background: linear-gradient(140deg, #d9c6ff, #8b5cf6); }

.rou-item.t-jack {
  background: linear-gradient(160deg, #2b2413 0%, #15100a 55%, #0b0806 100%);
  border-color: rgba(209, 254, 23, 0.62);
  box-shadow: 0 6px 22px -6px rgba(209, 254, 23, 0.35), 0 0 30px rgba(209, 254, 23, 0.12);
}

.rou-item.t-jack::after { border-color: rgba(209, 254, 23, 0.24); }
.rou-item.t-jack .rou-val {
  font-size: 1.16rem;
  background: linear-gradient(100deg, #6d8a05 0%, #d1fe17 30%, #f4ffc0 50%, #d1fe17 70%, #6d8a05 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rouGold 2.8s linear infinite;
}
.rou-item.t-jack .rou-cap { color: rgba(209, 254, 23, 0.75); }
.rou-item.t-jack .rou-ser { color: rgba(209, 254, 23, 0.7); }
.rou-item.t-jack .rou-coin { background: linear-gradient(140deg, #f4ffc0, #a9d60c); }

@keyframes rouGold {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.rou-item.t-plan {
  background: linear-gradient(160deg, #1d2f6b 0%, #122047 60%, #0b1631 100%);
  border-color: rgba(129, 140, 248, 0.5);
}

.rou-item.t-plan .rou-val { color: #cfd6ff; }
.rou-item.t-plan .rou-cap { color: rgba(207, 214, 255, 0.5); }
.rou-item.t-plan .rou-ser { color: rgba(207, 214, 255, 0.55); }
.rou-item.t-plan .rou-coin { background: linear-gradient(140deg, #cfd6ff, #818cf8); }

/* Победитель / проигравший */
.rou-item.win { animation: rouWin 0.55s cubic-bezier(0.22, 1.4, 0.36, 1) 2; }
.rou-item.win::before {
  content: "★";
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 3;
  color: var(--acc);
  font-size: 0.95rem;
  text-shadow: 0 0 12px rgba(209, 254, 23, 0.7);
}
.rou-item.lose { opacity: 0.72; filter: grayscale(0.55); }
.rou-item.lose .rou-val { text-decoration: line-through; text-decoration-color: rgba(248, 113, 113, 0.55); text-decoration-thickness: 2px; }

@keyframes rouWin {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

/* Конфетти */
.rou-boom {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.rou-boom i {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation: rouFall var(--d, 1.8s) linear forwards;
}

@keyframes rouFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(var(--fy, 320px)) rotate(640deg); opacity: 0; }
}

.rou-sad {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8877f;
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 1rem;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
  opacity: 0;
}

.rou-sad.show { animation: rouSad 1.6s ease-out forwards; }

@keyframes rouSad {
  0% { opacity: 0; transform: translateY(10px); }
  30% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ── HUD под колесом ────────────────────────────────────────────────── */
.rou-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.rou-bal {
  color: var(--muted);
  font-size: 0.9rem;
}

.rou-bal b { color: var(--txt); font-family: var(--mono); }
.rou-bal .tk { color: var(--acc); font-weight: 800; font-family: var(--mono); }

.rou-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.rou-free-hint {
  color: var(--dim);
  font-size: 0.8rem;
  margin-top: 10px;
  min-height: 18px;
}

.rou-result {
  margin-top: 12px;
  font-size: 1.05rem;
  min-height: 26px;
}

.rou-result b { color: var(--acc); font-weight: 800; }
.rou-result .rou-result-dim { color: var(--muted); }

.rou-feed {
  margin-top: 14px;
  color: var(--dim);
  font-size: 0.82rem;
  min-height: 20px;
}

.rou-feed b { color: var(--acc); font-weight: 700; }

/* ── Правила ────────────────────────────────────────────────────────── */
.rou-rules { margin-top: 18px; }

.rou-rules .rr {
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 10px;
  background: var(--surface);
}

.rou-rules .rr h4 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 800; }
.rou-rules .rr p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

/* ── Боковая колонка ────────────────────────────────────────────────── */
.rou-side-card {
  background: var(--surface);
  border: 1px solid var(--line-dim);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--specular);
}

.rou-side-card h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 12px;
}

.rou-prize-list { display: flex; flex-direction: column; gap: 8px; }

.rou-prize-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.rou-prize-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--acc);
  box-shadow: 0 0 10px rgba(209, 254, 23, 0.5);
}

.rou-prize-dot.p { background: var(--indigo); box-shadow: 0 0 10px rgba(129, 140, 248, 0.5); }
.rou-prize-dot.b { background: var(--brand-light); box-shadow: 0 0 10px rgba(182, 146, 255, 0.5); }
.rou-prize-dot.g { background: #c9a227; box-shadow: 0 0 10px rgba(201, 162, 39, 0.5); }

.rou-side-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.6; margin: 0; }
.rou-side-card p + p { margin-top: 10px; }

.rou-side-card a { color: var(--acc); font-weight: 600; }

/* ── Гейт «войдите» ─────────────────────────────────────────────────── */
.rou-gate-card {
  background: var(--surface);
  border: 1px solid var(--acc-line);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  text-align: center;
  box-shadow: var(--specular);
  max-width: 520px;
  margin: 0 auto;
}

.rou-gate-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.rou-gate-card p { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }

/* ── Адаптив ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rou-layout { grid-template-columns: minmax(0, 1fr); }
  .rou-side { position: static; }
}

@media (max-width: 560px) {
  .rou-frame { height: 340px; --rou-item-h: 56px; }
  .rou-strip { width: 230px; margin-left: -115px; }
  .rou-item { height: 56px; padding: 0 10px 0 14px; }
  .rou-val { font-size: 0.98rem; }
  .rou-coin { width: 28px; height: 28px; }
  .rou-hud { flex-direction: column; align-items: stretch; }
  .rou-actions { justify-content: stretch; }
  .rou-actions .btn { flex: 1 1 auto; }
}
