/* ============================================================
   DOMINÓ ROYALE — tema casino
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #e9c46a;
  --gold-2: #f7d98a;
  --gold-deep: #b8893a;
  --felt: #0f7a4a;
  --felt-dk: #075030;
  --panel: rgba(10, 32, 23, 0.92);
  --panel-line: rgba(233, 196, 106, 0.35);
  --cream: #f4eedd;
  --text: #eaf2ec;
  --dim: #9fb4a6;
  --danger: #ff7b7b;
}

html, body { height: 100%; }
body {
  font-family: "Poppins", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 92%, rgba(46, 200, 200, 0.16), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(150, 90, 255, 0.16), transparent 42%),
    url('bg.svg') center center / cover no-repeat fixed;
  background-color: #05241a;
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14px;
  overflow-x: hidden;
}
/* rayos de luz (spotlight) detrás de la UI */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: conic-gradient(
    from 90deg at 50% -15%,
    transparent 0 38%,
    rgba(255, 235, 170, 0.12) 44% 50%,
    transparent 56% 62%,
    rgba(255, 235, 170, 0.08) 68% 74%,
    transparent 80% 100%
  );
  animation: rays 16s linear infinite;
}
@keyframes rays {
  0% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}
/* viñeta para que el centro resalte */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(125% 105% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.6) 100%);
}

#app { width: 100%; max-width: 600px; position: relative; z-index: 1; }

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 0 30px;
}
.hidden { display: none !important; }
.dim { color: var(--dim); font-size: 14px; }

/* ---------- Marca ---------- */
.brand { text-align: center; margin-top: 14px; }
.brand.small { margin: 0; }
.brand-logo {
  font-size: 46px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}
.brand-name {
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fbe9b6, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.brand-name span { font-weight: 800; }
.brand-tag { color: var(--gold); opacity: 0.85; letter-spacing: 3px; font-size: 12px; }

/* ---------- Tarjetas ---------- */
.card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
}
label { font-size: 12px; color: var(--dim); margin-top: 8px; }
input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--gold); }

/* ---------- Botones ---------- */
.btn-primary {
  margin-top: 12px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  color: #4a2a02;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd479, #f4a623 55%, #db8410);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.08s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(233, 196, 106, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-recharge {
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid var(--gold);
  background: rgba(233, 196, 106, 0.12);
  color: var(--gold);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.cash-row { display: flex; gap: 8px; }
.cash-row .btn-recharge { flex: 1; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.link {
  background: none; border: none; color: var(--gold);
  text-decoration: underline; font-size: 13px; cursor: pointer; font-family: inherit;
}
.msg { color: var(--danger); min-height: 16px; text-align: center; font-size: 13px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.tab {
  flex: 1; padding: 11px; border: none; border-radius: 11px;
  background: rgba(255, 255, 255, 0.07); color: var(--text);
  font-family: inherit; font-size: 15px; cursor: pointer;
}
.tab.active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
  color: #2a1c05; font-weight: 700;
}

/* ---------- Topbar lobby ---------- */
.topbar {
  width: 100%; max-width: 400px;
  display: flex; justify-content: space-between; align-items: center;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; }
.balance { color: var(--gold); font-size: 14px; }
.lobby-card { gap: 14px; }
.section-title {
  color: var(--dim); font-size: 12px; text-transform: uppercase;
  letter-spacing: 1.5px; margin-top: 4px;
}

/* ---------- Apuestas ---------- */
.bets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bet {
  padding: 12px 0; border-radius: 12px; border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.07); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bet span { font-size: 12px; opacity: 0.8; }
.bet.active {
  border-color: var(--gold);
  background: rgba(233, 196, 106, 0.18);
  color: var(--gold);
}
.modes-pts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modebtn {
  padding: 12px 0; border-radius: 12px; border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.07); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.modebtn.active { border-color: var(--gold); background: rgba(233, 196, 106, 0.18); color: var(--gold); }

/* ---------- Modos ---------- */
.modes { display: flex; flex-direction: column; gap: 10px; }
.mode-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text); cursor: pointer; font-family: inherit; text-align: left;
}
.mode-btn.primary-mode {
  border-color: var(--gold);
  background: linear-gradient(120deg, rgba(233, 196, 106, 0.22), rgba(233, 196, 106, 0.05));
}
.mode-ic { font-size: 26px; }
.mode-tx { display: flex; flex-direction: column; }
.mode-tx b { font-size: 16px; }
.mode-tx small { color: var(--dim); font-size: 12px; }

