
:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #121215;
  --line: #29292f;
  --muted: #96969f;
  --text: #f5f5f6;
  --red: #d51f35;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(155,13,34,.08), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(213,31,53,.08), transparent 30%);
  z-index: -2;
}

.ambient {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .14;
  pointer-events: none;
  z-index: -1;
}
.ambient-one { background: #d51f35; top: 15%; left: -220px; }
.ambient-two { background: #7b1425; right: -220px; bottom: 0; }

.shell { width: min(1180px, calc(100% - 44px)); margin: auto; }

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: 23px;
  letter-spacing: 1px;
  line-height: .85;
}

.brand b { color: #e52b42; }

.brand small {
  display: block;
  font: 700 9px Inter, sans-serif;
  letter-spacing: 2px;
  color: #888;
  margin-top: 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg,#ed3048,#7e0e20);
  border-radius: 10px;
  font-size: 29px;
  box-shadow: 0 8px 24px #9b132b55;
}

.user-bar { display: flex; align-items: center; gap: 18px; color: #aaa; font-size: 12px; }
.hidden { display: none !important; }

.login-layout {
  min-height: calc(100vh - 89px);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 9%;
  padding: 55px 4%;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2.4px;
  font-weight: 800;
  color: #d9d9dd;
}

.eyebrow span, .pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e32a43;
  margin-right: 8px;
  box-shadow: 0 0 12px #e32a43;
}

.intro h1, .welcome-row h1 {
  font: 900 clamp(52px,7vw,86px)/.88 "Barlow Condensed", sans-serif;
  letter-spacing: -1px;
  margin: 24px 0;
}

.intro h1 em, .welcome-row h1 em {
  font-style: normal;
  color: #df263e;
}

.intro-copy {
  max-width: 470px;
  color: #a6a6ae;
  line-height: 1.8;
  font-size: 14px;
}

.intro-foot {
  margin-top: 46px;
  color: #777;
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 800;
}

.pulse { width: 6px; height: 6px; }

.panel {
  background: linear-gradient(145deg,rgba(25,25,30,.97),rgba(15,15,18,.97));
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 22px 70px #0005;
}

.login-card {
  padding: 36px;
  max-width: 430px;
  width: 100%;
  justify-self: end;
}

.card-kicker {
  font-size: 9px;
  letter-spacing: 2px;
  color: #e12b43;
  font-weight: 800;
}

.login-card h2, .catalog-head h2, .modal-head h2 {
  font: 800 30px "Barlow Condensed", sans-serif;
  margin: 10px 0 4px;
}

.muted { color: var(--muted); font-size: 12px; line-height: 1.65; }

.login-card label, .field > label {
  display: block;
  color: #c9c9ce;
  font-size: 11px;
  font-weight: 700;
  margin: 23px 0 8px;
}

input, textarea, select {
  width: 100%;
  background: #0c0c0f;
  border: 1px solid #303037;
  border-radius: 8px;
  color: #f5f5f6;
  padding: 13px 14px;
  font: 12px Inter, sans-serif;
  outline: none;
  transition: .2s;
}

input:focus, textarea:focus, select:focus {
  border-color: #c91d35;
  box-shadow: 0 0 0 3px #c91d351b;
}

input::placeholder, textarea::placeholder { color: #65656e; }
textarea { resize: vertical; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 13px 17px;
  font: 800 10px Inter, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: .2s;
}

.btn-primary {
  background: linear-gradient(110deg,#e02a43,#a90f28);
  color: white;
  box-shadow: 0 8px 22px #b3132b30;
}

.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.12); }
.btn-primary:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary span { font-size: 16px; margin-left: 12px; }
.full { width: 100%; margin-top: 25px; }

.btn-quiet {
  background: #222227;
  color: #bbb;
  border: 1px solid #34343a;
}
.btn-quiet:hover { background: #2d2d34; color: white; }

.message { min-height: 16px; color: #eaa0aa; font-size: 11px; line-height: 1.5; }

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 50px 0 28px;
}

.welcome-row h1 { font-size: 55px; margin: 12px 0; }
.welcome-row .muted { margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat { padding: 21px 24px; }
.stat span { font-size: 9px; letter-spacing: 1.6px; color: #92929b; font-weight: 800; }
.stat strong { display: block; font: 800 34px "Barlow Condensed",sans-serif; margin-top: 9px; }

.catalog-panel { padding: 25px; }

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.catalog-head h2 { margin: 0; }
.catalog-head .muted { margin: 5px 0 0; }

.search-wrap { position: relative; width: min(280px,45%); }
.search-wrap span { position: absolute; left: 12px; top: 8px; font-size: 22px; color: #777; }
.search-wrap input { padding: 11px 12px 11px 36px; }

.games-list { display: grid; gap: 9px; padding-top: 15px; }

.game-row {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff04;
}

.game-row:hover { border-color: #303037; background: #ffffff07; }

.game-thumb {
  width: 54px;
  height: 66px;
  border-radius: 6px;
  object-fit: cover;
  background: #25252b;
}

.game-info { min-width: 0; }
.game-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-info small { display: block; color: #85858e; font-size: 10px; margin-top: 6px; }

.game-status {
  display: inline-block;
  margin-top: 7px;
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 800;
  color: #9bd7ad;
}
.game-status.draft { color: #e7bb72; }

.row-actions { display: flex; gap: 7px; }

.mini-btn {
  background: #24242a;
  border: 1px solid #38383f;
  color: #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  cursor: pointer;
}
.mini-btn:hover { border-color: #c91d35; }
.mini-btn.delete:hover { color: #ff7888; border-color: #a51b30; }

.loading, .empty { padding: 35px; text-align: center; color: #888; font-size: 12px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000c;
  backdrop-filter: blur(7px);
}

.modal-card {
  position: relative;
  width: min(760px,100%);
  max-height: 92vh;
  overflow: auto;
  background: #141418;
  border: 1px solid #38383f;
  border-radius: 15px;
  padding: 27px;
  box-shadow: 0 30px 100px #000b;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.modal-head h2 { font-size: 32px; margin: 7px 0 0; }

.close-btn {
  border: 0;
  background: #29292f;
  color: #ddd;
  border-radius: 8px;
  width: 35px;
  height: 35px;
  font-size: 23px;
  cursor: pointer;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field.span-2 { grid-column: span 2; }
.field > label { margin: 16px 0 7px; }

.field small {
  display: block;
  color: #777;
  font-size: 9px;
  line-height: 1.5;
  margin-top: 7px;
}

.field input[type=file] { padding: 10px; font-size: 10px; }
.cover-preview img {
  width: 58px;
  height: 76px;
  object-fit: cover;
  border-radius: 5px;
  margin-top: 10px;
  border: 1px solid #444;
}

.toggle-field { display: flex; align-items: center; }
.toggle-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 5px !important;
}
.toggle-field input { width: 15px; height: 15px; accent-color: #d51f35; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%,20px);
  opacity: 0;
  pointer-events: none;
  background: #24242a;
  border: 1px solid #414149;
  color: white;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 11px;
  transition: .25s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media(max-width:760px) {
  .shell { width: min(100% - 28px,600px); }
  .login-layout { grid-template-columns: 1fr; gap: 35px; padding: 45px 0; }
  .intro h1 { font-size: 58px; }
  .login-card { justify-self: stretch; max-width: none; }
  .welcome-row { align-items: flex-start; gap: 15px; flex-direction: column; }
  .welcome-row h1 { font-size: 48px; }
  .stats-grid { gap: 8px; }
  .stat { padding: 15px 12px; }
  .stat span { font-size: 8px; }
  .stat strong { font-size: 29px; }
  .catalog-panel { padding: 16px; }
  .catalog-head { align-items: flex-start; flex-direction: column; }
  .search-wrap { width: 100%; }
  .game-row { grid-template-columns: 44px minmax(0,1fr); gap: 10px; }
  .game-thumb { width: 44px; height: 56px; }
  .row-actions { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .modal-card { padding: 18px; }
  .user-bar { gap: 8px; }
  .user-bar #userEmail { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
