:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0d11;
  color: #f4f6f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #0b0d11; }
body { margin: 0; min-width: 320px; min-height: 100%; background: radial-gradient(circle at top, #161a22 0, #0b0d11 48%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { display: block; max-width: 100%; }

.center-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.panel {
  width: min(100%, 520px);
  background: rgba(20, 23, 30, .96);
  border: 1px solid #2a2f3a;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.login-panel { width: min(100%, 470px); }
.logo-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #ec9a29;
  color: #101216;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 22px;
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.02; letter-spacing: -.04em; margin-bottom: 12px; }
h2 { font-size: 1.7rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.25; }
.eyebrow { color: #ec9a29; font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 8px; }
.muted { color: #aab1bd; line-height: 1.55; }
.security-note { margin: 18px 0; padding: 12px 14px; border: 1px solid #303641; border-radius: 10px; color: #aab1bd; font-size: .86rem; line-height: 1.45; background: #11141a; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 11px; background: #0d1015; margin: 22px 0; }
.auth-tab { border: 0; border-radius: 8px; background: transparent; color: #aab1bd; min-height: 42px; font-weight: 700; }
.auth-tab.active { background: #252a34; color: #fff; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #dbe0e7; font-size: .9rem; font-weight: 650; }
input {
  width: 100%;
  border: 1px solid #363c48;
  background: #0c0f14;
  color: #fff;
  border-radius: 10px;
  min-height: 46px;
  padding: 10px 12px;
  outline: none;
}
input:focus { border-color: #ec9a29; box-shadow: 0 0 0 3px rgba(236,154,41,.15); }

.primary-button, .secondary-button, .text-button {
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 15px;
  font-weight: 750;
}
.primary-button { border: 1px solid #ec9a29; background: #ec9a29; color: #111318; }
.primary-button:hover:not(:disabled) { filter: brightness(1.05); }
.secondary-button { border: 1px solid #353b47; background: #1a1e26; color: #f5f7fa; }
.text-button { border: 0; background: transparent; color: #aab1bd; }
.full-button { width: 100%; margin-top: 4px; }

.alert { margin: 14px 0; padding: 11px 13px; border: 1px solid #6d3237; background: #2a1417; color: #ffbdc3; border-radius: 10px; font-size: .9rem; }
.page-alert { margin: 0 0 20px; }

.spinner { width: 34px; height: 34px; border: 3px solid #2e3440; border-top-color: #ec9a29; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 50px);
  background: rgba(11,13,17,.9);
  border-bottom: 1px solid #242934;
  backdrop-filter: blur(16px);
}
.topbar p { margin-bottom: 3px; }
.topbar strong { font-size: 1.05rem; }
main { width: min(1420px, calc(100% - 36px)); margin: 0 auto; padding: 38px 0 70px; }
.section-block { margin-bottom: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.section-heading h1, .section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 480px; color: #9ca4b0; margin: 0; text-align: right; }
.case-grid, .inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.case-card, .inventory-card { min-width: 0; background: #14181f; border: 1px solid #292f39; border-radius: 13px; padding: 14px; }
.case-card h3, .inventory-card h3 { min-height: 2.5em; margin-bottom: 8px; }
.case-card > p, .inventory-card > p { color: #9da5b0; font-size: .85rem; }
.case-card .primary-button { width: 100%; margin-top: 8px; }
.image-box { display: grid; place-items: center; min-height: 155px; background: linear-gradient(145deg,#0e1116,#181c24); border-radius: 10px; padding: 12px; margin-bottom: 14px; overflow: hidden; }
.image-box img { max-height: 145px; object-fit: contain; }
.inventory-card { position: relative; overflow: hidden; border-top: 3px solid var(--rarity, #5e98d9); }
.inventory-image { min-height: 135px; }
.item-rarity { color: var(--rarity, #5e98d9) !important; font-weight: 750; }
.float-text { font-variant-numeric: tabular-nums; }
.empty-state { border: 1px dashed #343b47; border-radius: 13px; padding: 32px; color: #9ca4b0; text-align: center; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.72); }
.result-dialog { border-top: 4px solid var(--rarity, #5e98d9); text-align: center; }
.result-image { min-height: 220px; }
.result-image img { max-height: 210px; }

@media (max-width: 720px) {
  .panel { padding: 22px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .topbar { padding-inline: 16px; }
  main { width: min(100% - 24px, 1420px); padding-top: 26px; }
}
