* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 50% 0, #1d3a2e, #0b1612 70%); color: #e8f3ec;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif; min-height: 100vh; }
button:focus-visible, input:focus-visible { outline: 2px solid #5cf2a0; outline-offset: 2px; }
.casino { max-width: 1000px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 20px; }
.logo { font-weight: 900; font-size: 22px; letter-spacing: 2px; }
.logo span { color: #5cf2a0; font-weight: 400; }
.bal { background: #0f231b; border: 1px solid #2a5a44; padding: 8px 14px; border-radius: 10px; font-weight: 700; color: #ffd76a; }
.bal small { color: #9bb; font-weight: 400; }
.table { display: grid; gap: 20px; }
@media (min-width: 760px) { .table { grid-template-columns: 300px 1fr; } }
.panel { background: #12271f; border: 1px solid #234a39; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.lbl { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #9fc4b1; }
.betrow { display: flex; gap: 6px; }
.betrow input { flex: 1; min-width: 0; background: #0a1914; border: 1px solid #2a5a44; color: #fff; padding: 10px; border-radius: 8px; font-size: 16px; }
.betrow button { background: #234a39; color: #fff; border: 0; border-radius: 8px; padding: 0 14px; font-weight: 700; cursor: pointer; }
input[type=range] { accent-color: #5cf2a0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats div { background: #0a1914; border-radius: 8px; padding: 8px; text-align: center; }
.stats span { display: block; font-size: 11px; color: #8aa; }
.stats b { font-size: 16px; }
.cta { background: linear-gradient(#5cf2a0, #2fc477); color: #05200f; border: 0; border-radius: 10px; padding: 14px; font-size: 17px; font-weight: 800; cursor: pointer; }
.cta.cash { background: linear-gradient(#ffd76a, #e6a92a); color: #3a2500; }
.cta:disabled { opacity: .5; cursor: default; }
.refill { background: none; border: 1px dashed #5cf2a0; color: #5cf2a0; padding: 10px; border-radius: 10px; cursor: pointer; }
.msg { margin: 0; font-size: 14px; color: #bcd; min-height: 2.4em; }
.msg.lost { color: #ff7a7a; } .msg.won { color: #ffd76a; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; background: #12271f; border: 1px solid #234a39; border-radius: 16px; padding: 14px; align-self: start; }
.tile { aspect-ratio: 1; border: 0; border-radius: 12px; background: linear-gradient(#2d5e48, #1f4535); box-shadow: 0 4px 0 #0c1f17;
  font-size: clamp(20px, 6vw, 38px); cursor: pointer; transition: transform .12s, background .2s; color: inherit; }
.tile:not(:disabled):hover { transform: translateY(-3px); background: linear-gradient(#3a7a5d, #2a5a44); }
.tile:disabled { cursor: default; }
.tile.gem { background: #0a1914; box-shadow: none; opacity: .55; }
.tile.bomb { background: #2a0f12; box-shadow: none; opacity: .55; }
.tile.hit { opacity: 1; animation: pop .25s; }
.tile.gem.hit { background: radial-gradient(#1c6b47, #0a1914); }
.tile.bomb.hit { background: radial-gradient(#a3262e, #2a0f12); }
@keyframes pop { from { transform: scale(.7); } to { transform: scale(1); } }
.tile { position: relative; }
.tile.gem.hit { animation: pop .25s, glow .8s ease-out; }
.tile.gem.hit::before, .tile.gem.hit::after { content: "✦"; position: absolute; color: #fff7b0; font-size: 14px; pointer-events: none;
  animation: spark .7s ease-out forwards; top: 10%; left: 15%; }
.tile.gem.hit::after { top: auto; left: auto; bottom: 10%; right: 15%; animation-delay: .1s; font-size: 11px; }
@keyframes spark { 0% { opacity: 0; transform: scale(.2) rotate(0); } 40% { opacity: 1; transform: scale(1.4) rotate(90deg); }
  100% { opacity: 0; transform: scale(.4) rotate(180deg) translateY(-12px); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 #5cf2a0aa; } 100% { box-shadow: 0 0 0 18px #5cf2a000; } }
.grid5.lost { animation: shake .5s; }
@keyframes shake { 0%,100% { transform: translate(0); } 15% { transform: translate(-10px, 4px) rotate(-1deg); }
  30% { transform: translate(9px, -5px) rotate(1deg); } 45% { transform: translate(-7px, 3px); } 60% { transform: translate(5px, -2px); }
  80% { transform: translate(-2px, 1px); } }
.board { background: #12271f; border: 1px solid #234a39; border-radius: 16px; padding: 18px; }
@media (min-width: 760px) { .board { grid-column: 1 / -1; } }
.board h2 { margin: 0 0 12px; font-size: 18px; }
.lbform p { margin: 0 0 8px; font-size: 14px; color: #bcd; }
.lbform { margin-bottom: 14px; }
.lblist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lblist li { display: flex; align-items: center; gap: 10px; background: #0a1914; border-radius: 8px; padding: 8px 12px; }
.lblist .rank { width: 24px; color: #5cf2a0; font-weight: 800; }
.lblist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lblist .mx { color: #8aa; font-size: 13px; }
.lblist b { color: #ffd76a; }
.top { flex-wrap: wrap; gap: 10px; }
.acct { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.linkbtn { background: none; border: 0; color: #9fb3c8; text-decoration: underline; cursor: pointer; padding: 4px; font: inherit; }
.smallcta { background: #00e701; color: #0b1a10; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.authform { position: absolute; right: 0; top: 0; z-index: 20; width: min(320px, 90vw); background: #1a2c38; border: 1px solid #2f4553;
  border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px #0008; }
.authform h3 { margin: 0; font-size: 1rem; }
.authform input { background: #0f212e; border: 1px solid #2f4553; color: #fff; border-radius: 8px; padding: 10px; font: inherit; }
.authlinks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; }
.authlinks a { color: #9fb3c8; }
.hint { color: #9fb3c8; font-size: .9rem; margin: 0 0 8px; }
.res { font-weight: 700; min-width: 3em; }
.res.won { color: #00e701; }
.res.lost { color: #ff4d4d; }
.foot { text-align: center; color: #6a8; font-size: 12px; padding: 24px 0 8px; }
