:root {
  --ink: #f7f1ff;
  --muted: #b9adc8;
  --bg: #0e0716;
  --panel: #190d27;
  --panel-2: #241136;
  --violet: #8e4bff;
  --pink: #ff4fc8;
  --acid: #d9ff43;
  --orange: #ff773d;
  --red: #ff3f59;
  --line: rgba(255,255,255,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 20%, rgba(128,52,225,.18), transparent 34rem),
    linear-gradient(180deg, #12091d 0%, var(--bg) 58%, #09050e 100%);
  font-family: "Arial Narrow", "Noto Sans Thai", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

button, a { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.topbar {
  height: 84px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(12,6,18,.7);
  backdrop-filter: blur(15px); position: relative; z-index: 10;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; letter-spacing: .08em; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; color: #17091d; background: var(--acid);
  font-weight: 1000; font-size: 25px; transform: rotate(-5deg); box-shadow: 4px 4px 0 var(--pink);
}
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; }
.brand small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.account { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6d6175; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.account.connected .status-dot { background: #70ff96; box-shadow: 0 0 12px #70ff96; }
.text-button { border: 0; background: none; color: var(--pink); cursor: pointer; padding: 6px; text-decoration: underline; }

main { position: relative; z-index: 1; }
.hero { text-align: center; padding: 70px 20px 34px; }
.eyebrow { color: var(--acid); font-size: 11px; font-weight: 900; letter-spacing: .22em; }
.eyebrow span { color: var(--pink); text-shadow: 0 0 12px var(--pink); margin-right: 6px; }
.hero h1 { font-size: clamp(54px, 8vw, 104px); line-height: .88; margin: 20px auto 25px; letter-spacing: -.065em; text-transform: uppercase; max-width: 1050px; }
.hero h1 em { color: transparent; -webkit-text-stroke: 2px var(--pink); font-style: normal; text-shadow: 0 0 38px rgba(255,79,200,.22); }
.hero p { color: var(--muted); line-height: 1.7; margin: 0; font-size: 16px; }

.game-layout {
  width: min(1180px, calc(100% - 40px)); margin: 28px auto 110px; display: grid;
  grid-template-columns: 1fr minmax(430px, 540px) 1fr; gap: 30px; align-items: center;
}
.warning-card, .jackpot-card {
  background: linear-gradient(160deg, rgba(40,20,58,.9), rgba(19,10,29,.92));
  border: 1px solid var(--line); padding: 25px; position: relative; overflow: hidden;
}
.warning-card::after, .jackpot-card::after { content: ""; position: absolute; width: 100px; height: 100px; border-radius: 50%; filter: blur(42px); opacity: .28; }
.warning-card::after { background: var(--orange); left: -30px; bottom: -45px; }
.jackpot-card::after { background: var(--violet); right: -30px; top: -35px; }
.warning-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--orange); color: var(--orange); font-weight: 900; font-size: 21px; margin-bottom: 17px; transform: rotate(3deg); }
.warning-card h2 { margin: 0 0 11px; font-size: 18px; }
.warning-card p, .warning-card li, .jackpot-card p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.warning-card ul { padding: 14px 0 0 16px; margin: 14px 0 0; border-top: 1px solid var(--line); }
.warning-card li::marker { color: var(--acid); }

.machine-wrap { position: relative; }
.machine-glow { position: absolute; inset: 10% -14%; background: var(--violet); filter: blur(90px); opacity: .22; border-radius: 50%; }
.machine {
  position: relative; padding: 18px; border: 2px solid #a553ff; border-radius: 26px 26px 40px 40px;
  background: linear-gradient(145deg, #32144c, #160a24 65%); box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 0 0 5px #0e0716, inset 0 0 45px rgba(160,69,255,.16);
}
.machine::before, .machine::after { content: ""; position: absolute; left: 25px; right: 25px; height: 5px; background: repeating-linear-gradient(90deg, var(--acid) 0 7px, transparent 7px 18px); opacity: .6; }
.machine::before { top: 10px; } .machine::after { bottom: 11px; }
.machine-top { min-height: 90px; display: flex; justify-content: center; align-items: center; gap: 20px; text-align: center; }
.machine-top > span { color: var(--acid); text-shadow: 0 0 15px var(--acid); }
.machine-top b { display: block; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.04em; color: var(--acid); text-shadow: 3px 3px 0 #7f2caf; }
.machine-top small { display: block; font-size: 9px; letter-spacing: .21em; color: #d8c8e6; margin-top: 5px; }
.reel-window { background: #08050c; border: 8px solid #08050c; border-radius: 15px; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; padding: 7px; box-shadow: inset 0 0 20px #000, 0 0 0 2px #5d267e; position: relative; }
.payline { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--pink); opacity: .7; z-index: 3; box-shadow: 0 0 10px var(--pink); }
.reel { height: 138px; background: linear-gradient(#2a1735, #fff1 15%, #fff2 50%, #fff1 85%, #21132a); border-radius: 7px; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 18px 20px rgba(0,0,0,.4), inset 0 -18px 20px rgba(0,0,0,.4); }
.reel span { font-size: 64px; filter: drop-shadow(0 5px 5px rgba(0,0,0,.55)); transform: translateZ(0); }
.reel.spinning span { animation: reel-bounce .12s linear infinite; filter: blur(3px); }
@keyframes reel-bounce { 0% { transform: translateY(-35px) scale(.9); } 100% { transform: translateY(35px) scale(1.1); } }
.machine-screen { min-height: 68px; padding: 13px; margin: 15px 2px; border: 1px solid #68338c; background: #0e0816; text-align: center; display: grid; place-content: center; gap: 4px; }
.machine-screen b { font-size: 14px; color: var(--acid); }
.machine-screen span { font-size: 11px; color: var(--muted); }
.controls { display: flex; justify-content: center; padding: 4px 10px 20px; }
.discord-button, .spin-button { border: 0; cursor: pointer; min-height: 72px; width: 100%; border-radius: 9px; font-weight: 1000; letter-spacing: .06em; transition: transform .15s, filter .15s; }
.discord-button:hover, .spin-button:hover { transform: translateY(-2px); filter: brightness(1.1); }
.discord-button { background: #5865f2; box-shadow: 0 8px 0 #303ca8; }
.discord-logo { font-size: 20px; margin-right: 10px; }
.spin-button { background: var(--acid); color: #160a20; box-shadow: 0 8px 0 #76910f, 0 0 28px rgba(217,255,67,.18); }
.spin-button span, .spin-button small { display: block; }
.spin-button span { font-size: 25px; line-height: 1; }
.spin-button small { font-size: 9px; margin-top: 4px; }
.spin-button:disabled { cursor: not-allowed; filter: grayscale(.65) brightness(.65); transform: none; }
.coin-readout { text-align: center; color: var(--muted); font-size: 11px; margin: -5px 0 16px; }
.coin-readout b { color: var(--acid); font-size: 14px; }

.jackpot-card { text-align: center; }
.mini-label { font-size: 9px; color: var(--muted); letter-spacing: .2em; }
.coin-stack { font-size: 52px; filter: drop-shadow(0 0 16px #ffd43988); margin: 15px 0 2px; }
.jackpot-card strong { display: block; font-size: 39px; color: var(--acid); line-height: 1; letter-spacing: -.04em; }
.jackpot-card > b { font-size: 11px; letter-spacing: .15em; color: #fff; }
.jackpot-card p { border-top: 1px solid var(--line); margin: 18px 0 0; padding-top: 15px; }
.jackpot-card em { color: var(--pink); font-style: normal; font-weight: 900; }

.odds-section { border-top: 1px solid var(--line); padding: 90px max(20px, 5vw) 110px; background: rgba(5,2,8,.28); }
.section-heading { text-align: center; margin-bottom: 38px; }
.section-heading > span { color: var(--pink); font-size: 9px; letter-spacing: .25em; }
.section-heading h2 { margin: 8px 0 5px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.05em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.odds-grid { width: min(1080px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.odd-card { min-height: 150px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(28,14,41,.56); display: grid; grid-template-columns: auto 1fr; gap: 14px; align-content: start; transition: background .2s; }
.odd-card:hover { background: rgba(56,27,82,.74); }
.odd-icon { font-size: 28px; }
.odd-copy b { display: block; font-size: 14px; margin-bottom: 4px; }
.odd-copy p { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 0; }
.odd-chance { grid-column: 1 / -1; margin-top: auto; display: flex; justify-content: space-between; color: var(--acid); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.odd-chance i { height: 3px; flex: 1; margin: 7px 0 0 12px; background: linear-gradient(90deg, var(--pink) var(--w), rgba(255,255,255,.09) var(--w)); }

footer { min-height: 120px; padding: 35px max(20px,5vw); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
footer p { letter-spacing: 0; }

.result-modal { width: min(500px, calc(100% - 30px)); border: 1px solid #8f49bc; border-radius: 18px; color: var(--ink); background: radial-gradient(circle at 50% 5%, #492160, #190c27 60%); padding: 44px 35px 34px; text-align: center; box-shadow: 0 30px 100px #000; }
.result-modal::backdrop { background: rgba(6,2,10,.84); backdrop-filter: blur(9px); }
.modal-close { position: absolute; right: 13px; top: 9px; border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; }
.modal-badge { display: inline-block; padding: 5px 10px; border: 1px solid var(--acid); color: var(--acid); font-size: 9px; letter-spacing: .18em; }
.modal-reels { font-size: 53px; letter-spacing: 7px; margin: 24px 0 15px; }
.result-modal h2 { margin: 0; font-size: clamp(28px, 7vw, 46px); line-height: 1; color: var(--acid); }
.result-modal p { color: #e4d9eb; font-size: 16px; line-height: 1.6; }
.effect-note { padding: 11px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; margin: 18px 0; }
.modal-action { width: 100%; min-height: 48px; border: 0; background: var(--pink); color: #18091e; font-weight: 900; cursor: pointer; }
.result-modal.danger h2 { color: var(--red); }
.result-modal.jackpot { background: radial-gradient(circle at 50% 5%, #6e5b13, #1d1707 65%); border-color: var(--acid); }

@media (max-width: 950px) {
  .game-layout { grid-template-columns: minmax(0, 560px); justify-content: center; }
  .warning-card, .jackpot-card { max-width: 560px; }
  .warning-card { order: 2; } .machine-wrap { order: 1; } .jackpot-card { order: 3; }
  .odds-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .topbar { height: 70px; padding: 0 16px; }
  .brand-mark { width: 35px; height: 35px; font-size: 20px; }
  .brand b { font-size: 12px; }
  .account #accountLabel { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding-top: 50px; }
  .hero h1 { font-size: 51px; }
  .desktop-only { display: none; }
  .game-layout { width: calc(100% - 22px); gap: 18px; }
  .machine { padding: 12px; border-radius: 20px 20px 30px 30px; }
  .machine-top { min-height: 74px; }
  .machine-top b { font-size: 25px; }
  .machine-top > span { display: none; }
  .reel { height: 105px; }
  .reel span { font-size: 49px; }
  .odds-section { padding-top: 70px; }
  .odds-grid { grid-template-columns: 1fr; }
  footer { display: block; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
