* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0608; font-family: "Segoe UI", system-ui, sans-serif; color: #f6eee0; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 14px; background: #3a2a1a; color: #f6eee0; }
button:hover { filter: brightness(1.25); }
button:disabled { opacity: .45; cursor: default; filter: none; }
button.gold, button.big { background: linear-gradient(#f5d27a, #c8962e); color: #2a1a05; font-weight: 700; }
button.big { font-size: 20px; padding: 12px 28px; margin-top: 10px; }
button.big.alt { background: #3a2a1a; color: #f5d27a; border: 2px solid #c8962e; }
a { color: #f5d27a; }
#gear { position: absolute; top: 14px; right: 180px; pointer-events: auto; font-size: 20px; padding: 4px 10px; background: rgba(15, 8, 6, .75); border: 1px solid #c8962e; }
.vol { display: grid; grid-template-columns: 90px 1fr 50px; gap: 10px; align-items: center; max-width: 460px; margin: 10px auto; }
button.red { background: #b3262e; color: #fff; }
button.green { background: #1f8a4c; color: #fff; }
input, select { font: inherit; background: #1d1310; color: #f6eee0; border: 1px solid #6b4f2a; border-radius: 6px; padding: 6px 8px; }

.overlay { position: fixed; inset: 0; display: flex; background: rgba(5, 2, 3, .55); z-index: 20; overflow: auto; padding: 10px; }
.overlay > .card { margin: auto; }
.card { background: rgba(28, 16, 14, .95); border: 2px solid #c8962e; border-radius: 16px; padding: 24px 32px; text-align: center; box-shadow: 0 0 60px rgba(200, 150, 46, .35); }
.card.start { min-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.card label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 44px; letter-spacing: 3px; color: #f5d27a; text-shadow: 0 0 18px #c8962e; }
h1 span { color: #ff4d5a; text-shadow: 0 0 18px #ff2a3a; }
.sub { margin: 0; opacity: .8; }
.small { font-size: 13px; opacity: .8; min-height: 1em; margin: 0; }
#colors { display: flex; gap: 6px; }
#colors i { width: 24px; height: 24px; border-radius: 50%; display: inline-block; cursor: pointer; border: 2px solid transparent; }
#colors i.on { border-color: #fff; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#coins { position: absolute; top: 14px; left: 14px; background: rgba(15, 8, 6, .75); border: 2px solid #c8962e; border-radius: 30px; padding: 6px 16px 6px 8px; display: flex; align-items: center; gap: 8px; font-size: 22px; }
#coins.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.15); } }
.chip { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(#f5d27a 45%, #c8962e 46%, #c8962e 60%, #fff 61%, #fff 68%, #c8962e 69%); display: inline-block; }
#players { position: absolute; top: 14px; right: 14px; background: rgba(15, 8, 6, .65); border-radius: 10px; padding: 8px 12px; font-size: 14px; min-width: 150px; }
#players div { display: flex; justify-content: space-between; gap: 10px; }
#cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255, 255, 255, .8); box-shadow: 0 0 4px #000; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: rgba(15, 8, 6, .8); border: 1px solid #c8962e; padding: 8px 16px; border-radius: 8px; font-size: 18px; }
#prompt b { background: #f5d27a; color: #2a1a05; border-radius: 4px; padding: 0 7px; margin-right: 6px; }
#toasts { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
#toasts div { background: rgba(15, 8, 6, .85); border: 1px solid #c8962e; padding: 6px 16px; border-radius: 20px; animation: fade 4.5s forwards; }
#toasts div.big { font-size: 22px; color: #f5d27a; border-width: 2px; box-shadow: 0 0 20px #c8962e; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-8px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#chat { position: absolute; left: 14px; bottom: 40px; width: 380px; }
#chatlog div { text-shadow: 0 1px 3px #000; font-size: 15px; margin-top: 2px; }
#chatin { pointer-events: auto; width: 100%; margin-top: 6px; }
#help { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 13px; opacity: .65; text-shadow: 0 1px 2px #000; white-space: nowrap; }

#panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10; width: min(880px, 96vw); max-height: 94vh; overflow: auto;
  background: rgba(22, 12, 10, .96); border: 2px solid #c8962e; border-radius: 16px; box-shadow: 0 0 70px rgba(0, 0, 0, .7); }
.phead { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #6b4f2a; }
.phead h2 { margin: 0; color: #f5d27a; letter-spacing: 1px; }
#pbody { padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; margin: 8px 0; }
.betbox { display: flex; gap: 6px; align-items: center; }
.betbox input { width: 100px; text-align: center; }
.msg { text-align: center; font-size: 20px; min-height: 30px; margin: 8px 0; }
.msg.win { color: #7dff9b; } .msg.lose { color: #ff8a8a; }
.muted { opacity: .7; font-size: 14px; text-align: center; }

/* slots */
.reels { display: flex; gap: 12px; justify-content: center; margin: 10px 0; padding: 16px; background: #120a08; border-radius: 12px; border: 3px solid #c8962e; }
.reel { width: 130px; height: 130px; background: #fff8e8; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 80px; overflow: hidden; color: #c4161c; font-weight: 900; }
.reel.spin span { animation: spin .09s linear infinite; }
@keyframes spin { from { transform: translateY(-60%); } to { transform: translateY(60%); } }
.paytable { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 18px; justify-content: center; font-size: 14px; opacity: .85; }

/* roulette */
.rlboard { display: grid; grid-template-columns: 46px repeat(12, 1fr) 46px; gap: 3px; margin: 8px 0; }
.rlboard div { position: relative; text-align: center; padding: 8px 0; border-radius: 4px; cursor: pointer; font-weight: 700; user-select: none; border: 1px solid rgba(255, 255, 255, .15); }
.rlboard div:hover { outline: 2px solid #f5d27a; }
.rlboard .r { background: #b3262e; } .rlboard .b { background: #1d1d1d; } .rlboard .g { background: #1f8a4c; } .rlboard .o { background: #0f5a33; }
.rlboard .bet::after { content: attr(data-bet); position: absolute; right: -2px; top: -6px; background: #f5d27a; color: #2a1a05; border-radius: 10px; font-size: 11px; padding: 0 5px; }
.hist { display: flex; gap: 4px; justify-content: center; }
.hist span { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.chips button { border-radius: 50%; width: 52px; height: 52px; padding: 0; font-weight: 700; border: 3px dashed rgba(255, 255, 255, .6); }
.chips button.on { outline: 3px solid #f5d27a; }

/* cards */
.cards { display: flex; gap: 6px; justify-content: center; min-height: 92px; }
.pc { width: 62px; height: 88px; background: #fff; color: #111; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px; font-weight: 800; font-size: 18px; box-shadow: 0 2px 6px #000; animation: deal .3s; }
.pc.red { color: #c4161c; } .pc.back { background: repeating-linear-gradient(45deg, #8c1820 0 6px, #6d1118 6px 12px); border: 3px solid #fff; }
.pc .s2 { align-self: flex-end; transform: rotate(180deg); }
@keyframes deal { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.seat { background: rgba(31, 138, 76, .18); border: 2px solid #1f8a4c; border-radius: 10px; padding: 8px; text-align: center; min-height: 170px; }
.seat.turn { border-color: #f5d27a; box-shadow: 0 0 16px #c8962e; }
.seat .pc { width: 40px; height: 58px; font-size: 13px; }
.seat .cards { min-height: 60px; gap: 3px; }

/* crash */
#crcanvas, #pkcanvas { display: block; margin: 0 auto; background: #120a08; border-radius: 10px; border: 2px solid #6b4f2a; max-width: 100%; }
.list { font-size: 14px; display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; max-width: 420px; margin: 8px auto; }
.dicebig { font-size: 64px; text-align: center; font-weight: 800; color: #f5d27a; }
input[type=range] { width: 100%; accent-color: #f5d27a; }
