/* ===========================================================
   GRAMBLER — games UI (cartoon theme): HUD, modals, stake,
   dice, slot, long/short, leaderboard.
   =========================================================== */

/* ---------------- HUD ---------------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; font-family: var(--font); pointer-events: none;
}
#hud > * { pointer-events: auto; }
.hud-chip {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 15px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--card); color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  white-space: nowrap;
}
.hud-chip b { color: var(--blue); }
.hud-chip.timer b { color: var(--red); }
#bal { transition: transform .15s ease; display: inline-block; }
#bal.bump { transform: scale(1.35); }
.hud-spacer { flex: 1 1 auto; }
#board-btn {
  font-family: var(--font); font-weight: 700; font-size: 14px; letter-spacing: .5px;
  color: #fff; background: var(--gold);
  border: 3px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; box-shadow: 0 4px 0 var(--line);
}
#board-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }

#claim-btn {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--muted); border: 3px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: default; box-shadow: 0 4px 0 var(--line);
  min-width: 88px; justify-content: center;
}
#claim-btn[hidden] { display: none; }
#claim-btn.ready {
  background: var(--green); cursor: pointer;
  animation: claimpulse 1.2s ease-in-out infinite;
}
#claim-btn.ready:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
@keyframes claimpulse { 0%,100% { box-shadow: 0 4px 0 var(--line); } 50% { box-shadow: 0 4px 0 var(--line), 0 0 16px rgba(34,195,107,.7); } }

@media (max-width: 480px) {
  #hud { gap: 6px; padding: 8px 10px; }
  .hud-chip { font-size: 11px; padding: 6px 9px; border-width: 2.5px; gap: 4px; }
  .hud-chip .gram-label { display: none; }        /* just "1,500 💎" — drop the word GRAM */
  #board-btn, #claim-btn, #lang-btn { font-size: 11px; padding: 6px 9px; border-width: 2.5px; box-shadow: 0 3px 0 var(--line); }
  #claim-btn { min-width: 0; }
  #lang-btn { min-width: 0; padding: 6px 8px; }
}

/* ---------------- Overlays ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 16px;
  background: rgba(16,33,63,.42);
  backdrop-filter: blur(3px);
  animation: fade .18s ease;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.game-card, .board-card {
  position: relative; width: min(94vw, 430px);
  max-height: 92vh; overflow: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 58px 22px 22px; text-align: center;
  background: var(--card);
  border: 4px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 12px 0 var(--line), 0 22px 40px rgba(16,33,63,.3);
  font-family: var(--font);
  animation: pop .22s cubic-bezier(.22,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.9); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.game-card::-webkit-scrollbar, .board-card::-webkit-scrollbar { width: 0; height: 0; }

.game-bal {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font); font-weight: 700; font-size: 13px; color: var(--ink);
  background: var(--paper); border: 3px solid var(--line); border-radius: 999px;
  padding: 6px 12px; box-shadow: 0 3px 0 var(--line);
}
.game-bal b { color: var(--blue); transition: transform .15s ease; display: inline-block; }
.game-bal b.bump { transform: scale(1.3); }

.game-close {
  position: absolute; top: 12px; right: 12px;
  width: 38px; height: 38px; border-radius: 12px;
  font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--ink);
  background: var(--paper); border: 3px solid var(--line); cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
}
.game-close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

.game-card h2, .board-card h2 {
  margin: 2px 0 6px; font-weight: 700; font-size: 26px; letter-spacing: .5px;
  color: var(--blue);
  -webkit-text-stroke: 2px var(--line); paint-order: stroke fill;
}
.game-sub { margin: 0 0 16px; font-size: 12.5px; font-weight: 500; line-height: 1.6; color: var(--muted); }

@media (max-width: 460px) {
  .game-card, .board-card { padding: 50px 16px 18px; border-width: 3px; }
  .game-card h2, .board-card h2 { font-size: 22px; margin-bottom: 4px; }
  .game-sub { margin-bottom: 12px; font-size: 11.5px; }
  .game-bal { font-size: 12px; padding: 5px 10px; }
  .game-close { width: 34px; height: 34px; }
}

/* ---------------- Sticker tiles ---------------- */
.sticker {
  display: grid; place-items: center; background: #fff;
  border: 3px solid var(--line); border-radius: 16px; line-height: 1; user-select: none;
}

