/* ------------------------------------------------------------------
   CASHCADE — style.css
   Loud, chunky, high contrast. Everything that can pulse, pulses.
------------------------------------------------------------------ */

@font-face {
  font-family: 'Merri';
  src: url('../../Alpha/cf-fonts/s/merriweather/5.0.11/latin/900/normal.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg0: #070a14;
  --bg1: #0d1222;
  --bg2: #141b30;
  --bg3: #1d2743;
  --line: rgba(140,170,255,0.10);
  --line2: rgba(140,170,255,0.22);

  --ink: #eef3ff;
  --dim: rgba(238,243,255,0.55);
  --faint: rgba(238,243,255,0.30);

  --value: #3fa9ff;
  --mult: #ff4d6d;
  --xmult: #ffb02e;
  --gold: #ffd84a;
  --good: #4ade80;
  --bad: #ff5c5c;

  --common: #9fb0c9;
  --uncommon: #4fd1ff;
  --rare: #ff5c8a;
  --legendary: #ffd84a;

  --display: 'Merri', Georgia, serif;
  --font: system-ui, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg0); color: var(--ink);
  font-family: var(--font);
  user-select: none; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: -25%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(45% 40% at 25% 0%, rgba(63,169,255,0.13), transparent 70%),
    radial-gradient(45% 40% at 80% 10%, rgba(255,77,109,0.11), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(255,216,74,0.07), transparent 70%);
}

#app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

/* ---------------- top bar ---------------- */
#topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(29,39,67,0.96), rgba(13,18,34,0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.brand {
  font-family: var(--display); font-size: 23px; letter-spacing: 0.5px;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,216,74,0.45);
  white-space: nowrap;
}
.brand span { color: var(--ink); }
.runInfo {
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  color: var(--faint); padding: 4px 9px;
  border: 1px solid var(--line); border-radius: 6px;
}

