@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0d0c0b;
  --panel: rgba(18, 17, 16, 0.92);
  --border: rgba(237, 232, 224, 0.09);
  --border-strong: rgba(237, 232, 224, 0.20);

  --text: #f1ece4;
  --text-dim: #cdc6bb;
  --muted: #a19a8f;
  --muted-dim: #79726a;

  --accent: #9a3226;
  --accent-hover: #ad3b2d;
  --accent-tint: rgba(154, 50, 38, 0.12);
  --accent-line: rgba(154, 50, 38, 0.38);

  --ok: #7aa375;
  --ok-tint: rgba(122, 163, 117, 0.10);
  --ok-line: rgba(122, 163, 117, 0.30);
  --warn: #c99666;
  --warn-tint: rgba(201, 150, 102, 0.10);
  --warn-line: rgba(201, 150, 102, 0.30);
  --info-tint: rgba(237, 232, 224, 0.045);
  --off: #625c55;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 100px;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    linear-gradient(160deg, rgba(9,8,7,0.42) 0%, rgba(9,8,7,0.66) 48%, rgba(9,8,7,0.94) 100%),
    url('bg.png');
  background-size: cover;
  background-position: center 34%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  padding: 20px clamp(20px, 4vw, 56px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}
.brand .wordmark {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 56px) 40px;
}

/* ---------- Panel ---------- */
.panel {
  width: min(440px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.7);
}

/* ---------- Platform tabs ---------- */
.platform-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: rgba(237, 232, 224, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.platform-tab {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  color: var(--muted-dim);
}
.platform-tab.is-active {
  background: rgba(237, 232, 224, 0.09);
  color: var(--text);
}
.platform-tab.is-disabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-dim);
  opacity: 0.75;
  cursor: not-allowed;
}
.platform-tab.is-disabled em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(237, 232, 224, 0.08);
  border-radius: var(--radius-pill);
  padding: 2px 6px;
}

h1 {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--text);
}
h1 span { color: var(--muted); font-weight: 700; }

.top-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.status-dot.off { background: var(--off); }
.dot-sep { color: var(--muted-dim); }

/* ---------- Device / compat card ---------- */
.device-card {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--info-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin: 0 0 14px;
}
.device-card b { color: var(--text-dim); font-weight: 700; }
.device-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--muted-dim);
}
.device-card.is-ok { background: var(--ok-tint); border-color: var(--ok-line); }
.device-card.is-ok .device-dot { background: var(--ok); }
.device-card.is-warn { background: var(--warn-tint); border-color: var(--warn-line); }
.device-card.is-warn .device-dot { background: var(--warn); }

/* ---------- Arch selector ---------- */
fieldset {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
}
legend {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-dim);
  margin-bottom: 9px;
  padding: 0;
}

.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.arch-grid .arch-both { grid-column: 1 / -1; }

.arch-option { position: relative; }
.arch-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.arch-option label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(237, 232, 224, 0.015);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.arch-option label .k {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.arch-option label .v {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-dim);
}
.arch-option input:hover + label {
  border-color: var(--border-strong);
}
.arch-option input:focus-visible + label {
  outline: 2px solid var(--accent-hover);
  outline-offset: 1px;
}
.arch-option input:checked + label {
  border-color: var(--accent-line);
  background: var(--accent-tint);
}
.arch-option input:checked + label .k { color: var(--text); }

.arch-option.disabled label {
  opacity: 0.38;
  cursor: not-allowed;
}
.arch-option.disabled input { cursor: not-allowed; pointer-events: none; }

/* ---------- Download button ---------- */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease;
}
.download-btn:hover { background: var(--accent-hover); }
.download-btn:active { background: var(--accent); }
.download-btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.download-btn svg { width: 16px; height: 16px; flex: none; }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-dim);
}

.empty-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 4px;
}

footer {
  padding: 14px clamp(20px, 4vw, 56px) 22px;
  font-size: 11px;
  color: var(--muted-dim);
}

@media (max-width: 640px) {
  main { align-items: flex-end; padding-bottom: 26px; }
  .panel { width: 100%; }
}

@media (max-height: 700px) {
  main { padding-top: 16px; padding-bottom: 24px; }
  .panel { padding: 22px 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .download-btn, .arch-option label { transition: none; }
}
