:root {
  color-scheme: dark;
  --bg: #111319;
  --bg-soft: #171b24;
  --panel: rgba(27, 31, 41, 0.92);
  --panel-strong: #202635;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f8fb;
  --muted: #aeb7c7;
  --accent: #50c2a8;
  --accent-2: #f2c14e;
  --danger: #ff6b6b;
  --good: #68d391;
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --font-scale: 1;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(17, 19, 25, 0.11);
  --line-strong: rgba(17, 19, 25, 0.2);
  --text: #111319;
  --muted: #596273;
  --shadow: 0 18px 48px rgba(24, 31, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: calc(16px * var(--font-scale));
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(80, 194, 168, 0.2), transparent 28rem),
    radial-gradient(circle at 82% 6%, rgba(242, 193, 78, 0.16), transparent 24rem),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(80, 194, 168, 0.35);
  outline-offset: 2px;
}

label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.connection-banner {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  background: #d43f3a;
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.connection-banner.is-visible {
  transform: translate(-50%, 0);
}

.setup {
  min-height: calc(100vh - 48px);
  display: grid;
  align-items: center;
  gap: 28px;
}

.setup__intro {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setup h1,
.bank-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.setup__copy {
  width: min(720px, 100%);
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.setup-form {
  display: grid;
  gap: 22px;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 10px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 102px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice:has(input:checked) {
  border-color: rgba(80, 194, 168, 0.72);
  box-shadow: 0 0 0 3px rgba(80, 194, 168, 0.16);
}

.choice__title {
  font-size: 1.02rem;
  color: var(--text);
  font-weight: 900;
}

.choice__meta {
  color: var(--muted);
  line-height: 1.45;
}

.player-name-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.range-row output {
  min-width: 42px;
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
  padding: 9px 12px;
  text-align: center;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.danger-button {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 900;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.primary-button {
  background: var(--accent);
  color: #07110f;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.danger-button {
  background: rgba(255, 107, 107, 0.13);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.icon-button {
  width: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.bank-view {
  display: grid;
  gap: 20px;
}

.bank-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding-top: 8px;
}

.bank-header h1 {
  font-size: clamp(2.2rem, 7vw, 4.8rem);
}

.bank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.pill--ok {
  border-color: rgba(104, 211, 145, 0.35);
  color: var(--good);
}

.pill--warn {
  border-color: rgba(242, 193, 78, 0.44);
  color: var(--accent-2);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar select {
  width: auto;
  min-width: 168px;
  min-height: 44px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 900;
}

.segmented button[aria-pressed="true"] {
  background: var(--panel-strong);
  color: var(--text);
}

.bank-strip {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bank-strip__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.note-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.note-chip {
  flex: 0 0 auto;
  min-width: 92px;
  border: 1px solid color-mix(in srgb, var(--note-color) 60%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--note-color) 32%, transparent), rgba(255, 255, 255, 0.04)),
    var(--panel);
  padding: 9px 10px;
  color: var(--text);
}

.note-chip__value {
  font-weight: 1000;
  font-size: 1.03rem;
}

.note-chip__count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

[data-orientation="landscape"] .player-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.player-card {
  display: grid;
  gap: 14px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.player-card.is-private {
  grid-column: 1 / -1;
  width: min(620px, 100%);
  justify-self: center;
}

.player-card__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.player-name-input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 8px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 1000;
}

.player-name-input:disabled {
  opacity: 1;
}

.player-tools {
  display: flex;
  gap: 6px;
}

.balance-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.balance {
  min-height: 62px;
  font-size: clamp(2.3rem, 10vw, 4.2rem);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0;
}

.balance.is-glowing {
  animation: glow 560ms ease;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 0 rgba(80, 194, 168, 0);
  }

  50% {
    text-shadow: 0 0 24px rgba(80, 194, 168, 0.5);
  }

  100% {
    text-shadow: 0 0 0 rgba(80, 194, 168, 0);
  }
}

.money-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.money-button {
  min-height: 74px;
  border-radius: var(--radius);
  color: #08110f;
  font-size: 2rem;
  font-weight: 1000;
}

.money-button--plus {
  background: var(--good);
}

.money-button--minus {
  background: var(--danger);
  color: #1b0808;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 7px;
}

.mini-note {
  min-height: 56px;
  border: 1px solid color-mix(in srgb, var(--note-color) 54%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--note-color) 22%, transparent);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px;
}

.mini-note b {
  font-size: 0.92rem;
}

.mini-note span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.history {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 0.86rem;
}

.history strong {
  color: var(--text);
}

.history .tx-plus {
  color: var(--good);
}

.history .tx-minus {
  color: var(--danger);
}

.history .tx-reset {
  color: var(--accent-2);
}

.history li.is-undone {
  opacity: 0.55;
  text-decoration: line-through;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.modal {
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal__head,
.modal__body,
.modal__foot {
  padding: 18px;
}

.modal__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.modal__head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal__body {
  display: grid;
  gap: 18px;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.note-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.note-button {
  min-height: 92px;
  border: 1px solid color-mix(in srgb, var(--note-color) 58%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--note-color) 45%, transparent), rgba(255, 255, 255, 0.06)),
    var(--panel);
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 13px;
  text-align: left;
}

.note-button b {
  font-size: 1.55rem;
  line-height: 1;
}

.note-button span {
  color: var(--muted);
  font-weight: 800;
}

.custom-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}

.toggle-row input {
  width: 22px;
  height: 22px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--text);
  padding: 13px 15px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
}

@media (max-width: 860px) {
  .setup-grid,
  .player-name-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .bank-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .custom-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .choice-grid,
  .money-actions {
    grid-template-columns: 1fr;
  }

  .toolbar select,
  .segmented,
  .toolbar button {
    width: 100%;
  }

  .segmented {
    grid-auto-flow: row;
  }

  .player-card {
    min-height: 0;
  }
}

/* Premium visual layer */
:root {
  --bg: #0b0f14;
  --bg-soft: #141923;
  --panel: rgba(20, 25, 35, 0.78);
  --panel-strong: rgba(29, 36, 49, 0.96);
  --glass: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

[data-theme="light"] {
  --bg: #eef2f7;
  --bg-soft: #f8fafc;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --glass: rgba(10, 17, 30, 0.045);
  --shadow: 0 24px 70px rgba(25, 34, 52, 0.14);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 12% 12%, rgba(80, 194, 168, 0.24), transparent 26rem),
    radial-gradient(circle at 78% 2%, rgba(242, 193, 78, 0.18), transparent 22rem),
    radial-gradient(circle at 84% 88%, rgba(116, 199, 255, 0.13), transparent 26rem),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-size: 36px 36px, 36px 36px, auto, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.06) 44%, transparent 54%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 30rem);
  opacity: 0.58;
}

.app-shell {
  padding-top: clamp(18px, 3vw, 38px);
}

svg[data-lucide] {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  box-shadow: var(--inner-highlight);
}

.primary-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 35%),
    linear-gradient(135deg, #76e7ce 0%, #46c7a6 52%, #31a38b 100%);
  box-shadow:
    var(--inner-highlight),
    0 14px 32px rgba(80, 194, 168, 0.28);
}

.primary-button--hero {
  min-height: 58px;
  font-size: 1.05rem;
}

.secondary-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    var(--panel-strong);
  backdrop-filter: blur(16px);
}