/* ---------------- Slot ---------------- */
.reels {
  display: flex; justify-content: center; gap: 3%;
  padding: 12px; margin: 0 auto 16px; width: 100%; max-width: 340px;
  background: var(--paper); border: 3px solid var(--line); border-radius: 18px;
  box-shadow: inset 0 3px 0 rgba(16,33,63,.08);
}
.reel {
  flex: 1 1 0; max-width: 96px; aspect-ratio: 88 / 100;
  overflow: hidden; position: relative;
  background: #fff; border: 3px solid var(--line); border-radius: 14px;
}
.reel .sym { position: absolute; inset: 6px; }
.reel .sym svg { display: block; width: 100%; height: 100%; }
.reel.win { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,195,107,.4); background: #eafff2; }

/* ---------------- Dice ---------------- */
.dice-wrap { display: grid; place-items: center; margin: 8px auto 18px; min-height: 150px; }
#dlot { width: 150px; height: 150px; }
#dlot svg { display: block; }
#dcv { width: 128px; height: 128px; filter: drop-shadow(0 8px 7px rgba(16,33,63,.3)); }
#dcv.win { filter: drop-shadow(0 8px 7px rgba(16,33,63,.3)) drop-shadow(0 0 14px rgba(34,195,107,.85)); }

/* ---------------- Futures Memecoins ---------------- */
.coin-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 4px;
}
.coin {
  cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; background: var(--card);
  border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--line);
  transition: transform .08s ease, box-shadow .08s ease;
}
.coin:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.coin:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.coin { padding: 10px 4px 8px; }
.coin img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); object-fit: cover; background: #fff; }
.coin .csym { font-weight: 700; font-size: 10px; color: var(--ink); letter-spacing: .2px; }
@media (max-width: 460px) {
  .coin-grid { gap: 7px; }
  .coin { padding: 8px 3px 6px; border-width: 2.5px; box-shadow: 0 3px 0 var(--line); }
  .coin img { width: 38px; height: 38px; }
  .coin .csym { font-size: 9px; }
}

.ls-back {
  font-family: var(--font); font-weight: 700; font-size: 13px; color: var(--blue);
  background: none; border: none; cursor: pointer; padding: 0 0 8px; float: left;
}
.coin-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 6px; clear: both; }
.coin-head img { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); object-fit: cover; background: #fff; }
.coin-head .coin-name { font-weight: 700; font-size: 17px; color: var(--ink); line-height: 1.1; }
.coin-head .coin-tick { font-weight: 600; font-size: 12px; color: var(--muted); }

.market { margin: 0 auto 12px; }
.price { font-size: 32px; font-weight: 700; color: var(--ink); }
.price .cur { color: var(--muted); font-size: 15px; }
.chg { font-size: 14px; font-weight: 600; margin-top: 2px; height: 16px; }
.chg.up { color: var(--green); } .chg.down { color: var(--red); }
.spark {
  width: 100%; height: 76px; margin: 12px 0; display: block;
  background: var(--paper); border: 3px solid var(--line); border-radius: 14px;
}
.ls-btns { display: flex; gap: 12px; }
.ls-btns .btn { flex: 1; }
.btn.long  { background: var(--green); box-shadow: 0 5px 0 var(--green-2); color: #fff; }
.btn.short { background: var(--red);   box-shadow: 0 5px 0 var(--red-2);   color: #fff; }
.btn.long:active, .btn.short:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-2); }

/* ---------------- Buttons / result ---------------- */
.btn {
  font-family: var(--font); font-weight: 700; font-size: 16px; letter-spacing: .3px;
  color: #fff; background: var(--blue);
  border: 3px solid var(--line); border-radius: 16px;
  padding: 15px 18px; cursor: pointer; box-shadow: 0 5px 0 var(--blue-ink);
  min-height: 52px; width: 100%;
  transition: transform .08s ease, box-shadow .08s ease, filter .2s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-ink); }
.btn:disabled { filter: grayscale(.5) brightness(.9); cursor: default; }
.btn.gold { background: var(--gold); box-shadow: 0 5px 0 var(--gold-2); color: #fff; }
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-2); }

