:root {
  color-scheme: dark;
  --background: #090d16;
  --surface: #111722;
  --surface-raised: #161e2b;
  --border: #242e3e;
  --text: #f4f7fb;
  --muted: #8c98ab;
  --accent: #8b7cff;
  --accent-bright: #aa9fff;
  --success: #48d6a0;
  --warning: #f4bb5f;
  --danger: #ff7885;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  display: flex;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgb(102 82 210 / 13%), transparent 38rem),
    var(--background);
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/images/dj0k3r-logo.png') center / min(620px, 72vw) no-repeat;
  content: "";
  opacity: 0.5;
}

#festival-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--festival-glow, transparent);
  content: "";
  pointer-events: none;
}

body[data-festival='snow'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(140 170 255 / 10%), transparent 40rem); }
body[data-festival='christmas'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(120 160 255 / 14%), transparent 42rem); }
body[data-festival='fireworks'] { --festival-glow: radial-gradient(circle at 50% 100%, rgb(255 190 90 / 12%), transparent 46rem); }
body[data-festival='lantern'] { --festival-glow: radial-gradient(circle at 50% 110%, rgb(229 57 53 / 16%), transparent 44rem); }
body[data-festival='hearts'] { --festival-glow: radial-gradient(circle at 50% 100%, rgb(255 93 143 / 14%), transparent 40rem); }
body[data-festival='eggs'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(180 220 160 / 12%), transparent 40rem); }
body[data-festival='shamrocks'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(63 174 99 / 14%), transparent 40rem); }
body[data-festival='confetti'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(139 124 255 / 12%), transparent 40rem); }
body[data-festival='national'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(229 56 59 / 14%), transparent 42rem); }
body[data-festival='balloons'] { --festival-glow: radial-gradient(circle at 50% 110%, rgb(142 202 230 / 14%), transparent 40rem); }
body[data-festival='ripples'] { --festival-glow: radial-gradient(circle at 50% 110%, rgb(77 212 194 / 12%), transparent 42rem); }
body[data-festival='stars'] { --festival-glow: radial-gradient(circle at 70% 10%, rgb(139 124 255 / 14%), transparent 44rem); }
body[data-festival='moon'] { --festival-glow: radial-gradient(circle at 80% 18%, rgb(255 226 150 / 16%), transparent 36rem); }
body[data-festival='bats'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(124 76 201 / 16%), transparent 44rem), radial-gradient(circle at 50% 115%, rgb(255 140 60 / 12%), transparent 34rem); }
body[data-festival='leaves'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(224 169 79 / 10%), transparent 42rem); }
body[data-festival='blossom'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(255 158 190 / 12%), transparent 40rem); }
body[data-festival='bubbles'] { --festival-glow: radial-gradient(circle at 50% 0%, rgb(90 200 255 / 12%), transparent 40rem); }
body[data-festival='fireflies'] { --festival-glow: radial-gradient(circle at 50% 110%, rgb(217 255 122 / 10%), transparent 40rem); }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgb(36 46 62 / 80%);
  background: rgb(9 13 22 / 84%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand strong { color: var(--accent-bright); font-weight: 650; }
.brand-image {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgb(86 66 190 / 28%));
}

.topbar-actions { display: flex; align-items: center; gap: 22px; }
.system-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgb(244 187 95 / 9%); }
.system-status.healthy .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgb(72 214 160 / 9%); }
.system-status.unhealthy .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgb(255 120 133 / 9%); }
.clock { display: grid; gap: 2px; text-align: right; }
.current-date { color: var(--muted); font-size: 11px; }
.current-time { color: #c7cfdb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-variant-numeric: tabular-nums; }

.launcher-main {
  display: grid;
  flex: 1;
  padding: 64px 24px;
  place-items: center;
}

.app-grid {
  display: grid;
  width: min(1080px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 230px;
  padding: 28px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, rgb(22 30 43 / 96%), rgb(14 20 30 / 96%));
  text-align: center;
  transition: transform 180ms, border-color 180ms;
}

.app-card::before { position: absolute; inset: 0 0 auto; height: 2px; background: var(--app-color, var(--accent)); content: ""; opacity: 0.85; }
.app-card:hover { transform: translateY(-3px); border-color: #39465a; }
.app-studio { --app-color: #9a86ff; }
.app-hub { --app-color: #4fd4c2; }
.app-dratip { --app-color: #f4ae68; }

.app-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--app-color) 30%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--app-color) 10%, transparent);
  color: var(--app-color);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-image {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  border-radius: 16px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgb(0 0 0 / 35%));
}

.app-card h2 { margin: 0 0 10px; font-size: 20px; font-weight: 640; letter-spacing: -0.025em; }
.app-card .badge { margin-bottom: 24px; }

.button {
  display: inline-flex;
  min-height: 42px;
  width: 100%;
  max-width: 220px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 150ms, transform 150ms;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.button-primary { background: var(--accent); color: #0d0b19; }
.button-primary:hover { background: var(--accent-bright); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 99px;
  background: rgb(140 152 171 / 8%);
  color: #a6b0bf;
  font-size: 10px;
  font-weight: 650;
  text-transform: capitalize;
}

.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.badge-online { background: rgb(72 214 160 / 9%); color: var(--success); }
.badge-degraded { background: rgb(244 187 95 / 9%); color: var(--warning); }
.badge-offline { background: rgb(255 120 133 / 9%); color: var(--danger); }
.badge-checking { color: var(--muted); }
.loading-card { grid-column: 1 / -1; padding: 52px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); text-align: center; font-size: 13px; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px max(24px, calc((100vw - 1180px) / 2));
  border-top: 1px solid rgb(36 46 62 / 80%);
  background: rgb(9 13 22 / 62%);
  color: #68758a;
  font-size: 12px;
}

.credit {
  padding: 2px 0;
  background: linear-gradient(90deg, #ff004c, #ff9900, #f2ff00, #00ff7b, #00b3ff, #8b00ff, #ff004c);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: #ff3860;
  -webkit-text-fill-color: transparent;
  font-weight: 750;
  letter-spacing: 0.02em;
  animation: credit-rgb 8s linear infinite;
}

@keyframes credit-rgb {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .credit { animation: none; }
  #festival-canvas { display: none; }
}

@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; max-width: 470px; }
  .app-card { min-height: 190px; }
}

@media (max-width: 640px) {
  .topbar { min-height: 64px; padding-inline: 14px; }
  .brand { font-size: 15px; }
  .brand-image { width: 32px; height: 32px; }
  .topbar-actions { gap: 14px; }
  .system-status { display: none; }
  .current-time { font-size: 12px; }
  .launcher-main { padding: 32px 14px; }
  .app-card { padding: 24px 20px; }
  .footer { padding: 18px 14px; flex-direction: column; gap: 8px; text-align: center; }
}
