:root {
  color-scheme: dark;

  /* Base surfaces - layered for depth */
  --bg: #050409;
  --bg-2: #0a0813;
  --panel: #110f1d;
  --panel-2: #161426;
  --panel-3: #1e1b33;

  /* Text */
  --ink: #f4f7fc;
  --soft-ink: #cdd5e3;
  --muted: #828da0;
  --faint: #5e677a;

  /* Hairlines */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Accents */
  --blue: #5b8dff;
  --cyan: #8b5cf6;
  --green: #41dd9a;
  --amber: #ffc15c;
  --red: #ff6f7d;
  --violet: #a855f7;
  --pink: #ff7eb6;

  /* Brand gradient */
  --grad: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #d946ef 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(217, 70, 239, 0.12));
  --grad-green: linear-gradient(135deg, #8b5cf6, #d946ef);

  /* Effects */
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(139, 92, 246, 0.18), 0 14px 40px -12px rgba(139, 92, 246, 0.28);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.18);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sidebar-width: 256px;

  font-family: "Plus Jakarta Sans", "Aptos", "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 12% -8%, rgba(139, 92, 246, 0.08), transparent 60%),
    radial-gradient(1000px 680px at 100% 0%, rgba(217, 70, 239, 0.07), transparent 58%),
    radial-gradient(900px 620px at 50% 120%, rgba(91, 141, 255, 0.06), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  display: block;
}

.brand-mark svg,
.tab svg,
.with-icon svg,
.game-card svg,
.ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(139, 92, 246, 0.28);
  color: #fff;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16) padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28) padding-box;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(900px 600px at 18% 12%, rgba(139, 92, 246, 0.12), transparent 55%),
    radial-gradient(900px 600px at 84% 88%, rgba(217, 70, 239, 0.12), transparent 55%),
    #05070b;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}

.login-shell::before {
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 70%);
}

.login-shell::after {
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.5), transparent 70%);
  animation-delay: -7s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -24px) scale(1.08); }
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 24px;
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 32%),
    rgba(16, 20, 29, 0.72);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: riseIn 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-panel h1,
.topbar h1 {
  margin: 5px 0 0;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.login-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14.5px;
}

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

.login-highlights span {
  display: grid;
  gap: 9px;
  min-height: 80px;
  align-content: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 620;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
}

.login-highlights span:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.32);
  background: rgba(139, 92, 246, 0.06);
}

.login-highlights svg {
  width: 18px;
  height: 18px;
  color: var(--cyan);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ============================================================
   FORMS
   ============================================================ */
.stack,
.editor {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 580;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

select option {
  color: #0f1420;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: var(--ring);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.primary,
.ghost,
.tab,
.copy-chip,
.icon-button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 42px;
  font-weight: 640;
  transition: transform 150ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease, border-color 200ms ease, filter 200ms ease;
}

.primary {
  position: relative;
  padding: 0 18px;
  color: #04121a;
  background: var(--grad-green);
  box-shadow: 0 12px 28px -10px rgba(139, 92, 246, 0.5);
  letter-spacing: 0.01em;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(139, 92, 246, 0.6);
  filter: brightness(1.05);
}

.primary:active {
  transform: translateY(0);
}

.ghost {
  padding: 0 15px;
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
}

.with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.error {
  margin: 0;
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 560;
}

/* ============================================================
   APP SHELL + SIDEBAR
   ============================================================ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 80px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 22, 31, 0.9), rgba(10, 13, 19, 0.92));
  backdrop-filter: blur(18px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--grad);
  color: #061018;
  font-weight: 760;
  box-shadow: 0 10px 24px -10px rgba(139, 92, 246, 0.6);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  color: #061018;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* When holding a logo image, drop the gradient fill */
.brand-mark.has-logo {
  background: transparent;
  box-shadow: 0 10px 24px -12px rgba(139, 92, 246, 0.55);
}

.brand-text {
  min-width: 0;
}

.brand-block p {
  margin: 0;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.brand-block small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-tabs .tab span,
body.sidebar-collapsed .sidebar .ghost span {
  display: none;
}

body.sidebar-collapsed .nav-tabs .tab {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar .ghost {
  justify-content: center;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.icon-button span,
.icon-button span::before,
.icon-button span::after {
  content: "";
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transition: transform 200ms ease;
}

.icon-button span::before {
  transform: translateY(-6px);
}

.icon-button span::after {
  transform: translateY(4px);
}

.nav-tabs,
.taskbar-tabs {
  display: grid;
  gap: 6px;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-height: 44px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--cyan);
  transition: transform 200ms ease;
}

.tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  color: var(--ink);
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.tab.active::before {
  transform: translateY(-50%) scaleY(1);
}

.tab.active svg {
  color: var(--cyan);
}

.tab svg {
  flex: 0 0 auto;
}

.sidebar .ghost {
  margin-top: auto;
}

/* ============================================================
   WORKSPACE + TASKBAR
   ============================================================ */
.workspace {
  min-width: 0;
  padding: 22px;
  background: transparent;
}

.taskbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -22px -22px 20px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.7);
  backdrop-filter: blur(20px) saturate(140%);
}

#mobileSidebarToggle {
  display: none;
}

.taskbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.taskbar-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(65, 221, 154, 0.14);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(65, 221, 154, 0.14); }
  50% { box-shadow: 0 0 0 7px rgba(65, 221, 154, 0.05); }
}

