/* -------------------------------------------------------
   Tokens
------------------------------------------------------- */
:root {
  --bg:            #12160f;
  --bg-soft:       #171c15;
  --surface:       #1a201b;
  --surface-hover: #212820;
  --border:        #283028;
  --border-strong: #3a453b;

  --text:          #e9ede7;
  --text-muted:    #97a291;
  --text-faint:    #5f6a5f;

  --accent:        #86c39a;
  --accent-strong: #a4d9b4;
  --accent-dim:    #2c3b30;

  --warn:          #d7ab5e;
  --error:         #d9806b;
  --error-dim:     #3a2822;

  --tag-steam:     #3d75a8;
  --tag-epic:      #565f9c;

  --font-display: "Space Grotesk", sans-serif;
  --font-body:    "Inter", sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  --radius: 10px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(134,195,154,0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(61,117,168,0.05), transparent 55%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -------------------------------------------------------
   Top bar / signature status line
------------------------------------------------------- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(18, 22, 15, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
  box-shadow: 0 0 8px rgba(134, 195, 154, 0.6);
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  display: none;
}

@media (min-width: 560px) {
  .brand__tag { display: inline; }
}

.scanline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
}

.scanline__led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.scanline--ok .scanline__led {
  background: var(--accent);
  animation: blink 2.4s ease-in-out infinite;
}

.scanline--error .scanline__led {
  background: var(--error);
  animation: blink 1.2s ease-in-out infinite;
}

.scanline--error { color: var(--error); border-color: var(--error-dim); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .scanline__led { animation: none !important; }
}

/* -------------------------------------------------------
   Intro
------------------------------------------------------- */
.intro {
  padding: 56px 0 36px;
  max-width: 640px;
}

.intro__eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

.intro__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.intro__body {
  color: var(--text-muted);
  font-size: 15.5px;
  margin: 0;
}

/* -------------------------------------------------------
   Board / cards
------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 72px;
}

.board__loading,
.board__empty,
.board__error {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.board__error { color: var(--error); border-color: var(--error-dim); }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__shop {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 5px;
  color: #eef2ee;
  background: var(--tag-steam);
}

.card__shop[data-shop="epicgames"] { background: var(--tag-epic); }

.card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card__name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.card__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.card__price {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--border-strong);
}

.card__price--free {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.card__countdown {
  color: var(--warn);
  white-space: nowrap;
  flex-shrink: 0;
}

.card__countdown--soon { color: var(--error); }

.card__expiry {
  margin: -4px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 150px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.card__cta:hover {
  background: var(--accent);
  color: #10160f;
  border-color: var(--accent);
}

/* Secondary "open in desktop app" button — outlined, tinted by shop color
   so it visually pairs with the shop badge on the same card. */
.card__cta--app {
  flex: 1 1 130px;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
  font-size: 12.5px;
  font-family: var(--font-mono);
  padding: 10px 12px;
}

.card__cta--app[data-shop="steam"] {
  border-color: var(--tag-steam);
  color: #a9c8e0;
}

.card__cta--app[data-shop="epicgames"] {
  border-color: var(--tag-epic);
  color: #b8bdea;
}

.card__cta--app:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* -------------------------------------------------------
   Notification banner (from status.json "message")
------------------------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.55;
}

.banner[hidden] { display: none; }

.banner--info {
  border-color: var(--accent-dim);
  background: linear-gradient(0deg, rgba(134,195,154,0.06), rgba(134,195,154,0.06)), var(--surface);
}

.banner--error {
  border-color: var(--error-dim);
  background: linear-gradient(0deg, rgba(217,128,107,0.08), rgba(217,128,107,0.08)), var(--surface);
}

.banner__icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1.5;
}

.banner--info .banner__icon { color: var(--accent-strong); }
.banner--error .banner__icon { color: var(--error); }

.banner__body {
  flex: 1;
  color: var(--text);
  min-width: 0;
  overflow-wrap: break-word;
}

.banner__body strong { color: var(--text); font-weight: 600; }
.banner__body em { color: var(--text-muted); }

.banner__body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.banner__body a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.banner--error .banner__body a { color: var(--error); }

.banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  font-family: var(--font-body);
}

.banner__close:hover { color: var(--text); }

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 15px 0 15px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer__sep { opacity: 0.6; }

.footer__meta code {
  color: var(--text-muted);
}

.footer__social {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-faint);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.footer__social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer__social-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent-dim);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
