/* Rick & Morty Crypto Spinner — 3-Dominos (real crypto) */
:root {
  --pink: #FF00FF;
  --cyan: #00FFFF;
  --green: #39FF14;
  --gold: #FFD700;
  --bg: #0a0514;
  --panel: rgba(12, 8, 32, 0.85);
  --text: #e8f0ff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Orbitron', system-ui, sans-serif;
  overflow-x: hidden;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Background layers */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,0,255,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(0,255,255,0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(57,255,20,0.08) 0%, transparent 60%),
    linear-gradient(180deg, #0d0620 0%, #050210 100%);
  pointer-events: none;
}

.hex-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(0,255,255,0.06) 28px, rgba(0,255,255,0.06) 29px),
    repeating-linear-gradient(60deg, transparent, transparent 28px, rgba(255,0,255,0.05) 28px, rgba(255,0,255,0.05) 29px),
    repeating-linear-gradient(120deg, transparent, transparent 28px, rgba(57,255,20,0.04) 28px, rgba(57,255,20,0.04) 29px);
  pointer-events: none;
  animation: gridPulse 8s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  from { opacity: 0.25; }
  to { opacity: 0.45; }
}

.floating-coins {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.coin {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0.55;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.7));
  animation: floatCoin linear infinite;
  user-select: none;
}

@keyframes floatCoin {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* Header */
.header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.25rem 1rem 0.5rem;
}

.title {
  font-family: 'Russo One', 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0,255,255,0.5);
}

.title-rick { color: var(--cyan); text-shadow: 0 0 12px var(--cyan), 0 0 28px rgba(0,255,255,0.4); }
.title-amp { color: var(--green); margin: 0 0.15em; text-shadow: 0 0 10px var(--green); }
.title-morty { color: var(--pink); text-shadow: 0 0 12px var(--pink), 0 0 28px rgba(255,0,255,0.4); }

.subtitle {
  font-weight: 900;
  font-size: clamp(1.1rem, 3vw, 1.75rem);
  color: var(--gold);
  letter-spacing: 0.28em;
  margin-top: 0.35rem;
  text-shadow: 0 0 16px rgba(255,215,0,0.7), 0 2px 0 #b8860b;
}

.fan-note {
  margin-top: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(200,210,255,0.55);
  font-weight: 500;
}

/* Stage */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(100px, 180px) minmax(280px, 480px) minmax(100px, 180px);
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1rem 1rem;
}

.character {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: charBob 3s ease-in-out infinite;
}

.morty { animation-delay: -1.5s; }

@keyframes charBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.char-img {
  width: 100%;
  max-width: 170px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(0,255,255,0.4));
}

.morty .char-img {
  filter: drop-shadow(0 0 14px rgba(255,0,255,0.4));
}

.char-label {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.rick-label { color: var(--green); text-shadow: 0 0 8px var(--green); }
.morty-label { color: var(--pink); text-shadow: 0 0 8px var(--pink); }

/* Wheel */
.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  filter: drop-shadow(0 0 10px var(--cyan));
  animation: pointerGlow 1.5s ease-in-out infinite alternate;
}

@keyframes pointerGlow {
  from { filter: drop-shadow(0 0 8px var(--cyan)); }
  to { filter: drop-shadow(0 0 18px var(--cyan)) drop-shadow(0 0 6px #fff); }
}

.wheel-outer {
  position: relative;
  width: min(90vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(145deg, var(--cyan), var(--pink), var(--green));
  box-shadow:
    0 0 30px rgba(0,255,255,0.4),
    0 0 60px rgba(255,0,255,0.2),
    inset 0 0 20px rgba(0,0,0,0.5);
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #12081f;
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a1a4a, #0a0514);
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px rgba(255,215,0,0.6), inset 0 0 12px rgba(0,255,255,0.3);
  display: grid;
  place-items: center;
  z-index: 3;
  pointer-events: none;
}

.hub-glow {
  color: var(--gold);
  font-size: 1.4rem;
  text-shadow: 0 0 10px var(--gold);
}

/* Controls */
.controls {
  position: relative;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 360px;
}

.balance-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
}

.balance-panel {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  background: var(--panel);
  border: 1px solid rgba(0,255,255,0.35);
  border-radius: 12px;
  padding: 0.55rem 1.2rem;
  box-shadow: 0 0 20px rgba(0,255,255,0.15);
}

.balance-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
}

.balance-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255,215,0,0.5);
  min-width: 6ch;
  text-align: right;
  transition: transform 0.2s;
}

.balance-unit { color: var(--green); font-size: 1.1rem; }

.dep-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 108px;
  border: 1px solid rgba(255,0,255,0.55);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,0,255,0.16), rgba(0,255,255,0.10));
  color: var(--pink);
  font-family: inherit;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255,0,255,0.25);
  transition: all 0.15s;
}

.dep-btn:hover {
  background: linear-gradient(160deg, rgba(255,0,255,0.30), rgba(0,255,255,0.18));
  box-shadow: 0 0 24px rgba(255,0,255,0.5);
  transform: translateY(-1px);
}

.stake-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(200,210,255,0.8);
}

.stake-row input {
  width: 96px;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255,0,255,0.4);
  background: rgba(10,5,20,0.9);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: center;
}

.stake-row input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0,255,255,0.3);
}

.btn-sm {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(57,255,20,0.5);
  background: rgba(57,255,20,0.12);
  color: var(--green);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}