.taskbar-tabs {
  grid-template-columns: repeat(6, auto);
}

.taskbar-tabs .tab {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.taskbar-tabs .tab::before {
  display: none;
}

/* ============================================================
   TOPBAR + FILTERS
   ============================================================ */
.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(410px, 680px);
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar .eyebrow {
  letter-spacing: 0.16em;
}

.filters {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(165px, 1.1fr) minmax(190px, 1.2fr);
  gap: 10px;
}

.filter-field {
  gap: 6px;
}

.filter-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  min-height: 42px;
}

/* ============================================================
   SUMMARY CARDS
   ============================================================ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-item {
  position: relative;
  min-height: 92px;
  padding: 16px 16px 16px 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 60%),
    var(--panel);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 200ms ease, border-color 200ms ease;
}

.summary-item:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.summary-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px 80px at 90% 0%, rgba(139, 92, 246, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.summary-item:hover::after {
  opacity: 1;
}

.summary-icon {
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--cyan);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.18);
}

.summary-icon svg {
  width: 16px;
  height: 16px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-item p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 660;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  color: var(--ink);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* ============================================================
   VIEW PANELS + TOOLBAR
   ============================================================ */
.view-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 320ms ease both;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.toolbar h2,
.editor h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.editor h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}

.editor h2 .ui-icon {
  color: var(--cyan);
}

.toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================================
   INSIGHT CARDS
   ============================================================ */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.insight-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 70%), rgba(255, 255, 255, 0.02);
  transition: transform 200ms ease, border-color 200ms ease;
}

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

.insight-card > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--cyan);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.18);
}

.insight-card p,
.insight-card strong,
.insight-card small {
  display: block;
  min-width: 0;
}

.insight-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.insight-card strong {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.insight-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  font-size: 13.5px;
}

/* ============================================================
   GAMES PANEL
   ============================================================ */
.games-panel {
  display: grid;
  gap: 16px;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(214px, 1fr));
  gap: 12px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 90px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 70%), rgba(255, 255, 255, 0.015);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-sm);
}

.game-card.active {
  border-color: rgba(139, 92, 246, 0.5);
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.18), 0 12px 30px -14px rgba(139, 92, 246, 0.4);
}

.game-card span:not(.game-logo) {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.game-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.game-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.game-logo,
.logo-preview-image {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: cover;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(217, 70, 239, 0.1));
  font-weight: 760;
  font-size: 18px;
}

.game-logo.empty svg {
  width: 22px;
  height: 22px;
}

.game-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.8fr) minmax(260px, 1fr);
  gap: 14px;
}

.editor {
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.logo-preview span {
  color: var(--soft-ink);
  font-weight: 660;
  overflow-wrap: anywhere;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease;
}

.mini-item:hover {
  border-color: var(--line-strong);
}

.mini-item strong {
  font-weight: 680;
}

.mini-item span {
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   COMPARE VIEW
   ============================================================ */
.compare-list {
  display: grid;
  gap: 12px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(92px, 116px) minmax(150px, 184px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%), rgba(255, 255, 255, 0.012);
  transition: border-color 180ms ease;
}

.compare-row:hover {
  border-color: var(--line-strong);
}

.amount-cell,
.winner-cell {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.amount-cell strong {
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.amount-cell span,
.winner-cell span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 660;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.amount-cell em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--red);
  background: rgba(255, 111, 125, 0.12);
  font-size: 11px;
  font-style: normal;
  font-weight: 660;
}

.amount-cell em svg {
  width: 13px;
  height: 13px;
}

.winner-cell strong {
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.winner-cell small {
  color: var(--muted);
  line-height: 1.4;
}

.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
  gap: 10px;
  min-width: 0;
}

.offer {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.offer:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.32);
  box-shadow: var(--shadow-sm);
}

.offer.cheapest {
  border-color: rgba(65, 221, 154, 0.4);
  background: linear-gradient(180deg, rgba(65, 221, 154, 0.12), var(--panel-2));
}

.offer.value-pick {
  box-shadow: inset 0 0 0 1px rgba(91, 141, 255, 0.28);
}

.offer.cheapest.value-pick {
  box-shadow: inset 0 0 0 1px rgba(91, 141, 255, 0.28);
}

.offer-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.provider {
  font-weight: 680;
}

.catalog {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price {
  color: var(--ink);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.offer.cheapest .price {
  color: var(--green);
}

.offer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 540;
}

/* ============================================================
   BADGES + CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 193, 92, 0.15);
  color: var(--amber);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 193, 92, 0.2);
}

.badge.green {
  background: rgba(65, 221, 154, 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(65, 221, 154, 0.22);
}

.badge.blue {
  background: rgba(91, 141, 255, 0.16);
  color: #93b6ff;
  box-shadow: inset 0 0 0 1px rgba(91, 141, 255, 0.24);
}

.badge.amber {
  background: rgba(255, 193, 92, 0.15);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(255, 193, 92, 0.2);
}

.badge.red {
  background: rgba(255, 111, 125, 0.14);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 125, 0.22);
}

.label-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.copy-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  padding: 0 11px;
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 580;
  overflow-wrap: anywhere;
}

.copy-chip:hover {
  color: #04121a;
  background: var(--cyan);
  border-color: transparent;
  transform: translateY(-1px);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

td strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 640;
}

.value-row {
  background: rgba(255, 193, 92, 0.05);
}

.value-row:hover {
  background: rgba(255, 193, 92, 0.08);
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ============================================================
   LOGS
   ============================================================ */
.log-list {
  display: grid;
  gap: 12px;
}

.log-card {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%), rgba(255, 255, 255, 0.012);
  transition: border-color 180ms ease;
}

.log-card.success {
  border-left: 3px solid rgba(65, 221, 154, 0.6);
}

.log-card.failed {
  border-left: 3px solid rgba(255, 111, 125, 0.6);
}

.log-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.log-status > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--green);
  background: rgba(65, 221, 154, 0.12);
  box-shadow: inset 0 0 0 1px rgba(65, 221, 154, 0.2);
}