/* ---------- Spinner ---------- */
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.code {
  font-size: 40px; font-weight: 800; letter-spacing: 10px; color: var(--gold);
  background: rgba(0, 0, 0, 0.35); border: 2px dashed var(--gold);
  border-radius: 14px; padding: 14px 10px; margin: 8px 0; text-align: center;
}

/* ============================================================
   MESA
   ============================================================ */
.table-stage { width: 100%; display: flex; justify-content: center; }
.rail {
  width: 100%; max-width: 560px; padding: 13px;
  border-radius: 28px;
  background:
    repeating-linear-gradient(90deg, rgba(90, 55, 20, 0.22) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #d8b277 0%, #b58a4f 55%, #8f6936 100%);
  box-shadow:
    0 0 55px rgba(255, 205, 110, 0.28),
    0 14px 34px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 240, 210, 0.6),
    inset 0 -5px 12px rgba(80, 50, 20, 0.5);
}
.felt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 42%, #3aa563 0%, #237a45 70%, #185832 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.18),
    inset 0 0 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.felt-logo {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 120px; opacity: 0.05; pointer-events: none;
}

/* asientos */
.seat {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 4;
}
.seat.top { top: 8px; }
.seat.bottom { bottom: 8px; }
.avatar {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 800; color: #3a2705;
  background: radial-gradient(circle at 35% 30%, #fff0c6, #e9b84e);
  border: 3px solid #2ec4c4;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.avatar.me { border-color: #ffb347; }
.avatar.sm { width: 40px; height: 40px; font-size: 18px; border-color: var(--gold); }
.avatar.active-turn { animation: turnPulse 1.1s ease-in-out infinite; }
@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 0 3px #ffce54, 0 0 10px rgba(255, 206, 84, 0.6); }
  50% { box-shadow: 0 0 0 4px #ffce54, 0 0 22px rgba(255, 206, 84, 1); }
}
.nameplate {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #8a6038, #5e3f20);
  border: 1px solid rgba(255, 235, 200, 0.4);
  border-radius: 11px; padding: 3px 14px; min-width: 72px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.np-name { font-weight: 700; font-size: 12px; color: #fff; }
.np-sub { font-size: 13px; color: #ffd98a; font-weight: 700; }

/* barra de info (pozo / bote) arriba de la mesa */
.table-info {
  width: 100%; max-width: 540px;
  display: flex; justify-content: space-between; gap: 10px;
}
.plaque {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #8a6038, #5e3f20);
  border: 1px solid rgba(255, 235, 200, 0.4);
  border-radius: 12px; padding: 7px 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.pl-lbl { font-size: 11px; letter-spacing: 1.5px; color: #ecd9b6; }
.pl-num { font-size: 18px; font-weight: 800; color: #fff; }
.pl-num.gold { color: #ffd98a; }

/* tablero (cadena) */
.board-wrap {
  position: absolute; inset: 46px 14px;
  display: flex; align-items: safe center; justify-content: safe center;
  overflow: auto;
}
.board { position: relative; }
.btile { position: absolute; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }
.btile.just-played { animation: tilePop 0.4s ease; }
@keyframes tilePop {
  0% { transform: scale(1.5); filter: drop-shadow(0 0 12px var(--gold)); }
  60% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* confeti de celebración */
.confetti {
  position: fixed; top: -16px; width: 10px; height: 15px;
  z-index: 200; border-radius: 2px; pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(110vh) rotate(900deg); opacity: 0.9; }
}
.coin-drop {
  position: fixed; top: -34px; z-index: 205; font-size: 26px;
  pointer-events: none; animation: confettiFall linear forwards;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* ---------- Chat / emojis ---------- */
.chat-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 40;
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.chatbar {
  position: fixed; right: 14px; bottom: 74px; z-index: 41;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 240px;
  background: rgba(0, 0, 0, 0.78); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px; padding: 8px;
}
.chat-item {
  border: none; border-radius: 8px; background: rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 17px; padding: 6px 9px; cursor: pointer; font-family: inherit;
}
.chat-item:hover { background: rgba(255, 255, 255, 0.2); }
.bubble {
  position: absolute; top: -32px; left: 50%;
  transform: translateX(-50%) scale(0.5); opacity: 0;
  transition: all 0.15s ease; pointer-events: none; z-index: 8;
  background: #fff; color: #1c1c1c; border-radius: 14px; padding: 5px 12px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}
.seat.bottom .bubble { top: auto; bottom: -32px; }
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.dsvg { width: 100%; height: 100%; display: block; }

/* zonas para soltar */
.drop-zone {
  position: absolute; top: 52px; bottom: 52px; width: 44%;
  display: none; align-items: center; justify-content: center;
  border-radius: 14px; z-index: 50; pointer-events: none;
  font-size: 26px; font-weight: 800; color: #fff;
  border: 2px dashed transparent;
}
.drop-zone.left { left: 8px; }
.drop-zone.right { right: 8px; }
.drop-zone.show {
  display: flex; border-color: rgba(233, 196, 106, 0.6);
  background: rgba(233, 196, 106, 0.1);
}
.drop-zone.full { width: auto; left: 4px; right: 4px; }
.drop-zone.hover { background: rgba(46, 204, 113, 0.32); border-color: #2ecc71; color: #fff; }

/* ---------- Zoom del tablero ---------- */
.zoombar { display: flex; gap: 8px; justify-content: center; margin-top: 2px; }
.zoombtn {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(233, 196, 106, 0.45);
  color: var(--gold); font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 6px 14px; border-radius: 10px; cursor: pointer;
}
.zoombtn:active { transform: scale(0.96); }

/* ---------- Banner de turno ---------- */
.turn-banner {
  padding: 9px 20px; border-radius: 999px; font-weight: 600;
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.12);
}
.turn-banner.you {
  background: linear-gradient(180deg, var(--gold-2), var(--gold-deep));
  color: #2a1c05;
  box-shadow: 0 0 18px rgba(233, 196, 106, 0.5);
}
.turn-banner.hurry {
  background: linear-gradient(180deg, #ff6b6b, #b81d1d);
  color: #fff;
  animation: hurryPulse 0.7s ease-in-out infinite;
}
@keyframes hurryPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 80, 80, 0.5); }
  50% { box-shadow: 0 0 22px rgba(255, 80, 80, 0.95); }
}

/* ============================================================
   FICHAS (SVG)
   ============================================================ */
.tile { display: block; position: relative; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45)); }
.tile.v { width: 50px; height: 100px; }
.tile:not(.v) { width: 100px; height: 50px; }

/* mano (bandeja) */
.hand-wrap {
  margin: 4px auto 0; max-width: 480px; width: 100%;
  padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(#3c2618, #211207);
  border: 1px solid #523a25;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(233, 196, 106, 0.15);
  overflow-x: auto;
}
.hand { display: flex; gap: 6px; justify-content: center; min-height: 100px; align-items: flex-end; }
.hand .tile { cursor: grab; touch-action: none; user-select: none; transition: transform 0.12s, filter 0.12s; }
.hand .tile.playable {
  filter: drop-shadow(0 0 7px #34d27a) drop-shadow(0 0 3px #34d27a) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
}
.hand .tile.playable:hover { transform: translateY(-9px); }
.hand .tile.disabled { opacity: 0.5; }
.hand .tile.lifting { opacity: 0.3; }
.hand .tile.flip-in { animation: flipIn 0.45s ease both; }
@keyframes flipIn {
  from { transform: rotateY(85deg) translateY(20px); opacity: 0; }
  to { transform: rotateY(0) translateY(0); opacity: 1; }
}

/* ficha arrastrada */
.tile.ghost {
  position: fixed; left: 0; top: 0;
  transform: translate(-50%, -50%) scale(1.18) rotate(-3deg);
  pointer-events: none; z-index: 100;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.7));
}
body.dragging { user-select: none; }

.actions { display: flex; gap: 10px; }

/* ---------- Tomar fichas ---------- */
.pick-area { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pick-text { color: var(--gold); font-weight: 600; font-size: 14px; }
.pick-pile { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 520px; }
.pick-pile .back {
  width: 40px; height: 58px; border-radius: 7px; cursor: pointer;
  background: linear-gradient(145deg, #1c3a48, #0a1a22);
  border: 1px solid #2c4d5c; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}
.pick-pile .back::after {
  content: ""; display: block; margin: 16px auto; width: 12px; height: 12px;
  border-radius: 50%; background: rgba(233, 196, 106, 0.35);
}
.pick-pile .back:hover { transform: translateY(-5px); }
.pick-pile .back.taken { animation: takeFly 0.5s ease forwards; pointer-events: none; }
@keyframes takeFly { to { transform: translateY(130px) scale(0.5) rotate(12deg); opacity: 0; } }

/* ---------- Overlay revolver ---------- */
.deal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(circle at 50% 42%, #0f7546, #04140d 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
}
.shuffle-pile { position: relative; width: 200px; height: 150px; }
.facedown {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 62px;
  border-radius: 7px; transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #1c3a48, #0a1a22);
  border: 1px solid #2c4d5c; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.55);
}
.facedown::after {
  content: ""; position: absolute; inset: 8px; border-radius: 4px;
  border: 1px solid rgba(233, 196, 106, 0.25);
}
.shuffle-pile.shuffling .facedown { animation: jiggle 0.6s ease-in-out infinite; }
@keyframes jiggle {
  0% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -50%) translate(var(--rx), var(--ry)) rotate(var(--rr)); }
  100% { transform: translate(-50%, -50%); }
}
.deal-text { font-size: 20px; font-weight: 700; color: var(--gold); }

/* ---------- Resultado ---------- */
.result-card {
  background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 22px; padding: 30px 26px; text-align: center;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); margin-top: 30px;
}
.result-card h1 { font-size: 30px; }
#result-title.win { color: #46e08a; }
#result-title.lose { color: var(--danger); }
#result-title.draw { color: var(--gold); }
.chips-box {
  background: rgba(233, 196, 106, 0.14); border: 1px solid var(--gold);
  border-radius: 12px; padding: 10px 18px; color: var(--gold); font-size: 18px;
}

/* ---------- Modales ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  width: 100%; max-width: 380px;
  background: linear-gradient(#0d2e20, #0a2017);
  border: 1px solid var(--panel-line); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.modal-box h3 { text-align: center; color: var(--gold); }
.pay-box {
  background: rgba(233, 196, 106, 0.12);
  border: 1px solid var(--gold);
  border-radius: 12px; padding: 12px 14px; margin: 4px 0 6px;
}
.pay-step { font-size: 13px; color: var(--text); margin: 3px 0; }
.pay-step b { color: var(--gold); }
.pay-num {
  text-align: center; font-size: 22px; font-weight: 800; color: var(--gold);
  letter-spacing: 1px; margin: 6px 0; user-select: all;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions button { flex: 1; }
.sep { text-align: center; color: var(--dim); font-size: 13px; margin: 4px 0; }

/* ---------- Botón de esquina (reglas) ---------- */
.corner-btn {
  position: fixed; top: 12px; left: 12px; z-index: 45;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(233, 196, 106, 0.5);
  background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.corner-btn:active { transform: scale(0.95); }
.modal-box.rules { max-width: 440px; }
.rules-text {
  max-height: 60vh; overflow-y: auto; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
}
.rules-text b { color: var(--gold); margin-top: 10px; font-size: 14px; }
.rules-text p { color: var(--text); font-size: 13px; line-height: 1.45; margin: 2px 0 4px; }
.rule-examples {
  background: rgba(233, 196, 106, 0.12); border: 1px solid rgba(233, 196, 106, 0.4);
  border-radius: 8px; padding: 6px 10px; color: var(--gold) !important;
  font-weight: 700; text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .board-wrap { inset: 44px 10px; }
  .brand-name { font-size: 27px; }
  .np-name { font-size: 12px; }
}