.btn-sm:hover { background: rgba(57,255,20,0.28); }
.btn-sm:active { transform: scale(0.95); }
.btn-sm.max { font-size: 0.62rem; letter-spacing: 0.1em; }

.spin-btn {
  position: relative;
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #FF00FF 0%, #7B2FFF 40%, #00FFFF 100%);
  background-size: 200% 200%;
  animation: btnShine 3s ease infinite;
  box-shadow:
    0 0 24px rgba(255,0,255,0.45),
    0 4px 0 #5a0080,
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.15s, filter 0.15s;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 16px rgba(255,0,255,0.3), 0 1px 0 #5a0080;
}

.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  animation: none;
}

@keyframes btnShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.spin-text {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.35em;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.spin-sub {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
  margin-top: 0.25rem;
}

.ctrl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mute-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,255,0.4);
  background: var(--panel);
  cursor: pointer;
  font-size: 1.1rem;
  transition: border-color 0.15s;
}

.mute-btn:hover { border-color: var(--cyan); }

.link-btn {
  background: none;
  border: none;
  color: rgba(200,210,255,0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover { color: var(--cyan); }

/* Live feed */
.live-feed {
  position: fixed;
  left: 14px;
  bottom: 44px;
  z-index: 4;
  width: 250px;
  background: rgba(8, 4, 20, 0.82);
  border: 1px solid rgba(0,255,255,0.28);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(0,255,255,0.12);
}

.lf-head {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.4s infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.lf-list {
  list-style: none;
  max-height: 170px;
  overflow: hidden;
}

.lf-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
}

.lf-list .who { color: rgba(200,210,255,0.6); overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.lf-list .ch { color: var(--cyan); }
.lf-list .amt { font-weight: 700; color: var(--green); }
.lf-list li.lost .amt { color: var(--pink); }
.lf-empty { color: rgba(200,210,255,0.4); border: none !important; }

/* Footer */
.footer-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: linear-gradient(90deg, rgba(255,0,255,0.25), rgba(0,255,255,0.2), rgba(57,255,20,0.25));
  border-top: 1px solid rgba(0,255,255,0.3);
  font-weight: 700;
  font-size: clamp(0.75rem, 2vw, 1rem);
  letter-spacing: 0.25em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.footer-bar .dot { color: var(--cyan); }

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(5, 2, 16, 0.75);
  backdrop-filter: blur(6px);
  padding: 1rem;
  transition: opacity 0.25s;
  overflow-y: auto;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(30,15,60,0.95), rgba(10,5,25,0.98));
  border: 2px solid var(--cyan);
  box-shadow: 0 0 40px rgba(0,255,255,0.35), 0 0 80px rgba(255,0,255,0.15);
  text-align: center;
  overflow: hidden;
}

.overlay-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 30%, rgba(255,0,255,0.15), transparent 50%);
  pointer-events: none;
}

.result-title {
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,215,0,0.6);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.result-segment {
  font-size: 1.1rem;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.result-flavor {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(220,230,255,0.85);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.result-delta {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 1.25rem;
  text-shadow: 0 0 12px rgba(57,255,20,0.5);
}

.result-delta.negative { color: var(--pink); }

.overlay-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  color: #0a0514;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 20px rgba(0,255,255,0.4);
  transition: transform 0.15s;
}

.overlay-btn:hover { transform: scale(1.05); }

/* Deposit modal */
.dep-card {
  max-width: 560px;
  border-color: var(--pink);
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}

.dep-title {
  text-align: center;
  font-size: 1.2rem;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255,0,255,0.55);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.dep-note {
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(220,230,255,0.7);
  margin-bottom: 1rem;
}

.dep-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.dep-row input {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(0,255,255,0.4);
  background: rgba(5,2,16,0.9);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.dep-row input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,255,255,0.3);
}

.dep-hint { font-size: 0.62rem; color: rgba(200,210,255,0.55); letter-spacing: 0.05em; }

.dep-stats {
  display: flex;
  gap: 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: rgba(200,210,255,0.7);
  margin-bottom: 0.8rem;
}

.dep-stats b { color: var(--gold); }

.pay-box {
  background: rgba(5,2,16,0.92);
  border: 1px solid rgba(255,0,255,0.25);
  border-radius: 10px;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.9rem;
}

.pay-box b { color: var(--cyan); }
.pay-box code { color: var(--gold); }

.dep-msg { font-size: 0.72rem; min-height: 18px; margin-bottom: 0.4rem; }
.dep-msg.ok { color: var(--green); }
.dep-msg.err { color: var(--pink); }
.dep-msg.warn { color: var(--gold); }

/* Responsive */
@media (max-width: 900px) {
  .live-feed { display: none; }
}

@media (max-width: 800px) {
  .stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .wheel-wrap {
    grid-column: 1 / -1;
    order: -1;
  }
  .character { max-width: 120px; margin: 0 auto; }
  .char-img { max-width: 110px; }
}

@media (max-width: 480px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .character {
    flex-direction: row;
    gap: 0.5rem;
    max-width: none;
  }
  .char-img { max-width: 80px; }
  .rick { justify-content: flex-start; }
  .morty { justify-content: flex-end; }
  .footer-bar { letter-spacing: 0.12em; gap: 0.5rem; }
  .balance-row { flex-direction: column; }
  .dep-btn { min-width: 100%; }
}