.log-card.failed .log-status > span {
  color: var(--red);
  background: rgba(255, 111, 125, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 125, 0.2);
}

.log-status strong,
.log-status small {
  display: block;
}

.log-status strong {
  font-weight: 680;
}

.log-status small,
.log-card p {
  color: var(--muted);
  font-size: 12px;
}

.log-status em {
  min-height: 25px;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(65, 221, 154, 0.12);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.log-card.failed .log-status em {
  color: var(--red);
  background: rgba(255, 111, 125, 0.12);
}

.log-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.log-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--soft-ink);
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.log-grid b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.log-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ============================================================
   MANAGE
   ============================================================ */
.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
  gap: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 580;
  background: rgba(18, 22, 31, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: toastIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sidebar-scrim {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .log-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .game-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(284px, calc(100vw - 46px));
    transform: translateX(-105%);
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: min(284px, calc(100vw - 46px));
    z-index: 4;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-tabs .tab span,
  body.sidebar-collapsed .sidebar .ghost span {
    display: block;
  }

  #mobileSidebarToggle {
    display: grid;
  }

  .workspace {
    padding: 16px;
  }

  .taskbar {
    margin: -16px -16px 16px;
    padding: 11px 16px;
  }

  .taskbar-tabs {
    display: none;
  }

  .taskbar-left {
    margin-left: auto;
    font-size: 12px;
  }

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

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

  .summary-item {
    min-height: 80px;
    padding: 14px 14px 14px 52px;
  }

  .summary-icon {
    width: 28px;
    height: 28px;
  }

  .view-panel,
  .editor {
    padding: 15px;
  }

  .offers,
  .game-card-grid {
    grid-template-columns: 1fr;
  }

  .compare-row {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .log-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .login-panel {
    padding: 24px;
  }

  .login-brand {
    align-items: flex-start;
  }

  .login-highlights {
    grid-template-columns: 1fr;
  }

  .login-highlights span {
    min-height: 0;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar select {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-item p {
    font-size: 10px;
  }

  .summary-item strong {
    font-size: 21px;
  }

  .price {
    font-size: 20px;
  }

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

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

  .log-status {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .log-status em {
    justify-self: start;
    grid-column: 2;
  }

  table {
    min-width: 740px;
  }
}

/* ============================================================
   LOGIN ENHANCEMENTS + ANIMATED SIGN-IN
   ============================================================ */
.login-brand .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.login-brand .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-panel h1 {
  background: linear-gradient(120deg, #fff 20%, #d9c8ff 60%, #f3b6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-panel .eyebrow {
  color: var(--violet);
}

.login-highlights svg {
  color: var(--violet);
}

.login-highlights span:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}

/* Animated sign-in button */
.login-submit {
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  min-height: 50px;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #0a0612;
  background: linear-gradient(110deg, #8b5cf6, #a855f7, #d946ef, #8b5cf6);
  background-size: 240% 100%;
  box-shadow: 0 16px 38px -12px rgba(168, 85, 247, 0.65);
  animation: gradFlow 5s ease infinite;
}

@keyframes gradFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-22deg);
  animation: sheen 3.4s ease-in-out infinite;
}

@keyframes sheen {
  0% { left: -75%; }
  55%, 100% { left: 140%; }
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -12px rgba(217, 70, 239, 0.7);
  filter: brightness(1.06);
}

.login-submit:active {
  transform: translateY(0) scale(0.99);
}

.login-submit svg {
  position: relative;
  z-index: 1;
}
