:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fa;
  --accent: #3157d5;
  --border: #dce1eb;
  --muted: #657086;
}

* { box-sizing: border-box; }

body { margin: 0; }

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 4vw, 4rem) 1.5rem;
  color: white;
  background: linear-gradient(135deg, #15234a, #3157d5);
}

.brand { display: flex; align-items: center; gap: 1rem; }
.site-icon {
  width: clamp(52px, 6vw, 64px);
  height: clamp(52px, 6vw, 64px);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(8 17 48 / 24%);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.eyebrow { margin-bottom: .35rem; font-size: .75rem; letter-spacing: .16em; opacity: .8; }
.status { margin-bottom: .35rem; font-size: .9rem; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-actions form { margin: 0; }
.logout-button { min-height: 34px; padding: .4rem .7rem; border-color: rgb(255 255 255 / 45%); background: transparent; }

main { width: min(1400px, 100%); margin: 0 auto; padding: 1.25rem clamp(1rem, 4vw, 3rem) 3rem; }

.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tab-button {
  min-height: 44px;
  padding: .65rem 1.2rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.tab-button.is-active { border-bottom-color: var(--accent); color: var(--accent); }
.subtabs { display: flex; gap: .5rem; margin: 0 0 1rem; }
.subtab-button { min-height: 38px; padding: .45rem 1rem; color: #34415e; border-color: var(--border); background: white; }
.subtab-button.is-active { color: white; border-color: var(--accent); background: var(--accent); }
[hidden] { display: none !important; }

.filters {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(220px, 2fr) auto auto;
  align-items: end;
  gap: .9rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: 0 6px 24px rgb(24 35 60 / 6%);
}
.steam-filters { grid-template-columns: minmax(220px, 2fr) minmax(180px, .8fr) auto; }

label { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); }
.check-label { display: flex; align-items: center; min-height: 42px; }

input, select, button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .65rem .8rem;
  font: inherit;
}

button { border-color: var(--accent); color: white; background: var(--accent); cursor: pointer; }
button:hover { filter: brightness(.95); }
button:disabled { cursor: wait; opacity: .6; }
button.secondary { min-height: 34px; padding: .4rem .65rem; color: #34415e; border-color: var(--border); background: white; }

.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.article-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: 0 6px 22px rgb(24 35 60 / 5%); }
.article-card.is-read { opacity: .68; }
.image-link { display: block; aspect-ratio: 16 / 9; background: #e8ebf2; }
.article-image { width: 100%; height: 100%; object-fit: cover; }
.article-content { padding: 1rem; }
.meta { display: flex; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; color: var(--muted); font-size: .75rem; }
.source { color: var(--accent); font-weight: 700; }
h2 { font-size: 1.05rem; line-height: 1.5; }
.title-link { color: inherit; text-decoration: none; }
.title-link:hover { color: var(--accent); text-decoration: underline; }
.summary { display: -webkit-box; overflow: hidden; color: #4f5a70; font-size: .88rem; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.actions { display: flex; gap: .5rem; margin-top: .9rem; }
.sale-badges { display: inline-flex; align-items: center; gap: .4rem; }
.new-badge, .discount-badge { padding: .25rem .55rem; border-radius: 999px; color: white; font-weight: 800; }
.new-badge { background: #df4b2f; letter-spacing: .04em; }
.discount-badge { background: #137d51; }
.sale-end { align-self: center; }
.price { display: flex; align-items: baseline; gap: .75rem; margin: .9rem 0 0; }
.original-price { color: var(--muted); font-size: .9rem; }
.current-price { color: #137d51; font-size: 1.25rem; }
.store-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid #137d51;
  border-radius: 9px;
  padding: .5rem .75rem;
  color: white;
  background: #137d51;
  font-size: .9rem;
  text-decoration: none;
}
.store-button:hover { filter: brightness(.95); }
.steam-notice { margin: 1.25rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.load-more-wrap { display: grid; place-items: center; padding: 1.5rem; }
.empty { grid-column: 1 / -1; padding: 4rem 1rem; text-align: center; color: var(--muted); }

.login-page { min-height: 100vh; background: linear-gradient(135deg, #15234a, #3157d5); }
.login-main { display: grid; min-height: 100vh; place-items: center; padding: 1.25rem; }
.login-card { width: min(100%, 420px); padding: 2rem; border-radius: 18px; background: white; box-shadow: 0 24px 70px rgb(4 12 40 / 32%); }
.login-icon { display: block; width: 80px; height: 80px; margin-bottom: 1.25rem; border-radius: 18px; }
.login-eyebrow { color: var(--accent); font-weight: 700; }
.login-description { margin: .75rem 0 1.5rem; color: var(--muted); }
.login-form { display: grid; gap: 1rem; }
.login-error { padding: .75rem; border-radius: 9px; color: #922; background: #fff0f0; }
.login-note { margin: 1.25rem 0 0; color: var(--muted); font-size: .8rem; text-align: center; }

@media (max-width: 720px) {
  .site-header { align-items: start; flex-direction: column; }
  .brand { gap: .75rem; }
  .header-actions { width: 100%; justify-content: space-between; }
  .filters, .steam-filters { grid-template-columns: 1fr; }
}
