@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --bg: #0d0a24;
  --text: #f6f3ff;
  --muted: #a99fd0;

  --pink: #ff4fa3;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --mint: #34d399;
  --red: #ff3b5c;

  --glass: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.1);
  --glass-line: rgba(255, 255, 255, 0.12);

  --taskbar-h: 54px;
  --head: "Outfit", system-ui, sans-serif;

  /* tactile feel */
  --spring: cubic-bezier(0.34, 1.7, 0.5, 1);
  --press: cubic-bezier(0.3, 0, 0.6, 1);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 5% -10%, rgba(139, 92, 246, 0.5), transparent 60%),
    radial-gradient(900px 650px at 105% 5%, rgba(255, 79, 163, 0.38), transparent 60%),
    radial-gradient(1000px 700px at 50% 115%, rgba(34, 211, 238, 0.32), transparent 60%),
    radial-gradient(700px 500px at 0% 80%, rgba(251, 191, 36, 0.14), transparent 60%),
    var(--bg);
}

button { font: inherit; color: inherit; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* keyboard users can jump past the desktop icons straight to the windows */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.windows:focus { outline: none; }

#bubbles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ================= OS shell ================= */
.os {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--taskbar-h);
  grid-template-columns: minmax(0, 1fr);
}

.desktop { position: relative; overflow: hidden; }

.icons {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 14px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 100px);
  grid-auto-columns: 100px;
  gap: 4px 6px;
  align-content: start;
}
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  cursor: pointer;
}
.desk-icon:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--glass-line); }
.desk-icon-img svg {
  width: 52px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s var(--spring);
}
.desk-icon-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ================= windows ================= */
.windows { position: absolute; inset: 0; pointer-events: none; }

.window {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(20, 13, 52, 0.9);
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}
.window:focus { outline: none; }
.window:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.window.active {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(139, 92, 246, 0.35), 0 0 40px -10px rgba(139, 92, 246, 0.5);
}
.window.dragging { user-select: none; }
.window.maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}
.window[hidden] { display: none; }