.result {
  min-height: 22px; margin: 12px 0 4px; font-size: 15px; font-weight: 600; color: var(--ink);
  transition: transform .15s ease;
}
.result.win { color: var(--green-2); }
.result.lose { color: var(--red-2); }
.result.pop { transform: scale(1.12); }

/* floating +/- GRAM */
.floaty {
  position: fixed; z-index: 90; pointer-events: none;
  font-family: var(--font); font-weight: 700; font-size: 18px;
  -webkit-text-stroke: 1px var(--line); paint-order: stroke fill;
  animation: floatup 1s ease forwards; white-space: nowrap;
}
.floaty.up { color: var(--green); } .floaty.down { color: var(--red); }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60px); opacity: 0; } }

/* ---------------- Stake control ---------------- */
.stake { margin: 4px 0 14px; }
.chips { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.chip {
  flex: 1 1 0; min-width: 0;
  font-family: var(--font); font-weight: 700; font-size: 14px;
  color: var(--ink); background: var(--paper);
  border: 3px solid var(--line); border-radius: 12px;
  padding: 9px 4px; min-height: 44px; cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
  transition: transform .08s ease;
}
.chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.chip.on { background: var(--blue); color: #fff; }
.chip:disabled { opacity: .4; cursor: default; box-shadow: none; }
.stake-val { font-size: 13px; font-weight: 500; color: var(--muted); }
.stake-val b { color: var(--gold-2); }

/* ---------------- Leaderboard ---------------- */
.board-card { text-align: left; }
.board-card h2 { text-align: center; }
.board-sub { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); margin: 2px 0 14px; }
.board-sub b { color: var(--red); }
#board-list { list-style: none; margin: 8px 0 0; padding: 0; }
#board-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px; border-radius: 14px;
  background: var(--paper); border: 3px solid transparent; font-size: 15px; font-weight: 500;
}
#board-list li .rank { width: 30px; text-align: center; color: var(--muted); font-weight: 700; }
#board-list li .nm { flex: 1; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board-list li .sc { color: var(--gold-2); font-weight: 700; }
#board-list li.you { border-color: var(--blue); background: #e8efff; }
.board-me {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 11px 12px; border-radius: 14px;
  background: #e8efff; border: 3px solid var(--blue); font-size: 15px; font-weight: 600;
}
.board-me .rank { width: 44px; text-align: center; color: var(--blue); font-weight: 700; }
.board-me .nm { flex: 1; color: var(--ink); }
.board-me .sc { color: var(--gold-2); font-weight: 700; }
.rename { display: flex; gap: 8px; margin-top: 14px; }
.rename input {
  flex: 1; font-family: var(--font); font-size: 15px; color: var(--ink);
  background: #fff; border: 3px solid var(--line); border-radius: 12px; padding: 11px; min-height: 46px;
}
.rename input:focus { outline: none; border-color: var(--blue); }
.rename #name-save {
  font-family: var(--font); font-weight: 700; font-size: 15px; color: #fff; background: var(--blue);
  border: 3px solid var(--line); border-radius: 12px; padding: 0 18px; min-height: 46px; cursor: pointer;
  box-shadow: 0 3px 0 var(--blue-ink);
}
.contest-over { text-align: center; color: var(--gold-2); font-weight: 700; font-size: 16px; margin: 10px 0; }

/* ---------------- Disclaimer ---------------- */
#disclaimer { z-index: 120; background: rgba(16,33,63,.6); }
.disc-card {
  width: min(92vw, 400px); padding: 26px 22px 22px; text-align: center;
  background: var(--card); border: 4px solid var(--line); border-radius: 24px;
  box-shadow: 0 12px 0 var(--line), 0 22px 40px rgba(16,33,63,.3);
  font-family: var(--font); animation: pop .22s cubic-bezier(.22,.9,.3,1.2);
}
.disc-ico { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.disc-card h2 {
  margin: 0 0 12px; font-weight: 700; font-size: 24px; letter-spacing: .5px; color: var(--gold-2);
  -webkit-text-stroke: 2px var(--line); paint-order: stroke fill;
}
.disc-card p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--ink); font-weight: 500; }
.disc-card .btn { max-width: 260px; margin: 0 auto; }