.hud { display: flex; gap: 8px; align-items: stretch; }
.hudBox {
  position: relative; min-width: 92px;
  padding: 5px 12px 6px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
}
.hudLab { font-size: 9px; letter-spacing: 1.6px; color: var(--faint); font-weight: 800; }
.hudBox b { font-family: var(--display); font-size: 20px; line-height: 1.05; }
.hudBox.quota b { color: var(--bad); }
.hudBox.take b { color: var(--gold); transition: color .2s; }
.hudBox.take b.done { color: var(--good); }
.hudBox.cash b { color: var(--good); }
.hudBox .bar {
  position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px;
  background: rgba(0,0,0,0.5); border-radius: 3px; overflow: hidden;
}
.hudBox .bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #b8860b, var(--gold));
  transition: width .35s cubic-bezier(.2,1,.4,1);
}
.hudBox .bar i.done { background: linear-gradient(90deg, #1d9e5a, var(--good)); }

.spacer { flex: 1; }
#vol { width: 74px; accent-color: var(--gold); }
.iconBtn {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  background: var(--bg3); color: var(--ink); border: 1px solid var(--line);
  font-size: 14px; font-weight: 800;
}
.iconBtn:hover { background: #2a3556; }

/* ---------------- boss ---------------- */
#bossBar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 7px 18px;
  background: linear-gradient(90deg, rgba(255,60,80,0.22), rgba(255,60,80,0.05));
  border-bottom: 1px solid rgba(255,90,110,0.35);
  animation: bossPulse 2s ease-in-out infinite;
}
@keyframes bossPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
#bossName { font-family: var(--display); font-size: 15px; color: #ff8a9c; letter-spacing: 1px; }
#bossText { font-size: 12px; color: var(--dim); }

/* ---------------- layout ---------------- */
main { flex: 1 1 auto; display: flex; min-height: 0; }
#stage { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 10px; display: flex; }
#boardArea { position: relative; flex: 1; min-height: 0; }
#board { display: block; width: 100%; height: 100%; }

#side {
  flex: 0 0 340px; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 10px 10px 0; overflow-y: auto; min-height: 0;
}
#side::-webkit-scrollbar { width: 8px; }
#side::-webkit-scrollbar-thumb { background: #2a3556; border-radius: 6px; }

.panel {
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.panelHead {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: 2px; font-weight: 800;
  color: var(--faint); margin-bottom: 8px;
}
.panelHint { font-size: 10.5px; color: var(--faint); margin-top: 7px; line-height: 1.4; }
.slotCount { color: var(--dim); font-size: 11px; letter-spacing: 0; }

/* ---------------- the two numbers ---------------- */
.scoreboard { padding: 12px 10px 10px; }
.scoreRow { display: flex; align-items: stretch; gap: 8px; }
.numBox {
  flex: 1; border-radius: 12px; padding: 8px 6px 6px; text-align: center;
  border: 2px solid; position: relative; overflow: hidden;
}
.numBox.value { border-color: rgba(63,169,255,0.6); background: rgba(63,169,255,0.12); }
.numBox.mult  { border-color: rgba(255,77,109,0.6); background: rgba(255,77,109,0.12); }
.numLab { display: block; font-size: 9px; letter-spacing: 2px; font-weight: 800; color: var(--dim); }
.numBox b { font-family: var(--display); font-size: 34px; line-height: 1.05; display: block; }
.numBox.value b { color: var(--value); text-shadow: 0 0 18px rgba(63,169,255,0.55); }
.numBox.mult b  { color: var(--mult);  text-shadow: 0 0 18px rgba(255,77,109,0.55); }
.times { align-self: center; font-family: var(--display); font-size: 26px; color: var(--faint); }

.numBox.bump { animation: bump .22s cubic-bezier(.2,1.7,.4,1); }
.numBox.bumpBig { animation: bumpBig .38s cubic-bezier(.2,1.7,.4,1); }
@keyframes bump { 0% { transform: scale(1); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
@keyframes bumpBig {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.22) rotate(-2deg); filter: brightness(1.6); }
  100% { transform: scale(1) rotate(0); }
}

.dropTakeRow {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 9px; padding: 7px 10px; border-radius: 9px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--line);
}
.dropTakeRow span { font-size: 9.5px; letter-spacing: 2px; color: var(--faint); font-weight: 800; }
.dropTakeRow b { font-family: var(--display); font-size: 21px; color: var(--gold); }

/* ---------------- chips ---------------- */
.chipRow { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  width: 46px; height: 46px; border-radius: 10px; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #39456b, #161d31);
  border: 2px solid var(--common); cursor: pointer;
  transition: transform .12s cubic-bezier(.2,1.6,.4,1), box-shadow .15s;
}
.chipRow.small .chip { width: 38px; height: 38px; }
.chip:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 6px 18px rgba(0,0,0,0.6); }
.chip .ci { font-size: 20px; }
.chipRow.small .chip .ci { font-size: 16px; }
.chip .cr {
  position: absolute; bottom: -6px; right: -5px;
  background: var(--gold); color: #241a00;
  font-size: 9.5px; font-weight: 900; padding: 1px 4px; border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.4);
}
.chip.common { border-color: var(--common); }
.chip.uncommon { border-color: var(--uncommon); box-shadow: 0 0 12px rgba(79,209,255,0.28); }
.chip.rare { border-color: var(--rare); box-shadow: 0 0 14px rgba(255,92,138,0.35); }
.chip.legendary {
  border-color: var(--legendary); box-shadow: 0 0 18px rgba(255,216,74,0.5);
  animation: legend 2.4s ease-in-out infinite;
}
@keyframes legend { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }
.chip.empty {
  background: rgba(255,255,255,0.03); border: 2px dashed var(--line2);
  color: var(--faint); font-size: 20px; font-weight: 800; cursor: default;
}
.chip.empty:hover { transform: none; box-shadow: none; }

