* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0b1020;
  color: #e5e7eb;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.page-shell.is-authenticated {
  padding-top: 96px;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(11, 16, 32, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(14px);
}

.top-nav-brand {
  font-weight: 800;
  letter-spacing: 0.08em;
}

.top-nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-nav-link,
.ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 10px 14px;
  border-radius: 999px;
}

.top-nav-link.is-active {
  background: #2563eb;
  border-color: #2563eb;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
}

.flash-error {
  background: rgba(127, 29, 29, 0.55);
}

.flash-success {
  background: rgba(20, 83, 45, 0.55);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

.panel-card,
.login-card {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  padding: 24px;
}

.narrow-card,
.login-card {
  max-width: 520px;
}

.login-card {
  margin: 12vh auto 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form textarea {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 12px;
  min-height: 120px;
}

.stack-form input,
.stack-form select,
.stack-form button,
.ghost-button {
  min-height: 44px;
  border-radius: 12px;
}

.stack-form input,
.stack-form select {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: #e5e7eb;
  padding: 0 12px;
}

.stack-form button {
  border: 0;
  background: #2563eb;
  color: white;
  padding: 0 16px;
  cursor: pointer;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.button-row form {
  margin: 0;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-row input {
  min-height: auto;
}

.stack-form-inline {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 16px;
}

.stack-form-inline legend {
  padding: 0 8px;
  color: #93c5fd;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
}

.top-gap {
  margin-top: 20px;
}

.game-card {
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  overflow: hidden;
}

.game-card-cover-link {
  display: block;
}

.game-card-cover,
.game-card-cover-empty,
.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0f172a;
}

.game-card-cover-empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
}

.game-card-body {
  padding: 16px;
}

.game-card-body h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 24px;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.media-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: #0f172a;
}

.db-thumb,
.quiz-badge {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f172a;
  padding: 6px;
}

.compact-card {
  padding: 16px;
}

.split-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.prose-block {
  line-height: 1.6;
}

.full-width-audio {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

th {
  color: #93c5fd;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 720px) {
  .page-shell.is-authenticated {
    padding-top: 148px;
  }

  .top-nav {
    align-items: flex-start;
    flex-direction: column;
  }

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