/* resize from any edge or corner (os.js) */
.resize-grip { position: absolute; z-index: 5; touch-action: none; }
.resize-grip.n, .resize-grip.s { left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.resize-grip.e, .resize-grip.w { top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.resize-grip.n { top: 0; }
.resize-grip.s { bottom: 0; }
.resize-grip.e { right: 0; }
.resize-grip.w { left: 0; }
.resize-grip.ne, .resize-grip.nw, .resize-grip.se, .resize-grip.sw { width: 14px; height: 14px; }
.resize-grip.ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-grip.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.resize-grip.nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-grip.se { bottom: 0; right: 0; cursor: nwse-resize; }
.window.maximized .resize-grip { display: none; }
.window.resizing { user-select: none; }
.window.resizing .win-body { pointer-events: none; }
.window.opening    { animation: win-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.window.minimizing { animation: win-min 0.26s ease-in forwards; }
.window.closing    { animation: win-out 0.18s ease-in forwards; pointer-events: none; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  flex-shrink: 0;
  padding: 0 6px 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.window.active .titlebar {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.32), rgba(255, 79, 163, 0.2) 60%, rgba(34, 211, 238, 0.14));
}
.window.dragging .titlebar { cursor: grabbing; }
.win-icon svg { width: 22px; height: 22px; display: block; }
.win-title {
  flex: 1;
  min-width: 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.window.active .win-title { color: var(--text); }
.win-controls { display: flex; gap: 2px; }
.win-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.win-btn:hover { background: var(--glass-hover); color: var(--text); }
.win-btn.close:hover { background: var(--red); color: #fff; }

.win-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* ================= credit ================= */
.credit {
  position: absolute;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  margin: 0;
  max-width: calc(100% - 32px);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.credit a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.credit a:hover { color: var(--pink); border-color: var(--pink); }

/* ================= taskbar ================= */
.taskbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px env(safe-area-inset-bottom);
  background: rgba(13, 10, 36, 0.8);
  border-top: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 4px 16px -4px rgba(255, 79, 163, 0.7);
}
.brand-logo { width: 28px; height: 28px; display: block; }
.task-list {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.task-list::-webkit-scrollbar { display: none; }
.task {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  max-width: 190px;
  padding: 6px 12px 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.task:hover { background: var(--glass-hover); }
.task.active { background: rgba(139, 92, 246, 0.32); border-color: rgba(139, 92, 246, 0.8); }
.task-icon svg { width: 20px; height: 20px; display: block; }
.task-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.close-popups {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 2px solid #ffd400;
  border-radius: 10px;
  background: #c40000;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  animation: cta-pulse 1.1s ease-in-out infinite;
}
.close-popups[hidden] { display: none; }
.sound-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
}
.sound-toggle svg { width: 20px; height: 20px; display: block; }
.sound-toggle:hover { background: var(--glass-hover); }
.sound-toggle:active { scale: 0.88; }
.sound-toggle.muted { color: var(--muted); }
.clock {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

/* ================= German Wiener ================= */
.wiener {
  --t: 14px;
  position: relative;
  height: var(--t);
  min-width: var(--t);
  border-radius: 999px;
  background: linear-gradient(180deg, #f0a27a 0%, #cf6d40 30%, #a84b26 70%, #6f2c14 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 4px 10px -3px rgba(0, 0, 0, 0.55);
}
.wiener::before {
  content: "";
  position: absolute;
  left: calc(var(--t) * 0.55);
  right: calc(var(--t) * 0.55);
  top: 17%;
  height: 15%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}
.wiener::after {
  content: "";
  position: absolute;
  inset: 12% 0;
  background:
    linear-gradient(90deg, transparent calc(var(--t) * 0.3), rgba(80, 25, 8, 0.55) calc(var(--t) * 0.3), rgba(80, 25, 8, 0.55) calc(var(--t) * 0.3 + 2px), transparent calc(var(--t) * 0.3 + 2px)),
    linear-gradient(270deg, transparent calc(var(--t) * 0.3), rgba(80, 25, 8, 0.55) calc(var(--t) * 0.3), rgba(80, 25, 8, 0.55) calc(var(--t) * 0.3 + 2px), transparent calc(var(--t) * 0.3 + 2px));
}
.wiener.critical {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(255, 59, 92, 0.6);
}
.grow { animation: grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both; }
.mini-track { width: 100%; display: flex; align-items: center; min-height: 18px; }

/* ================= pig ================= */
.pig { position: relative; aspect-ratio: 200 / 196; flex-shrink: 0; }
.pig svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pig .ink { stroke: #5a2338; }
.pig .ink-fill { fill: #5a2338; }
.pig-tag {
  position: absolute;
  left: 50%;
  top: 70%;
  width: 27%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  overflow: hidden;
  border: max(2px, calc(var(--pig-size) * 0.02)) solid var(--accent);
  background: #1c1446;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.pig-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: calc(var(--pig-size) * 0.1);
  color: #fff;
  background: linear-gradient(135deg, #3b2a7a, #1c1446);
}
.pig.gold .pig-tag   { border-color: #ffd23f; }
.pig.silver .pig-tag { border-color: #d7e1f0; }
.pig.bronze .pig-tag { border-color: #ec8f4e; }
.pig.critical { filter: drop-shadow(0 0 14px rgba(255, 59, 92, 0.55)); }
.pig.mood-happy svg { animation: hop 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.pig.mood-sad svg { animation: droop 3.4s ease-in-out infinite; transform-origin: 50% 100%; }

/* ================= medals ================= */
.gold   { --m1: #fff4b0; --m2: #ffd23f; --m3: #ff9a1f; --glow: rgba(255, 196, 40, 0.55); }
.silver { --m1: #ffffff; --m2: #c9d6ea; --m3: #8ea4c8; --glow: rgba(190, 210, 240, 0.45); }
.bronze { --m1: #ffd9b3; --m2: #ec8f4e; --m3: #a9531c; --glow: rgba(236, 143, 78, 0.5); }

/* ================= leaderboard ================= */
.lb { container-type: inline-size; padding: 20px 22px 26px; }
.lb-title {
  margin: 4px 0 30px;
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--pink), var(--amber), var(--cyan), var(--violet), var(--pink));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-flow 10s linear infinite;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* daily re-measure: date + countdown under the title, ▲/▼ since yesterday */
.lb-title:has(+ .lb-sub) { margin-bottom: 6px; }
.lb-sub {
  margin: 0 0 30px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-reload {
  padding: 2px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-hover);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.move {
  --move: #34d399;
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.5;
  vertical-align: middle;
  color: #06140e;
  background: var(--move);
  -webkit-text-fill-color: currentColor;
}
.move.down { --move: #ff6b81; color: #22050b; }
.rank { position: relative; }
.rank .move { position: absolute; right: -9px; bottom: -7px; margin: 0; box-shadow: 0 0 0 2px var(--glass-line); }
.place .move { margin-left: 5px; }

.hog-today { margin-top: 10px; display: grid; gap: 4px; font-size: 0.82rem; }
.hog-news { font-weight: 800; }
.hog-news.up { color: #34d399; }
.hog-news.down { color: #ff6b81; }

.podium {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: end;
}
.pos-1 { order: 2; margin-bottom: 22px; }
.pos-2 { order: 1; }
.pos-3 { order: 3; }

.podium-card {
  position: relative;
  padding: 2px;
  border-radius: 24px;
  background: conic-gradient(from var(--angle), var(--m1), var(--m2), var(--m3), var(--m2), var(--m1));
  animation:
    border-spin 5s linear infinite,
    glow 3.2s ease-in-out infinite,
    pop-in 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
  animation-delay: 0s, 0s, calc(var(--i) * 140ms);
  box-shadow: 0 0 28px -6px var(--glow), 0 24px 60px -24px var(--glow);
}
.podium-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--m2) 22%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(32, 20, 78, 0.96), rgba(14, 9, 38, 0.98));
  padding: 40px 14px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.pos-1 .podium-inner { padding: 54px 14px 28px; }
.podium-inner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-12deg);
  animation: shine 4.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.7s + 1s);
  pointer-events: none;
}
.place {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #2b1500;
  background: linear-gradient(135deg, var(--m1), var(--m2), var(--m3));
  box-shadow: 0 2px 12px -2px var(--glow);
}
.silver .place { color: #1d2433; }

.avatar-holder { position: relative; margin-bottom: 10px; }
.ring { position: relative; width: 92px; height: 92px; border-radius: 50%; padding: 4px; }
.pos-1 .ring { width: 116px; height: 116px; }
.ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--m1), var(--m3), var(--m2), var(--m1));
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 0 10px var(--glow));
}
.ring .avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #1b1145;
  font-size: 1.6rem;
}
.crown {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 50px;
  margin-left: -25px;
  filter: drop-shadow(0 4px 10px rgba(255, 190, 30, 0.6));
  animation: bob 2.6s ease-in-out infinite;
}
.sparkle {
  position: absolute;
  color: var(--m1);
  text-shadow: 0 0 8px var(--glow);
  pointer-events: none;
  animation: twinkle 2.4s ease-in-out infinite;
}
.pinfo { width: 100%; min-width: 0; }
.pname { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.pos-1 .pname { font-size: 1.3rem; }
.pheight {
  font-family: var(--head);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--m1), var(--m2) 55%, var(--m3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px var(--glow));
  font-variant-numeric: tabular-nums;
}
.pos-1 .pheight { font-size: 2.9rem; }
.pin { color: var(--muted); font-size: 0.85rem; }
.podium-inner .mini-track { margin-top: 10px; }

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.row {
  --accent: var(--violet);
  display: grid;
  grid-template-columns: 44px 50px minmax(0, 1fr) minmax(70px, 160px) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 18px 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  box-shadow: inset 4px 0 0 var(--accent);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  animation: rise 0.6s ease both;
  animation-delay: calc(450ms + var(--i) * 60ms);
}
.row:hover { background: var(--glass-hover); }
.rank {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #3b2a7a, #1c1446);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}
.row .avatar { border: 2px solid var(--accent); }
.name { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.height { text-align: right; white-space: nowrap; }
.height .ft { display: block; font-family: var(--head); font-size: 1.4rem; font-weight: 800; line-height: 1.15; }
.height .in { color: var(--muted); font-size: 0.8rem; }

/* critical: under the threshold gets Comic Sans */
.row.critical,
.podium-card.critical,
.hog-view.critical,
.window.critical-win {
  --head: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
}
.row.critical,
.podium-card.critical,
.hog-view.critical { font-family: var(--head); }

.row.critical {
  --accent: var(--red);
  background: rgba(255, 59, 92, 0.14);
  border-color: rgba(255, 59, 92, 0.5);
  animation: rise 0.6s ease both, crit-pulse 2.4s ease-in-out infinite;
  animation-delay: calc(450ms + var(--i) * 60ms), 1.2s;
}
.row.critical .name,
.row.critical .height .ft { color: var(--red); }
.podium-card.critical .pname { color: var(--red); }
.podium-card.critical .pheight {
  background: none;
  -webkit-text-fill-color: var(--red);
  color: var(--red);
}
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: 10px;
  vertical-align: middle;
}
.badge {
  --badge: var(--red);
  display: inline-block;
  padding: 0.5px 7.5px;
  border-radius: 999px;
  border: 1.5px solid var(--badge-border, transparent);
  background: var(--badge-bg, var(--badge));
  color: var(--badge-text, #fff);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--badge) 80%, transparent);
  -webkit-text-fill-color: var(--badge-text, #fff);
}
.badge.multi { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.badge.multi.own-text { text-shadow: none; }
.badge.shine {
  background-size: 200% 100%;
  animation: badge-shine 3.5s linear infinite;
}
@keyframes badge-shine { to { background-position: -200% 0; } }
.pname .badges { display: flex; justify-content: center; margin: 6px 0 0; }

@container (max-width: 640px) {
  .lb { padding: 16px 12px 20px; }
  .podium { grid-template-columns: 1fr; gap: 12px; padding-top: 20px; }
  .pos-1, .pos-2, .pos-3 { order: 0; margin-bottom: 0; }
  .podium-inner, .pos-1 .podium-inner {
    flex-direction: row;
    text-align: left;
    gap: 14px;
    padding: 16px 14px;
  }
  .pos-1 .podium-inner { padding-top: 28px; }
  .avatar-holder { margin: 0; flex-shrink: 0; }
  .ring { width: 72px; height: 72px; padding: 3px; }
  .pos-1 .ring { width: 86px; height: 86px; }
  .ring .avatar { border-width: 3px; font-size: 1.2rem; }
  .crown { width: 38px; margin-left: -19px; top: -26px; }
  .place { top: auto; bottom: 10px; left: auto; right: 10px; font-size: 0.72rem; }
  .pname, .pos-1 .pname { font-size: 1.05rem; padding-right: 40px; }
  .pheight { font-size: 1.9rem; }
  .pos-1 .pheight { font-size: 2.3rem; }
  .pname .badges { justify-content: flex-start; margin: 4px 0 0; }
  .podium-inner .mini-track { width: calc(100% - 44px); margin-top: 8px; }

  .row {
    grid-template-columns: 36px 42px minmax(0, 1fr) auto;
    grid-template-areas: "rank av name size" "rank av track size";
    row-gap: 6px;
    column-gap: 10px;
    padding: 10px 12px 10px 10px;
  }
  .row .rank { grid-area: rank; width: 36px; height: 36px; font-size: 0.95rem; border-radius: 11px; }
  .row .avatar { grid-area: av; width: 42px; height: 42px; font-size: 0.9rem; }
  .row .name { grid-area: name; font-size: 1rem; }
  .row .mini-track { grid-area: track; }
  .row .height { grid-area: size; }
  .height .ft { font-size: 1.2rem; }
  .row .badges { display: flex; margin: 4px 0 0; }
}

/* ================= hog window ================= */
.hog-view {
  container-type: inline-size;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
}
.hog-view:not(.gold, .silver, .bronze) {
  --m1: #ffd1e6; --m2: var(--pink); --m3: var(--amber); --glow: rgba(255, 79, 163, 0.45);
}
.hog-view.critical { --m1: #ff8fa3; --m2: var(--red); --m3: #b3123a; --glow: rgba(255, 59, 92, 0.5); }

.hog-top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pig-stage {
  position: relative;
  padding: 18px 14px 6px;
  border-radius: 20px;
  background: radial-gradient(70% 60% at 50% 45%, color-mix(in srgb, var(--m2) 28%, transparent), transparent 75%);
}
.hog-info { flex: 1; min-width: 200px; }
.rank-chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--glass-hover);
  border: 1px solid var(--glass-line);
}
.hog-view.gold .rank-chip,
.hog-view.silver .rank-chip,
.hog-view.bronze .rank-chip {
  border: none;
  color: #2b1500;
  background: linear-gradient(135deg, var(--m1), var(--m2), var(--m3));
  box-shadow: 0 2px 14px -2px var(--glow);
}
.hog-name {
  margin-top: 8px;
  font-family: var(--head);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.hog-view.critical .hog-name { color: var(--red); }
.hog-name .badges { display: flex; margin: 6px 0 0; }

/* live weight counter (hogs with `weight` in data.js, see weight.js) */
.live-weight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}
.pname .live-weight { justify-content: center; }
.hog-name .live-weight { font-size: 0.85rem; }
.lw-scale {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(251, 146, 60, 0.55);
  background: rgba(251, 146, 60, 0.14);
  color: #fdba74;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.lw-num { min-width: 6.2ch; text-align: right; }
.lw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: lw-live 1.2s ease-in-out infinite;
}
@keyframes lw-live { 50% { opacity: 0.25; } }
.live-weight.up .lw-scale { color: #fff; background: rgba(239, 68, 68, 0.45); }
.lw-ate {
  color: #fde68a;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.4s ease;
}
.lw-ate.show {
  opacity: 1;
  max-width: none;
  overflow: visible;
  animation: lw-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes lw-pop { from { transform: translateY(4px) scale(0.85); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lw-dot, .lw-ate.show { animation: none; }
}
@container (max-width: 640px) {
  .pname .live-weight { justify-content: flex-start; }
}
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.dim {
  padding: 8px 14px 10px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.dim-val {
  font-family: var(--head);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--m1), var(--m2) 55%, var(--m3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px var(--glow));
  font-variant-numeric: tabular-nums;
}
.dim-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.scene {
  padding: 12px 20px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line);
}
.scene-title {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ruler {
  position: relative;
  height: 28px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 8px;
}
.tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
}
.tick.half { height: 8px; }
.tick.major { height: 13px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.6); }
.tick-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.wiener-track {
  container-type: inline-size;
  min-height: 40px;
  padding: 8px 0;
  display: flex;
  align-items: center;
}
.scene-note { margin: 4px 0 0; text-align: center; font-size: 0.78rem; color: var(--muted); }

.hog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.behind { font-weight: 700; color: var(--muted); }
.share-btn {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 9px 16px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  box-shadow: 0 6px 20px -8px rgba(255, 79, 163, 0.8);
  cursor: pointer;
}
.share-btn:hover { filter: brightness(1.1); }

.hog-links {
  padding: 12px 20px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line);
}
.hog-links .scene-title { margin-bottom: 10px; }
.hog-bio { margin: 0; line-height: 1.5; color: var(--text); }
.hog-links-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hog-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  transition: background 0.15s, border-color 0.15s, translate 0.15s;
}
.hog-link:hover { background: var(--glass-hover); border-color: color-mix(in srgb, var(--m2) 60%, transparent); translate: 0 -1px; }
.hog-link:focus-visible { outline: 2px solid var(--m2); outline-offset: 2px; }
.hog-link-icon { display: inline-flex; width: 18px; height: 18px; flex: none; color: var(--m2); }
.hog-link-icon svg { width: 100%; height: 100%; }
.hog-link-label { overflow-wrap: anywhere; }

@container (max-width: 460px) {
  .hog-view { padding: 16px; }
  .hog-top { justify-content: center; text-align: center; }
  .hog-name .badges { justify-content: center; }
  .dim-val { font-size: 2rem; }
  .scene, .hog-links { padding: 10px 14px 12px; }
}

/* ================= games ================= */
.game { display: flex; flex-direction: column; height: 100%; }
.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--glass-line);
  font-variant-numeric: tabular-nums;
}
.game-best { color: var(--muted); font-weight: 700; }
.game-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
  user-select: none;
}
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: rgba(13, 10, 36, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.game-overlay[hidden] { display: none; }
.game-overlay h3 {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--pink), var(--amber), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.game-overlay p { margin: 0; max-width: 360px; color: var(--muted); line-height: 1.4; }
.game-overlay p.critical { font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive; color: var(--red); font-size: 1.1rem; }
.game-btn {
  margin-top: 6px;
  padding: 10px 26px;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  box-shadow: 0 6px 20px -8px rgba(255, 79, 163, 0.8);
  cursor: pointer;
}
.game-btn:hover { filter: brightness(1.1); }

/* ================= hotdog.exe ================= */
.hotdog-stage {
  position: relative;
  height: 100%;
  min-height: 200px;
  background: radial-gradient(70% 70% at 50% 45%, rgba(255, 79, 163, 0.22), transparent 70%);
}
.hotdog-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.hotdog-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

/* ================= readme / trash ================= */
.readme { padding: 22px 26px; line-height: 1.6; }
.readme h2 { margin: 0 0 10px; font-size: 1.6rem; font-weight: 900; color: var(--amber); }
.readme ul { padding-left: 20px; }
.muted { color: var(--muted); }
.trash {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 20px;
}
.trash svg { width: 72px; height: 72px; opacity: 0.8; }

/* ================= fake ads ================= */
.window.hogpop {
  border: 3px solid #c40000;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 3px #ffd400, 0 20px 50px -10px rgba(0, 0, 0, 0.7);
}
.window.hogpop.opening { animation: hp-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.window.hogpop .titlebar {
  background: repeating-linear-gradient(45deg, #ffd400 0 12px, #1a1a1a 12px 24px);
  border-bottom: 3px solid #c40000;
}
.window.hogpop .win-title {
  flex: 0 1 auto;
  margin-right: auto;
  padding: 1px 8px;
  border-radius: 4px;
  background: #c40000;
  color: #fff;
  font-family: "Bangers", cursive;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}
.window.hogpop .win-btn { background: #1a1a1a; color: #fff; }
.window.hogpop .win-btn:hover { background: #c40000; }

.hp-body {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 14px 16px 16px;
  text-align: center;
  font-weight: 700;
}
.hp-body.t-yellow { background: #fff36b; color: #c40000; }
.hp-body.t-lime   { background: #b6ff3b; color: #6a0090; }
.hp-body.t-red    { background: #ff2d2d; color: #fff; }
.hp-body.t-alert  { background: #fff; color: #1a1a1a; }
.hp-body.t-pink   { background: #ff8ae0; color: #2a0060; }

.hp-kicker {
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  animation: blink 0.9s steps(2, start) infinite;
}
.hp-title {
  margin: 0;
  font-family: "Bangers", cursive;
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}
.t-alert .hp-title { color: #c40000; }
.hp-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed currentColor;
}
.hp-art.art-progress { flex-direction: column; align-items: stretch; }
.hp-col { flex: 1; display: grid; gap: 4px; justify-items: start; }
.hp-col-label { font-family: "Bangers", cursive; font-size: 1rem; letter-spacing: 0.05em; color: #1a1a1a; }
.hp-col-w { width: 100%; height: 44px; display: flex; align-items: center; }
.hp-arrow { font-size: 1.6rem; color: #1a1a1a; }
.hp-scan { height: 16px; border-radius: 4px; background: #eee; border: 2px solid #1a1a1a; overflow: hidden; }
.hp-scan-fill { height: 100%; width: 0; background: repeating-linear-gradient(45deg, #22c55e 0 8px, #16a34a 8px 16px); animation: scan 2.2s linear infinite; }
.hp-scan-txt { font-size: 0.85rem; color: #c40000; }
.hp-copy { margin: 0; font-size: 0.95rem; line-height: 1.35; }
.hp-price { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.hp-price s { opacity: 0.7; font-size: 1.1rem; }
.hp-price strong {
  font-family: "Bangers", cursive;
  font-weight: 400;
  font-size: 2.8rem;
  line-height: 1;
  color: #c40000;
  text-shadow: 2px 2px 0 #ffd400, 4px 4px 0 rgba(0, 0, 0, 0.2);
}
.t-red .hp-price strong { color: #fff200; text-shadow: 2px 2px 0 #1a1a1a; }
.hp-timer { font-size: 0.9rem; }
.hp-timer b {
  padding: 1px 7px;
  border-radius: 4px;
  background: #1a1a1a;
  color: #ffe600;
  font-variant-numeric: tabular-nums;
}
.hp-cta {
  padding: 10px 12px;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  background: linear-gradient(180deg, #7dff6b, #22c55e);
  color: #1a1a1a;
  font-family: "Bangers", cursive;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 0 #1a1a1a;
  cursor: pointer;
  animation: cta-pulse 1.1s ease-in-out infinite;
}
.hp-cta:active { animation: none; transform: translateY(3px); box-shadow: 0 1px 0 #1a1a1a; }
.hp-no {
  justify-self: center;
  border: none;
  background: none;
  font-size: 0.78rem;
  text-decoration: underline;
  opacity: 0.7;
  cursor: pointer;
}
.hp-fine { margin: 0; font-size: 0.66rem; opacity: 0.8; }

/* more ad colour schemes */
.hp-body.t-blue   { background: #2f6bff; color: #fff; }
.hp-body.t-black  { background: #0b0b0b; color: #39ff14; }
.hp-body.t-orange { background: #ff9a1f; color: #3a0a00; }
.hp-body.t-white  { background: repeating-linear-gradient(-45deg, #fff 0 14px, #fff6d6 14px 28px); color: #111; }
.hp-body.t-purple { background: linear-gradient(160deg, #7b2ff7, #f107a3); color: #fff; }
.t-blue .hp-price strong, .t-purple .hp-price strong { color: #ffe600; text-shadow: 2px 2px 0 #1a1a1a; }
.t-black .hp-price strong { color: #39ff14; text-shadow: 0 0 12px #39ff14; }
.t-black .hp-title { text-shadow: 0 0 10px rgba(57, 255, 20, 0.6); }
.t-black .hp-art { background: rgba(57, 255, 20, 0.08); }
.t-blue .hp-art, .t-purple .hp-art { background: rgba(255, 255, 255, 0.85); color: #1a1a1a; }

/* more ad pictures */
.hp-scan-fill.stuck { width: 99%; animation: none; }
.hp-wheel-wrap { position: relative; width: 110px; height: 110px; }
.hp-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #1a1a1a;
  background: conic-gradient(#ff2d2d 0 60deg, #ffd400 0 120deg, #22c55e 0 180deg, #2f6bff 0 240deg, #ff4fa3 0 300deg, #ff9a1f 0 360deg);
  animation: spin 2.4s linear infinite;
}
.hp-wheel span {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -7px 0 0 -18px;
  width: 36px;
  font-size: 0.62rem;
  font-weight: 900;
  color: #1a1a1a;
  text-align: center;
  transform-origin: 18px 7px;
}
.hp-wheel-pin {
  position: absolute;
  top: -6px;
  left: 50%;
  margin-left: -9px;
  border: 9px solid transparent;
  border-top: 16px solid #1a1a1a;
  z-index: 1;
}
.hp-chart { display: flex; align-items: flex-end; gap: 6px; height: 70px; flex: 1; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; padding: 0 6px; }
.hp-chart span { flex: 1; background: linear-gradient(#39ff14, #16a34a); border-radius: 3px 3px 0 0; animation: bar-up 0.8s ease-out both; transform-origin: bottom; }
.hp-rocket { font-size: 2.2rem; animation: bob 1.4s ease-in-out infinite; }
.hp-coupon {
  display: grid;
  gap: 2px;
  padding: 8px 18px;
  border: 3px dashed #1a1a1a;
  border-radius: 10px;
  background: #fff;
  color: #c40000;
  transform: rotate(-3deg);
}
.hp-coupon strong { font-family: "Bangers", cursive; font-weight: 400; font-size: 2.2rem; line-height: 1; }
.hp-coupon span { font-size: 0.8rem; color: #1a1a1a; letter-spacing: 0.1em; }
.hp-art.art-stars { flex-direction: column; gap: 2px; }
.hp-stars { font-size: 2.2rem; color: #ffb800; letter-spacing: 4px; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25); animation: cta-pulse 1.2s ease-in-out infinite; }
.hp-stars-sub { font-size: 0.8rem; }
.hp-table { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 3px 10px; width: 100%; font-size: 0.85rem; text-align: center; }
.hp-table span:nth-child(3n + 1) { text-align: left; }
.hp-table span:nth-child(-n + 3) { font-weight: 900; border-bottom: 2px solid currentColor; }
.hp-art.art-meter { flex-direction: column; align-items: stretch; gap: 6px; }
.hp-meter { height: 18px; border-radius: 999px; border: 2px solid #1a1a1a; background: #eee; overflow: hidden; }
.hp-meter-fill { height: 100%; background: repeating-linear-gradient(45deg, #ff2d2d 0 8px, #c40000 8px 16px); animation: bar-grow 1.2s ease-out both; }
.hp-meter-label { font-size: 0.85rem; text-align: left; }
.hp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; width: 100%; }
.hp-shield { font-size: 3rem; line-height: 1; animation: cta-pulse 1.4s ease-in-out infinite; }

/* ================= AntiHog ================= */
.antihog {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 100%;
  padding: 22px;
  text-align: center;
}
.ah-shield svg { width: 96px; height: 96px; display: block; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); transition: transform 0.3s ease; }
.antihog.scanning .ah-shield svg { animation: cta-pulse 0.6s ease-in-out infinite; }
.antihog.on .ah-shield svg { filter: drop-shadow(0 0 22px rgba(34, 197, 94, 0.8)); }
.ah-title { margin: 0; font-size: 1.8rem; font-weight: 900; }
.ah-status { font-weight: 900; font-size: 1.1rem; color: var(--red); }
.antihog.on .ah-status { color: var(--mint); }
.antihog.scanning .ah-status { color: var(--amber); }
.ah-detail { color: var(--muted); min-height: 2.6em; max-width: 300px; }
.ah-bar { width: 100%; max-width: 280px; height: 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); overflow: hidden; }
.ah-bar[hidden] { display: none; }
.ah-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--cyan)); transition: width 0.35s ease; }
.ah-btn {
  margin-top: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  color: #04210f;
  background: linear-gradient(135deg, #7dff6b, var(--mint));
  box-shadow: 0 6px 20px -8px rgba(52, 211, 153, 0.9);
  cursor: pointer;
}
.ah-btn:disabled { opacity: 0.6; cursor: progress; }
.ah-off { border: none; background: none; color: var(--muted); font-size: 0.8rem; text-decoration: underline; cursor: pointer; }
.ah-off[hidden] { display: none; }

/* ================= HogGPT ================= */
.hoggpt { display: flex; flex-direction: column; height: 100%; min-height: 0; background: rgba(8, 6, 22, 0.35); }
.hg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--glass-line); }
.hg-model { font-weight: 800; font-size: 0.95rem; }
.hg-model::after { content: " ▾"; color: var(--muted); font-weight: 600; }
.hg-pro { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; color: #2a1600; background: linear-gradient(135deg, #ffe27a, var(--amber)); }
.hg-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hg-intro { margin: auto 0; display: grid; justify-items: center; gap: 10px; text-align: center; }
.hg-logo svg { width: 64px; height: 64px; display: block; filter: drop-shadow(0 6px 14px rgba(16, 163, 127, 0.45)); }
.hg-intro-title { margin: 0; font-size: 1.35rem; font-weight: 800; }
.hg-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; }
.hg-chip { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.hg-chip:hover { background: var(--glass-hover); }
.hg-msg { max-width: 85%; display: grid; gap: 6px; justify-items: start; }
.hg-msg.me { align-self: flex-end; justify-items: end; }
.hg-msg.bot { align-self: flex-start; }
.hg-text { padding: 9px 13px; border-radius: 16px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.hg-msg.me .hg-text { background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff; border-bottom-right-radius: 4px; }
.hg-msg.bot .hg-text { background: var(--glass); border: 1px solid var(--glass-line); border-bottom-left-radius: 4px; }
.hg-msg.bot .hg-text:empty { display: none; }
.hg-dots { color: var(--muted); font-style: italic; }
.hg-dots::after { content: "…"; display: inline-block; animation: hg-blink 1s steps(2) infinite; }
@keyframes hg-blink { 50% { opacity: 0.2; } }
.hg-act { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(16, 163, 127, 0.6); background: rgba(16, 163, 127, 0.15); color: #7ef0cc; font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.hg-form { display: flex; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); }
.hg-form:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.hg-input { flex: 1; min-width: 0; border: none; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.hg-input::placeholder { color: var(--muted); }
.hg-send { width: 34px; height: 34px; flex: none; border: none; border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 900; font-size: 1.1rem; cursor: pointer; }
.hg-send:disabled { opacity: 0.4; cursor: progress; }
.hg-foot { margin: 6px 12px 10px; text-align: center; font-size: 0.72rem; color: var(--muted); }

/* ================= tactile feel ================= */
/* Everything clickable springs: lifts on hover, squishes on press, bounces back on release.
   Uses the separate translate/scale properties so it never fights the entrance animations. */
button,
.desk-icon {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition:
    translate 0.35s var(--spring),
    scale 0.35s var(--spring),
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.25s ease,
    filter 0.15s ease;
}
button:active:not(:disabled),
.desk-icon:active {
  transition-duration: 0.07s;
  transition-timing-function: var(--press);
}

/* small controls */
.win-btn:active, .hoggy-x:active { scale: 0.82; }
.task:active, .close-popups:active { scale: 0.93; }
.brand { transition: scale 0.35s var(--spring); }
.brand:active { scale: 0.94; }

/* pill buttons */
.share-btn:active, .game-btn:active, .ah-btn:active:not(:disabled), .hoggy-btn:active { scale: 0.94; translate: 0 1px; }
.hp-no:active, .ah-off:active { scale: 0.92; }

/* big cards */
.row:active { scale: 0.985; translate: 0 1px; }
.podium-inner:active { scale: 0.97; }

/* desktop icons: press in, then bounce when the app launches */
.desk-icon:active { scale: 0.9; }
.desk-icon.launch .desk-icon-img svg { animation: icon-launch 0.5s var(--spring); }

/* Hoggy squishes like a stress toy */
.hoggy-pig { transform-origin: 50% 100%; }
.hoggy-pig:active { scale: 1.1 0.86; }

@media (hover: hover) {
  .desk-icon:hover .desk-icon-img svg { transform: translateY(-3px) scale(1.07); }
  .row:hover:not(:active) { translate: 0 -2px; box-shadow: inset 4px 0 0 var(--accent), 0 10px 24px -14px rgba(0, 0, 0, 0.8); }
  .task:hover:not(:active) { translate: 0 -1px; }
  .share-btn:hover:not(:active), .game-btn:hover:not(:active), .ah-btn:hover:not(:active):not(:disabled) {
    translate: 0 -2px;
    filter: brightness(1.12);
  }
  .share-btn:hover:not(:active) { box-shadow: 0 10px 26px -8px rgba(255, 79, 163, 0.9); }
  .game-btn:hover:not(:active) { box-shadow: 0 10px 26px -8px rgba(255, 79, 163, 0.9); }
  .ah-btn:hover:not(:active):not(:disabled) { box-shadow: 0 10px 26px -8px rgba(52, 211, 153, 1); }
  .hoggy-btn:hover:not(:active) { translate: 2px 0; }
  .win-btn:hover:not(:active) { scale: 1.08; }
  .hoggy-pig:hover:not(:active) { scale: 1.04; }
  .brand:hover:not(:active) { scale: 1.04; }
}

/* a soft light that follows the cursor across cards (feel.js sets --mx / --my) */
.row, .task, .desk-icon { position: relative; }
.row::before,
.podium-inner::before,
.task::before,
.desk-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.13), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .row:hover::before,
  .podium-inner:hover::before,
  .task:hover::before,
  .desk-icon:hover::before { opacity: 1; }
}

/* podium cards tilt toward the cursor */
.podium-inner {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--spring), scale 0.35s var(--spring);
}
.podium-inner.tilting { transition: transform 0.1s linear, scale 0.35s var(--spring); }

/* windows lift while you drag them and settle when you let go */
.window { transition: scale 0.3s var(--spring), box-shadow 0.25s ease; }
.window.dragging {
  scale: 1.015;
  box-shadow: 0 44px 110px -24px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(139, 92, 246, 0.45), 0 0 50px -10px rgba(139, 92, 246, 0.55);
}
.window.focus-pop { animation: focus-pop 0.28s var(--spring); }

/* ripple where you touch or click */
.touch-layer { position: fixed; inset: 0; z-index: 2000000; pointer-events: none; overflow: hidden; }
.touch-ring {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  animation: touch-ring 0.45s ease-out forwards;
}

@keyframes touch-ring { from { scale: 0.3; opacity: 1; } to { scale: 1.6; opacity: 0; } }
@keyframes icon-launch {
  0% { transform: scale(0.9); }
  40% { transform: translateY(-8px) scale(1.12); }
  100% { transform: none; }
}
@keyframes focus-pop { 0% { scale: 0.985; } 100% { scale: 1; } }

/* ================= animations ================= */
@keyframes win-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes win-min { to { opacity: 0; transform: translateY(60%) scale(0.4); } }
@keyframes win-out { to { opacity: 0; transform: scale(0.92); } }
@keyframes hp-in {
  0%   { opacity: 0; transform: scale(0.3) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.06) rotate(2deg); }
  80%  { transform: scale(0.98) rotate(-1deg); }
  100% { transform: none; }
}
@keyframes grow {
  from { clip-path: inset(-20px 100% -20px -20px); }
  to   { clip-path: inset(-20px -20px -20px -20px); }
}
@keyframes border-spin { to { --angle: 360deg; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes title-flow { to { background-position: 300% 0; } }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 24px -8px var(--glow), 0 24px 60px -26px var(--glow); }
  50%      { box-shadow: 0 0 44px -4px var(--glow), 0 24px 70px -18px var(--glow); }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(30px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shine { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-6px) rotate(4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1) rotate(90deg); }
}
@keyframes crit-pulse {
  0%, 100% { box-shadow: inset 4px 0 0 var(--red), 0 0 0 0 rgba(255, 59, 92, 0); }
  50%      { box-shadow: inset 4px 0 0 var(--red), 0 0 22px -4px rgba(255, 59, 92, 0.6); }
}
@keyframes hop {
  0%, 70%, 100% { transform: translateY(0) scale(1, 1); }
  78% { transform: translateY(0) scale(1.04, 0.95); }
  86% { transform: translateY(-8%) scale(0.98, 1.03); }
  94% { transform: translateY(0) scale(1.02, 0.98); }
}
@keyframes droop {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg) translateY(2%); }
}
@keyframes blink { to { visibility: hidden; } }
@keyframes cta-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes scan { from { width: 0; } to { width: 100%; } }
@keyframes bar-up { from { transform: scaleY(0); } }
@keyframes bar-grow { from { width: 0; } }

/* ================= Hoggy (assistant) ================= */
.hoggy {
  position: absolute;
  right: 18px;
  bottom: 8px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  transform: translateY(130%);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.hoggy.arrived { transform: none; }
.hoggy.arrived.napping { transform: translateY(62%); }
.hoggy.arrived.napping.scared { transform: translateY(48%); }

.hoggy-pig {
  position: relative;
  width: 110px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.hoggy-pig:focus-visible { outline-offset: -4px; border-radius: 20px; }
.hg-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 100%;
  animation: hg-bob 3.2s ease-in-out infinite;
  transition: filter 0.3s ease;
}
.hoggy-pig:hover .hg-svg { animation-duration: 1.4s; }

/* parts that move */
.hg-arm, .hg-ear, .hg-eyes-calm, .hg-pupils { transform-box: view-box; transition: transform 0.25s ease; }
.hg-arm-l { transform-origin: 39px 98px; }
.hg-arm-r { transform-origin: 101px 98px; }
.hg-ear-l { transform-origin: 54px 28px; }
.hg-ear-r { transform-origin: 86px 28px; }
.hg-eyes-calm { transform-origin: 70px 45px; animation: hg-blink 4.6s infinite; }
.hoggy.waving .hg-arm-r { animation: hg-wave 0.5s ease-in-out 3; }

.hg-eyes-scared, .hg-eyes-sleep, .hg-mouth-scared, .hg-sweat { display: none; }

/* napping */
.hoggy.napping .hg-eyes-calm { display: none; }
.hoggy.napping .hg-eyes-sleep { display: inline; }
.hoggy-zzz {
  position: absolute;
  top: -6px;
  right: 2px;
  display: none;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  animation: hg-zzz 2.4s ease-in-out infinite;
}
.hoggy.napping:not(.scared) .hoggy-zzz { display: block; }

/* scared of ads */
.hoggy.scared .hg-eyes-calm,
.hoggy.scared .hg-eyes-sleep,
.hoggy.scared .hg-mouth-calm { display: none; }
.hoggy.scared .hg-eyes-scared,
.hoggy.scared .hg-mouth-scared,
.hoggy.scared .hg-sweat { display: inline; }
.hoggy.scared .hg-svg {
  animation: hg-shiver 0.14s linear infinite;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)) saturate(0.55) brightness(1.08);
}
.hoggy.scared .hg-arm-l { transform: rotate(100deg); }
.hoggy.scared .hg-arm-r { transform: rotate(-100deg); animation: none; }
.hoggy.scared .hg-ear-l { transform: rotate(-28deg); }
.hoggy.scared .hg-ear-r { transform: rotate(28deg); }
.hoggy.scared .hg-pupils { animation: hg-dart 0.9s steps(1) infinite; }
.hoggy.scared .hg-sweat { animation: hg-drip 0.9s ease-in infinite; }
.hoggy.panic .hg-svg { animation-duration: 0.08s; }
.hoggy.panic .hg-arm-l { transform: rotate(125deg); }
.hoggy.panic .hg-arm-r { transform: rotate(-125deg); }

/* speech bubble */
.hoggy-bubble {
  position: relative;
  width: 270px;
  max-width: calc(100vw - 32px);
  margin: 0 18px 8px 0;
  padding: 14px 16px 14px;
  border-radius: 16px;
  background: #fff7fb;
  color: #2a1640;
  border: 2px solid #f9a8c9;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  transform-origin: 85% 100%;
}
.hoggy-bubble[hidden] { display: none; }
.hoggy-bubble.pop { animation: hg-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.hoggy-bubble::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -10px;
  width: 16px;
  height: 16px;
  background: #fff7fb;
  border-right: 2px solid #f9a8c9;
  border-bottom: 2px solid #f9a8c9;
  transform: rotate(45deg);
}
.hoggy.scared .hoggy-bubble { border-color: #ff3b5c; }
.hoggy.scared .hoggy-bubble::after { border-color: #ff3b5c; }
.hoggy.scared .hoggy-text { font-weight: 800; color: #b3123a; }
.hoggy-text {
  margin: 0 18px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}
.hoggy-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: #8a6f9e;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.hoggy-x:hover { background: #fde3ee; color: #2a1640; }
.hoggy-actions { display: flex; flex-direction: column; gap: 6px; }
.hoggy-actions:not(:empty) { margin-top: 12px; }
.hoggy-btn {
  padding: 7px 12px;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  background: #f5edff;
  color: #4c1d95;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.hoggy-btn:hover { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.hoggy.scared .hoggy-btn:first-child { background: #c40000; border-color: #c40000; color: #fff; }

@keyframes hg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hg-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes hg-wave { 0%, 100% { transform: rotate(-110deg); } 50% { transform: rotate(-150deg); } }
@keyframes hg-shiver {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 0.5px); }
  50% { transform: translate(1.5px, -0.5px); }
  75% { transform: translate(-1px, -0.5px); }
}
@keyframes hg-dart {
  0% { transform: translate(-3px, 0); }
  33% { transform: translate(3px, 1px); }
  66% { transform: translate(0, -2px); }
}
@keyframes hg-drip { from { transform: translateY(-2px); opacity: 1; } to { transform: translateY(6px); opacity: 0.2; } }
@keyframes hg-pop { from { opacity: 0; transform: translateY(8px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes hg-zzz { 0%, 100% { opacity: 0.4; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-5px); } }

/* ================= start menu ================= */
.brand { border: none; cursor: pointer; font-size: 1rem; }
.brand[aria-expanded="true"] {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 4px 22px -2px rgba(255, 79, 163, 0.9);
}

.start-menu {
  position: absolute;
  left: 10px;
  bottom: calc(var(--taskbar-h) + 10px);
  z-index: 1500000;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - var(--taskbar-h) - 24px);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(20, 13, 52, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 34px 90px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(139, 92, 246, 0.3), 0 0 50px -12px rgba(255, 79, 163, 0.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  transform-origin: 10% 100%;
  animation: sm-in 0.32s var(--spring);
}
.start-menu[hidden] { display: none; }
.start-menu.closing { animation: sm-out 0.16s ease-in forwards; pointer-events: none; }

.sm-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 14px 4px;
  padding: 0 14px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-line);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}
.sm-search:focus-within {
  border-color: rgba(139, 92, 246, 0.9);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.sm-search-icon svg { width: 18px; height: 18px; display: block; color: var(--muted); }
.sm-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.sm-search-input::placeholder { color: var(--muted); }
.sm-search-input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }

.sm-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 14px 10px; }
.sm-section { margin-top: 12px; }
.sm-heading {
  margin: 0 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sm-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sm-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  cursor: pointer;
}
.sm-app-icon svg { width: 38px; height: 38px; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)); transition: transform 0.3s var(--spring); }
.sm-app-label { font-size: 0.75rem; font-weight: 600; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.sm-app:active { scale: 0.9; }

.sm-list { display: grid; gap: 2px; }
.sm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.sm-row:active { scale: 0.98; }
.sm-rank { width: 30px; flex-shrink: 0; font-family: var(--head); font-weight: 800; font-size: 0.85rem; color: var(--muted); }
.sm-avatar { width: 34px; height: 34px; flex-shrink: 0; font-size: 0.75rem; }
.sm-row-icon svg { width: 30px; height: 30px; display: block; }
.sm-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-row-name { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-row-sub { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-row-len { font-family: var(--head); font-weight: 800; font-size: 1rem; }
.sm-row.critical .sm-row-name, .sm-row.critical .sm-row-len { color: var(--red); }

.sm-app:focus-visible, .sm-row:focus-visible, .sm-more:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

.sm-more {
  display: block;
  margin: 6px 0 0 auto;
  padding: 6px 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: #c4b5fd;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.sm-more:active { scale: 0.95; }

.sm-empty { display: grid; gap: 4px; padding: 28px 10px; text-align: center; }
.sm-empty span { color: var(--muted); font-size: 0.85rem; }

.sm-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}
.sm-foot-gap { flex: 1; }
.sm-foot-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.sm-foot-btn.restart, .sm-foot-btn.power { padding: 7px 10px; }
/* restart / shut down are icon-only; their labels stay for screen readers */
.sm-foot-btn.restart span:last-child, .sm-foot-btn.power span:last-child {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.sm-foot-icon svg { width: 22px; height: 22px; display: block; }
.sm-foot-btn.ask .sm-foot-icon svg { width: 28px; height: 28px; }
.sm-foot-btn:active { scale: 0.92; }

@media (hover: hover) {
  .sm-app:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--glass-line); }
  .sm-app:hover .sm-app-icon svg { transform: translateY(-2px) scale(1.08); }
  .sm-row:hover { background: rgba(255, 255, 255, 0.08); }
  .sm-more:hover { background: rgba(139, 92, 246, 0.2); }
  .sm-foot-btn:hover { background: rgba(255, 255, 255, 0.08); }
  .sm-foot-btn.power:hover { background: var(--red); color: #fff; }
}

/* shut down screen */
.shutdown {
  position: fixed;
  inset: 0;
  z-index: 3000000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(800px 500px at 50% 40%, #2a1a66, #0d0a24 70%);
  animation: fade-in 0.4s ease;
}
.shutdown.off { background: #050310; }
.shutdown-logo svg { width: 96px; height: 96px; display: block; margin-bottom: 14px; animation: hg-bob 2s ease-in-out infinite; }
.shutdown.off .shutdown-logo svg { filter: grayscale(1) brightness(0.5); animation: none; }
.shutdown-msg { margin: 0; font-family: var(--head); font-size: 1.4rem; font-weight: 800; }
.shutdown-sub { margin: 0; color: var(--muted); }
.shutdown-sub:empty { display: none; }
.shutdown-on {
  margin-top: 18px;
  padding: 11px 24px;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  box-shadow: 0 6px 20px -8px rgba(255, 79, 163, 0.8);
  cursor: pointer;
}
.shutdown-on:active { scale: 0.94; }

/* ================= HOG DOWN crash screen (hogdown.js) ================= */
.hogdown {
  --hd-red: #ff3b5c;
  --hd-red-deep: #7a0019;
  position: fixed;
  inset: 0;
  z-index: 3000001;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #12020a;
  overflow: hidden;
}
.hd-flash {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 16px;
  font-family: "Bangers", var(--head);
  font-size: clamp(3rem, 14vw, 10rem);
  letter-spacing: 0.04em;
  text-align: center;
  animation: hd-strobe 0.8s steps(1) infinite; /* 2.5 flashes/s: under the 3/s seizure threshold */
}
.hd-flash-icon { font-size: 0.7em; }
@keyframes hd-strobe {
  0%, 50% { background: var(--hd-red); color: #fff; }
  25%, 75% { background: #12020a; color: var(--hd-red); }
}

.hogdown.dash { background: radial-gradient(900px 600px at 50% 0%, #4a0016, #12020a 70%); }
.hd-panel {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  animation: fade-in 0.3s ease;
}
.hd-bar {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--hd-red);
}
.hd-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: hd-blink 1s steps(1) infinite; }
@keyframes hd-blink { 50% { opacity: 0; } }
.hd-title {
  margin: 10px 0 0;
  font-family: "Bangers", var(--head);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--hd-red);
  text-shadow: 3px 3px 0 var(--hd-red-deep);
  animation: hd-shake 0.5s ease 2;
}
@keyframes hd-shake {
  20% { transform: translateX(-6px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.hd-stop { margin: 8px 0 0; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; color: #ffb3c1; overflow-wrap: anywhere; }
.hd-reason { margin: 10px 0 0; font-size: 1.15rem; font-weight: 700; }
.hd-sub { margin: 4px 0 0; color: #ffb3c1; }

.hd-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 12px;
  margin-top: 18px;
}
.hd-card {
  padding: 12px 14px 10px;
  border: 1px solid rgba(255, 59, 92, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  animation: sm-in 0.4s var(--spring) backwards;
  animation-delay: var(--d);
}
.hd-card-title { font-size: 0.8rem; font-weight: 700; color: #f6f3ff; }
.hd-card-note { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; color: #ffb3c1; }
.hd-card-value {
  margin-top: 4px;
  font-family: var(--head);
  font-size: 1.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hd-card.done .hd-card-value { color: var(--hd-red); }
.hd-plot {
  margin-top: 6px;
  height: 90px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  /* recessive grid at 25 / 50 / 75% */
  background: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), rgba(255, 255, 255, 0.08) calc(25% - 1px) 25%);
  overflow: hidden;
}
/* the line draws left to right by revealing the chart */
.hd-chart {
  display: block;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 0);
  animation: hd-draw 2.6s linear backwards;
  animation-delay: calc(var(--d) + 0.4s);
}
.hd-line { fill: none; stroke: var(--hd-red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hd-area { fill: rgba(255, 59, 92, 0.12); }
@keyframes hd-draw { from { clip-path: inset(0 100% 0 0); } }

.hd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.hd-count { margin: 0; font-weight: 800; font-size: 1.05rem; }
.hd-reboot {
  padding: 10px 22px;
  border: 2px solid var(--hd-red);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: transparent;
  cursor: pointer;
}
.hd-reboot:hover, .hd-reboot:focus-visible { background: var(--hd-red); }
.hd-reboot:active { scale: 0.94; }

.hd-ticker { flex: none; overflow: hidden; background: var(--hd-red); color: #fff; font-weight: 900; letter-spacing: 0.06em; white-space: nowrap; }
.hd-ticker-track { display: inline-flex; padding: 8px 0; animation: hd-ticker 28s linear infinite; }
.hd-ticker-track span { padding-right: 0.5em; }
@keyframes hd-ticker { to { transform: translateX(-50%); } }

.hogdown.booting {
  padding: 24px 16px;
  background: #000;
  font-family: ui-monospace, Consolas, monospace;
  color: #c8c8c8;
}
.hd-boot-title { color: #fff; font-weight: 700; }
.hd-boot { margin: 14px 0 0; font: inherit; white-space: pre-wrap; }
.hd-boot::after { content: "_"; animation: hd-blink 0.8s steps(1) infinite; }

@keyframes sm-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes sm-out { to { opacity: 0; transform: translateY(12px) scale(0.97); } }
@keyframes fade-in { from { opacity: 0; } }

/* ================= mobile ================= */
@media (max-width: 700px) {
  :root { --taskbar-h: 58px; }
  .icons {
    left: 10px;
    right: 10px;
    bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(4, 1fr);
  }
  .window,
  .window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .window.hogpop {
    left: 12px !important;
    top: 4% !important;
    width: calc(100% - 24px) !important;
    height: auto !important;
    max-height: 92%;
    margin-top: var(--jy, 0);
    margin-left: var(--jx, 0);
    border-radius: 6px;
    border: 3px solid #c40000;
  }
  .close-popups { padding: 6px 8px; font-size: 0.75rem; }
  .win-controls .max { display: none; }
  .resize-grip { display: none; }
  .titlebar { cursor: default; }
  .task { max-width: 140px; }
  .brand span { display: none; }
  .brand { padding: 5px; }
  .start-menu { left: 8px; right: 8px; width: auto; max-width: none; bottom: calc(var(--taskbar-h) + 8px); }
  .hoggy { right: 8px; bottom: 4px; }
  .hoggy-pig { width: 76px; }
  .hoggy-bubble { width: 250px; margin-right: 10px; }
  .hoggy-bubble::after { right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* the game canvas only takes focus so keys keep working; it doesn't need a ring */
.game-stage canvas:focus { outline: none; }

/* Windows High Contrast / forced colours: glass and gradients vanish, so give things real edges */
@media (forced-colors: active) {
  .window, .start-menu, .taskbar, .hoggy-bubble, .row, .podium-inner, .sm-row, .sm-app, .task, .desk-icon,
  .hp-cta, .hp-no, .game-btn, .ah-btn, .share-btn, .hoggy-btn, .hg-chip, .hg-act, .hg-form {
    border: 1px solid CanvasText;
  }
  .window.active .titlebar, .task.active { outline: 2px solid Highlight; }
  .badge { forced-color-adjust: none; }
  .hd-card, .hd-reboot { border: 1px solid CanvasText; }
  .hd-line { stroke: CanvasText; }
  .game-stage canvas:focus, .windows:focus { outline: 2px solid Highlight; }
}

/* text for search engines and screen readers only (src/worker.js puts the page's content here) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
