:root {
  --bg: #07111f;
  --panel: #111c2c;
  --panel-soft: #16243a;
  --panel-dark: #081321;
  --text: #eef6ff;
  --muted: #a8b5c7;
  --line: rgba(238, 246, 255, 0.14);
  --accent: #4aa8ff;
  --accent-strong: #7bc0ff;
  --green: #5ee0a0;
  --gold: #d7ae55;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(74, 168, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #07111f 0%, #0d1b2e 58%, #111927 100%);
}

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

.app-header,
.app-shell,
.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.app-header {
  min-height: 56px;
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(18px);
}

.back-link,
.status-pill,
.header-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.back-link {
  padding: 0 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  padding: 0 12px;
  color: var(--accent-strong);
  border: 1px solid rgba(74, 168, 255, 0.34);
  background: rgba(74, 168, 255, 0.1);
}

.header-actions button,
.error-state button {
  padding: 0 14px;
  border: 0;
  color: #06101d;
  background: var(--accent);
  cursor: pointer;
}

.header-actions button:hover,
.error-state button:hover {
  background: var(--accent-strong);
}

.app-shell {
  padding: 14px 0 28px;
}

.hero {
  max-width: 820px;
  margin-bottom: 14px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 6px;
  font-size: clamp(2.25rem, 5.8vw, 4.8rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.1;
}

.hero p:last-child,
.source-note,
.empty-state p,
.error-state p {
  color: var(--muted);
  line-height: 1.6;
}

.hero p:last-child {
  max-width: 690px;
  margin-top: 10px;
}

.toolbar,
.summary-strip,
.error-state,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 210px 170px;
  gap: 12px;
  padding: 12px;
}

.subscription-filter {
  grid-column: 1 / -1;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.subscription-filter input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.subscription-filter span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-dark);
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(74, 168, 255, 0.24);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
}

.summary-strip div {
  display: grid;
  gap: 2px;
  min-height: 78px;
  align-content: center;
  padding: 14px;
  background: rgba(8, 19, 33, 0.58);
}

.summary-strip span {
  color: var(--accent-strong);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.summary-strip small {
  color: var(--muted);
  font-weight: 800;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.game-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.game-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel-dark);
}

.game-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  align-content: center;
  place-items: center;
  gap: 6px;
  padding: 18px;
  color: #07111f;
  background:
    linear-gradient(135deg, rgba(94, 224, 160, 0.92), rgba(74, 168, 255, 0.92)),
    var(--panel-dark);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.game-image-placeholder small {
  font-size: 0.68rem;
  text-transform: uppercase;
}

.game-image-placeholder span {
  max-width: 28ch;
}

.game-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.game-card h2 {
  font-size: 1.02rem;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.game-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(74, 168, 255, 0.22);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(74, 168, 255, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
}

.game-meta .requirement-badge {
  color: #07111f;
  border-color: rgba(94, 224, 160, 0.35);
  background: var(--green);
}

.game-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.game-facts div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-dark);
}

.game-facts small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-facts strong {
  color: var(--text);
}

.game-actions {
  display: grid;
  grid-template-columns: minmax(108px, 0.75fr) minmax(138px, 1fr);
  gap: 8px;
  align-items: center;
}

.game-card .claim-link,
.game-card .secondary-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  border-radius: 8px;
  color: #06101d;
  background: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.game-card .claim-link:hover {
  background: var(--accent-strong);
}

.game-card .claim-link {
  padding: 0 10px;
  font-size: 0.84rem;
}

.game-card .secondary-link {
  padding: 0 9px;
  color: var(--accent-strong);
  border: 1px solid rgba(74, 168, 255, 0.3);
  background: rgba(74, 168, 255, 0.09);
  font-size: 0.78rem;
  white-space: nowrap;
}

.game-card .secondary-link:hover {
  border-color: rgba(123, 192, 255, 0.62);
  background: rgba(74, 168, 255, 0.16);
}

.error-state,
.empty-state {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 20px;
}

.source-note {
  margin-top: 16px;
  font-size: 0.9rem;
}

.source-note a {
  color: var(--accent-strong);
}

.app-footer {
  padding: 18px 0 26px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .toolbar,
  .games-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .toolbar label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .back-link,
  .status-pill,
  .header-actions button {
    width: 100%;
    justify-content: center;
  }

  .toolbar,
  .summary-strip,
  .games-grid,
  .game-facts {
    grid-template-columns: 1fr;
  }

  .game-actions {
    grid-template-columns: minmax(100px, 0.7fr) minmax(136px, 1fr);
  }
}
