  @font-face { font-family: "Sora"; font-weight: 400; font-display: swap; src: url("fonts/sora-latin-400-normal.woff2") format("woff2"); }
  @font-face { font-family: "Sora"; font-weight: 500; font-display: swap; src: url("fonts/sora-latin-500-normal.woff2") format("woff2"); }
  @font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("fonts/sora-latin-600-normal.woff2") format("woff2"); }
  @font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url("fonts/sora-latin-700-normal.woff2") format("woff2"); }
  @font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
  @font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

  :root {
    --bg: #07080b;
    --panel: #0e1015;
    --line: #1c1f27;
    --text: #e9ecf2;
    --muted: #8a91a0;
    --faint: #7a8191;
    --up: #34d399;
    --down: #f43f5e;
    --pending: #f5b544;
    --maint: #60a5fa;
    --empty: #1b1e26;
    --radius: 16px;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    background: var(--bg);
    background-image: radial-gradient(1200px 600px at 50% -200px, #141824 0%, transparent 70%);
    color: var(--text);
    font-family: "Sora", system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }
  .wrap { max-width: 1180px; margin: 0 auto; padding: 48px 24px 64px; }

  /* Header */
  header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px 24px; margin-bottom: 28px; }
  header .summary { justify-self: end; }
  .maint {
    justify-self: center; display: none; align-items: center; gap: 9px; max-width: 100%;
    padding: 7px 14px; border-radius: 999px; font-size: 12.5px; line-height: 1.2; white-space: nowrap;
    color: #f3d79b; background: rgba(245,181,68,.08); border: 1px solid rgba(245,181,68,.35);
  }
  .maint.show { display: inline-flex; }
  .maint.live { color: #ffe2a8; background: rgba(245,181,68,.16); border-color: rgba(245,181,68,.6); }
  .maint .dot { width: 8px; height: 8px; }
  .maint b { font-weight: 600; color: #fff1d0; }
  .maint .more { color: var(--muted); }
  @media (max-width: 900px) {
    header { grid-template-columns: 1fr auto; }
    .maint { grid-column: 1 / -1; grid-row: 2; justify-self: start; white-space: normal; border-radius: 12px; }
  }
  .brand { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
  .brand span { color: var(--muted); font-weight: 500; }
  .tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
  .summary { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }
  .summary .dot { width: 9px; height: 9px; }
  .summary small { color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 12px; }

  /* Grid */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }

  /* Card */
  .card {
    position: relative; overflow: hidden; border-radius: var(--radius);
    border: 1px solid var(--line); background-color: #000;
    display: flex; flex-direction: column; min-height: 340px;
    transition: transform .25s ease, border-color .25s ease;
  }
  .card:hover { transform: translateY(-3px); border-color: #2a2f3a; }
  .art {
    position: absolute; inset: 0 0 auto 0; height: 70%;
    background-size: cover; background-position: center 40%;
  }
  .art::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.05) 20%, rgba(0,0,0,.3) 45%, rgba(0,0,0,.85) 72%, #000 100%);
  }
  .card > .body { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; padding: 22px; }

  .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .chip {
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(6px); color: #d7dbe3;
  }
  .chip.ver { text-transform: none; letter-spacing: .02em; font-family: "JetBrains Mono", monospace; }
  .state { display: inline-flex; align-items: center; gap: 8px; }
  .title { margin-top: auto; padding-top: 64px; text-align: center; }
  .game.long { font-size: 30px; }
  .game { font-size: 38px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,.55), 0 6px 22px rgba(0,0,0,.45); }
  .sub { color: #b4bac6; font-size: 13px; margin-top: 6px; text-shadow: 0 1px 3px rgba(0,0,0,.7); min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
  .stat { min-width: 0; }
  .stat .k { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
  .stat .v { font-size: 16px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .stat .v small { color: var(--muted); font-weight: 500; font-size: 12px; }
  .stat .v.na { color: var(--faint); }
  .pbar { height: 3px; border-radius: 3px; background: var(--empty); margin-top: 7px; overflow: hidden; }
  .pbar i { display: block; height: 100%; background: var(--up); border-radius: 3px; transition: width .6s ease; }

  .history { margin-top: 18px; }
  .history-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-bottom: 7px; }
  .barrow { display: flex; align-items: center; gap: 12px; }
  .bar { flex: 1; display: flex; gap: 3px; height: 26px; }
  .seg { flex: 1; border-radius: 3px; background: var(--empty); transition: transform .15s, filter .15s; }
  .seg.s1 { background: var(--up); }
  .seg.s0 { background: var(--down); }
  .seg.s2 { background: var(--pending); }
  .seg.s3 { background: var(--maint); }
  .seg:not(.empty):hover { transform: scaleY(1.18); filter: brightness(1.2); }

  .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--faint); }
  .dot.up { background: var(--up); box-shadow: 0 0 6px var(--up), 0 0 16px rgba(52,211,153,.6); animation: pulse-up 2.4s ease-in-out infinite; }
  .dot.down { background: var(--down); box-shadow: 0 0 6px var(--down), 0 0 16px rgba(244,63,94,.6); animation: pulse-down 1.4s ease-in-out infinite; }
  .dot.pending { background: var(--pending); box-shadow: 0 0 6px var(--pending), 0 0 14px rgba(245,181,68,.5); }
  .dot.mnt { background: var(--maint); box-shadow: 0 0 6px var(--maint), 0 0 14px rgba(96,165,250,.5); }
  @keyframes pulse-up { 50% { box-shadow: 0 0 3px var(--up), 0 0 8px rgba(52,211,153,.35); } }
  @keyframes pulse-down { 50% { box-shadow: 0 0 3px var(--down), 0 0 6px rgba(244,63,94,.3); } }
  @media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } .card { transition: none; } }

  .foot { margin-top: 14px; font-size: 11.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; }

  /* Fallback art per game (shown if no image file is provided) */
  .t-mc { background-color: #2c4a22;
    background-image:
      linear-gradient(180deg, #7fb2e5 0%, #a9cdee 34%, transparent 34%),
      linear-gradient(180deg, transparent 34%, #5d9c3a 34%, #4f8a31 41%, #7a5534 41%, #6a4a2d 100%),
      repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 28px),
      repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 2px, transparent 2px 28px);
    background-blend-mode: normal, normal, multiply, multiply; }
  .t-terraria { background-color: #1b1640;
    background-image:
      radial-gradient(circle at 74% 20%, #fff7d6 0 22px, rgba(255,240,190,.35) 23px, transparent 70px),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 120 Q40 95 80 118 T160 110 T240 125 T320 105 T400 118 V200 H0Z' fill='%23142a1f'/%3E%3Cpath d='M0 150 Q60 130 120 150 T240 145 T400 152 V200 H0Z' fill='%230b1712'/%3E%3C/svg%3E"),
      linear-gradient(180deg, #2a2366 0%, #5b3f8c 40%, #c46a7a 62%, #0b1712 62%);
    background-size: auto, 100% 100%, auto; background-repeat: no-repeat; }
  .t-valheim { background-color: #16232a;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 110 L70 55 L110 85 L170 30 L230 90 L280 60 L340 100 L400 70 V200 H0Z' fill='%23324a52'/%3E%3Cpath d='M170 30 L190 48 L178 46 L165 52 L156 43Z' fill='%23c9d6da'/%3E%3Cpath d='M0 140 L60 110 L120 135 L200 100 L270 135 L330 115 L400 130 V200 H0Z' fill='%231d2e33'/%3E%3C/svg%3E"),
      linear-gradient(180deg, #8fa7ad 0%, #4f6a72 45%, #16232a 70%);
    background-size: 100% 100%, auto; background-repeat: no-repeat; }
  .t-zomboid { background-color: #1e1f16;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 120 H40 V80 H90 V100 H120 V60 H170 V105 H210 V85 H260 V120 H300 V70 H350 V110 H400 V200 H0Z' fill='%23262619'/%3E%3Crect x='130' y='70' width='8' height='8' fill='%23c9a64a' opacity='.7'/%3E%3Crect x='310' y='82' width='8' height='8' fill='%23c9a64a' opacity='.5'/%3E%3C/svg%3E"),
      linear-gradient(180deg, #8a8a5c 0%, #5c5a3a 35%, #2a2a1c 62%);
    background-size: 100% 100%, auto; background-repeat: no-repeat; }

  footer.page { margin-top: 40px; text-align: center; color: var(--faint); font-size: 12px; }
  .banner { display: none; margin-bottom: 20px; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(245,181,68,.3); background: rgba(245,181,68,.07); color: #f3d79b; font-size: 13px; }

  @media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
  @media (max-width: 520px) {
    header { grid-template-columns: 1fr; }
    header .summary { justify-self: start; }
    .game { font-size: 32px; }
    .wrap { padding: 32px 16px 48px; }
    .brand { font-size: 26px; }
    .grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  }

  /* Tabs */
  .tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 24px; }
  .tab {
    font: 600 14px "Sora", sans-serif; color: var(--muted); background: none; border: 0; cursor: pointer;
    padding: 9px 18px; border-radius: 9px; transition: color .2s, background .2s;
  }
  .tab:hover { color: var(--text); }
  .tab[aria-selected="true"] { color: var(--text); background: #1b1f29; box-shadow: inset 0 0 0 1px #2a2f3a; }
  .tab:focus-visible { outline: 2px solid #4b5568; outline-offset: 2px; }
  .view[hidden] { display: none; }

  /* Hardware card */
  .t-orange { background: linear-gradient(155deg, #f7a24b 0%, #ec7a26 45%, #c8520f 100%); }
  .t-teal   { background: linear-gradient(155deg, #4fd1c5 0%, #1f9e94 45%, #0f6b66 100%); }
  .t-violet { background: linear-gradient(155deg, #a78bfa 0%, #7c5ce6 45%, #5135b8 100%); }
  .hw .title { padding-top: 56px; }
  .meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
  .meter .row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  .meter .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .meter .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meter .track { height: 6px; border-radius: 6px; background: var(--empty); margin-top: 8px; overflow: hidden; }
  .meter .track i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--up); transition: width .6s ease, background .3s; }
  .warn { color: var(--pending) !important; }
  .crit { color: var(--down) !important; }
  .hw .stats { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
  .net { font-size: 14px !important; }
  .net b { font-weight: 600; }
  .net span { color: var(--faint); margin: 0 2px; }

  @media (max-width: 520px) {
    .meters { gap: 10px; }
    .meter .v { font-size: 17px; }
    .tabs { width: 100%; }
    .tab { flex: 1; }
  }

  /* demo + incident banners, noscript */
  .demo-flag { display: none; margin-bottom: 18px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
    border: 1px dashed rgba(96,165,250,.5); background: rgba(96,165,250,.08); color: #bcd7fb; }
  .demo-flag.show { display: block; }
  .incident { display: none; margin-bottom: 18px; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.5;
    border: 1px solid rgba(245,181,68,.35); background: rgba(245,181,68,.07); color: #f3d79b; }
  .incident.show { display: block; }
  .incident.danger { border-color: rgba(244,63,94,.45); background: rgba(244,63,94,.08); color: #fbc2cc; }
  .incident.info, .incident.primary { border-color: rgba(96,165,250,.45); background: rgba(96,165,250,.08); color: #bcd7fb; }
  .incident b { display: block; color: var(--text); margin-bottom: 2px; }
  .noscript { margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 14px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .stat.hidden { display: none; }
