/* =========================================================
   SEKOP WAWA — gaya tampilan
   ========================================================= */
:root {
  --red: #e8343b;
  --yellow: #f6b81e;
  --green: #23a55a;
  --blue: #1f77e0;
  /* sisi gelap UNO Flip */
  --pink: #e0409a;
  --teal: #12a8a0;
  --orange: #f0731e;
  --purple: #7b3fd6;
  --bg: #140d09;
  --bg-2: #22160f;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .09);
  --text: #fbf4e6;
  --muted: #c9b99c;
  --accent: #d4952a;
  --accent-2: #f2c14e;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --ok: #3ddc84;
  --radius: 18px;
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(242, 193, 78, .14), transparent 60%),
    radial-gradient(800px 600px at -10% 30%, rgba(37, 152, 94, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.in-game { overflow: hidden; height: 100dvh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid transparent; border-radius: 12px; padding: .72em 1.15em;
  background: var(--surface-2); font-weight: 700; line-height: 1.1; white-space: nowrap;
  transition: transform .12s, background .15s, box-shadow .2s, opacity .15s;
}
.btn:hover { background: rgba(255, 255, 255, .13); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -8px rgba(255, 65, 54, .7); }
.btn-accent:hover { background: var(--grad); box-shadow: 0 10px 30px -6px rgba(255, 65, 54, .85); filter: brightness(1.06); }
.btn-light { background: #fff; color: #2a1d10; }
.btn-light:hover { background: #f3ead8; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-wa { background: #25d366; color: #06301a; }
.btn-wa:hover { background: #2ee673; }
.btn-lg { padding: .95em 1.4em; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { padding: .5em .85em; font-size: .86rem; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.on { background: rgba(61, 220, 132, .16); border-color: rgba(61, 220, 132, .45); color: var(--ok); }
.icon-btn.danger { background: rgba(255, 65, 54, .15); border-color: rgba(255, 65, 54, .45); color: #ff7a72; }
.dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- layar ---------- */
.screen { display: none; }
.screen.active { display: block; }
#game.screen.active { display: flex; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 116px; width: auto; margin: -12px 0; filter: drop-shadow(0 8px 20px rgba(232, 52, 59, .3)); }
.brand.small .brand-logo { height: 76px; margin: -6px 0; }

/* =========================================================
   BERANDA
   ========================================================= */
.nav {
  max-width: 1180px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-links { display: flex; align-items: center; gap: 22px; font-weight: 600; color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--text); }

.hero {
  max-width: 1180px; margin: 0 auto; padding: 30px 20px 60px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 65, 54, .12); border: 1px solid rgba(255, 65, 54, .35); color: #ff8a80; font-weight: 700; font-size: .85rem;
}
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.02; margin: 18px 0 16px; letter-spacing: .3px; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 520px; line-height: 1.6; }
.join-card {
  margin-top: 26px; max-width: 460px; padding: 20px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid var(--border); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(10px);
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .join-row input, .invite-link input, .chat-form input {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .35); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .join-row input:focus, .chat-form input:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(255, 159, 28, .15);
}
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: .4em; font-weight: 800; text-align: center; font-size: 1.05rem; }
.hero-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-weight: 600; font-size: .9rem; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points .ico { color: var(--ok); }

.hero-art { position: relative; height: 460px; display: grid; place-items: center; }
.hero-art .glow {
  position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 54, .45), transparent 65%); filter: blur(20px);
}
.fan { position: relative; width: 100%; height: 100%; }
.fan .pc {
  --cw: 132px; position: absolute; left: 50%; top: 50%; margin: calc(var(--cw) * -.75) 0 0 calc(var(--cw) * -.5);
  transform-origin: 50% 140%; transform: rotate(var(--r)) translateY(-10px);
  animation: fanIn .9s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--d);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .7);
}
.fan .pc:hover { transform: rotate(var(--r)) translateY(-34px); transition: transform .25s; }
@keyframes fanIn { from { transform: rotate(0) translateY(80px); opacity: 0; } }

.features {
  max-width: 1180px; margin: 0 auto; padding: 0 20px 40px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.features article {
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.features h3 { font-size: 1.02rem; margin: 14px 0 6px; }
.features p { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.f-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 159, 28, .12); color: var(--accent-2); font-size: 1.15rem;
}

.section { max-width: 1180px; margin: 0 auto; padding: 60px 20px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin: 8px 0 10px; letter-spacing: .3px; }
.section-head p { color: var(--muted); line-height: 1.6; }

.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule {
  display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.rule .pc { --cw: 62px; }
.rule h4 { font-size: 1rem; margin-bottom: 4px; }
.rule p { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.rules-grid.compact { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rules-grid.compact .rule { padding: 10px; gap: 12px; }
.rules-grid.compact .rule .pc { --cw: 46px; }
.rule-notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.rule-notes div {
  padding: 16px 18px; border-radius: var(--radius); border: 1px dashed rgba(255, 255, 255, .14); color: var(--muted); line-height: 1.55; font-size: .92rem;
}
.rule-notes b { color: var(--text); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.steps b {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin-bottom: 14px;
}
.steps h3 { font-size: 1.08rem; margin-bottom: 6px; }
.steps p { color: var(--muted); line-height: 1.5; }

.footer {
  max-width: 1180px; margin: 0 auto; padding: 30px 20px 40px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .85rem; flex-wrap: wrap;
}
.footer > p { flex-basis: 100%; text-align: center; font-size: .78rem; }

/* =========================================================
   LOBI
   ========================================================= */
#lobby.active { min-height: 100dvh; }
.lobby { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1.15fr 1.1fr; gap: 16px; align-items: start; }
.panel {
  padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.panel h3 { font-size: 1.08rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-code { font-family: var(--display); font-size: 3.4rem; letter-spacing: .14em; line-height: 1; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { padding: 10px 12px; font-size: .85rem; color: var(--muted); }
.voice-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
}
.voice-box p { margin-top: 2px; }

.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: rgba(0, 0, 0, .22); border: 1px solid transparent; animation: slideIn .3s ease-out;
}
.player-list li.me { border-color: rgba(255, 159, 28, .35); }
@keyframes slideIn { from { transform: translateY(6px); opacity: 0; } }
.player-list .name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list .slot { border: 1px dashed var(--border); background: transparent; color: var(--muted); justify-content: center; font-size: .88rem; }
.tag { font-size: .68rem; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; }
.tag.host { background: rgba(255, 210, 63, .16); color: #ffd23f; }
.kick { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 8px; }
.kick:hover { color: var(--accent); background: rgba(255, 65, 54, .12); }

.avatar {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; text-transform: uppercase; font-size: .95rem;
  background: var(--av); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22);
}
.avatar .ico { width: 18px; height: 18px; }
.avatar.speaking { box-shadow: 0 0 0 3px var(--ok), 0 0 16px rgba(61, 220, 132, .7); }
.avatar .vbadge {
  position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: #251910; border: 2px solid var(--bg); color: var(--ok);
}
.avatar .vbadge .ico { width: 10px; height: 10px; }
.avatar .vbadge.muted { color: #ff7a72; }

.mode-select { display: grid; gap: 10px; }
.mode {
  text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--border); background: rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s;
}
.mode:hover:not(:disabled) { border-color: rgba(255, 255, 255, .25); }
.mode:disabled { cursor: default; }
.mode.selected { border-color: var(--accent-2); background: rgba(255, 159, 28, .1); }
.mode-title { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.mode.selected .mode-title .ico { color: var(--accent-2); }
.mode-desc { color: var(--muted); font-size: .84rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: .92rem; }
.switch-row select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: #22170f; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled, select:disabled { opacity: .55; cursor: default; }

.voice-ctl { display: flex; gap: 6px; align-items: center; }
.voice-ctl .btn { padding: .55em .85em; font-size: .86rem; }

/* =========================================================
   PERMAINAN
   ========================================================= */
#game { flex-direction: column; height: 100dvh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.tb-right { display: flex; align-items: center; gap: 6px; flex: none; }
/* Judul meja di dalam game: kartu kaca dengan ikon berwarna sesuai mode */
.tb-title {
  --mc: var(--accent-2); --mc2: var(--accent);
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 420px;
  padding: 5px 14px 5px 5px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border); /* cadangan browser lama tanpa color-mix */
  background: linear-gradient(135deg, color-mix(in srgb, var(--mc) 22%, transparent), rgba(255, 255, 255, .04) 60%);
  border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent);
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--mc) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}
.tb-title.m-classic { --mc: var(--blue); --mc2: #5b5fe0; }
.tb-title.m-flip { --mc: var(--yellow); --mc2: var(--green); }
.tb-title.m-flip.dark { --mc: var(--purple); --mc2: var(--pink); }
.tb-title.m-allwild { --mc: var(--green); --mc2: var(--blue); }
.tb-title.m-attack { --mc: var(--orange); --mc2: var(--red); }
.tb-emoji {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.35rem; line-height: 1; color: #fff;
  background: linear-gradient(135deg, var(--mc), var(--mc2));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 0 0 2px rgba(255, 255, 255, .25);
  transform: rotate(-6deg);
}
.tb-emoji .ico { width: 20px; height: 20px; }
.tb-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tb-name {
  font-family: var(--display); font-weight: 400; font-size: 1.02rem; line-height: 1.05; color: var(--text); letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.tb-chips { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.tb-meta { display: contents; }
.tb-chip {
  flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: .66rem; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .3); color: var(--muted); white-space: nowrap;
}
.tb-chip.code { color: var(--text); letter-spacing: .08em; }
.tb-chip .ico { width: .95em; height: .95em; }
.mode-badge {
  flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  padding: 4px 7px 3px; border-radius: 6px; background: var(--grad); color: #fff; white-space: nowrap;
}
.mode-badge.m-classic { background: var(--blue); }
.mode-badge.m-flip { background: linear-gradient(135deg, var(--yellow), var(--green)); color: #17151f; }
.mode-badge.m-flip.dark { background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff; }
.mode-badge.m-allwild { background: linear-gradient(90deg, var(--red), var(--yellow), var(--green), var(--blue)); }
.mode-badge.m-attack { background: linear-gradient(135deg, var(--orange), var(--red)); }

.table-wrap { flex: 1; display: flex; min-height: 0; gap: 12px; padding: 0 12px; }
.table { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---------- arena: meja oval dengan lawan melingkar ---------- */
.arena { position: relative; flex: 1; min-height: 0; }
.felt {
  position: absolute; left: 7%; right: 7%; top: 13%; bottom: 5%; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, .10), transparent 55%),
    radial-gradient(ellipse at center, #1a6b48 0%, #135537 55%, #0d3d28 100%);
  box-shadow:
    inset 0 0 0 9px #5a3622, inset 0 0 0 11px #7a4a2e, inset 0 0 0 12px rgba(0, 0, 0, .35),
    inset 0 18px 50px rgba(0, 0, 0, .45), 0 30px 60px -24px rgba(0, 0, 0, .9);
}
.felt::after {
  content: ""; position: absolute; inset: 20%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .08);
}
.seats { position: absolute; inset: 0; pointer-events: none; z-index: 2; --seat-w: 92px; --seat-av: 54px; }
.seats.crowded { --seat-w: 74px; --seat-av: 44px; }
.seat {
  position: absolute; width: var(--seat-w); transform: translate(-50%, -50%); pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: opacity .3s, filter .3s;
}
.seat-av { position: relative; }
.seat .avatar {
  width: var(--seat-av); height: var(--seat-av); font-size: calc(var(--seat-av) * .38);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 10px 22px rgba(0, 0, 0, .55); transition: box-shadow .3s, transform .3s;
}
.seat .avatar .ico { width: 50%; height: 50%; }
.seat.turn .avatar { transform: scale(1.08); box-shadow: 0 0 0 3px var(--accent-2), 0 0 0 7px rgba(255, 159, 28, .3), 0 0 26px rgba(255, 159, 28, .8); animation: turnGlow 1.2s ease-in-out infinite alternate; }
@keyframes turnGlow { to { box-shadow: 0 0 0 3px var(--accent-2), 0 0 0 10px rgba(255, 159, 28, .12), 0 0 34px rgba(255, 159, 28, .9); } }
.seat.off { opacity: .55; }
.seat.out { opacity: .45; filter: grayscale(1); }
.seat-cards {
  position: absolute; right: -10px; bottom: -6px; min-width: 24px; height: 32px; padding: 0 4px; border-radius: 5px;
  display: grid; place-items: center; background: linear-gradient(160deg, #ff4d55, #c8222a); border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5); transform: rotate(10deg);
}
.seat-cards b { font-family: var(--display); font-weight: 400; font-size: .95rem; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .4); transform: rotate(-10deg); }
.seat-name {
  max-width: 100%; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-weight: 700; font-size: .74rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seat.turn .seat-name { background: var(--accent-2); color: #2a1600; }
.seat-sub { font-size: .66rem; color: var(--muted); }
.seat .mercy { width: 70%; }
.seat .badge-uno { top: -10px; right: -14px; }
.seat .catch-btn { bottom: -26px; }
.mercy { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.mercy i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .4s, background .4s; }
.mercy i.warn { background: var(--yellow); }
.mercy i.danger { background: var(--accent); }
.badge-uno {
  position: absolute; top: -9px; right: -6px; background: var(--red); color: #fff; font-family: var(--display); font-size: .78rem;
  padding: 2px 8px; border-radius: 999px; transform: rotate(8deg); box-shadow: 0 0 0 2px #fff;
}
.catch-btn {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); border: 0; white-space: nowrap;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .72rem; padding: 5px 11px; border-radius: 999px;
  animation: pulse .7s infinite alternate; box-shadow: 0 6px 16px rgba(255, 65, 54, .6); z-index: 2;
}
@keyframes pulse { to { transform: translateX(-50%) scale(1.1); } }

.middle {
  position: absolute; left: 50%; top: 57%; transform: translate(-50%, -50%); z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
.direction-ring {
  position: absolute; left: 50%; top: 50%; margin: -135px 0 0 -135px; width: 270px; height: 270px; border-radius: 50%; pointer-events: none; opacity: .55;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--ring, rgba(255,255,255,.25)) 25%, transparent 30% 70%, var(--ring, rgba(255,255,255,.25)) 75%, transparent 80%);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 65%, transparent 66%);
  mask: radial-gradient(circle, transparent 62%, #000 63%, #000 65%, transparent 66%);
  animation: spin 6s linear infinite;
}
.direction-ring.ccw { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.pile { position: relative; border: 0; background: none; padding: 0; z-index: 1; }
.draw-pile .card { --cw: 96px; }
.draw-pile .stack { position: absolute; inset: 0; }
.draw-pile .stack::before, .draw-pile .stack::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; background: #17151f; border: 2px solid rgba(255, 255, 255, .7);
}
.draw-pile .stack::before { transform: translate(6px, 6px); }
.draw-pile .stack::after { transform: translate(3px, 3px); }
.draw-pile:hover .card.back { transform: translateY(-4px); }
.draw-pile .card.back { transition: transform .15s; }
.draw-pile.can .card.back { animation: glow 1s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 3px var(--accent-2), 0 0 30px 6px rgba(255, 159, 28, .7); } }
/* UNO Attack: tumpukan jadi peluncur kartu */
.draw-pile.launcher .card.back .oval::before { background: var(--orange); }
/* UNO Flip sisi gelap: kartu tumpukan ikut gelap */
.dark-side .draw-pile .card.back .oval::before { background: var(--purple); }
.pile-label { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); font-size: .76rem; color: var(--muted); white-space: nowrap; font-weight: 600; }

.discard { width: 116px; height: 174px; }
.discard .card { --cw: 116px; position: absolute; inset: 0; }
.discard .card.under { transform: rotate(var(--r)); filter: brightness(.7); }
.discard .card.fresh { animation: drop .4s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes drop { from { transform: translateY(-70px) rotate(-25deg) scale(1.2); opacity: 0; } }
.discard::after {
  content: ""; position: absolute; inset: -12px; border-radius: 22px; border: 4px solid var(--cur, transparent);
  box-shadow: 0 0 30px -4px var(--cur, transparent); pointer-events: none; transition: border-color .3s, box-shadow .3s;
}
.pending {
  position: absolute; top: -46px; left: calc(50% + 30px); z-index: 3;
  background: var(--grad); color: #fff; font-family: var(--display); font-size: 1.6rem;
  padding: 4px 16px 2px; border-radius: 14px; box-shadow: 0 10px 30px rgba(255, 65, 54, .5); animation: bump .5s;
}
@keyframes bump { 50% { transform: scale(1.3); } }

.banner {
  position: absolute; left: 50%; top: 50%; z-index: 10; pointer-events: none;
  font-family: var(--display); font-size: clamp(2rem, 6vw, 3.6rem); text-align: center; white-space: nowrap;
  color: #fff; -webkit-text-stroke: 2px rgba(0, 0, 0, .35); text-shadow: 0 6px 0 rgba(0, 0, 0, .3), 0 0 40px var(--bc, rgba(255, 159, 28, .8));
  transform: translate(-50%, -50%) scale(0); opacity: 0;
}
.banner.show { animation: banner 1.5s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes banner {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.08) rotate(-3deg); opacity: 1; }
  75% { transform: translate(-50%, -50%) scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(.9) rotate(-3deg); opacity: 0; }
}

.status-wrap { padding: 4px 8px 6px; }
.status { text-align: center; font-weight: 700; font-size: 1rem; min-height: 26px; color: var(--muted); }
.status.mine { color: #ffd23f; }
.timer { height: 4px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; margin: 6px auto 0; max-width: 640px; }
.timer div { height: 100%; width: 0; background: var(--grad); transition: width .25s linear; }
.timer div.low { background: var(--accent); }

/* ---------- kartu ---------- */
.card {
  --cw: 84px; --c: #17151f;
  position: relative; flex: none; width: var(--cw); height: calc(var(--cw) * 1.5);
  border-radius: calc(var(--cw) * .13); background: var(--c);
  border: calc(var(--cw) * .065) solid #fff; overflow: hidden; user-select: none;
  font-size: calc(var(--cw) * .2); box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .55);
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .28), transparent 40%, transparent 70%, rgba(0, 0, 0, .18));
}
.card.red { --c: var(--red); }
.card.yellow { --c: var(--yellow); }
.card.green { --c: var(--green); }
.card.blue { --c: var(--blue); }
.card.pink { --c: var(--pink); }
.card.teal { --c: var(--teal); }
.card.orange { --c: var(--orange); }
.card.purple { --c: var(--purple); }
.card .oval { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card .oval::before {
  content: ""; position: absolute; width: 80%; height: 88%; left: 10%; top: 6%;
  background: #fff; border-radius: 50%; transform: rotate(28deg);
}
.card .oval > * { position: relative; }
.card .num {
  font-family: var(--display); font-size: 2.7em; line-height: 1; color: var(--c);
  text-shadow: .05em .06em 0 rgba(0, 0, 0, .28); -webkit-text-stroke: .025em rgba(0, 0, 0, .35);
}
.card .num.long { font-size: 2.05em; }
.card.underline .num { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .08em; }
.card .glyph { display: grid; color: var(--c); filter: drop-shadow(.05em .06em 0 rgba(0, 0, 0, .28)); }
.card .glyph svg { width: 2.3em; height: 2.3em; }
.card .cap { font-size: .46em; font-weight: 800; letter-spacing: .06em; color: var(--c); margin-top: .1em; }
.card .corner {
  position: absolute; z-index: 1; font-family: var(--display); font-size: .82em; line-height: 1; color: #fff;
  text-shadow: .06em .06em 0 rgba(0, 0, 0, .4);
}
.card .corner.tl { top: .28em; left: .32em; }
.card .corner.br { bottom: .28em; right: .32em; transform: rotate(180deg); }
.card.wild .oval::before {
  background: conic-gradient(from -62deg, var(--red) 0 25%, var(--blue) 0 50%, var(--yellow) 0 75%, var(--green) 0);
  box-shadow: inset 0 0 0 .12em #17151f;
}
.card.wild.dark .oval::before {
  background: conic-gradient(from -62deg, var(--pink) 0 25%, var(--purple) 0 50%, var(--orange) 0 75%, var(--teal) 0);
}
.card.wild .num { color: #fff; -webkit-text-stroke: .05em #17151f; text-shadow: .06em .07em 0 #17151f; }
.card.wild .glyph { color: #fff; filter: drop-shadow(.06em .07em 0 #17151f); }
.card.wild .cap { color: #fff; background: #17151f; padding: .15em .45em; border-radius: .5em; }
.card.back .oval::before { background: var(--red); }
.card.back .back-logo {
  font-family: var(--display); font-size: 1.35em; color: #ffd23f; transform: rotate(-20deg);
  text-shadow: .07em .07em 0 #17151f; -webkit-text-stroke: .03em #17151f;
}

/* ---------- area pemain ---------- */
.me {
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(14, 9, 6, .95) 60%, rgba(14, 9, 6, 0)); border-top: 1px solid rgba(255, 255, 255, .04);
}
.me-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 16px 2px; max-width: 1100px; margin: 0 auto; }
.me-info { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); min-width: 0; flex: 1; }
.me-info .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text b { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { font-size: .78rem; white-space: nowrap; }
.me-info .mercy { width: 80px; flex: none; }
.me-actions { display: flex; gap: 8px; align-items: center; }
.btn-uno {
  font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: .5px; padding: .5em 1.1em .4em;
  background: var(--red); color: #ffd23f; border-radius: 12px; box-shadow: 0 0 0 2px #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
}
.btn-uno:hover { background: #ff4a50; }
.btn-uno.ready { animation: unoPulse .7s infinite alternate; }
.btn-uno.done { opacity: .55; }
@keyframes unoPulse { to { transform: scale(1.1); box-shadow: 0 0 0 2px #fff, 0 0 26px var(--red); } }

.hand {
  display: flex; justify-content: safe center; padding: 26px 24px 6px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
}
.hand .card {
  --cw: 88px; margin-left: var(--overlap, -24px); cursor: default;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.2), filter .2s, margin .25s;
}
.hand .card:first-child { margin-left: 0; }
.hand.my-turn .card.dim { filter: brightness(.42) saturate(.5); }
.hand .card.ok { cursor: pointer; transform: translateY(-14px); }
.hand .card.ok:hover { transform: translateY(-26px) scale(1.05); z-index: 5; }
.hand .card.drawn { box-shadow: 0 0 0 3px var(--accent-2), 0 0 20px rgba(255, 159, 28, .7); }
.hand .card.new { animation: deal .4s ease-out both; animation-delay: var(--dd, 0s); }
@keyframes deal { from { transform: translateY(-80px) scale(.6) rotate(-10deg); opacity: 0; } }
.hand-empty { color: var(--muted); padding: 40px 0; font-weight: 600; }

/* ---------- panel samping ---------- */
.side {
  width: 300px; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 8px;
}
.tabs { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding-right: 8px; }
.tab { flex: 1; border: 0; background: transparent; padding: 12px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-bottom-color: var(--accent-2); }
.side-close { display: none; }
.pane { display: none; flex: 1; flex-direction: column; min-height: 0; }
.pane.active { display: flex; }
.msgs { list-style: none; margin: 0; padding: 12px 14px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.msgs li { line-height: 1.4; word-wrap: break-word; }
.msgs li b { color: var(--accent-2); }
.msgs li.me b { color: #7cc7ff; }
.msgs.log li { color: var(--muted); font-size: .84rem; }
.msgs.log li:last-child { color: var(--text); }
.msgs .empty { color: var(--muted); text-align: center; margin: auto 0; font-size: .85rem; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form input { padding: 10px 14px; border-radius: 10px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 4, 12, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box {
  background: linear-gradient(180deg, #2a1c13, #1a110c); border: 1px solid var(--border); border-radius: 24px; padding: 24px;
  width: 100%; max-width: 360px; text-align: center; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column; gap: 14px; align-items: stretch; animation: pop .22s ease-out; max-height: calc(100dvh - 32px); overflow-y: auto;
}
.modal-box.wide { max-width: 500px; }
@keyframes pop { from { transform: scale(.88); opacity: 0; } }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-grid button {
  border: 0; border-radius: 16px; height: 78px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .3);
  transition: transform .12s, box-shadow .15s; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2);
}
.color-grid button:hover { transform: translateY(-2px) scale(1.03); }
.c-red { background: var(--red); } .c-yellow { background: var(--yellow); } .c-green { background: var(--green); } .c-blue { background: var(--blue); }
.c-pink { background: var(--pink); } .c-teal { background: var(--teal); } .c-orange { background: var(--orange); } .c-purple { background: var(--purple); }
.swap-list { display: flex; flex-direction: column; gap: 8px; }
.swap-list button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: left;
}
.swap-list button:hover { border-color: var(--accent-2); background: rgba(255, 159, 28, .1); }
.swap-list .name { flex: 1; font-weight: 700; }
.swap-list .cnt { font-family: var(--display); font-size: 1.2rem; }
.trophy { font-size: 3rem; line-height: 1; animation: bump 1s infinite; }
.end-title { font-family: var(--display); font-size: 1.9rem; }
.scores { width: 100%; border-collapse: collapse; font-size: .92rem; }
.scores th { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.scores th, .scores td { padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.scores td:not(:first-child), .scores th:not(:first-child) { text-align: right; }
.scores tr.win td { color: #ffd23f; font-weight: 800; }
.scores tr.out td { color: var(--muted); }
.end-actions { display: flex; gap: 10px; justify-content: center; }
.rules-modal { text-align: left; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 150px); background: #fbf4e6; color: #2a1d10; font-weight: 600;
  padding: 11px 18px; border-radius: 12px; font-size: .92rem; z-index: 99; transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
  max-width: calc(100% - 32px); text-align: center; box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- papan suara lucu ---------- */
.lobby-top-actions { display: flex; gap: 8px; }
.fun-emoji { font-size: 1.15em; line-height: 1; }
.fun-btn.active, [data-fun-toggle].active { background: rgba(255, 159, 28, .15); border-color: rgba(255, 159, 28, .5); }
.fun-panel {
  position: fixed; right: 16px; bottom: 120px; z-index: 45; width: 340px;
  background: linear-gradient(180deg, #2b1d14, #1c130d); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .8); padding: 14px; animation: pop .18s ease-out;
}
.fun-panel.at-top { bottom: auto; top: 70px; }
.fun-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fun-head .small { flex: 1; }
.fun-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fun-grid button {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  transition: transform .1s, background .15s;
}
.fun-grid button:hover:not(:disabled) { background: rgba(255, 159, 28, .12); transform: translateY(-2px); }
.fun-grid button:active:not(:disabled) { transform: scale(.94); }
.fun-grid button:disabled { opacity: .45; cursor: wait; }
.fun-grid .e { font-size: 1.7rem; line-height: 1; }
.fun-grid .l { font-size: .7rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.fun-grid.cooling button::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent-2);
  animation: cool var(--cool, 1.5s) linear forwards;
}
@keyframes cool { from { width: 100%; } to { width: 0; } }

.reactions { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.reaction {
  position: absolute; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%);
  animation: floatUp 2.4s ease-out forwards;
}
.reaction .e { font-size: 2.6rem; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); animation: wiggle .4s ease-in-out 3; }
.reaction .n {
  margin-top: 2px; font-size: .72rem; font-weight: 800; background: rgba(0, 0, 0, .65); padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.4); }
  12% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}
@keyframes wiggle { 50% { transform: rotate(-14deg) scale(1.1); } }

/* =========================================================
   APLIKASI: login, bilah navigasi, dasbor, turnamen, profil, admin
   ========================================================= */
.tiny { font-size: .76rem; }
.tiny a, .check a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.note { padding: 10px 14px; border-radius: 12px; background: rgba(255, 210, 63, .08); border: 1px solid rgba(255, 210, 63, .25); color: #ffe08a; font-size: .86rem; line-height: 1.45; }
.note code { font-size: .82rem; }
.pad { padding: 18px; }
.danger-text { color: #ff8a80 !important; }
.btn-danger { background: rgba(255, 65, 54, .16); border-color: rgba(255, 65, 54, .5); color: #ff8a80; }
.btn-danger:hover { background: rgba(255, 65, 54, .28); }
.tag.ok { background: rgba(61, 220, 132, .15); color: var(--ok); }
.tag.danger { background: rgba(255, 65, 54, .16); color: #ff8a80; }
.tag .ico { width: 1em; height: 1em; }

/* layar pembuka */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--bg); transition: opacity .35s, visibility .35s; }
.boot img { width: 190px; height: auto; animation: pop .5s ease-out; }
.boot.gone { opacity: 0; visibility: hidden; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }

/* kartu login (pop-up) */
.auth-card {
  position: relative; width: 100%; max-width: 430px; padding: 26px; border-radius: 26px;
  background: linear-gradient(180deg, #2b1d14, #1b120c);
  border: 1px solid var(--border); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 32px); overflow-y: auto; animation: pop .22s ease-out;
}
.auth-close { position: absolute; top: 14px; right: 14px; }
.auth-head { padding-right: 40px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.nav-login { color: var(--text); }
.auth-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; letter-spacing: .3px; margin-bottom: 4px; }
.google-btn { min-height: 44px; display: flex; justify-content: center; color-scheme: light; }
.google-btn:empty { display: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.seg button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.seg.wide { max-width: 360px; margin: 6px 0 14px; }
#authForm { display: flex; flex-direction: column; gap: 12px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 8px; border-radius: 8px; display: grid; }
.pw-toggle:hover { color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; color: var(--muted); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent-2); width: 16px; height: 16px; flex: none; }
.field select, .field textarea, .form-grid select, .inline-form input, .search-bar input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0, 0, 0, .35); outline: none;
}
.field select { background: #22170f; }
.field select:focus, .inline-form input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(255, 159, 28, .15); }
.cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 80px; }
.cta h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.8rem); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-links a:hover { color: var(--text); }

/* bilah aplikasi */
.appbar {
  position: sticky; top: 0; z-index: 30; background: rgba(20, 13, 9, .78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top);
}
.appbar-in { max-width: 1180px; margin: 0 auto; padding: 4px 20px; display: flex; align-items: center; gap: 22px; }
.appbar .brand-logo { height: 64px; margin: -4px 0; }
.tabbar { display: flex; gap: 4px; flex: 1; }
.tabbar a {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s;
}
.tabbar a:hover { color: var(--text); background: var(--surface); }
.tabbar a.active { color: var(--text); background: var(--surface-2); }
.tabbar a.active .ico { color: var(--accent-2); }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .9rem; max-width: 240px; }
.me-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip:hover { background: var(--surface-2); }
.u-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; object-fit: cover;
  background: var(--av, #3a2a1e); color: #fff; font-weight: 800; text-transform: uppercase; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22);
}
.u-avatar.sm { width: 30px; height: 30px; font-size: .8rem; }
.u-avatar.lg { width: 84px; height: 84px; font-size: 2rem; }

/* ---------- teman ---------- */
.tabbar a { position: relative; }
.nav-badge {
  position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}
.friend-search { margin-bottom: 4px; }
.friend-list { display: flex; flex-direction: column; gap: 2px; }
.friend-list .panel-head { margin-bottom: 6px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.friend-row:last-child { border-bottom: 0; }
.f-av { position: relative; flex: none; display: grid; }
.f-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #6b5d4c; border: 2.5px solid #1d130d; }
.f-dot.on { background: var(--ok); }
.f-dot.playing { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.f-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.f-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-status { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.f-status .ico { width: .9em; height: .9em; flex: none; }
.f-status.on { color: var(--ok); }
.f-status.playing { color: var(--accent-2); font-weight: 700; }
.f-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.f-acts .btn .ico { width: 1em; height: 1em; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .74rem; vertical-align: middle; }
.dlg-sub { margin: 4px 0 0; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
.friend-list.compact .friend-row { padding: 8px 0; }
.friend-list.compact .u-avatar { width: 34px; height: 34px; font-size: .85rem; }
.friend-list.compact .f-main { text-align: left; }
.lobby-friend { margin-left: auto; }
.lobby-friend .btn { padding: .4em .7em; font-size: .76rem; }
.lobby-friend + .kick { margin-left: 6px; }
.invite-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.invite-card p { margin: 0; }
.invite-room { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--surface-2); }
.invite-room .room-ico { width: 38px; height: 38px; }

/* halaman */
.page { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.7rem); letter-spacing: .3px; margin: 4px 0 6px; }
.page-head p { max-width: 640px; line-height: 1.55; }
.panel.flush { padding: 0; gap: 0; overflow: hidden; }
.skeleton { height: 120px; border-radius: 18px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.tall { height: 320px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 50px 20px; grid-column: 1 / -1; }
.empty-state > .ico { width: 44px; height: 44px; color: var(--accent-2); opacity: .8; }
.empty-state.small { padding: 26px 10px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  position: relative; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.stat b { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; }
.stat > span:last-child { color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat-ico { position: absolute; right: 14px; top: 14px; color: var(--accent-2); opacity: .7; }
.stat-ico .ico { width: 22px; height: 22px; }

.play-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.play-card { gap: 10px; }
.play-card h3 { font-size: 1.15rem; }
.play-card .btn-block, .play-card .join-row { margin-top: auto; }
.pc-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.pc-icon.c-yellow { color: #2a1d00; }
.pc-icon .ico { width: 22px; height: 22px; }
.promo { background: linear-gradient(160deg, rgba(246, 184, 30, .14), rgba(255, 65, 54, .08)); border-color: rgba(246, 184, 30, .3); }
.promo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* daftar meja */
.panel-head.wrap { flex-wrap: wrap; align-items: flex-start; }
.panel-head.wrap .seg { min-width: 280px; }
.room-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 240px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0, 0, 0, .3); color: var(--muted); }
.room-search input { border: 0; background: transparent; outline: none; padding: 10px 0; width: 100%; }
.room-search:focus-within { border-color: var(--accent-2); }
.room-more { grid-column: 1 / -1; }
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 10px; }
.room-item > .btn { flex: none; }
.room-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border);
  transition: border-color .15s;
}
.room-item:hover { border-color: rgba(255, 255, 255, .2); }
.room-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.room-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.room-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-title-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.room-title-row .status-pill { font-size: .62rem; padding: 2px 8px; }
.room-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.room-meta span { display: inline-flex; align-items: center; gap: 4px; }
.room-meta .tag { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.room-title { font-family: var(--display); font-weight: 400; font-size: 1.4rem; letter-spacing: .3px; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; }
.dialog-body .switch-row { text-align: left; }

/* turnamen */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.open { background: rgba(61, 220, 132, .14); color: var(--ok); }
.status-pill.live { background: rgba(255, 65, 54, .16); color: #ff7a72; }
.status-pill.live::before { animation: blink 1s infinite; }
.status-pill.done { background: rgba(255, 210, 63, .14); color: #ffd23f; }
@keyframes blink { 50% { opacity: .2; } }
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tour-card { gap: 12px; transition: border-color .15s, transform .15s; }
.tour-card:hover { border-color: rgba(255, 159, 28, .45); transform: translateY(-2px); }
.tour-card h3 { font-size: 1.2rem; }
.tc-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .28); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--muted); }
.prize, .champ { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #ffd23f; }
.champ { color: var(--text); }
.champ .ico { color: #ffd23f; }
.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: auto; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }

.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; align-self: flex-start; }
.back:hover { color: var(--text); }
.tour-hero { background: linear-gradient(135deg, rgba(255, 65, 54, .14), rgba(31, 119, 224, .1)); }
.tour-hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: .3px; }
.th-main { display: flex; flex-direction: column; gap: 12px; }
.th-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.champion-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; align-self: flex-start;
  background: linear-gradient(135deg, rgba(255, 210, 63, .22), rgba(255, 159, 28, .08)); border: 1px solid rgba(255, 210, 63, .4);
}
.champion-banner > .ico { width: 34px; height: 34px; color: #ffd23f; }
.champion-banner div { display: flex; flex-direction: column; }
.champion-banner b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.owner-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; border: 1px dashed rgba(255, 210, 63, .35); background: rgba(255, 210, 63, .04); }
.owner-bar .btn:first-of-type { margin-left: auto; }
.tour-cols { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.b-round { display: flex; flex-direction: column; gap: 10px; min-width: 210px; justify-content: center; }
.b-round h4 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.b-match { border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.b-match.mine { border-color: rgba(255, 159, 28, .55); box-shadow: 0 0 0 3px rgba(255, 159, 28, .1); }
.b-head { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 800; color: var(--muted); }
.live-dot { color: #ff7a72; display: inline-flex; align-items: center; gap: 5px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1s infinite; }
.b-match ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.b-match li { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; padding: 4px 6px; border-radius: 8px; }
.b-match li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-match li.win { background: rgba(255, 210, 63, .12); color: #ffd23f; }
.b-match li.lose { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.b-match li.bye { color: var(--muted); font-size: .76rem; font-style: italic; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.plist li .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li.me { outline: 1px solid rgba(255, 159, 28, .4); }
.plist li.out { opacity: .55; }
.countdown { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.countdown b { font-family: var(--display); font-weight: 400; font-size: 2.2rem; letter-spacing: .06em; color: #ffd23f; }
.match-call { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.match-call > .ico { width: 48px; height: 48px; color: #ffd23f; animation: bump 1s infinite; }

/* tabel data */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .025); }
table.data tr.me td { background: rgba(255, 159, 28, .08); }
table.data tr.banned td { opacity: .6; }
.ai-tag { margin-left: 6px; font-size: .6rem; padding: 2px 6px; background: rgba(124, 199, 255, .14); color: #7cc7ff; vertical-align: 1px; }
table.data tr.ai .who { color: #d9d5f2; font-weight: 600; }
table.data .rank { font-family: var(--display); font-size: 1.15rem; width: 48px; }
table.data .who { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
table.data .who .small { font-weight: 500; }
table.data td.actions { text-align: right; }
table.data td.actions .btn { margin-left: 4px; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-bar input { border: 0; background: transparent; padding: 4px; }

/* profil */
.profile-card { flex-direction: row; align-items: center; gap: 20px; background: linear-gradient(135deg, rgba(255, 159, 28, .12), rgba(31, 119, 224, .08)); }
.profile-card h1 { font-family: var(--display); font-weight: 400; font-size: 2rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-info p { overflow: hidden; text-overflow: ellipsis; }
.inline-form { display: flex; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.form-grid .span2 { grid-column: span 2; }
.link-list { display: flex; flex-direction: column; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; font-weight: 600; }
.row-link:last-child { border-bottom: 0; }
.row-link:hover { color: var(--accent-2); }
.danger-zone { border-color: rgba(255, 65, 54, .3); background: rgba(255, 65, 54, .04); }
.danger-zone .btn { align-self: flex-start; }

/* admin */
.report-list { display: flex; flex-direction: column; gap: 10px; }
.report.resolved { opacity: .6; }
.report blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: rgba(0, 0, 0, .25); border-radius: 0 10px 10px 0; font-size: .92rem; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.temp-pw { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .08em; padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px dashed var(--accent-2); user-select: all; }

/* foto profil */
.avatar img, .u-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar:has(img) { background: #251910; }
.avatar-edit { position: relative; flex: none; cursor: pointer; border-radius: 50%; }
.avatar-edit .u-avatar { box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 0 0 3px #22160f; transition: transform .15s;
}
.avatar-edit:hover .avatar-cam { transform: scale(1.1); }
.avatar-cam .ico { width: 16px; height: 16px; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* profil meja */
#lobbyTitle { display: flex; align-items: center; gap: 10px; }
#lobbyTitle .icon-btn { margin-left: auto; }
.room-emoji { font-size: 1.6rem; line-height: 1; }
.room-ico { font-size: 1.4rem; background: rgba(255, 255, 255, .07); border: 1px solid var(--border); box-shadow: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button {
  aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--border); background: rgba(0, 0, 0, .25); font-size: 1.35rem;
  display: grid; place-items: center; transition: border-color .15s, transform .1s;
}
.emoji-grid button:hover { transform: scale(1.06); }
.emoji-grid button.active { border-color: var(--accent-2); background: rgba(255, 159, 28, .15); }

/* pengaturan turnamen */
.setup-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); }
.setup-box h4 { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.quota { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; padding: 10px 12px; border-radius: 12px; background: rgba(255, 159, 28, .1); border: 1px solid rgba(255, 159, 28, .3); }
.quota b { color: #ffd23f; }
.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan li { display: grid; grid-template-columns: 74px 1fr 18px auto; align-items: center; gap: 8px; font-size: .86rem; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.plan li b { color: var(--accent-2); }
.plan li .arrow { color: var(--muted); display: grid; }
.plan li.final { background: rgba(255, 210, 63, .1); }
.plan li.final b { color: #ffd23f; }
.plan-box { display: flex; flex-direction: column; gap: 8px; }
.countdown-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 7px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  background: rgba(61, 220, 132, .12); border: 1px solid rgba(61, 220, 132, .35); color: var(--ok);
}
.countdown-chip b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; letter-spacing: .04em; color: #fff; }
.countdown-chip.idle { background: rgba(255, 255, 255, .05); border-color: var(--border); color: var(--muted); }
.b-match li.pass { background: rgba(61, 220, 132, .1); color: var(--ok); }

/* dialog */
.dialog-box { text-align: left; }
.dialog-body { display: flex; flex-direction: column; gap: 12px; }
.dialog-box .end-actions { justify-content: flex-end; }

/* download aplikasi */
body:not(.guest) .guest-only { display: none; }
.app-banner {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(31, 119, 224, .18), rgba(255, 65, 54, .14)); border: 1px solid rgba(255, 255, 255, .12);
  transition: border-color .15s, transform .15s;
}
.app-banner:hover { border-color: rgba(255, 159, 28, .5); transform: translateY(-1px); }
.app-banner.big { padding: 22px 26px; }
.ab-icon img { width: 52px; height: 52px; border-radius: 14px; display: block; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.app-banner.big .ab-icon img { width: 72px; height: 72px; border-radius: 18px; }
.ab-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }
.ab-text b { font-size: 1.05rem; }
.app-banner.big .ab-text b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; letter-spacing: .3px; }
.ab-os { display: flex; gap: 6px; }
.os-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); font-size: .8rem; font-weight: 700; }
.dl-hero { flex-direction: row; align-items: center; gap: 24px; background: linear-gradient(135deg, rgba(255, 65, 54, .14), rgba(31, 119, 224, .12)); }
.dl-hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.7rem); letter-spacing: .3px; margin: 4px 0 8px; }
.dl-hero p { max-width: 620px; line-height: 1.6; }
.dl-icon { width: 120px; height: 120px; border-radius: 28px; flex: none; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7); }
.installed { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px !important; padding: 8px 14px; border-radius: 999px; background: rgba(61, 220, 132, .14); color: var(--ok); font-weight: 700; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dl-card { gap: 14px; }
.dl-card.recommended { border-color: rgba(255, 159, 28, .5); box-shadow: 0 0 0 3px rgba(255, 159, 28, .08); }
.dl-head { display: flex; align-items: center; gap: 14px; }
.dl-head > div { flex: 1; }
.dl-head h3 { font-size: 1.3rem; }
.os-badge { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; flex: none; }
.os-badge .ico { width: 28px; height: 28px; }
.os-badge.android { background: #3ddc84; color: #06301a; }
.os-badge.ios { background: linear-gradient(160deg, #fbf4e6, #d8c8a8); color: #2a1d10; }
.store-btn { gap: .6em; }
.dl-card details { border-top: 1px solid var(--border); padding-top: 12px; }
.dl-card summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.dl-card details[open] summary { margin-bottom: 10px; }
.steps-list { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps-list li { counter-increment: s; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .25); font-size: .92rem; line-height: 1.45; }
.steps-list li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-weight: 800; font-size: .8rem; }
.st-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #7cc7ff; }
.dl-desktop { flex-direction: row; align-items: center; gap: 14px; }
.dl-desktop > .ico { width: 30px; height: 30px; color: var(--accent-2); }

/* panel menu dari bawah (HP) */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(5, 4, 12, .6); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #2b1d14, #1b120c); border: 1px solid var(--border); border-bottom: 0;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -30px 60px rgba(0, 0, 0, .6); animation: sheetUp .26s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); margin: 4px auto 10px; }
.sheet-head { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sheet-head b { font-size: 1.05rem; }
.sheet-head.user { flex-direction: row; align-items: center; gap: 12px; }
.sheet-head.user > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sheet-head.user .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 8px; border: 0; border-radius: 14px;
  background: transparent; text-align: left; color: var(--text);
}
button.sheet-row:active { background: var(--surface-2); }
@media (hover: hover) { button.sheet-row:hover { background: var(--surface); } }
.sheet-row > .ico { color: var(--muted); width: 18px; height: 18px; }
.sr-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .07); color: #7cc7ff; }
.sr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sr-text b { font-size: .95rem; }
.sr-text span { font-size: .76rem; color: var(--muted); }
.sr-badge { font-size: .66rem; font-weight: 800; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.sheet-row.danger { color: #ff8a80; }
.sheet-row.danger .sr-ico { background: rgba(255, 65, 54, .14); color: #ff8a80; }
.sheet-row.static { cursor: default; }
.sr-toggle { width: 40px; height: 24px; border-radius: 999px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; }
.sr-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sr-toggle.on { background: var(--ok); }
.sr-toggle.on::after { transform: translateX(16px); }

/* menu: tombol game & tab menu hanya untuk HP */
.menu-btn, .menu-tab { display: none !important; }
.menu-btn .dot { top: 4px; right: 4px; }

/* notifikasi tereliminasi */
.elim { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.elim-ico { font-size: 3.2rem; line-height: 1; animation: bump 1s ease-in-out 2; }

/* halaman dokumen (privasi, syarat, hapus akun, offline) */
.doc-top { max-width: 820px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.doc { max-width: 820px; margin: 0 auto; padding: 10px 20px 70px; line-height: 1.7; }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: .3px; margin-bottom: 4px; }
.doc h2 { font-size: 1.2rem; margin: 30px 0 8px; }
.doc p, .doc li { color: #d9d5f2; }
.doc p { margin: 10px 0; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc a:not(.btn) { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.doc .btn { color: #fff; }
.offline { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 20px; }
.offline img { width: 220px; height: auto; }
.offline h1 { font-family: var(--display); font-weight: 400; font-size: 2.2rem; }
.offline p { max-width: 420px; line-height: 1.6; }

/* chat: bisukan & laporkan */
.msgs li { position: relative; }
.msg-tools { float: right; display: inline-flex; gap: 2px; margin-left: 6px; opacity: .35; transition: opacity .15s; }
.msgs li:hover .msg-tools { opacity: 1; }
.msg-tools button { border: 0; background: transparent; color: var(--muted); padding: 2px 4px; border-radius: 6px; display: grid; }
.msg-tools button:hover { color: var(--accent); background: rgba(255, 65, 54, .12); }
.msg-tools .ico { width: 14px; height: 14px; }

/* =========================================================
   RESPONSIF
   ========================================================= */
@media (max-width: 1080px) {
  .play-grid { grid-template-columns: 1fr 1fr; }
  .play-grid .promo { grid-column: span 2; }
  .tour-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-cta .btn { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  /* Di HP, menu utama jadi bilah tab di bawah layar seperti aplikasi. */
  body.in-portal { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  /* backdrop-filter membuat elemen fixed di dalamnya ikut terkurung, jadi dimatikan di HP. */
  .appbar { backdrop-filter: none; background: rgba(20, 13, 9, .97); }
  .appbar-in { padding: 2px 14px; justify-content: space-between; }
  .appbar .brand-logo { height: 56px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; gap: 0; justify-content: space-around;
    background: rgba(14, 12, 26, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar .menu-tab { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .68rem; border-radius: 10px; }
  .tabbar a .ico, .tabbar .menu-tab .ico { width: 22px; height: 22px; }
  .tabbar a.active, .tabbar .menu-tab.active { background: transparent; color: var(--text); }
  .tabbar .menu-tab.active .ico { color: var(--accent-2); }
  /* HP: Profil & Admin pindah ke tab Menu */
  .tabbar [data-nav="profile"], .tabbar [data-nav="admin"] { display: none !important; }
  .tabbar .menu-tab {
    display: flex !important; align-items: center; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-family: inherit;
  }
  .me-chip .nm { max-width: 110px; }
  .page { padding: 18px 16px 40px; }
  .play-grid { grid-template-columns: 1fr; }
  .play-grid .promo { grid-column: auto; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 1.6rem; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-card h1 { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .owner-bar .btn:first-of-type { margin-left: 0; }
  .room-list { grid-template-columns: minmax(0, 1fr); }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-hero { flex-direction: column; text-align: center; }
  .dl-icon { width: 96px; height: 96px; border-radius: 24px; }
  .app-banner { flex-wrap: wrap; }
  .app-banner .ab-os { display: none; }
  .app-banner.big { flex-direction: column; text-align: center; }
  .app-banner.big .ab-os { display: flex; }
  .form-grid.three { grid-template-columns: 1fr; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .pc-actions { justify-content: center; }
  .panel-head.wrap .seg, .room-search { min-width: 0; width: 100%; }

  /* ---- HP: tampilan ringkas seperti aplikasi ---- */
  input, select, textarea { font-size: 16px !important; } /* iPhone tidak memperbesar layar saat mengetik */
  .appbar .brand-logo { height: 46px; margin: -2px 0; }
  .me-chip { padding: 3px 10px 3px 3px; font-size: .8rem; gap: 7px; }
  .me-chip .u-avatar.sm { width: 28px; height: 28px; }
  .nav { padding: 10px 16px; }
  .nav .brand-logo { height: 74px; margin: -8px 0; }
  .brand.small .brand-logo { height: 54px; margin: -4px 0; }
  .page { padding: 14px 14px 32px; gap: 14px; }
  .page-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .page-head h1 { font-size: 1.65rem; margin: 2px 0 4px; }
  .page-head p { font-size: .86rem; }
  .eyebrow { font-size: .68rem; }
  .panel { padding: 16px; border-radius: 18px; gap: 12px; }
  .panel h3 { font-size: 1rem; }
  .stat-row { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat { padding: 10px 4px; align-items: center; text-align: center; border-radius: 14px; }
  .stat b { font-size: 1.3rem; }
  .stat > span:last-child { font-size: .64rem; }
  .stat-ico { display: none; }
  /* Buat meja & gabung pakai kode bersebelahan, tanpa teks panjang */
  .play-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .play-grid .promo { grid-column: 1 / -1; }
  .play-card { gap: 8px; }
  .play-card:not(.promo) > p.muted { display: none; }
  .play-card .pc-icon { width: 36px; height: 36px; border-radius: 11px; }
  .play-card .pc-icon .ico { width: 18px; height: 18px; }
  .play-card h3 { font-size: .92rem; }
  .play-card .btn-lg { padding: .8em .6em; font-size: .95rem; }
  .play-card .join-row { flex-direction: column; gap: 6px; }
  .play-card .join-row input { padding: 10px; letter-spacing: .25em; }
  .play-card .join-row .btn { padding: .65em; }
  .promo .pc-icon { width: 38px; height: 38px; border-radius: 12px; }
  .app-banner { padding: 12px 14px; gap: 12px; }
  .ab-icon img { width: 42px; height: 42px; border-radius: 11px; }
  .ab-text { font-size: .8rem; }
  .ab-text b { font-size: .95rem; }
  .room-item { padding: 10px; gap: 10px; border-radius: 14px; }
  .room-ico { width: 38px; height: 38px; font-size: 1.2rem; }
  .room-title-row b { font-size: .9rem; }
  .room-meta { font-size: .72rem; gap: 8px; }
  .room-item .btn-sm { padding: .5em .75em; font-size: .8rem; }
  .tour-hero h1 { font-size: 1.7rem; }
  .hero { padding: 6px 16px 40px; gap: 18px; }
  .hero h1 { font-size: 2.2rem; margin: 14px 0 12px; }
  .lead { font-size: .98rem; }
  .hero-art { height: 240px; }
  .fan .pc { --cw: 84px; }
  .room-code { font-size: 2.4rem; }
  .lobby { padding: 10px 14px 30px; }
  .lobby-top { margin-bottom: 12px; }
  /* Peringkat di HP: cukup #, Pemain, Gelar, Menang (Main, Win rate, Poin tampil di layar lebar) */
  #lbTable th:nth-child(n+5), #lbTable td:nth-child(n+5) { display: none; }
  #lbTable table.data { table-layout: fixed; }
  #lbTable th:nth-child(1) { width: 40px; }
  #lbTable th:nth-child(3) { width: 58px; }
  #lbTable th:nth-child(4) { width: 64px; }
  #lbTable table.data th, #lbTable table.data td { padding: 10px 7px; }
  #lbTable .rank { width: 34px; }
  #lbTable .who { gap: 6px; max-width: 100%; }
  #lbTable .lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #lbTable td:nth-child(2) { white-space: nowrap; }
  #lbTable .ai-tag { margin-left: 4px; flex: none; }
  #lbTable .who .u-avatar.sm { width: 26px; height: 26px; }
  .modal-box { padding: 20px 16px; }
  .end-actions { gap: 8px; }
  .end-actions .btn { flex: 1; padding-left: .6em; padding-right: .6em; }
}
@media (max-width: 1080px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; }
  .lobby-grid .settings { grid-column: span 2; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .rules-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero-art { height: 300px; order: -1; }
  .fan .pc { --cw: 96px; }
  .hero-art .glow { width: 260px; height: 260px; }
  .steps { grid-template-columns: 1fr; }
  .rule-notes { grid-template-columns: 1fr; }
  .side {
    position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 90vw); margin: 0; border-radius: 0;
    background: #1a110c; z-index: 40; transform: translateX(105%); transition: transform .28s; box-shadow: -20px 0 50px rgba(0, 0, 0, .5);
  }
  .side.open { transform: none; }
  .side-close { display: inline-grid; }
}
@media (min-width: 901px) {
  #sideToggle { display: none; }
}
@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-grid .settings { grid-column: auto; }
  .room-code { font-size: 2.8rem; }
  .features { grid-template-columns: 1fr; }
  .rules-grid, .rules-grid.compact { grid-template-columns: 1fr; }
  .footer { flex-direction: column; text-align: center; }
}
@media (max-width: 600px) {
  .topbar { padding: calc(6px + env(safe-area-inset-top)) 10px 6px; gap: 8px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
  .tb-title { gap: 8px; padding: 4px 10px 4px 4px; border-radius: 14px; }
  .tb-emoji { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; }
  .tb-name { font-size: .9rem; }
  .table-wrap { padding: 0; }
  .avatar { width: 32px; height: 32px; font-size: .82rem; }
  /* meja di HP: lebih lebar, kursi & kartu tengah lebih ringkas */
  .felt { left: 3%; right: 3%; top: 12%; bottom: 4%; }
  .seats { --seat-w: 80px; --seat-av: 46px; }
  .seats.crowded { --seat-w: 64px; --seat-av: 38px; }
  .seat-name { font-size: .68rem; padding: 2px 6px; }
  .seat-cards { min-width: 20px; height: 27px; right: -8px; }
  .seat-cards b { font-size: .82rem; }
  .middle { gap: 18px; top: 58%; }
  .draw-pile .card { --cw: 64px; }
  .discard { width: 80px; height: 120px; }
  .discard .card { --cw: 80px; }
  .discard::after { inset: -8px; border-width: 3px; border-radius: 16px; }
  .direction-ring { width: 190px; height: 190px; margin: -95px 0 0 -95px; }
  .pile-label { top: calc(100% + 8px); font-size: .68rem; }
  .pending { top: -40px; font-size: 1.2rem; }
  .status { font-size: .9rem; min-height: 22px; }
  .hand { padding: 22px 12px 4px; }
  .hand .card { --cw: 68px; }
  .me-info .mercy { display: none; }
  .voice-ctl .btn .lbl { display: none; }
  .voice-ctl .btn { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
  /* HP: kontrol meja di bilah atas digabung ke satu tombol Menu */
  .topbar #leaveGameBtn, .topbar .voice-ctl, #soundBtn, #rulesBtn, #friendsBtn, #sideToggle { display: none !important; }
  .menu-btn { display: inline-grid !important; }
  .sheet .voice-ctl .btn { width: auto; height: auto; padding: .5em .85em; }
  .sheet .voice-ctl .btn .lbl { display: inline; }
}
@media (max-width: 600px) {
  .fun-panel, .fun-panel.at-top { left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; }
  .lobby-top-actions .btn span:not(.fun-emoji) { display: none; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; }
  .tb-left, .tb-right { gap: 4px; }
  .icon-btn, .voice-ctl .btn { width: 34px; height: 34px; border-radius: 9px; }
  .tb-chip, .mode-badge { font-size: .6rem; padding: 3px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   SEKOP WAWA — kartu remi, ruangan, meja kayu & kursi
   ========================================================= */
:root { --gold: #f2c14e; --gold-2: #ffe7a3; --felt-1: #25985e; --felt-2: #127046; --felt-3: #0a4a2d; --wood-1: #8b5a33; --wood-2: #5a3418; --wood-3: #3a200d; }

/* aksen emas menggantikan merah-oranye UNO */
.btn-accent { color: #2b1a05; box-shadow: 0 8px 24px -8px rgba(229, 169, 44, .7); }
.btn-accent:hover { box-shadow: 0 10px 30px -6px rgba(229, 169, 44, .85); }
.pill { background: rgba(242, 193, 78, .12); border-color: rgba(242, 193, 78, .35); color: var(--gold); }
.hero-art .glow { background: radial-gradient(circle, rgba(242, 193, 78, .32), transparent 65%); }
.promo { background: linear-gradient(160deg, rgba(242, 193, 78, .14), rgba(37, 152, 94, .08)); border-color: rgba(242, 193, 78, .3); }
.tour-hero, .dl-hero { background: linear-gradient(135deg, rgba(242, 193, 78, .14), rgba(37, 152, 94, .12)); }
.app-banner { background: linear-gradient(120deg, rgba(37, 152, 94, .18), rgba(242, 193, 78, .14)); }
.f-icon { background: rgba(242, 193, 78, .12); }
.brand-logo { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }

/* ---------- kartu remi ---------- */
.pc {
  --cw: 76px; position: relative; flex: none; width: var(--cw); height: calc(var(--cw) * 1.4);
  border-radius: calc(var(--cw) * .11); color: #1a1a1a; font-family: var(--font);
  background: linear-gradient(160deg, #ffffff 0%, #f4eddd 100%); border: 1px solid rgba(0, 0, 0, .22);
  box-shadow: -2px 4px 10px rgba(0, 0, 0, .45), inset 0 0 0 3px #fff, inset 0 0 0 4px rgba(0, 0, 0, .06);
  user-select: none;
}
.pc.red { color: #c0262d; }
.pc-corner { position: absolute; width: 30%; text-align: center; font-weight: 800; font-size: calc(var(--cw) * .22); line-height: .95; }
.pc-corner.tl { top: 6%; left: 3%; }
.pc-corner.br { bottom: 6%; right: 3%; transform: rotate(180deg); }
.pc-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pc-mid i { font-style: normal; font-size: calc(var(--cw) * .5); line-height: 1; }
.pc-face { font-family: var(--display); font-size: calc(var(--cw) * .36); line-height: 1; }
.pc-face + i { font-size: calc(var(--cw) * .28); }
.fan .pc { --cw: 132px; }
.rule .pc { --cw: 58px; }
.rules-grid.compact .rule .pc { --cw: 44px; }

.mini-pc {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 34px; padding: 0 3px;
  background: linear-gradient(160deg, #fff, #f3ecdc); color: #1a1a1a; border-radius: 4px; font-weight: 800; font-size: 12px;
  line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); font-family: var(--font);
}
.mini-pc.red { color: #c0262d; }

/* ---------- mode ---------- */
.tb-title.m-tutup { --mc: #b8860b; --mc2: #f2c14e; }
.tb-title.m-pas { --mc: #1e8449; --mc2: #2ecc71; }
.mode-badge.m-tutup { background: linear-gradient(135deg, #b8860b, #f2c14e); color: #2b1a05; }
.mode-badge.m-pas { background: linear-gradient(135deg, #1e8449, #2ecc71); }

/* ---------- ruangan ---------- */
body.in-game {
  background-color: #150e0a;
  background-image:
    radial-gradient(ellipse 65% 50% at 50% 45%, rgba(255, 210, 140, .18), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .7), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 140px),
    linear-gradient(180deg, #2b1b12 0%, #1d120c 55%, #120a06 100%);
}
.sv-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.sv-wrap {
  --k: 1; position: absolute; left: 50%; top: 50%; width: 1020px; padding: 104px 140px 76px;
  transform: translate(-50%, -50%) scale(var(--k)); transform-origin: center center;
}

/* ---------- meja ---------- */
.sv-table {
  position: relative; border-radius: 150px; padding: 16px;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .04) 0 3px, transparent 3px 11px),
    linear-gradient(145deg, var(--wood-1) 0%, var(--wood-2) 38%, #77482a 62%, var(--wood-3) 100%);
  box-shadow: 0 0 0 3px #2a1608, 0 40px 80px rgba(0, 0, 0, .7), 0 12px 24px rgba(0, 0, 0, .5),
    inset 0 2px 2px rgba(255, 255, 255, .28), inset 0 -4px 8px rgba(0, 0, 0, .45);
}
.sv-felt {
  position: relative; border-radius: 134px; padding: 28px 52px 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), inset 0 3px 8px rgba(0, 0, 0, .6);
}
.sv-felt::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 4px 4px;
}
.sv-felt::after { content: ''; position: absolute; inset: 10px; border-radius: 126px; pointer-events: none; border: 1.5px solid rgba(242, 193, 78, .28); }
.sv-mark {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--display); font-weight: 900; font-size: 180px; color: rgba(255, 255, 255, .035);
}

/* ---------- papan (baris per jenis kartu) ---------- */
.sv-board { position: relative; display: flex; flex-direction: column; gap: 6px; }
.sv-row { display: grid; grid-template-columns: 26px repeat(13, minmax(0, 1fr)); gap: 4px; align-items: center; container-type: inline-size; }
.sv-suit { font-size: 20px; text-align: center; color: #f0f0f0; text-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.sv-suit.red { color: #ff9a92; }
.sv-cell {
  aspect-ratio: 5 / 7; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .10); border: 1px solid rgba(255, 255, 255, .06);
  font-size: clamp(8px, 2.5cqi, 17px); color: rgba(255, 255, 255, .2); font-weight: 900;
}
.sv-cell.seven { border: 1.5px dashed rgba(242, 193, 78, .6); color: rgba(242, 193, 78, .65); background: rgba(242, 193, 78, .06); }
.sv-cell.target { border: 2px solid var(--gold); background: rgba(242, 193, 78, .15); animation: svPulse 1.2s infinite; }
.sv-bcard {
  width: 100%; height: 100%; border-radius: 5px; color: #1a1a1a; background: linear-gradient(160deg, #ffffff, #f3ecdc);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  line-height: 1; font-weight: 900; box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}
.sv-bcard i { font-style: normal; font-size: 1.2em; }
.sv-bcard.red { color: #c0262d; }
.sv-bcard.pop { animation: svPop .45s ease-out; box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(242, 193, 78, .7); }

.sv-status { position: relative; margin-top: 10px; text-align: center; }
.sv-status .status {
  display: inline-block; padding: 7px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; min-height: 0;
  background: rgba(0, 0, 0, .38); border: 1px solid rgba(255, 255, 255, .1); color: var(--text);
}
.sv-status .status.mine { border-color: rgba(242, 193, 78, .6); color: var(--gold-2); }
.sv-status .status.warn { border-color: rgba(255, 107, 107, .6); color: #ffd0c4; }
.sv-status .timer { max-width: 360px; margin: 8px auto 0; background: rgba(0, 0, 0, .3); }
.sv-status .timer div { background: linear-gradient(90deg, #f2c14e, #ffe7a3); }
.sv-status .timer div.low { background: #ff6b6b; }

/* ---------- kursi & pemain ---------- */
.sv-seats { position: absolute; top: 104px; left: 140px; right: 140px; bottom: 76px; pointer-events: none; }
.sv-seat { position: absolute; z-index: 2; width: 132px; display: flex; justify-content: center; pointer-events: auto; --rot: 0deg; }
.sv-seat.side-T { top: -98px; left: var(--p); transform: translateX(-50%); }
.sv-seat.side-L { left: -138px; top: var(--p); transform: translateY(-50%); --rot: -90deg; }
.sv-seat.side-R { right: -138px; top: var(--p); transform: translateY(-50%); --rot: 90deg; }
.sv-me-seat { position: absolute; left: 0; right: 0; bottom: 4px; width: auto; z-index: 2; display: flex; justify-content: center; --rot: 180deg; }

.sv-sitter { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sv-me-seat .sv-sitter { flex-direction: row; gap: 10px; }
.sv-sitter.done, .sv-sitter.off { opacity: .65; }
.sv-av { position: relative; width: 58px; height: 58px; }
.sv-chair {
  position: absolute; left: 50%; top: 50%; width: 100px; height: 94px; z-index: -1; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--rot)) translateY(-12px);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .55));
}
.sv-chair i { position: absolute; display: block; }
.sv-chair-back {
  top: 0; left: 4px; right: 4px; height: 40px; border-radius: 22px 22px 10px 10px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 9px), linear-gradient(180deg, #7b4a28, #45260f);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -3px 4px rgba(0, 0, 0, .4);
}
.sv-chair-seat {
  top: 26px; left: 0; right: 0; bottom: 0; border-radius: 20px; border: 6px solid #5d361a;
  background: radial-gradient(circle at 50% 38%, #b3323a 0%, #8a1d24 55%, #5e1116 100%);
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, .12), inset 0 -6px 10px rgba(0, 0, 0, .4);
}
.sv-chair-seat::after { content: ''; position: absolute; inset: 7px; border-radius: 12px; border: 1.5px dashed rgba(255, 220, 200, .22); }
.sv-av .avatar {
  width: 58px; height: 58px; font-size: 1.5rem; border: 2px solid rgba(255, 255, 255, .75);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.sv-av::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; opacity: 0; transition: opacity .2s;
  background: conic-gradient(var(--gold) 0 30%, transparent 30% 50%, var(--gold) 50% 80%, transparent 80%);
}
.sv-sitter.turn .sv-av::before { opacity: 1; animation: svSpin 1.6s linear infinite; }
.sv-plate {
  min-width: 112px; max-width: 150px; padding: 5px 10px 6px; border-radius: 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(180deg, rgba(25, 16, 10, .94), rgba(12, 8, 5, .94));
  border: 1px solid rgba(242, 193, 78, .35); box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
}
.sv-me-seat .sv-plate { align-items: flex-start; text-align: left; }
.sv-sitter.turn .sv-plate { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(242, 193, 78, .45); }
.sv-name { font-size: 13px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-sitter.turn .sv-name { color: var(--gold-2); }
.sv-stats { display: flex; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.sv-stats b { color: var(--text); }
.sv-fan { display: flex; justify-content: center; height: 15px; margin-top: 2px; }
.sv-fan i {
  width: 10px; height: 15px; margin-left: -6px; border-radius: 2px; flex: none;
  background: repeating-linear-gradient(45deg, #7d1820 0 2px, #a8262f 2px 4px); border: 1px solid #f3dca0;
}
.sv-fan i:first-child { margin-left: 0; }
.sv-off { font-size: 10px; color: #ff9a92; font-weight: 700; }
.sv-bubble {
  position: absolute; left: calc(100% + 6px); top: 2px; z-index: 3; white-space: nowrap;
  padding: 4px 9px; border-radius: 10px 10px 10px 2px; font-size: 12px; font-weight: 800;
  background: #fffaf0; color: #2a1d10; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); opacity: .8;
}
.sv-bubble.close { background: #3a1214; color: #ffb4b4; border: 1px solid #b0363f; }
.sv-bubble.pass { background: #2b2b2b; color: #ddd; }
.sv-bubble.think { background: rgba(0, 0, 0, .6); color: var(--gold-2); letter-spacing: 2px; animation: svBlink 1s infinite; opacity: 1; }
.sv-bubble.fresh { opacity: 1; animation: svBubble .35s ease-out; }
.side-R .sv-bubble { left: auto; right: calc(100% + 6px); border-radius: 10px 10px 2px 10px; }

/* ---------- tangan pemain ---------- */
.hand .pc { --cw: 84px; margin-left: var(--overlap, -16px); cursor: default; transition: transform .18s cubic-bezier(.2, .9, .3, 1.2), filter .2s, margin .25s, box-shadow .15s; }
.hand .pc:first-child { margin-left: 0; }
.hand.my-turn .pc.dim { filter: brightness(.5) saturate(.7); }
.hand .pc.ok { cursor: pointer; transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(242, 193, 78, .6), 0 8px 16px rgba(0, 0, 0, .5); }
.hand .pc.ok:hover { transform: translateY(-24px); z-index: 5; }
.hand .pc.closable { cursor: pointer; }
.hand .pc.closable:hover { transform: translateY(-8px); }
.hand .pc.selected { transform: translateY(-18px); box-shadow: 0 0 0 3px #ff6b6b, 0 0 16px rgba(255, 107, 107, .6), 0 8px 16px rgba(0, 0, 0, .5); z-index: 5; }
.hand .pc.new { animation: deal .4s ease-out both; animation-delay: var(--dd, 0s); }
.hand .pc.shake { animation: svShake .3s; }
.btn-close { background: linear-gradient(180deg, #ff7f7f, #d64545); color: #fff; box-shadow: 0 3px 0 #9e2c2c; }
.btn-close:disabled { opacity: .6; }
.me-closed { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.me-closed .mini-pc { height: 28px; min-width: 24px; font-size: 11px; }

/* ---------- hasil ronde ---------- */
.end-cards { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.scores .num { text-align: right; }
.scores .clean { color: #3ddc84; font-weight: 700; }

@keyframes svPop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
@keyframes svPulse { 50% { box-shadow: 0 0 12px rgba(242, 193, 78, .7); } }
@keyframes svShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes svSpin { to { transform: rotate(360deg); } }
@keyframes svBlink { 50% { opacity: .5; } }
@keyframes svBubble { from { transform: scale(.6); opacity: 0; } }

/* ---------- HP: lawan duduk berjajar di sisi seberang meja ---------- */
@media (max-width: 700px) {
  .sv-wrap { width: 390px; padding: 122px 6px 70px; }
  .sv-table { border-radius: 40px; padding: 10px; }
  .sv-felt { border-radius: 30px; padding: 20px 8px 10px; }
  .sv-felt::after { inset: 6px; border-radius: 26px; }
  .sv-mark { font-size: 110px; }
  .sv-board { gap: 3px; }
  .sv-row { grid-template-columns: 16px repeat(13, minmax(0, 1fr)); gap: 2px; }
  .sv-suit { font-size: 13px; }
  .sv-cell, .sv-bcard { border-radius: 3px; }
  .sv-status .status { font-size: 12px; padding: 6px 12px; }

  .sv-seats { top: 0; left: 6px; right: 6px; bottom: auto; height: 116px; display: flex; justify-content: space-evenly; align-items: flex-end; }
  .sv-seat, .sv-seat.side-T, .sv-seat.side-L, .sv-seat.side-R {
    position: relative; left: auto; right: auto; top: auto; transform: none; --rot: 0deg; flex: 1 1 0; min-width: 0; width: auto;
  }
  .sv-chair { width: 74px; height: 70px; }
  .sv-av, .sv-av .avatar { width: 44px; height: 44px; }
  .sv-av .avatar { font-size: 1.1rem; }
  .sv-plate { min-width: 0; width: 100%; max-width: 110px; padding: 4px 5px; }
  .sv-name { font-size: 11px; }
  .sv-stats { gap: 4px; font-size: 10px; }
  .sv-fan { height: 11px; }
  .sv-fan i { width: 7px; height: 11px; margin-left: -5px; }
  .sv-bubble, .side-R .sv-bubble { left: 50%; right: auto; top: auto; bottom: calc(100% + 2px); transform: translateX(-50%); font-size: 10px; padding: 3px 7px; border-radius: 8px; }
  .sv-bubble.fresh { animation: none; }
  .sv-me-seat .sv-plate { width: auto; max-width: none; }
  .sv-seats[data-n="5"] .sv-name, .sv-seats[data-n="6"] .sv-name, .sv-seats[data-n="7"] .sv-name { font-size: 10px; }
  .sv-seats[data-n="6"] .sv-stats span:nth-child(3), .sv-seats[data-n="7"] .sv-stats span:nth-child(3) { display: none; }
  .sv-seats[data-n="6"] .sv-fan, .sv-seats[data-n="7"] .sv-fan { display: none; }
  .hand .pc { --cw: 62px; }
}
