:root {
  color-scheme: dark;
  --bg: #080a09;
  --panel: #161815;
  --panel-2: #20221e;
  --cell: #1e211f;
  --cell-line: #4b5048;
  --text: #d6d2c9;
  --muted: #9a978d;
  --gold: #cbb47a;
  --green: #15901f;
  --red: #9b342d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0c0e09;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    linear-gradient(rgba(9, 11, 7, 0.76), rgba(9, 11, 7, 0.88)),
    radial-gradient(circle at 50% 0%, #2d302b 0, #0c0e0c 48rem);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(0.72) brightness(0.65);
  transform: scale(1.08);
}

body::after {
  z-index: -1;
  opacity: 0.16;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, 0.48) 72%);
}

#app {
  position: relative;
  min-height: 100vh;
}

button {
  border: 1px solid #5b5d55;
  background: linear-gradient(#343631, #20231f);
  color: var(--text);
  padding: 0.75rem 1rem;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.22);
}

button:not(:disabled):hover {
  background: linear-gradient(#4a4d46, #2f332d);
  border-color: #8d8877;
}

button:disabled {
  color: #6d6655;
  border-color: #4f4938;
  background: #25251d;
}

button.quiet {
  background: transparent;
}

.debug-toggle {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 60;
  padding: 0.38rem 0.58rem;
  font-size: 11px;
  background: rgba(25, 27, 24, 0.92);
}

.debug-panel {
  position: fixed;
  right: 12px;
  top: 112px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(2, minmax(44px, 1fr));
  gap: 6px;
  width: 150px;
  padding: 10px;
  background: rgba(12, 14, 12, 0.95);
  border: 1px solid rgba(170, 157, 112, 0.72);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.debug-title {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.debug-panel button {
  padding: 0.42rem 0.3rem;
  font-size: 11px;
}

.debug-panel [data-debug-raid] {
  grid-column: 1 / -1;
}

.debug-panel button.active {
  border-color: #d3b559;
  color: #f1d681;
  background: linear-gradient(#514832, #262317);
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.intro-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(320px, 600px) minmax(280px, 360px);
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 44px;
  background:
    radial-gradient(circle at 28% 50%, rgba(139, 127, 84, 0.13), transparent 28rem),
    linear-gradient(90deg, rgba(191, 180, 130, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(191, 180, 130, 0.028) 1px, transparent 1px) 0 0 / 42px 42px,
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
}

.intro-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, 0.5) 78%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 5px);
  opacity: 0.56;
}

.intro-screen > * {
  position: relative;
  z-index: 1;
}

.fan-disclaimer {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  width: min(900px, calc(100vw - 48px));
  margin: 0;
  transform: translateX(-50%);
  color: rgba(189, 180, 158, 0.62);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.intro-copy,
.menu-panel,
.results-card {
  background: linear-gradient(180deg, rgba(25, 27, 24, 0.94), rgba(10, 12, 11, 0.96));
  border: 1px solid rgba(100, 100, 90, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.intro-copy {
  padding: 32px;
}

.tartris-hero-art {
  align-self: center;
  height: 510px;
  max-height: calc(100vh - 88px);
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(25, 27, 24, 0.42), rgba(5, 6, 5, 0.8));
  border: 1px solid rgba(100, 100, 90, 0.58);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tartris-hero-art img {
  width: 108%;
  max-width: none;
  height: auto;
  transform: translateY(2%);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.55));
}

.trader-intro {
  display: flex;
  align-items: center;
  gap: 18px;
}

.trader-line {
  color: #d6c592;
  font-size: 18px;
}

.tartris-portrait {
  flex: 0 0 auto;
  border: 1px solid rgba(150, 139, 104, 0.72);
  background: #080908;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 16px 34px rgba(0, 0, 0, 0.45);
  object-fit: cover;
}

.tartris-portrait.small {
  width: 50px;
  height: 58px;
  object-position: 50% 18%;
}

.eyebrow,
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.intro-copy h1 {
  margin: 0 0 18px;
  max-width: 620px;
  color: #e7e1d4;
  font-size: 62px;
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-copy p {
  max-width: 620px;
  margin: 14px 0 0;
  color: #bdb49e;
  line-height: 1.55;
}

.menu-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.profile-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  background: #17180f;
  color: var(--muted);
}

.profile-line strong {
  color: var(--gold);
}

.active-profile-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 165, 103, 0.42);
  background: rgba(30, 31, 22, 0.84);
  color: var(--muted);
  font-size: 13px;
}

.active-profile-line strong {
  color: #efe4c3;
  text-align: right;
}

.profile-name-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.profile-name-label input {
  width: 100%;
  border: 1px solid #5b543f;
  background: #15170f;
  color: var(--text);
  padding: 0.75rem;
  font: inherit;
  text-transform: none;
}

.profile-save-note {
  margin: -4px 2px 2px;
  color: rgba(189, 180, 158, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

.deploy-menu-button {
  margin-top: 22px;
  padding: 1rem;
  background: linear-gradient(#4b4e47, #242821);
  border-color: #8a846f;
  color: #f0e7d4;
}

.volume-control {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(96, 89, 67, 0.62);
  background: rgba(15, 17, 13, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.volume-control input {
  width: 100%;
  accent-color: #b8a66e;
}

.hud-volume {
  flex: 0 0 100%;
  margin-top: 4px;
  padding: 4px 7px;
}

.deploy-screen {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(58, 46, 40, 0.18), transparent 34rem),
    #070808;
}

.deploy-box {
  width: min(380px, calc(100vw - 48px));
  padding: 22px;
  text-align: center;
  background: linear-gradient(180deg, #6f1515, #3f0e0f);
  border: 1px solid #b9b2a1;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.deploy-timer {
  margin-top: 6px;
  color: #fff;
  font-size: 46px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.game-screen {
  position: relative;
  min-height: 100vh;
}

.hud {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 120px minmax(320px, 1fr) 220px 210px 250px;
  gap: 1px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(102, 102, 92, 0.55);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4);
}

.hud-side,
.extract-panel {
  min-width: 0;
  min-height: 88px;
  padding: 9px 14px;
  background: linear-gradient(180deg, rgba(31, 33, 30, 0.96), rgba(16, 18, 16, 0.96));
  border: 1px solid rgba(0, 0, 0, 0.34);
}

.hud-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tax-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.value {
  margin-top: 3px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#raidLabel {
  font-size: 34px;
  color: #e4ded0;
}

#target {
  color: #f1d681;
  text-shadow: 0 0 12px rgba(211, 181, 89, 0.16);
}

.tartris-comment {
  position: absolute;
  z-index: 7;
  top: 154px;
  right: 450px;
  width: min(360px, calc(100vw - 40px));
  padding: 9px 18px;
  overflow: hidden;
  border: 1px solid rgba(176, 164, 119, 0.35);
  background: linear-gradient(180deg, rgba(23, 25, 21, 0.94), rgba(9, 11, 9, 0.92));
  color: #cfc5a6;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.tartris-comment.show {
  opacity: 1;
  transform: translateY(0);
}

.tartris-comment.good {
  color: #c9d9a2;
  text-shadow: 0 0 10px rgba(148, 176, 100, 0.18);
}

.tartris-comment.bad {
  color: #d3aaa2;
  text-shadow: 0 0 10px rgba(190, 82, 68, 0.16);
}

#target.fir-target {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

#target.fir-target img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: contain;
  border: 1px solid rgba(193, 182, 132, 0.55);
  background:
    linear-gradient(180deg, rgba(45, 48, 42, 0.9), rgba(13, 15, 13, 0.96));
}

.extract-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.extract-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.extract-row strong {
  color: var(--gold);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
}

.extract-track {
  height: 12px;
  margin-top: 6px;
  background: #0b0d08;
  border: 1px solid #565951;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7);
}

.extract-button {
  display: block;
  width: 146px;
  margin: 7px auto 0;
  padding: 0.36rem 0.62rem;
  background: #47301f;
}

.player-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 88px;
  padding: 20px 10px 7px;
  background: linear-gradient(180deg, rgba(31, 33, 30, 0.96), rgba(16, 18, 16, 0.96));
  border: 1px solid rgba(0, 0, 0, 0.34);
}

.back-menu-button {
  position: absolute;
  right: 8px;
  top: 6px;
  padding: 0.25rem 0.45rem;
  border-color: rgba(110, 111, 101, 0.7);
  background: rgba(17, 19, 17, 0.88);
  color: #bdb8aa;
  font-size: 10px;
  line-height: 1;
  box-shadow: none;
}

.back-menu-button:not(:disabled):hover {
  background: rgba(46, 49, 43, 0.95);
  border-color: #8d8877;
}

.player-portrait {
  width: 48px;
  height: 56px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  object-position: 50% 18%;
  background: linear-gradient(145deg, #252924, #080908);
  border: 1px solid #67675e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 22px rgba(0, 0, 0, 0.35);
}

.player-name {
  margin-top: 2px;
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.loyalty-level {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(203, 180, 122, 0.55);
  color: #e2cf95;
  background: rgba(12, 13, 11, 0.82);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: help;
  position: relative;
}

.loyalty-tooltip {
  position: absolute;
  right: 8px;
  top: calc(100% + 8px);
  z-index: 45;
  width: 210px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  padding: 10px 12px;
  border: 1px solid rgba(203, 180, 122, 0.65);
  background: linear-gradient(180deg, rgba(25, 27, 23, 0.98), rgba(8, 10, 9, 0.98));
  color: #d6d2c9;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.loyalty-level:hover + .loyalty-tooltip,
.loyalty-level:focus + .loyalty-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.extract-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #7e734f, #cbb47a);
  transform-origin: left center;
}

.raid-area {
  position: relative;
  height: calc(100vh - 82px);
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(160, 155, 132, 0.06), rgba(0, 0, 0, 0.28) 70%);
}

.fir-notice {
  position: absolute;
  z-index: 5;
  padding: 7px 18px;
  border: 1px solid rgba(74, 156, 70, 0.72);
  background:
    linear-gradient(180deg, rgba(25, 43, 23, 0.92), rgba(8, 15, 8, 0.94));
  color: #77e16d;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(86, 255, 98, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.backpack-panel {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: none;
  padding: 14px;
  background: linear-gradient(180deg, rgba(22, 24, 21, 0.97), rgba(8, 10, 9, 0.98));
  border: 1px solid rgba(105, 105, 96, 0.84);
  box-shadow: 0 28px 92px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.bag-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(100, 100, 92, 0.42);
  cursor: move;
  user-select: none;
}

.bag-icon-frame {
  width: 38px;
  height: 42px;
  flex: 0 0 auto;
  position: relative;
  border: 1px solid #565951;
  background: linear-gradient(135deg, rgba(90, 92, 82, 0.35), rgba(18, 20, 18, 0.86));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.58);
}

.bag-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.bag-icon.missing {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

.bag-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  display: none;
}

.grid {
  --cols: 5;
  --rows: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), 64px);
  grid-template-rows: repeat(var(--rows), 64px);
  gap: 2px;
  padding: 6px;
  background: #090b0a;
  border: 1px solid #51534c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72);
}

.cell {
  width: 64px;
  height: 64px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 52%),
    linear-gradient(#20231f, #151816);
  border: 1px solid rgba(74, 79, 72, 0.9);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.cell.blocked {
  visibility: hidden;
}

.cell.valid {
  background: rgba(23, 120, 32, 0.52);
}

.cell.invalid {
  background: rgba(137, 43, 35, 0.64);
}

.preview-cell {
  position: absolute;
  width: 64px;
  height: 64px;
  z-index: 9;
  pointer-events: none;
  border: 1px solid rgba(225, 222, 205, 0.26);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.34);
}

.preview-cell.valid {
  background: rgba(23, 120, 32, 0.46);
}

.preview-cell.invalid {
  background: rgba(137, 43, 35, 0.66);
}

.loot {
  position: absolute;
  width: calc(var(--w) * 64px + (var(--w) - 1) * 2px);
  height: calc(var(--h) * 64px + (var(--h) - 1) * 2px);
  z-index: 2;
  background: rgba(11, 13, 9, 0.28);
  border: 1px solid rgba(186, 177, 131, 0.62);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  user-select: none;
  touch-action: none;
}

.loot.in-bag {
  z-index: 3;
}

.loot.dragging {
  z-index: 10;
  opacity: 0.92;
}

.loot.unrevealed {
  cursor: default;
  background:
    repeating-linear-gradient(135deg, rgba(160, 160, 150, 0.08) 0 5px, transparent 5px 12px),
    linear-gradient(180deg, rgba(42, 44, 39, 0.94), rgba(13, 15, 13, 0.96));
  border-color: rgba(102, 106, 98, 0.88);
}

.loot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.loot.icon-missing img {
  display: none;
}

.missing-icon {
  display: none;
}

.loot.icon-missing .missing-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(193, 182, 132, 0.08) 0 4px, transparent 4px 11px),
    linear-gradient(180deg, rgba(28, 31, 27, 0.96), rgba(8, 10, 9, 0.98));
  color: #c9b989;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.loot.unrevealed img {
  opacity: 0;
}