/* ---------------- shop ---------------- */
.shop { display: none; }
.shop.open { display: block; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.card {
  background: linear-gradient(180deg, #232d4d, #131a2e);
  border: 2px solid var(--common); border-radius: 11px;
  padding: 8px; cursor: pointer; position: relative;
  transition: transform .13s cubic-bezier(.2,1.6,.4,1), box-shadow .15s, filter .15s;
}
.card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 10px 26px rgba(0,0,0,0.65); }
.card.common { border-color: var(--common); }
.card.uncommon { border-color: var(--uncommon); }
.card.rare { border-color: var(--rare); box-shadow: 0 0 14px rgba(255,92,138,0.25); }
.card.legendary { border-color: var(--legendary); box-shadow: 0 0 18px rgba(255,216,74,0.35); }
.card.sold { opacity: 0.35; filter: grayscale(1); cursor: default; }
.card.sold:hover { transform: none; }
.card.isCharm { background: linear-gradient(180deg, #2c2447, #1a1330); }
.card.isStaple { background: linear-gradient(180deg, #24402f, #10231a); }
.cardTop { display: flex; align-items: center; justify-content: space-between; }
.cardIcon { font-size: 22px; }
.cardKind { font-size: 8px; letter-spacing: 1.4px; font-weight: 900; color: var(--faint); }
.cardName { font-family: var(--display); font-size: 13px; margin: 3px 0 4px; line-height: 1.15; }
.cardText { font-size: 10.5px; line-height: 1.42; color: var(--dim); min-height: 44px; }
.cardBuy {
  margin-top: 6px; text-align: center; font-family: var(--display); font-size: 15px;
  color: var(--good); background: rgba(0,0,0,0.4); border-radius: 7px; padding: 3px;
}
.card.afford .cardBuy { color: var(--good); background: rgba(74,222,128,0.16); }
.card:not(.afford) .cardBuy { color: var(--bad); }

.miniBtn {
  background: var(--bg3); border: 1px solid var(--line2); color: var(--ink);
  border-radius: 7px; padding: 4px 9px; font-size: 11px; font-weight: 800; cursor: pointer;
  letter-spacing: 0;
}
.miniBtn:hover:not(:disabled) { background: #2c3860; }
.miniBtn:disabled { opacity: .4; cursor: not-allowed; }

.bigBtn {
  display: block; width: 100%; margin-top: 10px; padding: 13px;
  border: none; border-radius: 11px; cursor: pointer;
  font-family: var(--display); font-size: 18px; letter-spacing: 1.5px;
  color: #06210f; background: linear-gradient(180deg, #6ef2a4, #17a35c);
  box-shadow: 0 5px 0 #0c5f36, 0 0 30px rgba(74,222,128,0.35);
  transition: transform .1s, box-shadow .15s;
}
.bigBtn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #0c5f36, 0 0 40px rgba(74,222,128,0.5); }
.bigBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0c5f36; }
.ghostBtn {
  display: block; width: 100%; margin-top: 8px; padding: 10px;
  border: 1px solid var(--line2); border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--dim); font-weight: 800; font-size: 13px;
}
.ghostBtn:hover { color: var(--ink); border-color: var(--ink); }
.ghostBtn.danger { color: var(--bad); border-color: rgba(255,92,92,0.4); }

/* ---------------- tooltip ---------------- */
#tooltip {
  position: fixed; display: none; z-index: 90; max-width: 280px;
  background: rgba(8,11,20,0.97); border: 1px solid var(--line2);
  border-radius: 10px; padding: 10px 12px; pointer-events: none;
  box-shadow: 0 14px 40px rgba(0,0,0,0.75);
}
.tipHead { font-family: var(--display); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.tipRar { margin-left: auto; font-size: 9px; letter-spacing: 1.5px; opacity: .8; font-family: var(--font); font-weight: 800; }
.tipBody { font-size: 11.5px; line-height: 1.5; color: var(--dim); margin-top: 5px; }
.tipNow { font-size: 11px; color: var(--gold); margin-top: 5px; }

/* ---------------- toasts ---------------- */
#toasts {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 7px; align-items: center;
  z-index: 80; pointer-events: none;
}
.toast {
  background: rgba(10,14,26,0.96); border: 1px solid var(--line2);
  border-left: 4px solid var(--gold); border-radius: 9px;
  padding: 8px 14px; opacity: 0; transform: translateY(14px);
  transition: opacity .3s, transform .3s cubic-bezier(.2,1.5,.4,1);
  display: flex; gap: 9px; align-items: baseline; white-space: nowrap;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast b { font-size: 13px; }
.toast span { font-size: 11.5px; color: var(--dim); }

/* ---------------- overlay ---------------- */
#overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,6,13,0.82); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
#overlay.open { display: flex; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(560px, 94vw); max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #1a2338, #0b0f1c);
  border: 2px solid var(--line2); border-radius: 18px;
  padding: 26px 26px 22px; text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,0.8);
  animation: sheetIn .32s cubic-bezier(.2,1.4,.4,1);
}
@keyframes sheetIn { from { transform: scale(0.88) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheetTitle {
  font-family: var(--display); font-size: 30px; letter-spacing: 2px; margin-bottom: 6px;
}
.sheetTitle.good { color: var(--good); text-shadow: 0 0 30px rgba(74,222,128,0.5); }
.sheetTitle.bad { color: var(--bad); text-shadow: 0 0 30px rgba(255,92,92,0.5); }
.sheetNote { font-size: 12.5px; color: var(--dim); margin: 10px 0; line-height: 1.55; }
.bigTake {
  font-family: var(--display); font-size: 46px; color: var(--gold);
  text-shadow: 0 0 40px rgba(255,216,74,0.45); margin: 4px 0 14px;
}
.bigTake.bad { color: var(--bad); text-shadow: 0 0 40px rgba(255,92,92,0.4); }
.bigTake span { font-size: 20px; color: var(--faint); text-shadow: none; }
.payouts {
  text-align: left; background: rgba(0,0,0,0.35); border-radius: 11px;
  padding: 10px 14px; margin: 12px 0;
}
.payRow {
  display: flex; justify-content: space-between; padding: 4px 0;
  font-size: 12.5px; color: var(--dim);
}
.payRow b { color: var(--good); }
.payTotal { font-family: var(--display); font-size: 26px; color: var(--good); }

.logo {
  font-family: var(--display); font-size: clamp(38px, 8vw, 62px); letter-spacing: 3px;
  color: var(--gold); text-shadow: 0 0 50px rgba(255,216,74,0.55), 0 5px 0 rgba(0,0,0,0.5);
}
.logo span { color: var(--ink); }
.tagline { font-size: 13px; color: var(--dim); letter-spacing: 1.5px; margin-bottom: 16px; }
.rules { text-align: left; display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.rule {
  font-size: 12.5px; line-height: 1.6; color: var(--dim);
  background: rgba(255,255,255,0.035); border-left: 3px solid var(--line2);
  padding: 9px 12px; border-radius: 0 9px 9px 0;
}
.rule b { color: var(--ink); }
.kV { color: var(--value); font-weight: 800; }
.kM { color: var(--mult); font-weight: 800; }
.bestLine { font-size: 12px; color: var(--dim); margin-top: 10px; }
.bestLine b { color: var(--gold); }

/* ---------------- responsive ---------------- */
@media (max-width: 1150px) { #side { flex-basis: 300px; } }
@media (max-width: 900px) {
  main { flex-direction: column; overflow-y: auto; }
  #side { flex: 1 1 auto; padding: 0 10px 10px; }
  #boardArea { min-height: 58vh; }
  .hud { flex-wrap: wrap; }
  #vol { display: none; }
}
