/* rush1k dev frontend — asset-free. Board = divs, symbols = SVG. */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --gap: 4px;
  /* fluid: fill the viewport width up to the desktop size */
  --cell: min(72px, calc((100vw - 16px - 6 * var(--gap)) / 7));
  --board-w: calc(7 * var(--cell) + 6 * var(--gap));
}
html, body { height: 100%; }
body {
  font-family: "Trebuchet MS", Verdana, sans-serif;
  background: linear-gradient(180deg, #b7c8f5 0%, #dcc2ee 45%, #f6c9e2 100%);
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; overflow: hidden; user-select: none;
  transition: background 0.8s;
}
body.fs-mode {
  background: linear-gradient(180deg, #7d5bc9 0%, #b455c9 55%, #e06aa8 100%);
}

/* ---------------- top banner ---------------- */
#topbar {
  height: 64px; display: flex; align-items: center; justify-content: center;
  gap: 24px; width: 100%; color: #fff;
  text-shadow: 0 2px 4px rgba(40, 10, 70, .5); font-weight: 800;
}
#fsbanner { display: none; font-size: 22px; letter-spacing: 1px; }
body.fs-mode #fsbanner { display: block; }
#fsbanner .count { color: #ffd23e; font-size: 28px; }

/* ---------------- board ---------------- */
#board-wrap {
  position: relative; width: var(--board-w);
  height: calc(7 * var(--cell) + 6 * var(--gap));
  background: rgba(255, 255, 255, 0.25);
  border: 4px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(60, 20, 100, 0.35);
  overflow: hidden;
}
#spots, #syms, #fx {
  position: absolute; inset: 0;
}
.cellpos { position: absolute; width: var(--cell); height: var(--cell); }

/* multiplier spots: semi-transparent pad behind the symbol */
.spot {
  border-radius: 12px;
  background: rgba(255, 214, 74, 0.28);
  box-shadow: inset 0 0 0 2px rgba(255, 214, 74, 0.55);
  display: flex; align-items: flex-end; justify-content: flex-end;
  opacity: 0; transform: scale(0.6);
  transition: opacity .25s, transform .25s;
}
.spot.on { opacity: 1; transform: scale(1); }
.spot .mval {
  font-size: 20px; font-weight: 900; color: #ffb400; padding: 2px 6px;
  text-shadow: 0 1px 2px #7a4d00, 0 0 8px rgba(255, 200, 60, .8);
}
.spot.bump { animation: spotbump .35s ease; }
@keyframes spotbump { 40% { transform: scale(1.25); } }

/* symbols */
.sym {
  position: absolute; width: var(--cell); height: var(--cell); padding: 5px;
  will-change: transform; filter: drop-shadow(0 3px 3px rgba(60, 20, 90, .35));
}
.sym svg { width: 100%; height: 100%; }
.sym.streamer { filter: blur(0.6px) brightness(1.05); opacity: 0.92; }
.sym.winner { animation: winpulse .45s ease infinite alternate; z-index: 3; }
@keyframes winpulse { to { transform: var(--tf) scale(1.18); filter: brightness(1.35) drop-shadow(0 0 10px #fff); } }

/* win popup at cluster centroid */
.popup {
  position: absolute; z-index: 6; transform: translate(-50%, -50%);
  font-size: 26px; font-weight: 900; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 #8a2be2, 0 0 14px rgba(255, 255, 255, .9);
  animation: popin .9s ease forwards; pointer-events: none;
}
.popup .x { color: #ffd23e; font-size: 22px; }
@keyframes popin {
  0% { opacity: 0; scale: 0.4; } 20% { opacity: 1; scale: 1.15; }
  75% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; translate: 0 -18px; }
}

/* modal panel (buy confirmation) */
#overlay .panel {
  background: linear-gradient(180deg, #c95fd6, #a03bbf);
  border: 6px solid #ff8fb0; outline: 4px solid #fff3;
  border-radius: 22px; padding: 34px 48px; text-align: center;
  box-shadow: 0 16px 50px rgba(30, 5, 60, .6);
}
#overlay .panel h1 { font-size: 44px; color: #ffe9a8; text-shadow: 0 3px 0 #7c2a94; }
#overlay .pricepill {
  display: inline-block; margin: 18px 0 22px; padding: 8px 26px;
  background: linear-gradient(180deg, #ffd23e, #f0a500); color: #7c2a00;
  font-size: 24px; font-weight: 900; border-radius: 999px;
  box-shadow: 0 3px 0 #b97a00;
}
#overlay .mrow { display: flex; gap: 26px; justify-content: center; }
#overlay .mbtn {
  width: 96px; height: 52px; border-radius: 14px; font-size: 26px;
}
#overlay .mbtn.no  { background: linear-gradient(180deg, #ff5d5d, #c81e1e); }
#overlay .mbtn.yes { background: linear-gradient(180deg, #58e05f, #1f9d3f); }
#overlay .continue {
  margin-top: 26px; color: #ffd23e; font-size: 16px; font-weight: 800;
  letter-spacing: 1px; animation: contpulse 1.4s ease infinite;
}
@keyframes contpulse { 50% { opacity: 0.45; } }

/* overlays (trigger / cap / round end) */
#overlay {
  position: fixed; inset: 0; display: none; z-index: 20;
  align-items: center; justify-content: center; flex-direction: column;
  background: rgba(40, 10, 70, 0.55); color: #fff; text-align: center;
}
#overlay.show { display: flex; animation: fade .3s; }
#overlay h1 { font-size: 52px; text-shadow: 0 3px 0 #8a2be2; }
#overlay h2 { font-size: 30px; color: #ffd23e; margin-top: 10px; }
@keyframes fade { from { opacity: 0; } }