.unknown-mark,
.searching {
  display: none;
}

.loot.unrevealed .unknown-mark {
  display: block;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  color: #c8c6ba;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.loot.unrevealed .searching {
  display: block;
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 4px;
  color: #aaa69a;
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}

.loot.just-revealed {
  animation: reveal-pop 0.42s ease both;
}

.loot.rotated img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--base-w) * 64px + (var(--base-w) - 1) * 2px);
  height: calc(var(--base-h) * 64px + (var(--base-h) - 1) * 2px);
  transform: translate(-50%, -50%) rotate(90deg);
}

.price {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #f3d26a;
  font-size: 12px;
  text-align: right;
  display: none;
}

.ended .loot.in-bag .price {
  display: block;
}

.results {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.results-card {
  position: absolute;
  right: 32px;
  top: 118px;
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  pointer-events: auto;
}

.results-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -8px -8px 16px;
  padding: 8px;
  cursor: move;
}

.results-handle span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.result-summary {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

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

.result-delta {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 700;
}

.result-delta.gain {
  color: #76c46f;
}

.result-delta.loss {
  color: #ef827c;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cash-toast {
  position: fixed;
  left: 50%;
  top: 104px;
  z-index: 30;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  padding: 16px 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 232, 139, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(53, 45, 22, 0.98), rgba(14, 15, 12, 0.96));
  border: 1px solid #d3b559;
  color: var(--gold);
  font-size: 42px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(255, 215, 89, 0.62), 0 2px 0 rgba(0, 0, 0, 0.8);
  box-shadow:
    0 0 0 1px rgba(255, 235, 160, 0.1) inset,
    0 0 34px rgba(230, 192, 73, 0.35),
    0 24px 70px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
}

