/* Shared by every page: colours, sizes, buttons, page layout and pop-up messages.
   The header, drops strip and footer are in site-frame.css. */

/* Forge palette: soot-dark backgrounds, steel edges, ember accents. */
:root {
  --soot: #100e0e;
  --iron: #1a1716;
  --iron-light: #24201f;
  --iron-lighter: #322d2c;
  --steel: #4a4544;
  --ash: #a39c97;
  --white-hot: #f6efe6;
  --ember: #ff6b1a;
  --ember-light: #ffb347;
  --ember-dark: #b8360b;
  --gold: #ffe08a;
  --success: #1f8a4c;
  --success-text: #49c47c;
  --danger: #b3362b;
  --danger-text: #ff7a6b;
  /* The design kit. Every page builds its panels and controls from these, so the site looks like one place.
     Three surfaces: the well (inputs, tab bars) is --soot, a panel is --iron, a control on it is --iron-light;
     --iron-lighter is the hover of a control. One 1 px line, one radius (and its inner step), one shadow. */
  --surface-well: var(--soot);
  --surface-panel: var(--iron);
  --surface-control: var(--iron-light);
  --surface-hover: var(--iron-lighter);
  --line: rgba(255, 236, 222, 0.08);
  --line-strong: rgba(255, 236, 222, 0.14);
  --line-ember: rgba(255, 107, 26, 0.42);
  --tint-ember: rgba(255, 107, 26, 0.12);
  --border: 1px solid var(--line);
  /* The one shadow: a faint top light inside, a soft drop below. Nothing else casts a shadow. */
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px -24px rgba(0, 0, 0, 0.85);
  /* The one glow: only filled ember buttons (and the active ember of a moment) carry it */
  --glow: 0 6px 20px -8px rgba(255, 107, 26, 0.7);
  --glow-strong: 0 10px 30px -8px rgba(255, 107, 26, 0.85);
  --ember-fill: linear-gradient(180deg, #ff8f45, var(--ember) 55%, #e5560f);
  --ember-ink: #1a0d05;
  --plate: var(--surface-panel);
  --plate-edge: var(--shadow);

  /* One grid for the whole site: the page, header, drops strip and footer share these edges */
  --page-max: 1440px;
  --gutter: 24px;
  /* The round wheel and chat buttons: size and distance from the page bottom (phone sizes in responsive.css) */
  --round-button-size: 52px;
  --round-button-bottom: 24px;
  --frame-inline: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  --header-height: 64px;
  --control-height: 40px;
  --radius: 10px;
  /* Only for a control inside a padded holder (a tab in its bar): the outer radius minus the padding */
  --radius-inner: 6px;

  /* Text sizes: small print, secondary, body; headings set their own */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;

  /* Rarity tiers: the colour of the molten inlay on a case, and of the item's bar */
  --tier-consumer: #b0c3d9;
  --tier-industrial: #5e98d9;
  --tier-milspec: #4b69ff;
  --tier-restricted: #8847ff;
  --tier-classified: #d32ce6;
  --tier-covert: #eb4b4b;
  --tier-extraordinary: #e4ae39;

  /* Spacing steps shared by the cases page and the forge */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--soot);
  scrollbar-color: var(--steel) var(--soot);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--white-hot);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The same dark forge behind every page: a blurred hearth far away, darkened so text sits on it calmly.
   Fixed in its own layer, so scrolling never repaints it. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 90% at 50% 30%, transparent 30%, rgba(10, 8, 8, 0.85) 100%),
    linear-gradient(180deg, rgba(16, 14, 14, 0.35), rgba(16, 14, 14, 0.8) 75%),
    url("../images/bg/forge.webp") center 40% / cover no-repeat,
    var(--soot);
  pointer-events: none;
}