.ghost-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
}

.danger-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent),
    rgba(255, 107, 107, 0.14);
}

.premium-panel,
.bank-header,
.bank-strip,
.player-card,
.modal {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-highlight);
  backdrop-filter: blur(24px);
}

.setup {
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.8fr);
  align-items: center;
}

.setup__intro {
  position: relative;
  min-height: 440px;
  display: grid;
  align-content: center;
  isolation: isolate;
}

.brand-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(80, 194, 168, 0.38);
  border-radius: 20px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.42), transparent 38%),
    linear-gradient(135deg, rgba(80, 194, 168, 0.38), rgba(116, 199, 255, 0.16));
  box-shadow: 0 18px 42px rgba(80, 194, 168, 0.2), var(--inner-highlight);
  color: #dffcf5;
  margin-bottom: 22px;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.hero-ledger {
  position: absolute;
  right: max(12px, 5%);
  bottom: 0;
  width: min(340px, 64vw);
  height: 210px;
  z-index: -1;
  opacity: 0.9;
}

.hero-note {
  position: absolute;
  width: 190px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 2rem;
  font-weight: 1000;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28), var(--inner-highlight);
  transform-origin: center;
}

.hero-note::before,
.note-chip::before,
.note-button::before,
.mini-note::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  pointer-events: none;
}