.cash-toast.show {
  animation: cash-pop 1.65s cubic-bezier(0.2, 0.9, 0.16, 1) both;
}

.cash-toast.gain::before,
.cash-toast.gain::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170%;
  height: 170%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 225, 113, 0.72) 49%, transparent 51%),
    linear-gradient(0deg, transparent 47%, rgba(255, 225, 113, 0.72) 49%, transparent 51%);
  opacity: 0;
}

.cash-toast.gain.show::before {
  animation: cash-spark 1.1s ease-out both;
}

.cash-toast.gain.show::after {
  transform: translate(-50%, -50%) rotate(45deg);
  animation: cash-spark 1.1s 0.08s ease-out both;
}

.cash-toast.loss {
  color: #ef827c;
  border-color: #9b342d;
  background: linear-gradient(180deg, rgba(58, 20, 18, 0.98), rgba(14, 15, 12, 0.96));
  text-shadow: 0 0 16px rgba(239, 130, 124, 0.4), 0 2px 0 rgba(0, 0, 0, 0.8);
}

.cash-toast.loyalty {
  left: 50%;
  right: auto;
  top: 128px;
  transform: translate(-50%, -12px);
  color: #f1d681;
  border-color: #b99d48;
  background: linear-gradient(180deg, rgba(46, 42, 25, 0.96), rgba(17, 18, 14, 0.96));
  text-transform: uppercase;
}

.fade-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  background: #000;
  pointer-events: none;
}

.fade-overlay.active {
  animation: fade-pulse 1.05s ease both;
}

@keyframes fade-pulse {
  0% { opacity: 0; }
  40% { opacity: 1; }
  64% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes cash-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); filter: brightness(2.2); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(1.34); filter: brightness(1.65); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  68% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -82%) scale(0.92); }
}

@keyframes cash-spark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.42); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.22); }
}

@keyframes reveal-pop {
  0% { filter: brightness(1.9); transform: scale(0.96); }
  100% { filter: brightness(1); transform: scale(1); }
}

.cash-toast.loyalty.show {
  animation: loyalty-pop 2.2s ease both;
}

@keyframes loyalty-pop {
  0% { opacity: 0; transform: translate(-50%, -18px) scale(0.92); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
  28% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  82% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(0.96); }
}

@media (max-width: 900px) {
  .intro-screen {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hud {
    grid-template-columns: 1fr 1fr;
  }

  .extract-panel {
    grid-column: 1 / -1;
    order: -1;
  }

  .player-card {
    grid-column: 1 / -1;
  }
}
