/* Bola Tangkas — gaya mesin 90-an (mengikuti susunan Tangkasnet): latar hitam beranyam, header biru tua,
   tombol kuning keemasan, layar mesin hitam dengan tulisan hijau & kuning. Semua layar digambar pada
   kanvas tetap 1280×720 lalu diskalakan utuh (--s) agar susunannya sama di semua HP. */
:root {
  --yellow-1: #fbe98a; --yellow-2: #d9b440; --yellow-3: #9c7a17;
  --red: #e8112d; --red-d: #a10a1d; --navy: #060a3a; --green: #7cff3b; --gold: #ffd84d;
  --ui: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font: 400 18px/1.35 var(--ui); color: #fff; -webkit-tap-highlight-color: transparent; user-select: none; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #38d6ff; outline-offset: 2px; }

.stage {
  position: fixed; left: 50%; top: 50%; width: 1280px; height: 720px;
  transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: center;
  overflow: hidden;
}
.scr { position: absolute; inset: 0; }
/* Mesin Buah: kanvas tegak 720×1280 (lihat buah.css). */
html[data-orient='p'] .stage { width: 720px; height: 1280px; }

/* Latar dipasang di <body> supaya memenuhi seluruh layar HP (termasuk sisi kiri-kanan / atas-bawah kanvas
   1280×720). Kanvas sendiri transparan; ukuran anyaman ikut skala kanvas. */
body {
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0 calc(3px * var(--s, 1)), transparent calc(3px * var(--s, 1)) calc(9px * var(--s, 1))),
    repeating-linear-gradient(45deg, rgba(120, 60, 10, 0.35) 0 calc(2px * var(--s, 1)), transparent calc(2px * var(--s, 1)) calc(9px * var(--s, 1))),
    radial-gradient(ellipse at 50% 30%, #3a1a08, #120602 70%);
  background-attachment: fixed;
}
html[data-screen='title'] body { background: radial-gradient(ellipse at 50% 55%, #4a0507, #160101 65%, #050000) fixed; }
html[data-screen='machines'] body { background: #000; }
html[data-screen='game'] body { background: radial-gradient(ellipse at 50% 40%, #2c2c2c, #0d0d0d 65%, #000) fixed; }
/* Bilah header biru diteruskan sampai tepi layar. */
html[data-hdr='1'] body::before {
  content: ''; position: fixed; left: 0; right: 0; top: calc(50% - 360px * var(--s, 1)); height: calc(116px * var(--s, 1));
  background: linear-gradient(180deg, #0a0f4a, #04072a); border-bottom: calc(2px * var(--s, 1)) solid #3646c9; box-sizing: border-box;
}

/* ---- Logo: kancil + tulisan merah bergaya ---- */
.logo { display: flex; align-items: center; justify-content: center; gap: 10px; }
.logo svg { width: 78px; height: 78px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6)); }
.logo b {
  font: 400 46px/1 'Lobster', cursive; color: var(--red); letter-spacing: 0.5px;
  -webkit-text-stroke: 5px #fff; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55);
}
.logo.big svg { width: 110px; height: 110px; }
.logo.big b { font-size: 70px; -webkit-text-stroke-width: 7px; }
.logo b { white-space: nowrap; }
.logo b.long { font-size: 34px; }
.logo.big b.long { font-size: 52px; }

/* ---- Header (KEMBALI · logo · LOGOUT) ---- */
.hdr {
  position: absolute; left: 0; right: 0; top: 0; height: 116px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  background: linear-gradient(180deg, #0a0f4a, #04072a); border-bottom: 2px solid #3646c9;
  border-top-left-radius: 30px;
}
.kembali {
  position: relative; height: 66px; padding: 0 30px 0 72px; border: 0;
  background: linear-gradient(180deg, #ff6b7a, #e8112d 55%, #b40a1f); color: #fff;
  font: 500 38px var(--ui); letter-spacing: 1px; border-radius: 4px 6px 6px 4px;
  clip-path: polygon(0 50%, 56px 0, 56px 14%, 100% 14%, 100% 86%, 56px 86%, 56px 100%);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}
.logout {
  display: flex; align-items: center; height: 54px; padding: 0; border: 0; background: none; color: #fff;
}
.logout .door {
  width: 58px; height: 54px; border-radius: 8px; border: 3px solid #ffb02e;
  background: linear-gradient(90deg, #e8112d 0 30%, #ffb02e 30% 42%, #8b0a14 42%);
}
.logout span {
  height: 46px; display: grid; place-items: center; padding: 0 34px; margin-left: -4px;
  background: linear-gradient(180deg, #ff5c6c, #d20f25); font: 500 34px var(--ui); border-radius: 0 6px 6px 0;
}

/* ---- Tombol kuning ---- */
.ybtn {
  height: 66px; border: 0; border-radius: 2px; color: #1b1405; font: 500 26px var(--ui); letter-spacing: 0.5px;
  background: linear-gradient(180deg, var(--yellow-1), var(--yellow-2) 55%, var(--yellow-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 3px 6px rgba(0, 0, 0, 0.6);
}
.ybtn:active { filter: brightness(0.9); transform: translateY(2px); }
.ybtn:disabled { background: linear-gradient(180deg, #a8a8a8, #858585); color: #5b5b5b; cursor: not-allowed; }
.ybtn.small { height: 50px; font-size: 21px; padding: 0 28px; }

.fine { font-size: 15px; color: #d8cbb0; margin: 0; }
.fine a { color: #ffd84d; }
.center { text-align: center; }
.form-msg { min-height: 22px; margin: 0; font-weight: 700; color: #ff8b8b; }
.form-msg.good { color: var(--green); }

/* ---- Masuk ---- */
.login { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.login-box {
  width: 520px; display: flex; flex-direction: column; gap: 14px; padding: 26px 30px;
  background: rgba(0, 0, 0, 0.75); border: 2px solid var(--yellow-2); border-radius: 6px;
}
.login-box label, .panel.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: #ffe9a8; }
input, select {
  height: 52px; padding: 0 14px; border-radius: 4px; border: 2px solid #5a4a20; background: #111; color: #fff; font: 500 22px var(--ui);
}
input:focus { border-color: var(--yellow-2); outline: none; }
.login .bottom { position: absolute; bottom: 18px; }

/* ---- Layar judul ---- */
.title { background: none; }
.title::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.35) 0 3px, transparent 3px 10px);
}
.title-user, .title-credit { position: absolute; top: 18px; font-size: 28px; color: var(--green); }
.title-user { left: 200px; }
.title-credit { right: 230px; }
.title-user b, .title-credit b { font-weight: 400; }
.title .logo { position: absolute; top: 40px; left: 0; right: 0; }
.fan { position: absolute; left: 360px; top: 160px; width: 560px; height: 380px; }
.fan svg { position: absolute; width: 190px; height: 266px; left: 185px; top: 40px; transform-origin: 50% 110%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7)); }
.fan::after {
  content: ''; position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 200, 0.35), transparent 60%); pointer-events: none;
}
.ribbon { position: absolute; left: 330px; top: 400px; width: 640px; height: 170px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6)); }
.sparkles { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(2px 2px at 20% 60%, #fff, transparent), radial-gradient(2px 2px at 30% 75%, #fff, transparent),
    radial-gradient(3px 3px at 26% 84%, #fff, transparent), radial-gradient(2px 2px at 74% 52%, #fff, transparent),
    radial-gradient(3px 3px at 80% 70%, #fff, transparent), radial-gradient(2px 2px at 88% 82%, #fff, transparent),
    radial-gradient(2px 2px at 16% 40%, #fff, transparent), radial-gradient(2px 2px at 70% 90%, #fff, transparent);
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.35; } }
.tap {
  position: absolute; z-index: 10; left: 290px; right: 290px; top: 250px; height: 60px; border: 0;
  background: rgba(200, 200, 200, 0.62); color: #fff; font: 700 38px var(--ui); letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6); animation: tapPulse 1.6s ease-in-out infinite;
}
@keyframes tapPulse { 50% { color: #ffe27a; } }

/* ---- Menu ---- */
.menu-grid {
  position: absolute; top: 140px; left: 200px; right: 200px;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; row-gap: 16px;
}
.menu-grid #btnResume { grid-column: 1 / -1; background: linear-gradient(180deg, #8cff6a, #35b51b 55%, #1d6f0c); color: #062200; }

/* ---- Lobi: kartu permainan + dompet + menu ---- */
.lobby-games { position: absolute; left: 30px; top: 134px; width: 680px; height: 530px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gcard {
  position: relative; border: 3px solid #e0a51b; border-radius: 18px; padding: 0 0 18px; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: linear-gradient(180deg, #2a0d4a, #10031f 70%); box-shadow: 0 0 0 4px #4a2a00, 0 14px 30px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(255, 200, 60, 0.12);
  transition: transform 0.15s;
}
.gcard.buah { background: linear-gradient(180deg, #6a0a12, #22020a 70%); }
.gcard:hover, .gcard:focus-visible { transform: translateY(-5px); }
.gcard:active { transform: scale(0.98); }
.gcard .gc-art { position: relative; width: 100%; height: 290px; display: flex; align-items: center; justify-content: center; }
.gcard.tangkas .gc-art span { position: absolute; width: 104px; height: 146px; transform-origin: 50% 115%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6)); }
.gcard.tangkas .gc-art span svg { width: 100%; height: 100%; }
.gcard.buah .gc-art { display: grid; grid-template-columns: repeat(3, 60px); gap: 7px; justify-content: center; align-content: center; }
.gcard.buah .gc-art i { width: 60px; height: 60px; padding: 6px; border-radius: 10px; background: linear-gradient(180deg, #fffdf2, #efdcb0); box-shadow: 0 0 0 3px #7a5a10, 0 4px 8px rgba(0, 0, 0, 0.5); }
.gcard.buah .gc-art i:nth-child(5) { box-shadow: 0 0 0 4px #fff36a, 0 0 22px 6px #ffd21a; }
.gcard b { font: 400 30px/1 'Lobster', cursive; white-space: nowrap; color: #ffd84d; -webkit-text-stroke: 4px #5a1a00; paint-order: stroke fill; letter-spacing: 1px; }
.gcard small { font: 600 14px var(--ui); color: #f4ead2; padding: 0 6px; }
.gcard i { margin-top: 6px; font: 900 22px/46px var(--ui); font-style: normal; padding: 0 44px; border-radius: 99px; color: #062200;
  background: linear-gradient(180deg, #8cff6a, #35b51b 55%, #1d6f0c); box-shadow: 0 4px 0 #124a07; animation: tapPulse 1.6s ease-in-out infinite; }
.gcard.poker { background: linear-gradient(180deg, #0b5a2c, #021a0c 70%); }
.lobby-wallet { position: absolute; left: 730px; right: 40px; top: 134px; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  border-radius: 10px; background: rgba(0, 0, 0, 0.6); border: 2px solid #e0a51b; font: 700 20px var(--ui); color: #ffe9a8; }
.lobby-wallet b { font: 900 30px var(--ui); color: var(--green); }
#scrMenu .menu-grid { top: 204px; left: 730px; right: 40px; column-gap: 12px; row-gap: 10px; }
#scrMenu .menu-grid .ybtn { height: 54px; font-size: 19px; padding: 0 8px; }

/* ---- Daftar ---- */
.register .logo svg { width: 64px; height: 64px; }
.register .logo b { font-size: 40px; }
.register .login-box { gap: 10px; padding: 18px 28px; width: 600px; }
.reg-title { margin: 0; text-align: center; font: 700 26px var(--ui); color: #ffe27a; letter-spacing: 2px; }
.reg-pw { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.register input { height: 46px; }
.login-box .agree { flex-direction: row; align-items: flex-start; gap: 10px; font: 500 16px/1.35 var(--ui); color: #f4ead2; }
.login-box .agree input { width: 26px; height: 26px; flex: none; margin: 0; accent-color: #d9b440; }
.login-box .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.home-link { position: absolute; top: 18px; left: 22px; text-decoration: none; color: #ffd84d; font-size: 18px; }

/* ---- Ticker kemenangan besar ---- */
.ticker {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.7); color: #ffe27a; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden;
}
.ticker:empty { display: none; }
.ticker .bot { color: #b8c4d8; }
.ticker .who { color: #fff; }
.ticker.ann { background: linear-gradient(90deg, #00264d, #0059b3 50%, #00264d); }
.ticker .ann { color: #ffe27a; font-weight: 900; }
.ticker.jp { background: linear-gradient(90deg, #5a0000, #b30000 50%, #5a0000); animation: jpflash 0.5s steps(1) infinite; }
@keyframes jpflash { 50% { background: linear-gradient(90deg, #7a4a00, #e0a000 50%, #7a4a00); } }
.ticker b { color: #6dff5a; font-weight: 900; }
.ticker .tk { position: absolute; left: 100%; white-space: nowrap; animation: tk linear 2 both; }
@keyframes tk { from { left: 100%; transform: translateX(0); } to { left: 0; transform: translateX(-100%); } }
.tk-probe { position: absolute; left: 0; top: 0; visibility: hidden; white-space: nowrap; font-weight: 700; font-size: 18px; pointer-events: none; }

/* ---- Halaman ---- */
.page-title { position: absolute; top: 130px; left: 0; right: 0; margin: 0; text-align: center; font: 700 30px var(--ui); color: #ffe27a; letter-spacing: 2px; text-shadow: 0 2px 2px #000; }
.panel {
  position: absolute; left: 200px; right: 200px; top: 182px; bottom: 30px;
  background: rgba(0, 0, 0, 0.72); border: 2px solid var(--yellow-3); border-radius: 6px; padding: 24px 30px;
}
.panel.form { display: flex; flex-direction: column; gap: 14px; left: 330px; right: 330px; bottom: auto; }
.panel.prose { overflow-y: auto; font-size: 20px; line-height: 1.55; color: #f4ead2; white-space: pre-line; user-select: text; }
/* ---- Choose Room: tulisan WELCOME berlampu + deretan mesin BET ---- */
html[data-screen='rooms'] body {
  background:
    radial-gradient(circle at 12% 30%, rgba(255, 170, 60, 0.35) 0 3%, transparent 9%),
    radial-gradient(circle at 85% 20%, rgba(255, 140, 40, 0.3) 0 4%, transparent 11%),
    radial-gradient(circle at 70% 80%, rgba(255, 190, 80, 0.25) 0 3%, transparent 10%),
    radial-gradient(circle at 25% 85%, rgba(255, 120, 40, 0.25) 0 4%, transparent 12%),
    radial-gradient(ellipse at 50% 45%, #6a2a0c, #2a0c04 60%, #110402) fixed;
}
.rooms-ticker { top: 0; bottom: auto; height: 38px; font-size: 19px; background: rgba(0, 0, 0, 0.8); }
.rbtn { position: absolute; top: 52px; width: 70px; height: 70px; border-radius: 50%; border: 3px solid #ffd27a; color: #fff;
  background: radial-gradient(circle at 40% 35%, #ff6b6b, #b3131f 70%); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); font: 900 34px var(--ui); }
.rbtn.back { left: 24px; }
.rbtn.exit { right: 24px; }
.rbtn.exit i { position: absolute; left: 50%; top: 14px; width: 30px; height: 30px; margin-left: -15px; border: 4px solid #fff; border-top-color: transparent; border-radius: 50%; }
.rbtn.exit i::before { content: ''; position: absolute; left: 9px; top: -9px; width: 4px; height: 18px; background: #fff; border-radius: 2px; }
.rbtn.exit span { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); font: 700 15px var(--ui); color: #fff; padding: 0 8px; border-radius: 6px; background: #555; }
.welcome { position: absolute; left: 140px; right: 140px; top: 46px; width: 1000px; height: 170px; }
.welcome text { font: 900 150px/1 'Roboto', var(--ui); letter-spacing: 6px; fill: #8e1b14; stroke: #f6c96b; stroke-width: 7px; paint-order: stroke; }
.welcome .bulbs { fill: none; stroke: #fff3b0; stroke-width: 9px; stroke-linecap: round; stroke-dasharray: 0 22; animation: bulbs 1.2s linear infinite; filter: drop-shadow(0 0 4px #ffcc33); }
@keyframes bulbs { to { stroke-dashoffset: -22; } }
.room-list { position: absolute; left: 30px; right: 30px; top: 250px; display: flex; justify-content: center; gap: 14px; }
.rcab { width: 160px; padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #ffe9a8; }
.rcab svg { width: 160px; height: 214px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.6)); transition: transform 0.15s; }
.rcab:hover svg, .rcab:focus-visible svg { transform: translateY(-6px); }
.rcab:active svg { transform: scale(0.96); }
.rcab small { font: 600 15px var(--ui); color: #f4ead2; text-shadow: 0 1px 2px #000; }
.rplaque {
  position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); min-width: 320px; padding: 10px 40px; text-align: center;
  display: flex; flex-direction: column; border-radius: 60px; border: 6px solid #8e1b14; box-shadow: 0 0 0 3px #f6c96b, 0 6px 14px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #ffe7b8, #e9b96e); color: #6b1410; font: 700 30px/1.15 Georgia, 'Times New Roman', serif;
}
.rplaque span { font-size: 34px; }
#onlineLine { position: absolute; bottom: 14px; left: 0; right: 0; }

.settings { display: flex; flex-direction: column; gap: 22px; font-size: 24px; }
.sw { display: flex; align-items: center; justify-content: space-between; }
.sw input { appearance: none; width: 74px; height: 40px; border-radius: 99px; background: #444; position: relative; padding: 0; border: 0; cursor: pointer; }
.sw input::before { content: ''; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.sw input:checked { background: #3fb21f; }
.sw input:checked::before { transform: translateX(34px); }
.opt { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg.themes { grid-template-columns: repeat(4, 1fr); }
.seg button { height: 54px; border-radius: 4px; border: 2px solid #5a4a20; background: #1a1408; color: #ffe9a8; font: 500 20px var(--ui); display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button[aria-checked='true'] { background: linear-gradient(180deg, var(--yellow-1), var(--yellow-2) 55%, var(--yellow-3)); color: #1b1405; border-color: transparent; }
.seg.themes button { height: 82px; }
.seg.themes svg { width: 40px; height: 56px; border-radius: 3px; }

.bonus { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-size: 26px; left: 380px; right: 380px; }
.bonus p { margin: 0; }
.bonus-amt { font: 900 70px var(--ui); color: var(--green); text-shadow: 0 0 14px rgba(124, 255, 59, 0.5); }
.bonus .ybtn { width: 300px; }

.table-wrap { overflow-y: auto; padding: 0; }
table.hist { width: 100%; border-collapse: collapse; font-size: 18px; }
.hist th, .hist td { padding: 10px 14px; border-bottom: 1px solid rgba(255, 216, 77, 0.18); text-align: left; }
.hist th { position: sticky; top: 0; background: #1a1408; color: #ffe27a; }
.hist .num { text-align: right; font-variant-numeric: tabular-nums; }
.hist td.win { color: var(--green); font-weight: 700; }
.contact-list { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.contact-list a {
  display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-radius: 6px; text-decoration: none;
  background: #1a1408; border: 2px solid #5a4a20; color: #fff; font: 500 24px var(--ui);
}
.contact-list a:active { filter: brightness(0.85); }
.contact-list a span { flex: 1; }
.contact-list a small { color: #ffe27a; font-size: 17px; }
.contact-list .cicon { width: 52px; height: 52px; flex: none; }
.contact-list .empty { margin: auto; text-align: center; color: #f4ead2; font-size: 22px; }
.hist td.minus { color: #ff8a96; font-weight: 700; }

.chat { display: flex; flex-direction: column; gap: 12px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 19px; user-select: text; }
.chat-log p { margin: 0; color: #f0e6cc; overflow-wrap: anywhere; }
.bubble { max-width: 70%; padding: 8px 14px; border-radius: 14px; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px; }
.bubble.me { align-self: flex-end; background: #2f6f1f; color: #fff; border-bottom-right-radius: 4px; }
.bubble.admin { align-self: flex-start; background: #2a2414; color: #f4ead2; border: 1px solid #5a4a20; border-bottom-left-radius: 4px; }
.bubble b { color: #ffe27a; font-size: 15px; }
.bubble time { align-self: flex-end; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.chat-empty { margin: auto; text-align: center; max-width: 520px; }
[data-badge]:not([data-badge=''])::after {
  content: attr(data-badge); position: absolute; top: -10px; right: -10px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px;
  background: #e0172f; color: #fff; font: 900 20px/34px var(--ui); box-shadow: 0 0 0 3px #fff;
}
.menu-grid .ybtn { position: relative; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; }

/* ---- Daftar colokan (gaya daftar 1-50 = X10) ---- */
.machines { background: none; }
.mtop { position: absolute; left: 30px; right: 30px; top: 8px; height: 68px; display: flex; gap: 14px; align-items: center; }
.mback { width: 70px; height: 62px; border: 0; border-radius: 10px; background: linear-gradient(180deg, #ff6b7a, #c40d22); color: #fff; font: 700 34px var(--ui); }
#roomSelect {
  flex: 1; height: 62px; font: 400 30px var(--ui); color: #222; border-radius: 12px; border: 0;
  background: linear-gradient(180deg, #e9e9e9, #bdbdbd); padding: 0 18px;
}
.mstat { height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); border: 2px solid var(--yellow-3); color: #ffe9a8; font: 700 22px var(--ui); }
.mstat b { color: #fff; font-size: 28px; font-weight: 900; }
/* Panel kiri: info colokan yang dipilih. */
.minfo {
  position: absolute; left: 20px; top: 88px; width: 290px; bottom: 96px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, #fbf3dc, #e9dbb4); border: 3px solid #8a5a1e; border-radius: 10px; color: #3a2408;
}
.minfo h3 { margin: 0; font: 900 22px var(--ui); color: #6b3d0a; }
.minfo .no { font: 900 60px/1 var(--ui); color: #1b1405; }
.minfo dl { margin: 6px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font: 700 18px var(--ui); }
.minfo dt { color: #6b3d0a; } .minfo dd { margin: 0; text-align: right; font-weight: 900; }
.minfo dl > * { padding-bottom: 5px; border-bottom: 2px solid rgba(138, 90, 30, 0.25); }
.minfo .hist { font-size: 16px; color: #5a4320; margin-top: 4px; }
.minfo .st { margin-top: auto; font: 800 18px var(--ui); }
.minfo .st.kosong { color: #1f7a10; } .minfo .st.pemain { color: #b0121f; } .minfo .st.kamu { color: #a06b00; } .minfo .st.bot { color: #374151; }
/* Grid mesin: 10 per baris, bisa digulir. */
.mgrid {
  position: absolute; left: 326px; right: 20px; top: 88px; bottom: 96px; overflow-y: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px 6px; align-content: start;
  background: linear-gradient(180deg, #fbf3dc, #eadcb6); border: 3px solid #8a5a1e; border-radius: 10px;
}
.mtile { position: relative; height: 104px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; }
.mtile svg { width: 100%; height: 100%; display: block; }
.mtile.sel { border-color: #ff9f1a; background: rgba(255, 190, 60, 0.35); }
.mtile.pemain { cursor: not-allowed; }
.mtile .tag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); padding: 0 6px; border-radius: 6px; background: #111; color: #fff; font: 800 13px var(--ui); white-space: nowrap; }
.mtile.kamu .tag { background: #e09a00; color: #1b1405; }
.mtile.bot .tag { background: #475569; }
.mselect { position: absolute; left: calc(326px + (100% - 346px) / 2 - 140px); bottom: 14px; width: 280px; }
.mgrid .fine { grid-column: 1 / -1; color: #3a2408; padding: 20px; text-align: center; }

/* ---- Layar mesin ---- */
.game { color: #fff; }
.g-menu {
  position: absolute; left: 60px; top: 14px; width: 78px; height: 78px; border-radius: 50%; border: 3px solid #f4b8ff;
  background: radial-gradient(circle at 35% 30%, #f3a6ff, #b03fd0 55%, #6c1386); padding: 18px 16px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}
.g-menu i { display: block; height: 7px; border-radius: 4px; background: #fff; box-shadow: -10px 0 0 -1px #fff; margin-left: 10px; }
.g-arrow { position: absolute; top: 30px; width: 124px; height: 58px; border: 0; background: none; padding: 0; }
.g-arrow::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #bdbdbd, #7d7d7d);
  clip-path: polygon(0 50%, 34% 0, 34% 24%, 100% 24%, 100% 76%, 34% 76%, 34% 100%);
}
.g-arrow.left { left: 165px; }
.g-arrow.right { left: 310px; transform: scaleX(-1); }
.g-arrow:active::before { background: linear-gradient(180deg, #ffe27a, #b08a1f); }
.g-ful { position: absolute; left: 66px; top: 96px; border: 0; background: none; color: #e9e9e9; font: 400 28px var(--ui); padding: 0; }
.g-ful b { font-weight: 400; color: #ffe27a; }
.g-credit { position: absolute; left: 66px; top: 132px; width: 380px; display: flex; justify-content: space-between; font-size: 36px; }
.g-credit span { color: var(--green); }
.g-credit b { font-weight: 400; color: var(--green); }
.g-bet { position: absolute; left: 66px; top: 180px; width: 380px; font-size: 26px; }
.g-bet .lbl { color: #ddd; }
.g-bet .mult { position: absolute; right: 0; top: 0; color: #ddd; }
.g-bet .meters { list-style: none; margin: 4px 0 0; padding: 0; color: #ffe27a; font-size: 23px; line-height: 1.12; }
.g-bet .bet-now { position: absolute; right: 0; top: 32px; color: #ffe27a; font-weight: 400; font-size: 23px; }
.coin { position: absolute; left: 480px; width: 100px; height: 100px; border: 0; padding: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffd27a, #ff9a1a 55%, #c45d00); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.6); }
.coin i { position: absolute; right: -14px; top: -14px; width: 56px; height: 56px; display: grid; place-items: center; font: 900 50px/1 var(--ui); font-style: normal; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4); }
.coin.in { top: 104px; }
.coin.in i { color: #6bd84a; }
.coin.out { top: 222px; }
.coin.out i { color: #ff4b4b; }
.coin:disabled { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; }
.g-pay { position: absolute; left: 800px; right: 54px; top: 18px; font-size: 23px; line-height: 1.08; }
.g-pay .row { display: flex; justify-content: space-between; }
.g-pay .row:nth-child(odd) span { color: #ffe27a; }
.g-pay .row:nth-child(odd) b { color: #ffe27a; }
.g-pay b { font-weight: 400; }
.g-pay .row.lit { animation: litrow 0.45s steps(1) infinite; }
.g-pay .row.lit span, .g-pay .row.lit b { color: inherit !important; }
@keyframes litrow { 0% { background: #ffe27a; color: #000; } 50% { background: transparent; color: #fff; } }
.g-pay .njx { margin-top: 4px; color: #ff5a6a; font-size: 18px; }
.g-msg {
  position: absolute; left: 160px; right: 160px; top: 296px; height: 46px; display: grid; place-items: center;
  font: 900 32px var(--ui); color: #ffe27a; text-shadow: 0 0 10px rgba(255, 160, 0, 0.8), 0 2px 2px #000; pointer-events: none;
}
.g-msg.bad { color: #ff9aa6; text-shadow: 0 2px 2px #000; }
.g-msg.info { color: #fff; font-size: 26px; font-weight: 700; text-shadow: 0 2px 2px #000; }
.g-cards { position: absolute; left: 0; right: 0; top: 350px; height: 300px; perspective: 1200px; }
.g-cards .card { position: absolute; width: 176px; height: 246px; transition: transform 0.3s; }
.g-cards .card.low { top: 40px; }
.card .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1); }
.card.down .inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8% / 5.7%; overflow: hidden; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.65); }
.face svg { display: block; width: 100%; height: 100%; }
.face.back { transform: rotateY(180deg); }
.card.deal { animation: deal 0.4s cubic-bezier(0.22, 1.2, 0.36, 1) both; }
@keyframes deal { from { transform: translate(260px, -360px) rotate(-14deg) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.card.hit .face.front { box-shadow: 0 0 0 4px #ffe27a, 0 0 26px #ffb000; }
.card.dim .face { filter: brightness(0.45) saturate(0.6); }
.card.fig .face { box-shadow: none; border-radius: 0; overflow: visible; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.55)); }
.card.fig.low { top: 0; }
.card.fig.hit .face.front { box-shadow: none; filter: drop-shadow(0 0 4px #ffe27a) drop-shadow(0 0 12px #ffb000); }
.card.fig.dim .face { filter: brightness(0.45) saturate(0.6); }
.g-insert {
  position: absolute; left: 170px; width: 980px; top: 455px; z-index: 20; text-align: center; pointer-events: none;
  font: 400 50px/1.25 'Press Start 2P', var(--ui); letter-spacing: 2px; color: #fff6c8; filter: blur(0.8px);
  text-shadow: 0 0 10px #ffb000, 0 0 22px #ff6a00; animation: insert 1.2s steps(1) infinite;
}
.g-insert small { display: block; margin-top: 14px; font-size: 30px; }
.g-insert[hidden] { display: none; }
@keyframes insert { 0% { opacity: 0.5; } 50% { opacity: 0.06; } }
.g-bottom { position: absolute; left: 66px; right: 470px; bottom: 6px; height: 50px; display: flex; align-items: center; gap: 46px; font-size: 32px; color: var(--green); }
.g-bottom b { font-weight: 400; }
.g-bottom .wallet { margin-left: auto; }
.g-btn {
  position: absolute; bottom: 6px; width: 160px; height: 76px; border: 0; border-radius: 2px;
  background: linear-gradient(180deg, #a9a9a9, #7c7c7c); color: #eee; font: 400 30px var(--ui);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.6);
}
.g-btn.bet { right: 270px; }
.g-btn.fold { right: 40px; }
.g-btn.ready.bet { background: linear-gradient(180deg, #46a6ff, #1662c4); color: #fff; }
.g-btn.ready.fold { background: linear-gradient(180deg, #ff6d6d, #c11818); color: #fff; }
.g-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.g-btn:active:not(:disabled) { transform: translateY(2px); }
.game-ticker { top: 322px; bottom: auto; left: 0; right: 0; height: 27px; font-size: 15px; background: rgba(0, 0, 0, 0.6); border-top: 1px solid rgba(255, 216, 77, 0.35); border-bottom: 1px solid rgba(255, 216, 77, 0.35); }

/* ---- Dialog (Help, Pilih Fullhouse, Coin In) ---- */
dialog.box {
  width: min(720px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); overflow-y: auto;
  background: #050505; color: #fff; border: 2px solid #555; border-radius: 2px; padding: 18px 26px; font: 400 clamp(14px, 3.3vh, 22px)/1.35 var(--ui);
}
dialog.box::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.box h2 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid #333; font: 400 1.6em var(--ui); }
dialog.box form > .ybtn { margin-top: 14px; }
/* Menu mesin: pengaturan yang sama dengan layar SETTINGS, dipinjam ke dalam dialog. */
.game-menu { width: min(860px, calc(100vw - 20px)); }
.game-menu .panel { position: static; background: none; border: 0; padding: 4px 0 0; font-size: 1.05em; gap: 14px; }
.game-menu .seg button { height: 46px; }
.game-menu .seg.themes button { height: 70px; font-size: 17px; }
dialog.box h2:focus { outline: none; }
.gm-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.gm-actions .ybtn { width: 100%; padding: 0 6px; font-size: 18px; }
.gm-actions .gm-play { background: linear-gradient(180deg, #6fe04a, #2f9e1a); color: #fff; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 1.35em; }
.legend li { display: flex; align-items: center; gap: 22px; }
.ico { width: 56px; height: 36px; flex: none; display: grid; place-items: center; font-style: normal; font-weight: 900; }
.ico.arrow-l, .ico.arrow-r { background: linear-gradient(180deg, #bdbdbd, #7d7d7d); clip-path: polygon(0 50%, 40% 0, 40% 25%, 100% 25%, 100% 75%, 40% 75%, 40% 100%); }
.ico.arrow-r { transform: scaleX(-1); }
.ico.coin-in, .ico.coin-out { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffd27a, #ff9a1a 60%, #c45d00); font-size: 26px; }
.ico.coin-in { color: #6bd84a; margin: 0 8px; }
.ico.coin-out { color: #ff4b4b; margin: 0 8px; }
.ico.menu { width: 44px; height: 36px; margin: 0 6px; background: repeating-linear-gradient(180deg, #fff 0 5px, transparent 5px 11px); border-radius: 4px; }
.ico.tag { width: 56px; height: 28px; font: 500 18px var(--ui); color: #fff; }
.ico.tag.bet { background: #2b8be0; }
.ico.tag.fold { background: #e0303a; }
.rules { margin-top: 14px; padding-top: 10px; border-top: 1px solid #333; font-size: 0.95em; color: #ddd; user-select: text; }
.rules h3 { margin: 10px 0 6px; color: #ffe27a; font-size: 1.1em; }
.rules ol { margin: 0; padding-left: 1.3em; }
.rules p { margin: 6px 0; }
.pick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.pick-grid button, .coin-grid button {
  height: 64px; border: 2px solid #5a4a20; border-radius: 4px; background: #1a1408; color: #ffe9a8; font: 700 26px var(--ui);
}
.pick-grid button.on { background: linear-gradient(180deg, var(--yellow-1), var(--yellow-2) 55%, var(--yellow-3)); color: #1b1405; }
.coin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.coin-grid button:disabled { opacity: 0.35; cursor: not-allowed; }

.toast {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 20; max-width: 900px;
  padding: 12px 22px; border-radius: 6px; background: rgba(160, 10, 28, 0.95); border: 2px solid #ff8b97; font: 700 22px var(--ui); text-align: center;
}
.toast.good { background: rgba(20, 90, 10, 0.95); border-color: #9cff6c; }

/* HP tegak: minta diputar. */
.rotate { display: none; position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; font: 500 20px var(--ui); }
.rotate-phone { width: 60px; height: 100px; border: 5px solid #ffe27a; border-radius: 12px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 40%, 60% { transform: rotate(-90deg); } }
@keyframes rotP { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0); } }
@media (orientation: portrait) and (max-width: 820px) { html:not([data-orient='p']) .rotate { display: flex; } }
@media (orientation: landscape) and (max-height: 600px) {
  html[data-orient='p'] .rotate { display: flex; }
  html[data-orient='p'] .rotate-phone { animation-name: rotP; }
}

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