.hero-note--green {
  right: 92px;
  bottom: 84px;
  background: linear-gradient(135deg, #3ca46c, #1d634b);
  transform: rotate(-10deg);
}

.hero-note--gold {
  right: 28px;
  bottom: 42px;
  background: linear-gradient(135deg, #f0bd49, #966a20);
  transform: rotate(5deg);
}

.hero-note--blue {
  right: 116px;
  bottom: 0;
  background: linear-gradient(135deg, #5aa9e8, #254f8c);
  transform: rotate(13deg);
}

.setup-form {
  padding: clamp(16px, 2.4vw, 26px);
  border-radius: var(--radius);
}

.choice {
  overflow: hidden;
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    var(--panel);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.choice::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.choice__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.choice__note-row {
  display: flex;
  gap: 5px;
  min-height: 26px;
}

.choice__note-row i {
  min-width: 42px;
  border: 1px solid color-mix(in srgb, var(--note-color) 54%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--note-color) 22%, transparent);
  color: var(--text);
  padding: 4px 6px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.bank-header {
  align-items: center;
  padding: clamp(16px, 2.4vw, 24px);
  border-radius: var(--radius);
}

.bank-subline {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.pill {
  gap: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

.toolbar select,
input,
select {
  box-shadow: var(--inner-highlight);
}

.segmented {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--inner-highlight);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.segmented button[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    var(--panel-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.bank-strip {
  padding: 18px;
  border-radius: var(--radius);
}

.bank-strip__top {
  color: var(--text);
  font-size: 1rem;
}

.note-row {
  scrollbar-width: thin;
}

.note-chip,
.note-button,
.mini-note {
  position: relative;
  overflow: hidden;
}

.note-chip {
  min-width: 126px;
  min-height: 76px;
  padding: 13px 14px;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.22), transparent 20px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 10px),
    linear-gradient(135deg, color-mix(in srgb, var(--note-color) 54%, #121722), color-mix(in srgb, var(--note-color) 18%, #0d1118));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2), var(--inner-highlight);
}

.note-chip__ornament {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.note-chip__value {
  position: relative;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.note-chip__count {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
}

.player-grid {
  gap: clamp(14px, 1.5vw, 20px);
}

.player-card {
  position: relative;
  overflow: hidden;
  gap: 16px;
  min-height: 410px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38), var(--inner-highlight);
}

.player-card__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 26%, rgba(255, 255, 255, 0.08) 42%, transparent 58%),
    radial-gradient(circle at 78% 0%, rgba(80, 194, 168, 0.16), transparent 14rem);
  opacity: 0.8;
}

.player-card > *:not(.player-card__shine) {
  position: relative;
}

.player-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(135deg, rgba(80, 194, 168, 0.82), rgba(116, 199, 255, 0.52));
  color: #06110f;
  font-weight: 1000;
  box-shadow: var(--inner-highlight);
}

.player-name-input {
  min-width: 0;
}

.player-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.06);
  box-shadow: var(--inner-highlight);
}

.icon-button--danger {
  color: var(--danger);
}

.balance-panel {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.12);
}

.balance {
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}

.balance-meter {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.balance-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 48%, transparent);
}

.money-button {
  display: grid;
  place-items: center;
  min-height: 82px;
  box-shadow: var(--inner-highlight), 0 18px 32px rgba(0, 0, 0, 0.16);
  transition: transform 120ms ease, filter 120ms ease;
}

.money-button svg {
  width: 34px;
  height: 34px;
}

.money-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.money-button--plus {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.38), transparent 32%),
    linear-gradient(135deg, #8ff0b2, #32b477);
}

.money-button--minus {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(135deg, #ff8f8f, #e55353);
}

.mini-note {
  min-height: 62px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 9px),
    linear-gradient(135deg, color-mix(in srgb, var(--note-color) 34%, transparent), rgba(255, 255, 255, 0.035));
  box-shadow: var(--inner-highlight);
}

.mini-note::before {
  inset: 6px;
  opacity: 0.55;
}

.mini-note i {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--note-color) 62%, rgba(255, 255, 255, 0.22));
}