h1,
h2 {
  margin: 0;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

a,
button,
input {
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

:focus-visible {
  outline: 2px solid var(--ember-light);
  outline-offset: 2px;
}

/* The logo's anvil as an icon: the picture cuts the shape, the text colour fills it */
.icon-anvil {
  flex: none;
  width: 24px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("../images/anvil.png") center / contain no-repeat;
  mask: url("../images/anvil.png") center / contain no-repeat;
}

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The coin picture has a white background, so it is always cut to a circle. */
.coin {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* Buttons: one primary (ember, filled) and one secondary (dark, thin ember edge). Only one filled button per state.
   Sizes: .button-primary is the big action of a page; .button-ember is the same button at control size. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition-property: background-color, border-color, color, box-shadow, filter, transform, opacity;
  transition-duration: 0.15s;
  transition-timing-function: ease-out;
}

.button:disabled {
  cursor: not-allowed;
}

.button-primary,
.button-ember,
.header-deposit {
  background: var(--ember-fill);
  border-color: rgba(255, 190, 130, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), var(--glow);
  color: var(--ember-ink);
  font-weight: 700;
}

.button-primary {
  min-width: 260px;
  min-height: 56px;
  padding: 0 40px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button-primary:hover:not(:disabled),
.button-ember:hover:not(:disabled),
.header-deposit:hover {
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), var(--glow-strong);
}

.button-primary:active:not(:disabled),
.button-ember:active:not(:disabled),
.header-deposit:active,
.button-secondary:active:not(:disabled) {
  transform: scale(0.97);
}

/* Cold metal: the button is there, but there is no heat in it yet */
.button-primary:disabled,
.button-ember:disabled {
  background: var(--surface-control);
  border-color: var(--line-strong);
  box-shadow: none;
  color: #6d6664;
  filter: none;
}

.button-secondary {
  background: var(--surface-control);
  border-color: var(--line-ember);
  color: var(--white-hot);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--ember);
}

.button-secondary:disabled {
  border-color: var(--line);
  color: var(--ash);
  opacity: 0.5;
}

/* Small choice chips (X1-X10 on a case, deposit quick amounts, upgrade multipliers): neutral until chosen,
   then ember-tinted and never filled, so the one filled button of the state stays the only one.
   Their own files set only size and layout. */
.case-qty-chip,
.deposit-amount,
.multiplier-button {
  background: var(--surface-control);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--white-hot);
  font: inherit;
  cursor: pointer;
}

.case-qty-chip:hover:not(:disabled),
.deposit-amount:hover,
.multiplier-button:hover {
  background: var(--surface-hover);
  border-color: var(--line-ember);
}

.case-qty-chip[aria-pressed="true"],
.deposit-amount[aria-pressed="true"],
.multiplier-button[aria-pressed="true"] {
  background: var(--tint-ember);
  border-color: var(--ember);
  color: var(--ember-light);
}

/* Page */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 72px;
}

.mode-switch {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 22px;
  padding: 4px;
  gap: 4px;
  background: var(--soot);
  border: var(--border);
  border-radius: var(--radius);
}

.mode-switch .tab {
  min-width: 130px;
  justify-content: center;
}

/* In mystery mode the right panel only shows possible drops */
.mystery-mode .catalog-toolbar,
.mystery-mode .price-field {
  display: none;
}

.mystery-mode .catalog-filters {
  grid-template-columns: minmax(0, 1fr) auto;
}

.mystery-mode .skin-card-selectable {
  cursor: default;
}

.mystery-mode .skin-card-selectable:hover {
  transform: none;
  border-color: var(--iron-lighter);
}

/* Pop-up messages */
/* Bottom right: away from the header and from the forge, where the result is shown */
.toasts {
  position: fixed;
  right: var(--frame-inline);
  bottom: 84px; /* above the chat button */
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--iron-light);
  border: var(--border);
  border-left: 3px solid var(--toast-colour);
  border-radius: var(--radius);
  color: var(--white-hot);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.toast-success {
  --toast-colour: var(--success-text);
}

.toast-error {
  --toast-colour: var(--danger-text);
}

.toast-close {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ash);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}



.toast-link {
  color: var(--ember-light);
  text-underline-offset: 3px;
}
