 html {
   box-sizing: border-box;
 }

 *,
 *::before,
 *::after {
   box-sizing: inherit;
 }

 body {
   font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
   margin: 0;
   background: #0f1115;
   color: #e7e9ee;
   line-height: 1.45;
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
 }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0b0d12;
  border-bottom: 1px solid #232838;
}

.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__left,
.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__link {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #e7e9ee;
  text-decoration: none;
}

.nav__link:hover {
  text-decoration: none;
  border-color: #232838;
  background: #141823;
}

.nav__link:focus-visible {
  outline: none;
  border-color: rgba(158, 203, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(158, 203, 255, 0.18);
}

.nav__user {
  color: #9aa3b2;
  font-size: 13px;
}

.auth-page {
  min-height: calc(100vh - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid #232838;
  border-radius: 14px;
  background: #141823;
  padding: 20px;
}

.auth-title {
  margin: 0 0 14px;
  font-size: 22px;
}

.flash {
  border: 1px solid #232838;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 14px;
}

.flash--alert {
  border-color: rgba(255, 99, 99, 0.35);
  background: rgba(255, 99, 99, 0.10);
  color: #ffd1d1;
}

.flash--notice {
  border-color: rgba(106, 231, 172, 0.35);
  background: rgba(106, 231, 172, 0.10);
  color: #c8ffe7;
}

.flash-area {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  color: #9aa3b2;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #0f1115;
  color: #e7e9ee;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(158, 203, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(158, 203, 255, 0.18);
}

.auth-button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #1a2436;
  color: #e7e9ee;
  font-weight: 600;
  cursor: pointer;
}

.auth-button:hover {
  background: #20304a;
}

.auth-links {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  font-size: 14px;
}

a {
  color: #9ecbff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  width: min(420px, 44vw);
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #0f1115;
  color: #e7e9ee;
}

.search-input::placeholder {
  color: #9aa3b2;
}

.search-input:focus {
  outline: none;
  border-color: rgba(158, 203, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(158, 203, 255, 0.18);
}

.search-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #1a2436;
  color: #e7e9ee;
  font-weight: 600;
  cursor: pointer;
}

.search-btn:hover {
  background: #20304a;
}

.search-btn:focus-visible {
  outline: none;
  border-color: rgba(158, 203, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(158, 203, 255, 0.18);
}

@media (max-width: 700px) {
  .nav__inner {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nav__search {
    width: 100%;
    order: 3;
  }

  .search-form {
    width: 100%;
  }

  .search-input {
    width: 100%;
    flex: 1;
  }
}

.game-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.1;
}

.card {
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 14px;
}

.game-header {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.game-title {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.1;
}

.game-header__image {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: #141823;
}

.game-short-description {
  margin: 12px 0 0;
  color: #c9ced9;
  font-size: 15px;
  line-height: 1.5;
}

.game-meta {
  margin-top: 16px;
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 12px;
}

.game-meta__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #232838;
}

.game-meta__row:last-child {
  border-bottom: 0;
}

.game-meta__label {
  color: #9aa3b2;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.game-meta__value {
  color: #e7e9ee;
  font-size: 14px;
}

.game-section {
  margin-top: 24px;
}

.game-section__title {
  margin: 0 0 10px;
  font-size: 16px;
  color: #e7e9ee;
}

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

.game-card {
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 12px;
}

.game-card__label {
  color: #9aa3b2;
  font-size: 12px;
}

.game-card__value {
  font-size: 18px;
  margin-top: 6px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid #232838;
  background: #141823;
  color: #e7e9ee;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  color: #c9ced9;
}

.prose {
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 14px;
  color: #c9ced9;
  line-height: 1.6;
}

.prose a {
  color: #9ecbff;
}

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

.screenshot {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #232838;
  background: #141823;
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

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

.trailer {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #141823;
}

.empty-state {
  color: #9aa3b2;
}

@media (max-width: 900px) {
  .game-header {
    grid-template-columns: 1fr;
  }

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

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

  .home-page {
    padding: 24px 12px;
  }

  .section h2 {
    font-size: 20px;
  }
}

.home-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.home-title {
  font-size: 36px;
  margin: 0 0 8px;
  color: #e7e9ee;
}

.home-subtitle {
  color: #c9ced9;
  font-size: 18px;
  margin-bottom: 32px;
}

.home-user {
  color: #9aa3b2;
  margin-bottom: 16px;
}

.home-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #1a2436;
  color: #e7e9ee;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
}

.btn:hover {
  background: #20304a;
}

.btn-primary {
  background: #9ecbff;
  color: #0f1115;
}

.btn-secondary {
  background: transparent;
}

.section {
  margin-bottom: 48px;
}

.section h2 {
  font-size: 24px;
  margin: 0 0 16px;
  color: #e7e9ee;
}

.game-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #141823;
  border: 1px solid #232838;
}

.game-card-image-placeholder {
  height: 160px;
  background: #141823;
  border-radius: 10px;
  border: 1px solid #232838;
}

.game-card-title {
  font-size: 16px;
  margin: 0 0 8px;
}

.game-card-title a {
  color: #e7e9ee;
  text-decoration: none;
}

.game-card-title a:hover {
  text-decoration: underline;
}

.game-card-desc {
  color: #c9ced9;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.admin-title {
  font-size: 32px;
  margin: 0 0 24px;
  color: #e7e9ee;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 16px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #e7e9ee;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #9aa3b2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-pending .stat-value {
  color: #fbbf24;
}

.stat-syncing .stat-value {
  color: #60a5fa;
}

.stat-synced .stat-value {
  color: #34d399;
}

.stat-failed .stat-value {
  color: #f87171;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #232838;
}

.admin-table th {
  background: #0f1115;
  color: #9aa3b2;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table td {
  font-size: 14px;
  color: #e7e9ee;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.status-syncing {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.status-synced {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.status-failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.btn-warning {
  background: #fbbf24;
  color: #0f1115;
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #c8ffe7;
}

.alert-danger {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #ffd1d1;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }
}

.sync-jobs-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.sync-job-form {
  border: 1px solid #232838;
  border-radius: 12px;
  background: #141823;
  padding: 16px;
  margin-bottom: 32px;
}

.form-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.form-field {
  flex: 1;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: #9aa3b2;
  margin-bottom: 6px;
}

.form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #232838;
  background: #0f1115;
  color: #e7e9ee;
  font-size: 14px;
}

.form-select:focus {
  outline: none;
  border-color: rgba(158, 203, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(158, 203, 255, 0.18);
}

@media (max-width: 768px) {
  .form-fields {
    flex-direction: column;
    align-items: stretch;
  }
}