.history {
  padding-top: 4px;
}

.history li {
  min-height: 34px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-backdrop {
  backdrop-filter: blur(14px);
}

.modal {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--panel-strong);
}

.note-button {
  min-height: 112px;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.24), transparent 24px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 10px),
    linear-gradient(135deg, color-mix(in srgb, var(--note-color) 52%, #141a24), color-mix(in srgb, var(--note-color) 17%, #0f141c));
  box-shadow: var(--inner-highlight);
  transition: transform 120ms ease, border-color 120ms ease;
}

.note-button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--note-color) 76%, white);
}

.note-button i {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.note-button b,
.note-button span {
  position: relative;
}

.toast {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    var(--panel-strong);
  backdrop-filter: blur(18px);
}

@media (max-width: 980px) {
  .setup {
    grid-template-columns: 1fr;
  }

  .setup__intro {
    min-height: 340px;
  }

  .hero-ledger {
    opacity: 0.42;
  }
}

@media (max-width: 560px) {
  .setup__intro {
    min-height: 300px;
  }

  .hero-ledger {
    width: 260px;
    height: 160px;
    right: 0;
  }

  .hero-note {
    width: 150px;
    height: 78px;
    font-size: 1.6rem;
  }

  .bank-header,
  .bank-strip,
  .player-card {
    padding: 14px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .player-card__head {
    grid-template-columns: 1fr;
  }

  .player-tools {
    justify-content: flex-start;
  }
}

/* Private duo mode */
.duo-view {
  min-height: calc(100vh - 48px);
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}

.duo-topbar,
.duo-card,
.duo-footer,
.duo-switch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-highlight);
  backdrop-filter: blur(24px);
}

.duo-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.duo-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 10vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.duo-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.duo-controls select {
  width: auto;
  min-width: 150px;
  min-height: 42px;
}

.duo-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.duo-switch button {
  min-height: 62px;
  display: grid;
  gap: 3px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
}

.duo-switch button[aria-pressed="true"] {
  background:
    linear-gradient(135deg, rgba(80, 194, 168, 0.18), rgba(116, 199, 255, 0.08)),
    var(--panel-strong);
  color: var(--text);
  box-shadow: var(--inner-highlight);
}

.duo-switch span {
  font-weight: 1000;
}

.duo-switch strong {
  font-size: 0.92rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.duo-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(18px, 4vw, 28px);
}

.duo-card__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(80, 194, 168, 0.22), transparent 18rem),
    linear-gradient(120deg, transparent 0 30%, rgba(255, 255, 255, 0.08) 44%, transparent 58%);
}

.duo-card > *:not(.duo-card__glow) {
  position: relative;
}

.duo-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.duo-card h2 {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.duo-balance {
  min-height: 108px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: clamp(3rem, 16vw, 6.6rem);
  line-height: 0.92;
  font-weight: 1000;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}

.duo-balance.is-glowing {
  animation: glow 560ms ease;
}

.duo-other {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 12px 14px;
  color: var(--muted);
}

.duo-other span {
  font-weight: 900;
}

.duo-other strong {
  color: var(--text);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.duo-inventory {
  display: grid;
  gap: 10px;
}

.duo-inventory__title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.duo-inventory__title strong {
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
}

.duo-note-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
}

.duo-note {
  min-width: 0;
  min-height: 72px;
}

.duo-note .note-chip__value {
  font-size: 1rem;
}

.duo-money-actions {
  gap: 12px;
}

.duo-money-actions .money-button {
  min-height: clamp(104px, 22vh, 180px);
}

.duo-money-actions .money-button svg {
  width: clamp(42px, 12vw, 76px);
  height: clamp(42px, 12vw, 76px);
}

.duo-history {
  margin-top: 2px;
}

.duo-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

@media (max-width: 640px) {
  .duo-view {
    min-height: calc(100vh - 28px);
    gap: 10px;
  }

  .duo-topbar {
    grid-template-columns: 1fr;
  }

  .duo-controls {
    justify-content: stretch;
  }

  .duo-controls select,
  .duo-controls .pill {
    width: 100%;
  }

  .duo-card {
    min-height: 0;
  }

  .duo-balance {
    min-height: 82px;
  }

  .duo-footer {
    grid-template-columns: 1fr;
  }
}
