@font-face {
  font-family: "Lilita One"; font-weight: 400; font-display: swap;
  src: url(fonts/lilita-one.woff2) format("woff2");
}
@font-face {
  font-family: "Nunito"; font-weight: 400 900; font-display: swap;
  src: url(fonts/nunito.woff2) format("woff2");
}

:root {
  --bg: #04222b;
  --bg-2: #073b49;
  --panel: #0b4a5a;
  --panel-2: #0e5d70;
  --line: rgba(255, 255, 255, .16);
  --text: #f3fbff;
  --muted: #a8d3de;
  --gold: #ffc531;
  --gold-hi: #ffe98a;
  --gold-dark: #b86e00;
  --wood: #8a4f1d;
  --wood-dark: #4f2a0b;
  --felt: #12a06b;
  --felt-edge: #06583c;
  --ivory: #fffdf2;
  --ivory-2: #efe2ba;
  --pip: #d0202b;
  --red: #ff8573;
  --green: #7df0a8;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --hud: 66px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg) 70%) fixed;
  color: var(--text);
  font: 600 16px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h2 { font-size: 1.5rem; }
main { width: 100%; max-width: 980px; margin: 0 auto; padding: 16px; flex: 1; }

/* HUD atas */
.top {
  position: sticky; top: 0; z-index: 5; height: var(--hud);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: linear-gradient(#13a3b8, #0a6b80);
  border-bottom: 3px solid #064454;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 4px 14px rgba(0, 0, 0, .35);
}
.player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(#ffb25c, #f0652b);
  border: 3px solid var(--gold-hi); box-shadow: 0 0 0 2px var(--gold-dark), 0 3px 6px rgba(0, 0, 0, .3);
}
.avatar svg { display: block; width: 100%; height: 100%; }
.pname { display: flex; flex-direction: column; line-height: 1.1; }
.pname b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.pname small { font-size: .72rem; color: #c9f2fa; }
.wallet { display: flex; align-items: center; }
.chips {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 5px; border-radius: 999px;
  background: linear-gradient(#04303b, #06414f);
  border: 2px solid var(--gold); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5);
  font-family: var(--display); font-size: 1.1rem; color: var(--gold-hi);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.coin {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff6c2, var(--gold) 55%, #e08e00);
  border: 2px solid var(--gold-dark); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.plus {
  appearance: none; border: 0; cursor: pointer; width: 26px; height: 26px; margin-right: -9px; border-radius: 50%;
  background: linear-gradient(#8df08f, #1fa34a); color: #fff; font: 400 1.2rem/1 var(--display);
  box-shadow: 0 2px 0 #0f6b2c;
}
.brand {
  flex: none; font-family: var(--display); font-size: 1.5rem; color: #fff; text-decoration: none;
  -webkit-text-stroke: 4px #064454; paint-order: stroke fill; letter-spacing: .02em;
}
.brand b { font-weight: 400; color: var(--gold); }

/* Tombol */
.btn {
  appearance: none; border: 0; cursor: pointer; position: relative;
  padding: 11px 22px; border-radius: 14px;
  background: linear-gradient(#fff0a1, #ffc531 45%, #ff9f0a);
  color: #6b3300; font: 400 1.1rem/1.2 var(--display); letter-spacing: .02em;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(180, 90, 0, .25), 0 4px 0 var(--gold-dark), 0 8px 14px rgba(0, 0, 0, .28);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 1px 0 var(--gold-dark); }
.btn:focus-visible, .tile:focus-visible, .dock-btn:focus-visible, .plus:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn.small { padding: 7px 14px; font-size: .95rem; border-radius: 11px; }
.btn.big { padding: 15px 56px; font-size: 1.6rem; border-radius: 18px; }
.btn.green {
  background: linear-gradient(#b4f7a0, #3fca5a 45%, #169c3f); color: #fff; text-shadow: 0 2px 0 #0f6b2c;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 0 #0f6b2c, 0 8px 14px rgba(0, 0, 0, .28);
}
.btn.ghost, .btn.pick {
  background: rgba(255, 255, 255, .1); color: var(--text);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.pick[aria-pressed="true"] {
  background: linear-gradient(#fff0a1, #ffc531 45%, #ff9f0a); color: #6b3300;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 3px 0 var(--gold-dark);
}
.btn[disabled] { filter: grayscale(.8) brightness(.85); cursor: not-allowed; }

/* Lobi */
#lobby { max-width: none; padding: 0; }
.island {
  position: relative; flex: 1; overflow: hidden; isolation: isolate;
  min-height: calc(100vh - var(--hud)); min-height: calc(100svh - var(--hud));
  display: flex; flex-direction: column;
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.scene .sun { transform-origin: 1050px 520px; animation: pulse 7s ease-in-out infinite; }
.scene .tw { animation: tw 3.4s ease-in-out infinite; }
@keyframes tw { 50% { opacity: .15; } }
/* Lampu gantung di atas dan gelap lembut di tepi supaya ikon di tengah menonjol */
.island { background: #2a1552; }
.island::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46px; pointer-events: none;
  background:
    radial-gradient(circle at 30px 20px, #fff8d6 0 4px, rgba(255, 214, 102, .6) 6px, transparent 19px) 0 0 / 120px 46px repeat-x,
    radial-gradient(circle at 90px 26px, #ffe3f0 0 4px, rgba(255, 122, 182, .6) 6px, transparent 19px) 0 0 / 120px 46px repeat-x,
    linear-gradient(rgba(20, 10, 42, .9), rgba(20, 10, 42, .9)) 0 9px / 100% 2px no-repeat;
  animation: lamps 2.6s ease-in-out infinite alternate;
}
@keyframes lamps { from { filter: brightness(.85); } to { filter: brightness(1.2); } }
.island::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 90% at 55% 45%, transparent 45%, rgba(18, 8, 37, .55));
}
.scene .ca { animation: drift 38s ease-in-out infinite alternate; }
.scene .cb { animation: drift 52s ease-in-out infinite alternate-reverse; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .85; } }
@keyframes drift { from { transform: translateX(-50px); } to { transform: translateX(70px); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

.lobby-grid {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  display: grid; gap: 22px; padding: 22px 16px 26px;
  grid-template-columns: minmax(0, 1fr); align-content: center;
}
.promo {
  position: relative; justify-self: center; width: 100%; max-width: 420px;
  padding: 16px 18px 14px; border-radius: 20px; text-align: center; color: #fff6dc;
  background: repeating-linear-gradient(180deg, transparent 0 34px, rgba(0, 0, 0, .13) 34px 37px), linear-gradient(#b66f2c, #7c4315);
  border: 4px solid var(--wood-dark);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25), 0 8px 0 rgba(60, 28, 5, .55), 0 18px 28px rgba(0, 0, 0, .3);
}
.promo p { margin: 0; }
.promo-kicker {
  display: inline-block; padding: 1px 12px; border-radius: 999px; margin-bottom: 4px !important;
  background: var(--wood-dark); color: var(--gold-hi); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
}
.promo-title {
  font-family: var(--display); font-size: clamp(1.6rem, 5vw, 2.1rem); line-height: 1.05; color: var(--gold-hi);
  -webkit-text-stroke: 5px var(--wood-dark); paint-order: stroke fill;
}
.promo-text { font-size: .9rem; margin: 6px 0 12px !important; }
.promo-msg { min-height: 1.4em; margin-top: 8px !important; font-size: .85rem; font-weight: 800; color: var(--gold-hi); }

.games {
  display: grid; min-width: 0; width: 100%; max-width: 720px; justify-self: center;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 8px;
}
.game-btn {
  --c1: #ffd75e; --c2: #f59e0b;
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit;
  position: relative; display: flex; flex-direction: column; align-items: center;
  animation: float 4s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s);
  transition: filter .15s;
}
.g-biasa { --c1: #6ff3d2; --c2: #0d9c88; }
.g-bet { --c1: #ffc37a; --c2: #ef5a14; }
.g-qiu { --c1: #d3c0ff; --c2: #6d32d6; }
.g-slot { --c1: #ffb1d6; --c2: #d61f7a; }
.g-remi { --c1: #a9d2ff; --c2: #1f5fd6; }
.g-cara { --c1: #fff0a1; --c2: #f0a400; }
.game-btn .medal {
  width: min(100%, 176px); aspect-ratio: 1; border-radius: 50%; position: relative; overflow: hidden;
  border: 7px solid transparent;
  background-image: radial-gradient(circle at 50% 28%, var(--c1), var(--c2) 78%), linear-gradient(#fff6c2, #ffc531 40%, #c97a00);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 0 0 3px #7a4300, inset 0 -10px 18px rgba(0, 0, 0, .22), 0 12px 0 -4px rgba(0, 0, 0, .18), 0 16px 22px rgba(0, 0, 0, .3);
}
.game-btn .medal::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 5%; height: 42%; border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, 0));
}
.game-btn .medal::after {
  content: ""; position: absolute; top: -20%; left: -60%; width: 34%; height: 140%; transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shine 4.5s ease-in-out infinite; animation-delay: calc(var(--i) * .5s);
}
.game-btn .art {
  position: absolute; top: 0; left: 50%; width: min(100%, 176px); aspect-ratio: 1;
  transform: translateX(-50%); pointer-events: none; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .28));
}
.game-btn .art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.game-btn:hover:not(.soon) { filter: brightness(1.08); }
.game-btn:hover:not(.soon) .art { transform: translateX(-50%) scale(1.12) rotate(-3deg); }
.game-btn:active:not(.soon) .medal { transform: scale(.96); }
.game-btn:focus-visible { outline: 0; }
.game-btn:focus-visible .medal { outline: 4px solid #fff; outline-offset: 3px; }
.game-btn .label {
  margin-top: -18px; position: relative; z-index: 1; white-space: nowrap;
  font-family: var(--display); font-size: clamp(1.05rem, 4.4vw, 1.75rem); color: #fff; letter-spacing: .02em;
  -webkit-text-stroke: 6px #7a3300; paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .28));
}
.game-btn.soon { cursor: default; animation: none; }
.game-btn.soon .medal, .game-btn.soon .art { filter: grayscale(.85) brightness(.92); }
.game-btn.soon .medal::after { display: none; }
.game-btn .tag {
  position: absolute; top: 4%; right: 6%; z-index: 2; transform: rotate(10deg);
  padding: 3px 12px; border-radius: 999px; font-family: var(--display); font-size: .85rem;
  background: linear-gradient(#ff7a6b, #d92626); color: #fff; border: 2px solid #fff; box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}

.dock {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: linear-gradient(rgba(74, 35, 128, .92), rgba(28, 14, 56, .96));
  border-top: 3px solid var(--gold); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .14), 0 -8px 22px rgba(0, 0, 0, .35);
}
.dock-btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 14px; color: #fff; font: 400 1.05rem/1 var(--display); letter-spacing: .02em;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
}
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:hover { background: rgba(255, 255, 255, .2); }
.dock .stats {
  margin: 0 auto; padding: 4px 14px; border-radius: 999px; font-size: .85rem; font-weight: 800; color: #f1e4ff;
  background: rgba(255, 255, 255, .1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dock .stats:empty { visibility: hidden; }
.dock-btn.hot {
  position: relative; overflow: hidden; padding: 13px 26px; font-size: 1.35rem; color: #fff7c4;
  background: linear-gradient(#ffb04a, #ff5a1f 55%, #d92d0b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 4px 0 #8f1f06, 0 8px 16px rgba(0, 0, 0, .3);
  -webkit-text-stroke: 4px #8f1f06; paint-order: stroke fill;
}
.dock-btn.hot::after {
  content: ""; position: absolute; top: -20%; left: -60%; width: 30%; height: 140%; transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shine 3s ease-in-out infinite;
}
.dock-btn.hot:hover { filter: brightness(1.08); background: linear-gradient(#ffb04a, #ff5a1f 55%, #d92d0b); }

@media (min-width: 900px) {
  .lobby-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 40px; padding: 30px 40px 36px; align-items: center; }
  .promo { transform: rotate(-2deg); }
  .games { gap: 30px 20px; }
}
@media (max-width: 520px) {
  :root { --hud: 54px; }
  .pname { display: none; }
  .brand { font-size: 1.25rem; }
  .dock .stats { display: none; }
  .dock-btn.hot { margin-left: auto; }
  .game-btn .medal { border-width: 5px; }
  .game-btn .label { -webkit-text-stroke-width: 5px; margin-top: -12px; }
}

/* Meja permainan */
#game, #qiu, #slot { display: flex; flex-direction: column; gap: 12px; }
.gamebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gamebar > span { font-family: var(--display); font-size: 1.05rem; color: var(--gold-hi); letter-spacing: .02em; }
.opps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opp {
  --av: linear-gradient(#7cc4ff, #2a6fe0);
  position: relative; min-width: 0; padding: 9px 10px 9px 58px; min-height: 64px; border-radius: 16px;
  background: linear-gradient(var(--panel-2), var(--panel));
  border: 2px solid var(--line); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 4px 10px rgba(0, 0, 0, .25);
}
.opp:nth-child(2) { --av: linear-gradient(#ff9ccb, #d61f7a); }
.opp:nth-child(3) { --av: linear-gradient(#9bf0a8, #169c3f); }
.opp::before {
  content: ""; position: absolute; left: 9px; top: 10px; width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fff 0 22%, transparent 23%), radial-gradient(circle at 50% 105%, #fff 0 44%, transparent 45%), var(--av);
  border: 3px solid var(--gold-hi); box-shadow: 0 0 0 2px var(--gold-dark);
}
.opp.turn, .me.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 197, 49, .35), 0 0 22px rgba(255, 197, 49, .45); }
.opp.out { opacity: .55; }
.opp-name { font-family: var(--display); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-count { color: var(--muted); font-size: .8rem; }
.opp-hand { font-size: .82rem; font-weight: 800; color: var(--gold-hi); min-height: 1.3em; }
.backs { display: flex; gap: 2px; margin-top: 4px; height: 16px; }
.backs i { width: 9px; height: 16px; border-radius: 2px; background: linear-gradient(var(--ivory), var(--ivory-2)); box-shadow: 0 1px 0 #9c8558; }
.opp .mini { display: flex; gap: 1px; margin-top: 4px; --u: clamp(12px, 3.6vw, 22px); }
.said {
  position: absolute; top: -10px; right: 8px; padding: 2px 10px; border-radius: 999px;
  background: linear-gradient(#ff7a6b, #d92626); color: #fff; border: 2px solid #fff;
  font-family: var(--display); font-size: .8rem;
}
@media (max-width: 520px) {
  .opp { padding-left: 10px; }
  .opp::before { display: none; }
}

.board {
  position: relative; min-height: 270px; padding: 16px 8px 46px; border-radius: 26px;
  background: radial-gradient(ellipse at 50% 40%, #1fc487, var(--felt) 45%, var(--felt-edge));
  border: 10px solid var(--wood);
  box-shadow: 0 0 0 3px var(--wood-dark), inset 0 0 0 3px rgba(0, 0, 0, .25), inset 0 0 60px rgba(0, 0, 0, .4), 0 12px 24px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; justify-content: center;
}
.chain { margin: 0 auto; }
.row { display: flex; align-items: center; justify-content: flex-end; height: calc(var(--u) * 2 + 4px); }
.row.rev { flex-direction: row-reverse; }
.row.last { justify-content: flex-start; }
.row.solo { justify-content: center; }
.row.rev .tile.h { flex-direction: row-reverse; }
.status {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; max-width: 94%;
  padding: 3px 16px; border-radius: 999px; background: rgba(0, 0, 0, .32);
  text-align: center; font-size: .9rem; font-weight: 800; color: #eafff4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chooser {
  position: absolute; inset: 0; z-index: 2; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 12px; background: rgba(3, 40, 28, .78);
}

/* Kartu domino */
.tile {
  display: flex; flex: none; gap: 1.5px; padding: 0; margin: 1px;
  border: 0; border-radius: calc(var(--u) * .18);
  background: #b9a777; overflow: hidden;
  box-shadow: 0 calc(var(--u) * .08) 0 #9c8558, 0 calc(var(--u) * .14) calc(var(--u) * .12) rgba(0, 0, 0, .45);
}
.tile.h { width: calc(var(--u) * 2 - 2px); height: calc(var(--u) - 2px); }
.tile.v { width: calc(var(--u) - 2px); height: calc(var(--u) * 2 - 2px); flex-direction: column; }
.tile.new { box-shadow: 0 0 0 2px var(--gold), 0 0 14px 3px rgba(255, 197, 49, .8); }
.half {
  flex: 1; min-width: 0; min-height: 0;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 12%; background: linear-gradient(var(--ivory), var(--ivory-2));
}
.half i { margin: 10%; border-radius: 50%; }
.half i.p { background: radial-gradient(circle at 35% 30%, #ff6b6b, var(--pip) 60%); box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .35); }
.tile.back { background: #7d1f18; }
.tile.back .half { background: repeating-linear-gradient(45deg, #e0503f 0 4px, #c93a2c 4px 8px); }
.tile.back .half i { visibility: hidden; }

/* Tangan pemain */
.me, .panel {
  padding: 12px; border-radius: 20px;
  background: linear-gradient(var(--panel-2), var(--panel));
  border: 2px solid var(--line); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .25);
}
.panel h2 { margin: 4px 0 6px; font-size: 1.25rem; color: var(--gold-hi); }
.me-head { display: flex; align-items: center; justify-content: space-between; min-height: 34px; margin-bottom: 4px; font-family: var(--display); font-size: 1.05rem; }
.hand {
  --u: clamp(30px, calc((100vw - 60px) / 7), 62px);
  display: flex; flex-wrap: wrap; justify-content: center; min-height: calc(var(--u) * 2 + 16px);
  padding-top: 12px;
}
.hand .tile { cursor: pointer; transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), filter .15s; }
.hand .tile.dim { filter: brightness(.55) saturate(.6); cursor: default; }
.hand .tile.can { box-shadow: 0 0 0 2px var(--gold), 0 0 12px 2px rgba(255, 197, 49, .7), 0 4px 0 #9c8558; }
.hand .tile.can:hover, .hand .tile.sel { transform: translateY(-10px); }
.hand.static .tile { cursor: default; }

/* QiuQiu & slot */
.qboard { min-height: 150px; padding: 18px 12px; align-items: center; text-align: center; }
.pot { margin: 0; font-family: var(--display); font-size: 1.1rem; }
.pot b { font-weight: 400; color: var(--gold-hi); font-size: 2rem; margin-left: 6px; -webkit-text-stroke: 4px #6b3300; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.msg { margin: 6px 0 0; min-height: 1.5em; font-weight: 800; }
.msg.win { color: var(--green); font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.msg.lose { color: var(--red); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 10px 0 6px; }
.machine {
  padding: 22px 12px 14px; border-radius: 28px; text-align: center;
  background: linear-gradient(#a855f7, #6d28d9 55%, #4c1d95);
  border: 6px solid var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dark), inset 0 4px 0 rgba(255, 255, 255, .3), inset 0 0 40px rgba(0, 0, 0, .35), 0 14px 26px rgba(0, 0, 0, .4);
}
.reels {
  display: inline-flex; justify-content: center; gap: 8px; padding: 10px; border-radius: 20px;
  background: #2e1065; box-shadow: inset 0 4px 10px rgba(0, 0, 0, .6);
}
.reel {
  width: min(25vw, 124px); aspect-ratio: 3 / 4; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#d9d4c5, #fff 30%, #fff 70%, #d9d4c5);
  font-size: clamp(2.4rem, 12vw, 4.4rem); line-height: 1;
}
.reel.spin { filter: blur(2px); }
.machine .msg { color: #fff; }
.machine .msg.win { color: var(--gold-hi); }

/* Modal */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(2, 20, 26, .72); backdrop-filter: blur(4px);
}
.modal {
  width: 100%; max-width: 420px; padding: 24px 22px 22px; border-radius: 24px; text-align: center;
  background: linear-gradient(#12798f, #0a4c5e);
  border: 4px solid var(--gold); box-shadow: 0 0 0 3px var(--gold-dark), inset 0 3px 0 rgba(255, 255, 255, .25), 0 24px 50px rgba(0, 0, 0, .55);
  animation: pop .22s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal h2 { font-size: 1.9rem; color: #fff; -webkit-text-stroke: 5px #064454; paint-order: stroke fill; }
.modal h3 { margin: 14px 0 4px; font-size: 1.15rem; color: var(--gold-hi); }
.modal ol { margin: 0; padding-left: 1.2em; color: #d3eef5; font-size: .92rem; }
.modal.left { text-align: left; max-width: 540px; max-height: 88vh; overflow: auto; }
.modal.left p { color: #d3eef5; font-size: .92rem; margin: 0; }
.modal.left .modal-actions { margin-top: 20px; }
.delta { font-family: var(--display); font-size: 2rem; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.delta.win { color: var(--green); }
.delta.lose { color: var(--red); }
.reslist { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; }
.reslist li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.reslist li.winner { color: var(--gold-hi); font-weight: 900; }
.reslist span:last-child { color: var(--muted); }
.reslist li.winner span:last-child { color: inherit; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pick-opts { display: grid; gap: 12px; margin: 14px 0 18px; }

/* Daftar / masuk */
.icon-btn {
  appearance: none; border: 0; cursor: pointer; flex: none; width: 36px; height: 36px; padding: 7px; border-radius: 11px;
  color: #fff; background: rgba(0, 40, 50, .4); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2);
}
.icon-btn:hover { background: rgba(0, 40, 50, .65); }
.icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.icon-btn svg { display: block; width: 100%; height: 100%; }
.modal.auth { position: relative; max-width: 400px; }
.auth-note { margin: 0 0 14px; color: var(--gold-hi); font-weight: 800; }
.field { display: block; margin-bottom: 12px; text-align: left; font-size: .9rem; font-weight: 800; color: #d3eef5; }
.field input {
  display: block; width: 100%; margin-top: 4px; padding: 12px 14px; border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .25); background: #04303b; color: #fff;
  font: 700 1rem/1.2 "Nunito", system-ui, sans-serif;
}
.field input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 197, 49, .3); }
.auth-err { min-height: 1.4em; margin: 0 0 10px; color: var(--red); font-size: .9rem; font-weight: 800; }
.auth-switch { margin: 16px 0 0; font-size: .9rem; color: #d3eef5; }
.link { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: var(--gold-hi); font: inherit; font-weight: 900; text-decoration: underline; }
.x {
  appearance: none; border: 0; cursor: pointer; position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .3); color: #fff; font: 400 1.4rem/1 var(--display);
}
.x:hover { background: rgba(0, 0, 0, .5); }
@media (max-width: 520px) {
  .player { display: none; }
  .top { gap: 8px; padding: 0 12px; }
}

.brand img { display: block; height: 62px; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.foot .brand img { height: 96px; }
@media (max-width: 520px) { .top .brand img { height: 38px; } }
@media (max-width: 400px) { .top { gap: 6px; padding: 0 8px; } }

/* Menu utama */
.menu { display: flex; gap: 4px; margin: 0 auto 0 14px; }
.menu a {
  appearance: none; border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px;
  background: none; color: #fff; font: 400 1.05rem/1 var(--display); letter-spacing: .02em; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25); transition: background .15s;
}
.menu a:hover { background: rgba(0, 40, 50, .35); }
.menu a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.menu a[aria-current="page"] { background: rgba(0, 40, 50, .55); color: var(--gold-hi); box-shadow: inset 0 0 0 2px rgba(255, 197, 49, .6); }
.menu-btn { display: none; }
@media (max-width: 1023px) {
  .brand { margin-right: auto; }
  .menu-btn { display: block; }
  .menu {
    display: none; position: absolute; top: var(--hud); left: 0; right: 0; margin: 0; padding: 10px 12px 14px;
    flex-direction: column; gap: 4px;
    background: linear-gradient(#0a6b80, #07495a); border-bottom: 3px solid #064454; box-shadow: 0 14px 24px rgba(0, 0, 0, .4);
  }
  .menu.open { display: flex; }
  .menu a { text-align: left; padding: 13px 16px; border-radius: 12px; font-size: 1.15rem; }
}
@media (max-width: 520px) {
  .top .brand { font-size: 1.15rem; -webkit-text-stroke-width: 3px; }
  .chips { font-size: 1rem; padding-right: 11px; gap: 6px; }
}

/* Halaman Tentang & Kontak */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: .88rem; font-weight: 800; color: var(--muted); }
.crumbs a { color: var(--gold-hi); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: #fff; }
.page { max-width: 900px; padding-block: 28px 40px; }
.page-card { padding: 28px 22px; }
.page-card.narrow { max-width: 560px; margin: 0 auto; }
.kicker {
  display: inline-block; margin: 0 0 10px; padding: 2px 12px; border-radius: 999px;
  background: rgba(255, 197, 49, .12); box-shadow: inset 0 0 0 2px rgba(255, 197, 49, .45);
  color: var(--gold-hi); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
}
.page h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); color: #fff; margin-bottom: .4em; }
.page h2 { margin: 28px 0 10px; color: var(--gold-hi); }
.lead { margin: 0 0 22px; max-width: 62ch; color: #d3eef5; font-size: 1.05rem; }
.features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.feature {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px;
  background: rgba(0, 30, 40, .35); box-shadow: inset 0 0 0 2px var(--line); border-top: 4px solid var(--gold);
}
.feature b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: #fff; }
.feature span { color: var(--muted); font-size: .92rem; }
.ticks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; color: #d3eef5; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--felt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.500l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3.500' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.page .actions { justify-content: flex-start; }
.field textarea {
  display: block; width: 100%; margin-top: 4px; padding: 12px 14px; border-radius: 12px; resize: vertical; min-height: 120px;
  border: 2px solid rgba(255, 255, 255, .25); background: #04303b; color: #fff;
  font: 700 1rem/1.5 "Nunito", system-ui, sans-serif;
}
.field textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 197, 49, .3); }
.form-msg { min-height: 1.5em; margin: 0; font-weight: 800; color: var(--red); }
.form-msg.ok { color: var(--green); }

/* Tautan yang tampil sebagai tombol */
.menu a, .foot-col a, a.btn, a.dock-btn { text-decoration: none; }
a.btn { display: inline-block; }

/* Teks beranda + sidebar */
.home-info { background: linear-gradient(#f0b95c 0, #0a4c5e 0, var(--bg-2)); border-top: 4px solid var(--gold-dark); }
.home-in {
  max-width: 1180px; margin: 0 auto; padding: 40px 20px 48px;
  display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
}
.home-text h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); color: #fff; margin-bottom: .45em; }
.home-text h2 { margin: 30px 0 12px; color: var(--gold-hi); }
.home-text p { color: #d3eef5; max-width: 70ch; }
.home-text a, .faq a { color: var(--gold-hi); font-weight: 800; }
.home-text .ticks b { color: #fff; }
.sidebar { display: grid; gap: 16px; align-content: start; }
.side-card {
  padding: 18px; border-radius: 18px;
  background: linear-gradient(var(--panel-2), var(--panel));
  border: 2px solid var(--line); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .25);
}
.side-card h2 { margin: 0 0 12px; font-size: 1.25rem; color: #fff; }
.side-card h2::after { content: ""; display: block; width: 34px; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--gold); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; color: #d3eef5; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; min-height: 30px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); color: #6b3300;
  background: linear-gradient(#fff0a1, #ffb300); box-shadow: 0 2px 0 var(--gold-dark);
}
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-list a {
  display: block; padding: 9px 12px; border-radius: 10px; color: #d3eef5; font-weight: 800; text-decoration: none;
  overflow-wrap: anywhere; transition: background .15s, color .15s;
}
.side-list a::before { content: "\203A"; margin-right: 8px; color: var(--gold); font-weight: 900; }
.side-list a:hover { background: rgba(0, 30, 40, .45); color: var(--gold-hi); }
.side-list a:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
@media (min-width: 900px) {
  .home-in { grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; padding: 56px 40px 64px; }
  .sidebar { position: sticky; top: calc(var(--hud) + 16px); }
}

/* Panduan */
.rules { margin: 0 0 14px; padding-left: 1.3em; color: #d3eef5; display: grid; gap: 6px; }
.page-card > p { color: #d3eef5; max-width: 70ch; }
.page .features { margin-bottom: 8px; }
.faq { display: grid; gap: 8px; margin-bottom: 22px; }
.faq details { border-radius: 14px; background: rgba(0, 30, 40, .35); box-shadow: inset 0 0 0 2px var(--line); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 800; color: #fff; }
.faq summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 14px; }
.faq details[open] summary { color: var(--gold-hi); }
.faq p { margin: 0; padding: 0 16px 16px; color: #d3eef5; }

/* Footer */
.foot {
  position: relative; color: #b9dbe4; font-size: .92rem;
  background:
    radial-gradient(circle at 12% 30%, rgba(255, 197, 49, .08) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 75%, rgba(31, 196, 139, .1) 0 130px, transparent 131px),
    linear-gradient(#0a4c5e, #04222b 70%);
  border-top: 4px solid var(--gold); box-shadow: inset 0 3px 0 var(--gold-dark), inset 0 14px 24px rgba(0, 0, 0, .25);
}
.foot-in {
  max-width: 1180px; margin: 0 auto; padding: 36px 20px 28px;
  display: grid; gap: 30px 28px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.foot-about, .foot-note { grid-column: 1 / -1; }
.foot .brand { display: inline-block; margin: 0; font-size: 2rem; -webkit-text-stroke-color: #021a21; }
.foot p { margin: 8px 0 0; max-width: 46ch; line-height: 1.55; }
.badges { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 999px;
  font-size: .82rem; font-weight: 800; color: var(--gold-hi);
  background: rgba(255, 197, 49, .1); box-shadow: inset 0 0 0 2px rgba(255, 197, 49, .4);
}
.badges svg { width: 16px; height: 16px; flex: none; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.foot-col h3 { margin: 0 0 8px; font-size: 1.2rem; color: #fff; letter-spacing: .02em; }
.foot-col h3::after { content: ""; display: block; width: 34px; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--gold); }
.foot-col :is(a, button) {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 5px 0; text-align: left;
  color: #b9dbe4; font: inherit; font-weight: 700; transition: color .15s, transform .15s;
}
.foot-col :is(a, button):hover { color: var(--gold-hi); transform: translateX(4px); }
.foot-col :is(a, button):focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 4px; }
.foot-note p { margin-top: 0; }
.foot-note p + p { margin-top: 8px; }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px;
  max-width: 1180px; margin: 0 auto; padding: 16px 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, .12); font-size: .8rem; color: #7fa9b5;
}
@media (min-width: 900px) {
  .foot-in { grid-template-columns: 1.5fr .9fr .9fr 1.3fr; padding: 48px 40px 36px; }
  .foot-about, .foot-note { grid-column: auto; }
  .foot-bottom { padding-inline: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