/* ---------------- controls ---------------- */
#controls {
  width: min(1000px, 96vw); height: 92px; margin-top: 14px;
  display: grid; grid-template-columns: 220px 1fr 260px;
  align-items: center; background: #3f3670;
  border-radius: 16px; padding: 0 18px; color: #fff;
  box-shadow: 0 8px 24px rgba(40, 15, 80, .4);
}
#meters { display: flex; flex-direction: column; gap: 4px; font-weight: 800; }
#meters .lbl { color: #ffd23e; font-size: 12px; letter-spacing: 1px; }
#meters .val { font-size: 18px; }
#centermsg { text-align: center; font-weight: 800; letter-spacing: 1px; font-size: 16px; }
#centermsg .win { color: #ffd23e; font-size: 26px; }
#right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

button {
  border: 0; border-radius: 50%; cursor: pointer; font-weight: 900;
  color: #fff; transition: transform .1s, filter .1s;
}
button:hover { filter: brightness(1.15); }
button:active { transform: scale(0.94); }
button:disabled { filter: grayscale(.7) brightness(.7); cursor: default; }

#spin {
  width: 74px; height: 74px; font-size: 34px;
  background: radial-gradient(circle at 35% 30%, #7d6df0, #4636b8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 0 0 4px rgba(255,255,255,.25);
}
.betbtn { width: 40px; height: 40px; font-size: 22px; background: #5a4fa8; }
#auto {
  width: 58px; height: 58px; font-size: 12px; background: #5a4fa8;
}
#auto.on { background: #1f9d55; }

/* buys */
#buys { position: fixed; left: 14px; top: 90px; display: flex; flex-direction: column; gap: 10px; }
#buys button {
  border-radius: 14px; width: 140px; padding: 10px 8px; font-size: 13px;
  background: linear-gradient(180deg, #ff5d8f, #d61f63); line-height: 1.3;
}
#buys button.super { background: linear-gradient(180deg, #35d0c0, #0b8f83); }
#buys .price { font-size: 15px; color: #ffe9a8; }

/* ---------------- mobile ---------------- */
button, body { touch-action: manipulation; }

@media (max-width: 760px) {
  #topbar { height: 40px; }
  #fsbanner { font-size: 15px; }
  #fsbanner .count { font-size: 18px; }

  /* reference order: message -> buys -> spin cluster -> credit/bet */
  #controls {
    display: flex; flex-direction: column; align-items: center;
    height: auto; padding: 16px 14px 18px; gap: 16px;
    margin-top: 4px; width: min(100vw - 16px, 480px);
  }
  #centermsg { order: 1; font-size: 13px; letter-spacing: 2px; }
  #centermsg .win { font-size: 20px; }
  #right { order: 2; justify-content: center; gap: 14px; width: 100%; }
  #betminus { order: 1; } #spin { order: 2; } #betplus { order: 3; } #auto { order: 4; }
  #spin { width: 68px; height: 68px; font-size: 30px; }
  #auto { width: 46px; height: 46px; font-size: 10px; }
  .betbtn { width: 38px; height: 38px; font-size: 20px; }
  #meters {
    order: 3; flex-direction: row; justify-content: center; gap: 18px;
    width: 100%;
  }
  #meters > div { display: flex; gap: 6px; align-items: baseline; }
  #meters .lbl { font-size: 10px; }
  #meters .val { font-size: 14px; }
  #meters br { display: none; }

  /* buys: big pill row directly under the board, like the reference */
  #buys {
    position: static; flex-direction: row; justify-content: center;
    gap: 12px; margin: 14px 0;
  }
  #buys button { width: auto; padding: 8px 14px; font-size: 11px; line-height: 1.25; }
  #buys .price { font-size: 13px; }

  #overlay h1 { font-size: 30px; }
  #overlay h2 { font-size: 18px; }
  #overlay .panel { padding: 22px 24px; }
  #overlay .panel h1 { font-size: 28px; }
  #overlay .pricepill { font-size: 18px; }
  .popup { font-size: 18px; }
  .spot .mval { font-size: 13px; }
}
