/* The Nibbles look (25 Nov 2026) - 369games.gg is the Nibbles site. Wisse: "Deadrooms menu style having nibbles play in
   the background, id also like a fullscreen button", "we can also lose the backrooms vibe", "i think id like an old tv style
   around nibbles screen. like one of those tvs that still had thick glass", "it needs to be extremely good".
   A dark room lit by one old TV: Nibbles is on it, live. The DeadRooms menu's glow buttons stay (site.css .btn), in
   crayon colours. Loaded after site.css / pet.css / age_gate.css; body.nib re-colours what those draw.
   assets/nibbles_home.js runs the menu, the panels, the fullscreen button and the TV's light (live / off air). */

.nib {
  --nib-bg: #0d0b14;
  --nib-bg-2: #141020;
  --nib-panel: rgba(21, 16, 33, .9);
  --nib-panel-solid: #161124;
  --nib-line: #2d2545;
  --nib-line-hi: #463a6a;
  --nib-text: #f3efff;
  --nib-muted: #a9a0c6;
  --nib-dim: #6f6690;
  --nib-slime: #9fe870;      /* zombie green - live, the main buttons */
  --nib-brain: #ff8fb5;      /* brain pink - gifts */
  --nib-lilac: #a98bff;      /* the menu */
  --nib-gold: #ffd166;       /* the fund */
  --nib-sky: #7cc8ff;        /* fullscreen, links in the chat */
  --nib-live: #ff4d5e;
  --nib-plastic-1: #47346b;  /* the TV */
  --nib-plastic-2: #2b2045;
  --nib-plastic-3: #1d152f;
  --nib-display: ui-rounded, "Arial Rounded MT Bold", "Segoe UI Black", "Arial Black", system-ui, sans-serif;
  --nib-mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  /* what site.css / pet.css / age_gate.css draw with */
  --accent: var(--nib-slime);
  --accent-ink: #10200a;
  --mark: #5b3fb0;
  --dr-bg: var(--nib-bg);
  --dr-card: var(--nib-panel-solid);
  --dr-line: var(--nib-line);
  --dr-text: var(--nib-text);
  --dr-muted: var(--nib-muted);
  --dr-wall: var(--nib-lilac);
  --dr-wall-dark: var(--nib-line-hi);
  --btn-pick-ink: #10200a;
  --surface: var(--nib-panel-solid);
  --ink: var(--nib-text);
  --muted: var(--nib-muted);
  --line: var(--nib-line);

  color-scheme: dark;
  color: var(--nib-text);
  background-color: var(--nib-bg);
  background-image:
    radial-gradient(70% 55% at 50% 36%, rgba(104, 84, 190, .20), transparent 70%),
    radial-gradient(45% 35% at 8% 90%, rgba(159, 232, 112, .05), transparent 70%),
    linear-gradient(180deg, #100d1a, #0a0810 75%);
  background-attachment: fixed;
}
.nib a { color: var(--nib-slime); }
.nib .muted, .nib .section-head p { color: var(--nib-muted); }
.nib :focus-visible { outline-color: var(--nib-slime); }

/* ---------------------------------------------------------------- header and footer */
.nib .site-header { background: transparent; border-bottom: 0; position: relative; z-index: 20; }
.nib .brand { color: var(--nib-text); }
.nib .brand span { color: var(--nib-muted); }
.nib .nav .btn { --glow: var(--nib-lilac); }
.nib .nav .btn[aria-current="page"] { --glow: var(--nib-slime); }
.nib .site-footer { margin-top: 40px; border-top: 1px solid var(--nib-line); color: var(--nib-dim); }
.nib .site-footer a { color: var(--nib-muted); }
.nib .btn { color: #f6f2ff; }
.nib .btn.ghost { color: color-mix(in srgb, var(--glow), #fff 25%); }

/* ---------------------------------------------------------------- the home: title, menu, TV, chat */
.nib-home .pet-main { padding: 6px 0 0; }
.nib-home .pet-main > .wrap {
  max-width: 1720px; position: relative;
  display: grid; gap: 18px 28px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "tv" "menu" "chat" "note";
}
.nib-home .pet-game { display: contents; }        /* (its pieces become the page's own grid cells) */
.nib-home .pet-title { grid-area: title; display: block; margin: 0; }
.nib-home .pet-view { grid-area: tv; }
.nib-home .nib-menu { grid-area: menu; }
.nib-home .pet-chatbox { grid-area: chat; }
.nib-home .pet-ai-note { grid-area: note; }
.nib-home noscript { grid-area: tv; }

@media (min-width: 900px) {
  .nib-home .pet-main > .wrap {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 360px);
    grid-template-areas: "title chat" "tv chat" "menu chat" "note note";
  }
}
@media (min-width: 1200px) {
  .nib-home .pet-main > .wrap {
    grid-template-columns: clamp(232px, 17vw, 290px) minmax(0, 1fr) clamp(300px, 22vw, 380px);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "title tv chat" "menu tv chat" ". note note";
  }
  .nib-home .pet-chatbox { align-self: stretch; }
}

/* the title: a sticker on the wall */
.nib-kicker {
  margin: 0 0 2px; font: 700 .78rem/1.2 var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--nib-muted);
}
.nib-home .pet-title .dr-title, .nib .nib-title {
  display: inline-block; margin: 0 0 6px; transform: rotate(-3deg); transform-origin: 0 100%;
  font-family: var(--nib-display); font-weight: 900; font-stretch: normal; text-transform: uppercase;
  font-size: clamp(3rem, 5.2vw, 5.4rem); line-height: .95; letter-spacing: .01em;
  color: var(--nib-slime);
  text-shadow:
    3px 0 0 #1a1230, -3px 0 0 #1a1230, 0 3px 0 #1a1230, 0 -3px 0 #1a1230,
    2px 2px 0 #1a1230, -2px -2px 0 #1a1230, 2px -2px 0 #1a1230, -2px 2px 0 #1a1230,
    0 7px 0 #2c2048, 3px 8px 0 #2c2048, -3px 8px 0 #2c2048,
    0 12px 26px rgba(0, 0, 0, .55), 0 0 40px rgba(159, 232, 112, .22);
}
.nib-home .pet-title > p.muted { margin: 10px 0 0; max-width: 26em; font-size: 1rem; line-height: 1.5; }
@media (max-width: 899px) {
  .nib-home .pet-title { text-align: center; }
  .nib-home .pet-title .dr-title { transform: rotate(-2deg); transform-origin: 50% 100%; font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .nib-home .pet-title > p.muted { margin-inline: auto; font-size: .95rem; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .nib-home .pet-title { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 22px; }
  .nib-home .pet-title .nib-kicker { flex-basis: 100%; }
  .nib-home .pet-title > p.muted { margin: 0 0 8px; }
}

/* ON AIR / LIVE */
.nib-onair {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 4px 12px 4px 10px;
  border-radius: 999px; border: 1px solid var(--nib-line-hi); background: rgba(10, 8, 16, .6);
  font: 800 .78rem/1.2 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--nib-text);
}
.nib-onair .nib-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--nib-dim); flex: none; }
.nib-onair-off, .nib-onair-tune { display: none; }
.nib-live .nib-onair .nib-dot { background: var(--nib-live); box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: nib-beat 1.6s ease-out infinite; }
.nib-off .nib-onair-on, .nib-tuning .nib-onair-on { display: none; }
.nib-off .nib-onair-off, .nib-tuning .nib-onair-tune { display: inline; }
.nib-off .nib-onair { color: var(--nib-muted); }
@keyframes nib-beat { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .65); } 70% { box-shadow: 0 0 0 9px rgba(255, 77, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); } }

/* ---------------------------------------------------------------- the menu: the game's menu buttons, one crayon each */
.nib-menu { display: grid; gap: 10px; align-content: start; }
.nib-menu .btn.nib-go {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 14px; align-items: center; justify-content: stretch;
  gap: 2px 12px; padding: 10px 14px 10px 10px; text-align: left; font: inherit; font-weight: 800; border-radius: 10px;
}
.nib-go .nib-ico {
  grid-row: span 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px;
  background: color-mix(in srgb, var(--glow) 22%, rgba(0, 0, 0, .4)); color: var(--glow);
}
.nib-go .nib-ico svg, .nib-go .nib-ico img { width: 24px; height: 24px; display: block; }
.nib-go .nib-label { font-family: var(--nib-display); font-size: 1.08rem; line-height: 1.15; letter-spacing: .01em; }
.nib-go .nib-sub { grid-column: 2; font-size: .8rem; font-weight: 500; line-height: 1.25; color: color-mix(in srgb, var(--glow), #fff 55%); text-shadow: none; }
.nib-go::after { content: "\203A"; grid-column: 3; grid-row: 1 / span 2; font-size: 1.5rem; line-height: 1; opacity: .5; transition: transform .2s, opacity .2s; }
.nib-go:hover::after, .nib-go[aria-expanded="true"]::after { transform: translateX(3px); opacity: 1; }
.nib-go.first { padding-block: 14px; }
.nib-go.first .nib-label { font-size: 1.3rem; }
.nib-go[data-c="slime"] { --glow: var(--nib-slime); }
.nib-go[data-c="brain"] { --glow: var(--nib-brain); }
.nib-go[data-c="lilac"] { --glow: var(--nib-lilac); }
.nib-go[data-c="gold"] { --glow: var(--nib-gold); }
.nib-go[data-c="sky"] { --glow: var(--nib-sky); }
.nib-menu .btn[aria-expanded="true"]:not(:active) {   /* (its panel is open: picked, like the page you're on) */
  --see: 100%; --from: var(--glow); --to: color-mix(in srgb, var(--glow) 82%, #000);
  border-color: var(--glow); color: #120c1e; text-shadow: none;
}
.nib-menu .btn[aria-expanded="true"] .nib-sub { color: rgba(18, 12, 30, .75); }
.nib-menu .btn[aria-expanded="true"] .nib-ico { background: rgba(18, 12, 30, .18); color: #120c1e; }
@media (max-width: 1199px) {
  .nib-menu { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .nib-go.first { padding-block: 10px; }
  .nib-go.first .nib-label { font-size: 1.08rem; }
}
@media (max-width: 520px) {
  .nib-menu { grid-template-columns: 1fr 1fr; gap: 8px; }
  .nib-menu .btn.nib-go { grid-template-columns: 30px minmax(0, 1fr); padding: 8px 10px 8px 8px; gap: 0 8px; }
  .nib-go .nib-ico { width: 30px; height: 30px; }
  .nib-go .nib-ico svg, .nib-go .nib-ico img { width: 20px; height: 20px; }
  .nib-go .nib-sub { display: none; }
  .nib-go::after { display: none; }
  .nib-go .nib-ico { grid-row: auto; }
  .nib-go .nib-label { font-size: .98rem !important; }
}

/* ---------------------------------------------------------------- THE TV */
.nib-home .pet-view {
  --tv-pad: clamp(14px, 1.7vw, 26px);
  --tv-panel: clamp(78px, 7vw, 104px);
  position: relative; isolation: isolate; justify-self: center; width: 100%;
  margin: clamp(46px, 6vh, 64px) 0 26px;             /* (room for the antenna, the feet) */
  display: grid; gap: 14px 18px;
  grid-template-columns: minmax(0, 1fr) var(--tv-panel);
  grid-template-rows: auto auto;
  padding: var(--tv-pad) calc(var(--tv-pad) * .8) var(--tv-pad) var(--tv-pad);
  border-radius: 40px / 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 18%),
    linear-gradient(0deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 26%),
    radial-gradient(120% 90% at 20% 0%, var(--nib-plastic-1), var(--nib-plastic-2) 55%, var(--nib-plastic-3));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .22), inset 0 -4px 0 rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .07),
    inset 6px 0 14px -8px rgba(255, 255, 255, .12),
    0 34px 60px -18px rgba(0, 0, 0, .85), 0 12px 24px -8px rgba(0, 0, 0, .55);
}
@media (min-width: 1200px) {   /* (the whole TV fits the window: the picture's 4:3 decides its width) */
  .nib-home .pet-view { width: min(100%, calc((100vh - 316px) * 4 / 3 + var(--tv-panel) + 78px)); min-width: 560px; }
}
/* the light it throws on the wall */
.nib-home .pet-view::before {
  content: ""; position: absolute; z-index: -2; inset: -18% -14% -10%; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(135, 150, 255, .26), rgba(135, 150, 255, .08) 55%, transparent);
  filter: blur(26px); animation: tv-throw 5.5s ease-in-out infinite alternate;
}
/* its shadow on the floor */
.nib-home .pet-view::after {
  content: ""; position: absolute; z-index: -1; left: 6%; right: 6%; bottom: -34px; height: 30px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent); filter: blur(6px);
}
@keyframes tv-throw { 0% { opacity: .85; } 40% { opacity: 1; } 55% { opacity: .9; } 100% { opacity: 1; } }

/* the picture tube: a pillow of thick glass in a deep bezel */
.nib-home .pet-screen {
  grid-column: 1; grid-row: 1; aspect-ratio: 4 / 3; border: 0; outline: 0;
  border-radius: 9% / 12%;
  background: #06050a;
  box-shadow:
    0 0 0 3px #0c0914, 0 0 0 9px #1b1429, 0 0 0 10px rgba(255, 255, 255, .06),
    0 0 0 14px #120d1e, 0 2px 0 14px rgba(255, 255, 255, .06);
  margin: 12px;
}
.nib-home .pet-screen.backrooms { background: #06050a; }
.nib-home .pet-screen.backrooms::before, .nib-home .pet-screen.backrooms::after, .nib-home .pet-screen > .light { display: none; }
.nib-home .pet-screen canvas { border-radius: inherit; }
.nib-home .pet-screen.is-3d canvas { animation: tv-on .75s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes tv-on {
  0% { transform: scale(.7, .004); filter: brightness(6) saturate(0); }
  35% { transform: scale(1, .012); filter: brightness(5) saturate(0); }
  70% { transform: scale(1, 1); filter: brightness(1.8) saturate(.6); }
  100% { transform: none; filter: none; }
}
/* the glass over the picture: thick and curved - dark round the edge, a glare, faint lines, now and then a rolling bar */
.tv-glass {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit; overflow: hidden;
  background:
    radial-gradient(90% 70% at 28% 14%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 38%, transparent 52%),
    radial-gradient(60% 40% at 82% 92%, rgba(255, 255, 255, .05), transparent 60%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .13) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, transparent 56%, rgba(0, 0, 0, .58) 100%);
  box-shadow: inset 0 0 34px 8px rgba(0, 0, 0, .78), inset 0 0 6px 2px rgba(0, 0, 0, .9), inset 0 1px 0 1px rgba(255, 255, 255, .07);
}
.tv-glass::before {   /* the curve of the glass catching the light along the top */
  content: ""; position: absolute; left: 9%; right: 9%; top: 2.5%; height: 18%; border-radius: 50% / 100% 100% 0 0;
  border-top: 2px solid rgba(255, 255, 255, .13); filter: blur(1.5px);
}
.tv-glass::after {    /* the rolling bar */
  content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .035) 45%, rgba(255, 255, 255, .05) 50%, transparent);
  animation: tv-roll 9s linear infinite;
}
@keyframes tv-roll { 0%, 55% { transform: translateY(0); } 100% { transform: translateY(470%); } }
/* off air: snow */
.nib-off .tv-glass {
  background:
    radial-gradient(90% 70% at 28% 14%, rgba(255, 255, 255, .16), transparent 52%),
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .22) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .35) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, rgba(120, 120, 140, .28) 40%, rgba(0, 0, 0, .6) 100%);
  background-size: auto, 7px 9px, 5px 6px, auto, auto;
  animation: tv-snow .18s steps(3) infinite;
}
@keyframes tv-snow { 0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; } 33% { background-position: 0 0, 3px 5px, -2px 3px, 0 1px, 0 0; } 66% { background-position: 0 0, -4px 2px, 3px -2px, 0 2px, 0 0; } }

/* what the screen shows on top: the channel's on-screen text, the speech, the sound box, Moltbook */
.nib-home .pet-mood {
  top: 6.5%; left: 7%; right: auto; max-width: 62%;
  font: 700 clamp(.72rem, 1vw, .9rem)/1.3 var(--nib-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--nib-slime); text-shadow: 0 0 6px rgba(159, 232, 112, .65), 1px 1px 0 #000;
}
.nib-home .pet-mood::before { content: "CH 369 \25B8  "; opacity: .85; }
.nib-home .pet-overhead { color: #fff7dc; text-shadow: 0 2px 0 #000, 0 0 3px #000, 0 0 10px rgba(0, 0, 0, .8); font-weight: 800; }
.nib-home #pet-sound { top: 5.5% !important; right: 6% !important; }
.nib-home .molt-inset { top: 14% !important; right: 6% !important; border-radius: 8px; }
.nib-home #pet-subs { bottom: 7% !important; }
.nib-home .pet-offline {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(78%, 380px);
  margin: 0; padding: 14px 18px; text-align: center; border: 2px solid var(--nib-line-hi) !important; border-radius: 14px;
  background: rgba(8, 6, 14, .82); color: var(--nib-text); font-size: .95rem;
}
.nib-home .pet-offline strong { display: block; font: 900 1.15rem/1.2 var(--nib-display); color: var(--nib-text); letter-spacing: .04em; margin-bottom: 4px; }

/* the brain meter: the little display under the picture */
.nib-home .pet-brain {
  grid-column: 1; grid-row: 2; justify-self: center; margin: 0 0 2px; padding: 3px 14px; border-radius: 6px;
  background: #0b0812; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .08);
  font: 600 .74rem/1.4 var(--nib-mono); letter-spacing: .06em; color: #8fd96a; text-shadow: 0 0 5px rgba(143, 217, 106, .45);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nib-home .pet-view > p.fine:has(> a[href="gallery.html"]) { display: none; }   /* (the gallery is in the menu now) */

/* the control panel: maker's plate, knobs, speaker, the light, FULLSCREEN */
.tv-panel {
  grid-column: 2; grid-row: 1 / span 2; align-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 8px 12px; border-radius: 16px;
  background: linear-gradient(180deg, #2b2044, #1a1329);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 255, 255, .06), 0 1px 0 rgba(255, 255, 255, .08);
}
.tv-plate {
  font: 900 .78rem/1 var(--nib-display); letter-spacing: .14em; padding: 4px 8px 3px; border-radius: 4px;
  color: #241a38; background: linear-gradient(180deg, #f2eefa, #b9b2cb); box-shadow: 0 1px 0 rgba(255, 255, 255, .3), 0 2px 3px rgba(0, 0, 0, .5);
}
.tv-knob {
  position: relative; width: clamp(44px, 4.4vw, 62px); aspect-ratio: 1; border-radius: 50%; flex: none;
  background:
    repeating-conic-gradient(from 0deg, rgba(0, 0, 0, .28) 0 5deg, rgba(255, 255, 255, .05) 5deg 15deg),
    radial-gradient(circle at 34% 28%, #fbf9ff 0 3%, #d6d0e4 10%, #8e87a6 48%, #514a68 78%, #332d47);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .6), inset 0 -2px 3px rgba(0, 0, 0, .4), 0 0 0 4px #140f20, 0 0 0 5px rgba(255, 255, 255, .06);
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.tv-knob::after {     /* its pointer */
  content: ""; position: absolute; left: 50%; top: 9%; width: 3px; height: 30%; margin-left: -1.5px; border-radius: 2px;
  background: #241a38; box-shadow: 0 1px 0 rgba(255, 255, 255, .4);
}
.tv-knob.small { width: clamp(32px, 3.2vw, 44px); transform: rotate(-40deg); }
.pet-view:hover .tv-knob:not(.small) { transform: rotate(30deg); }
.tv-grille {
  width: 72%; flex: 1 1 auto; min-height: 36px; max-height: 120px; border-radius: 8px;
  background: repeating-linear-gradient(180deg, #0c0915 0 4px, rgba(255, 255, 255, .05) 4px 5px, transparent 5px 8px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7);
}
.tv-led {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: #3b3350; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6);
}
.nib-live .tv-led { background: #b8ff8a; box-shadow: 0 0 6px 2px rgba(159, 232, 112, .75), 0 0 16px rgba(159, 232, 112, .5); }
.nib-off .tv-led { background: #ff5d6c; box-shadow: 0 0 6px 2px rgba(255, 77, 94, .6); }
.nib-tuning .tv-led { background: #ffd166; box-shadow: 0 0 6px 2px rgba(255, 209, 102, .55); animation: nib-blink 1s steps(2) infinite; }
@keyframes nib-blink { 50% { opacity: .35; } }
.tv-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center;
  width: clamp(44px, 4.4vw, 58px); height: 40px; border-radius: 9px; color: #2a2040;
  background: linear-gradient(180deg, #f4efe2, #d3cab4); border-bottom: 4px solid #9d9378;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
  transition: transform .08s, border-bottom-width .08s, box-shadow .2s;
}
.tv-btn svg { width: 22px; height: 22px; }
.tv-btn:hover { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 14px rgba(124, 200, 255, .55); }
.tv-btn:active { transform: translateY(3px); border-bottom-width: 1px; }
.tv-btn:focus-visible { outline: 3px solid var(--nib-sky); outline-offset: 3px; }
.tv-label { font: 800 .58rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--nib-muted); margin-top: -6px; }

/* the antenna and the feet */
.tv-antenna { position: absolute; z-index: -1; left: 50%; top: 0; width: 64px; height: 18px; transform: translate(-50%, -14px); pointer-events: none; }
.tv-antenna::before {  /* its foot */
  content: ""; position: absolute; inset: 0; border-radius: 40px 40px 6px 6px;
  background: linear-gradient(180deg, #5b4a80, #2a1f42); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2);
}
.tv-antenna i {
  position: absolute; left: 50%; bottom: 10px; width: 4px; height: clamp(48px, 7vh, 78px); margin-left: -2px; border-radius: 2px;
  background: linear-gradient(90deg, #8c86a0, #efeaf8 45%, #8c86a0); transform-origin: 50% 100%; transform: rotate(-32deg);
}
.tv-antenna i + i { transform: rotate(26deg); height: clamp(42px, 6vh, 68px); }
.tv-antenna i::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #b9b2cb 55%, #6d6684);
}
.tv-feet { position: absolute; z-index: -1; left: 12%; right: 12%; bottom: -16px; height: 18px; pointer-events: none; }
.tv-feet i { position: absolute; bottom: 0; width: 15%; height: 100%; border-radius: 0 0 8px 8px; background: linear-gradient(180deg, #241a38, #120d1d); clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); }
.tv-feet i:first-child { left: 0; }
.tv-feet i + i { right: 0; }

/* a TV for a phone: the controls go under the picture */
@media (max-width: 699px) {
  .nib-home .pet-view {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
    border-radius: 28px / 26px; padding: 12px 12px 10px; gap: 8px; margin-top: 38px;
  }
  .nib-home .pet-screen { margin: 9px; }
  .nib-home .pet-brain { grid-row: 3; font-size: .66rem; }
  .tv-panel { grid-column: 1; grid-row: 2; flex-direction: row; padding: 8px 12px; gap: 10px; }
  .tv-grille { width: auto; height: 26px; min-height: 0; flex: 1 1 auto; background: repeating-linear-gradient(90deg, #0c0915 0 4px, rgba(255, 255, 255, .05) 4px 5px, transparent 5px 8px); }
  .tv-knob { width: 34px; } .tv-knob.small { width: 26px; }
  .tv-label { display: none; }
  .tv-btn { width: 46px; height: 34px; }
}

/* fullscreen: the picture fills the screen (the browser's fullscreen of the page where it can; a page cover where it
   can't, like iPhones); a Chat button lays the chat over its right side */
.tv-watchbar { display: none; position: absolute; z-index: 7; right: 18px; bottom: 18px; gap: 8px; }
.tv-watchbar button {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .55); color: #fff; font: 700 .9rem/1 var(--font);
}
.tv-watchbar button:hover { background: rgba(0, 0, 0, .75); border-color: #fff; }
.tv-watchbar button[aria-pressed="true"] { background: var(--nib-slime); border-color: var(--nib-slime); color: #10200a; }
.tv-watchbar svg { width: 16px; height: 16px; }
.nib-watch { overflow: hidden; }
.nib-watch .tv-watchbar { display: flex; }
.nib-watch .pet-view { isolation: auto; }
.nib-watch .pet-view::before, .nib-watch .pet-view::after { display: none; }
.nib-watch .pet-screen {
  position: fixed !important; inset: 0; z-index: 3000; margin: 0; width: auto; height: auto; aspect-ratio: auto;
  border-radius: 0; box-shadow: none; background: #000;
}
.nib-watch .tv-glass { border-radius: 0; }
.nib-watch .pet-chatbox { display: none; }
.nib-watch.nib-watch-chat .pet-chatbox {
  display: flex; position: fixed; z-index: 3001; top: 18px; right: 18px; bottom: 74px; width: min(360px, calc(100vw - 36px));
  max-height: none; min-height: 0; margin: 0; background: rgba(13, 10, 22, .8); backdrop-filter: blur(8px);
}
.nib-watch.nib-watch-chat .chat-log { flex: 1 1 0; height: auto; }

/* ---------------------------------------------------------------- the chat: down the right, like a broadcast's */
.nib-home .pet-chatbox {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 420px;
  background: var(--nib-panel); border: 1px solid var(--nib-line); border-radius: 20px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .05);
}
@media (min-width: 1200px) { .nib-home .pet-chatbox { margin-top: 0; max-height: calc(100vh - 96px); position: sticky; top: 12px; } }
.nib-chat-h {
  display: flex; align-items: center; gap: 8px; margin: 0; font: 900 1.05rem/1.2 var(--nib-display); letter-spacing: .03em;
}
.nib-chat-h::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nib-dim); }
.nib-live .nib-chat-h::before { background: var(--nib-live); animation: nib-beat 1.6s ease-out infinite; }
.nib-home .chat-tabs { gap: 6px; }
.nib-home .chat-filter { --glow: var(--nib-lilac); border-radius: 999px; padding: 3px 12px; font-size: .78rem; }
.nib-home .chat-log { flex: 1 1 0; height: auto; min-height: 200px; padding: 4px 4px; font-size: .93rem; scrollbar-width: thin; scrollbar-color: var(--nib-line-hi) transparent; }
@media (max-width: 899px) { .nib-home .chat-log { flex: none; height: 340px; } }
.nib-home .chat-log .line { padding: 3px 6px; border-radius: 8px; }
.nib-home .chat-log .game { color: var(--nib-muted); font-style: italic; }
.nib-home .chat-log .player .who { color: #d8ceff; }
.nib-home .chat-log .mine .who { color: var(--nib-brain); }
.nib-home .chat-log .pet .who { color: var(--nib-slime); }
.nib-home .chat-log .pet { background: rgba(159, 232, 112, .06); }
.nib-home .chat-log .to { color: var(--nib-sky); }
.nib-home .chat-log .to-me { background: rgba(255, 143, 181, .1); }
.nib-home .chat-log time { color: var(--nib-dim); }
.nib-home .chat-form { border-top: 1px solid var(--nib-line); padding-top: 10px; flex-wrap: wrap; }
.nib-home .chat-who { color: var(--nib-slime); font-size: .92rem; }
.nib-home .chat-form input {
  border: 1px solid var(--nib-line-hi); border-radius: 999px; padding: 8px 14px; background: rgba(0, 0, 0, .35); color: var(--nib-text);
}
.nib-home .chat-form input:focus { border-color: var(--nib-slime); box-shadow: 0 0 0 3px rgba(159, 232, 112, .15); }
.nib-home .chat-form .btn { --glow: var(--nib-slime); border-radius: 999px; }

/* ---------------------------------------------------------------- the panels the menu opens: Feed, Account, Fund */
.nib-home .pet-side, .nib-home .pet-fund {
  position: fixed; z-index: 60; left: 50%; bottom: 0; width: min(100%, 560px); max-height: 84vh; overflow: auto;
  margin: 0; padding: 18px 18px 22px; border-radius: 22px 22px 0 0;
  background: var(--nib-panel-solid); border: 1px solid var(--nib-line-hi); border-bottom: 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .65);
  transform: translate(-50%, 104%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s;
}
@media (min-width: 1200px) {     /* (beside the menu, over the TV's edge - the TV keeps playing) */
  .nib-home .pet-side, .nib-home .pet-fund {
    position: absolute; left: calc(clamp(232px, 17vw, 290px) + 40px); top: 4px; bottom: auto; width: 380px;
    max-height: calc(100vh - 110px); border-radius: 20px; border-bottom: 1px solid var(--nib-line-hi);
    transform: translateX(-16px); opacity: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .3);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s, visibility 0s .25s;
  }
}
.nib-home[data-panel="items"] .pet-side, .nib-home[data-panel="account"] .pet-side, .nib-home[data-panel="fund"] .pet-fund {
  visibility: visible; transform: translate(-50%, 0); opacity: 1; transition-delay: 0s;
}
@media (min-width: 1200px) {
  .nib-home[data-panel="items"] .pet-side, .nib-home[data-panel="account"] .pet-side, .nib-home[data-panel="fund"] .pet-fund { transform: none; }
}
.nib-home[data-panel="items"] .pet-side > :is(.pet-acct-head, .pet-tabs, .pet-panel) { display: none !important; }
.nib-home[data-panel="account"] .pet-side > :is(.pet-side-head, .pet-items) { display: none !important; }
.nib-home .pet-fund[hidden] { display: none; }
.nib-close {
  all: unset; box-sizing: border-box; position: sticky; float: right; top: 0; z-index: 2; margin: -6px -6px 0 8px; cursor: pointer;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; line-height: 1;
  color: var(--nib-muted); background: rgba(255, 255, 255, .06);
}
.nib-close:hover { color: var(--nib-text); background: rgba(255, 255, 255, .12); }
.nib-close:focus-visible { outline: 3px solid var(--nib-slime); outline-offset: 2px; }
.nib-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5, 3, 10, .55); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.nib-home[data-panel] .nib-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (min-width: 1200px) { .nib-home[data-panel] .nib-scrim { background: rgba(5, 3, 10, .25); } }

.nib-home .pet-side { gap: 12px; }
.nib-home .pet-side-head strong { font: 900 1.25rem/1.2 var(--nib-display); color: var(--nib-slime); }
.nib-home .pet-side .pet-items-head, .nib-home .pet-side .pet-acct-head { font: 900 1.25rem/1.2 var(--nib-display); letter-spacing: .02em; color: var(--nib-text); border: 0; padding: 0; margin: 0; }
.nib-home .pet-item { border-color: var(--nib-line); background: rgba(255, 255, 255, .025); border-radius: 10px; }
.nib-home .pet-give { border-top-color: var(--nib-line); padding-top: 14px; }
.nib-home .shop-give { --glow: var(--nib-brain); }
.nib-home .acct-form input, .nib-home .acct-lang select {
  background: #0b0912; border-color: var(--nib-line-hi); border-radius: 10px; padding: 9px 12px; color: var(--nib-text);
}
.nib-home .acct-form .btn { --glow: var(--nib-slime); }
.nib-home .acct-form .btn.ghost, .nib-home .acct-in .btn.ghost { --glow: var(--nib-lilac); }
.nib-home .acct-lang { border-top-color: var(--nib-line); }
.nib-home .pet-fund { display: grid; gap: 12px 14px; }
.nib-home .pet-fund-text strong { font: 900 1.25rem/1.2 var(--nib-display); color: var(--nib-gold); }
.nib-home .pet-bar { height: 14px; background: #0b0912; border-color: var(--nib-line-hi); }
.nib-home .pet-bar i { background: linear-gradient(90deg, var(--nib-slime), var(--nib-gold)); }
.nib-home .pet-donate { --glow: var(--nib-gold); }
.nib-home .pet-sol { border-top-color: var(--nib-line); }
.nib-home .pet-sol-row code { background: #0b0912; border-color: var(--nib-line-hi); }

/* the small print under the TV */
.nib-home .pet-ai-note { margin: 0; max-width: 72em; font-size: .8rem; line-height: 1.5; color: var(--nib-dim); }
.nib-home .pet-ai-note strong { color: var(--nib-muted); }

/* ---------------------------------------------------------------- the 18+ gate: a broadcast's warning slate */
.nib .age-gate.backrooms {
  background: radial-gradient(70% 55% at 50% 40%, rgba(104, 84, 190, .28), transparent 70%), linear-gradient(180deg, #100d1a, #07060b);
}
.nib .age-gate.backrooms::before, .nib .age-gate.backrooms::after, .nib .age-gate > .light { display: none; }
.nib .age-gate-card {
  overflow: hidden; padding: 34px 26px 20px; border: 2px solid var(--nib-line-hi); border-radius: 22px;
  background: linear-gradient(180deg, #1a1429, #120e1d); color: var(--nib-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .75), 0 0 0 6px rgba(0, 0, 0, .25), 0 0 90px rgba(104, 84, 190, .25);
}
.nib .age-gate-card::before {  /* the test card's colour bars */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: linear-gradient(90deg, #c9c9c9 0 14.28%, #d8cf35 0 28.57%, #3fc7c9 0 42.85%, #4fc443 0 57.14%, #c43fc0 0 71.42%, #d23c3c 0 85.71%, #3c46d2 0);
}
.nib .age-gate-card .kicker {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--nib-brain); color: #2a0b19;
  font-weight: 900; letter-spacing: .14em;
}
.nib .age-gate-title {
  font-family: var(--nib-display); font-weight: 900; font-stretch: normal; letter-spacing: .01em; line-height: 1;
  color: var(--nib-text); text-shadow: 0 3px 0 #000;
}
.nib .age-gate-text { color: var(--nib-muted); }
.nib .age-gate-row .btn { --glow: var(--nib-slime); border-radius: 10px; }
.nib .age-gate-row .btn.ghost { --glow: var(--nib-lilac); }

@media (prefers-reduced-motion: reduce) {
  .nib-home .pet-view::before, .tv-glass::after, .nib-off .tv-glass, .nib-live .nib-onair .nib-dot, .nib-live .nib-chat-h::before,
  .nib-tuning .tv-led, .nib-home .pet-screen.is-3d canvas { animation: none !important; }
  .tv-knob, .nib-home .pet-side, .nib-home .pet-fund { transition: none; }
}

/* ---------------------------------------------------------------- the other Nibbles pages (Characters, Town ...) */
.nib-page .nib-hero { padding: 56px 0 28px; }
.nib-page .nib-hero .lead { color: var(--nib-muted); max-width: 40em; font-size: clamp(1.05rem, 2vw, 1.25rem); margin-top: 14px; }
.nib-page main { min-height: 56vh; }

/* (no DeadRooms letters on Nibbles' pages: site.css gives .dr h2 the Backrooms' Impact) */
.nib h2, .nib h3 { font-family: var(--nib-display); font-weight: 900; font-stretch: normal; text-transform: none; letter-spacing: .01em; }
.nib h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.nib-home .site-header .wrap { max-width: 1720px; }
.nib-home .nib-chat-h { font-size: 1.05rem; }

/* ---------------------------------------------------------------- the TV's buttons under the picture: Brain, Finger, the
   brain meter's display, CC + sound (Wisse: "or like buttons on the TV, same with mute and subtitles") */
.tv-controls {
  grid-column: 1; grid-row: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  margin: 0 12px; padding: 8px 12px; border-radius: 14px;
  background: linear-gradient(180deg, #221934, #18112a);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(255, 255, 255, .07);
}
.tv-gifts { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; }
.nib-gifts-row { display: flex; gap: 8px; }
.nib-home .tv-gifts .btn.nib-gift {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; isolation: isolate;
  width: auto; min-width: 64px; height: 56px; padding: 4px 9px 3px; border-radius: 11px; cursor: pointer; touch-action: manipulation; user-select: none;
  color: #2a2040; text-shadow: none; font-weight: 800;
  background: linear-gradient(180deg, #f6f1e4, #d6cdb6); border: 0; border-bottom: 4px solid #9a8f73;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
  transition: transform .07s, border-bottom-width .07s, box-shadow .2s;
}
.nib-home .tv-gifts .btn.nib-gift::before { display: none; }
.nib-home .tv-gifts .nib-gift .gift-icon { width: 30px; height: 30px; }
.nib-home .tv-gifts .nib-gift .gift-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.nib-home .tv-gifts .nib-gift .gift-price { font: 800 .62rem/1 var(--font); color: #5a4f6e; letter-spacing: .02em; white-space: nowrap; }
.nib-home .tv-gifts .nib-gift:hover { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 16px rgba(255, 143, 181, .6); }
.nib-home .tv-gifts .nib-gift + .nib-gift:hover { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 16px rgba(255, 209, 102, .6); }
.nib-home .tv-gifts .nib-gift:active { transform: translateY(3px); border-bottom-width: 1px; }
.nib-home .tv-gifts .nib-gift[aria-disabled="true"] { filter: saturate(.55) brightness(.86); }
.nib-home .tv-gifts .nib-gift:focus-visible { outline: 3px solid var(--nib-brain); outline-offset: 3px; }
.nib-gifts-tokens {
  margin: 0; padding: 3px 8px; border-radius: 6px; background: #0b0812; white-space: nowrap;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8); font: 700 .72rem/1.3 var(--nib-mono); color: var(--nib-gold);
  text-shadow: 0 0 5px rgba(255, 209, 102, .4);
}
.nib-gifts-tokens::before {   /* (a Token: a little gold coin) */
  content: ""; display: inline-block; width: .7em; height: .7em; margin-right: 6px; vertical-align: -.05em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--nib-gold) 45%, #b8862b); box-shadow: 0 0 4px rgba(255, 209, 102, .6);
}
.nib-gifts-fine {   /* the small print: shows while you're on the buttons; it's always in the Feed panel too */
  position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 30; width: 300px; padding: 10px 12px; border-radius: 10px;
  background: rgba(10, 8, 16, .95); border: 1px solid var(--nib-line-hi); color: var(--nib-muted); font-size: .72rem; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s, transform .15s, visibility 0s .15s;
}
.tv-gifts:hover .nib-gifts-fine:not([hidden]), .tv-gifts:focus-within .nib-gifts-fine:not([hidden]) { opacity: 1; visibility: visible; transform: none; transition-delay: .25s, .25s, 0s; }
.nib-home .pet-side .gift-buttons { display: none; }   /* (the TV has them) */
.tv-lcd { display: flex; justify-content: center; min-width: 0; }
.nib-home .tv-lcd .pet-brain { margin: 0; }
.tv-sound { display: flex; justify-content: flex-end; }
.nib-home .tv-sound #pet-sound {
  position: static !important; background: transparent !important; padding: 0 !important; gap: 8px !important;
  color: var(--nib-text) !important; flex-wrap: wrap; justify-content: flex-end;
}
.nib-home .tv-sound #pet-sound > button {
  box-sizing: border-box !important; display: inline-grid !important; place-items: center !important; min-width: 40px; height: 34px !important;   /* (!important: pet_sound.js's inline all:unset; Wisse: "CC and mute can also go in the middle of the button") */
  padding: 0 9px !important; border-radius: 9px !important; cursor: pointer !important;
  border: 0 !important; border-bottom: 3px solid #0e0a17 !important;
  background: linear-gradient(180deg, #43355f, #2a2040) !important; color: #f3efff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .15) !important;
  font: 800 12px/1 var(--font) !important; letter-spacing: .06em;
}
.nib-home .tv-sound #pet-sound > button:active { transform: translateY(2px); border-bottom-width: 1px !important; }
.nib-home .tv-sound #pet-sound > button:focus-visible { outline: 3px solid var(--nib-lilac); outline-offset: 2px; }
.nib-home .tv-sound #pet-sound > button[aria-pressed="true"] { color: var(--nib-slime) !important; text-shadow: 0 0 6px rgba(159, 232, 112, .7); }
.nib-home .tv-sound #pet-sound input[type="range"] { width: 76px !important; accent-color: var(--nib-lilac) !important; }
.nib-home .tv-sound #pet-sound select { font: 600 12px var(--font); padding: 5px 6px; border-radius: 8px; background: #0b0912; color: var(--nib-text); border: 1px solid var(--nib-line-hi); max-width: 130px; }

@media (max-width: 699px) {
  .tv-controls { grid-row: 2; margin: 0 6px; grid-template-columns: auto minmax(0, 1fr); padding: 8px 10px; gap: 8px; }
  .tv-lcd { grid-column: 1 / -1; grid-row: 2; }
  .tv-panel { grid-row: 3; }
  .nib-home .tv-gifts .btn.nib-gift { min-width: 56px; height: 52px; padding-inline: 7px; }
  .nib-home .tv-sound #pet-sound { flex-wrap: nowrap; }
  .nib-gifts-fine { width: min(300px, 80vw); }
  .nib-home .tv-sound #pet-sound input[type="range"] { display: none; }
}

/* in fullscreen the TV's buttons float over the picture, bottom left */
.nib-watch .tv-controls {
  position: fixed; z-index: 3002; left: 18px; bottom: 18px; margin: 0; grid-template-columns: auto auto;
  background: rgba(10, 8, 16, .62); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .12);
}
.nib-watch .tv-lcd { display: none; }
.nib-watch #pet-subs { bottom: 96px !important; }
.nib-watch .nib-gifts-fine { bottom: calc(100% + 18px); }

/* the little display: a ticker, like an old VCR's (the brain meter's line runs through it) */
.nib-home .tv-lcd {
  position: relative; height: 26px; align-items: center; justify-content: flex-start; overflow: hidden; border-radius: 6px;
  background: #0b0812; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .07);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.nib-home .tv-lcd:not(:has(.pet-brain:not([hidden]))) { visibility: hidden; }
.nib-home .tv-lcd .pet-brain {
  display: inline-block; flex: none; width: auto; max-width: none; overflow: visible; text-overflow: clip;
  margin: 0; padding: 0 0 0 100%; background: none; box-shadow: none; border-radius: 0;
  animation: lcd-tick 26s linear infinite;
}
@keyframes lcd-tick { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .nib-home .tv-lcd .pet-brain { animation: none; padding-left: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
.nib-toast {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 31; margin: 0; padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  background: var(--nib-brain); color: #2a0b19; font: 800 .8rem/1.2 var(--font); box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(6px) scale(.96); pointer-events: none; transition: opacity .18s, transform .18s;
}
.nib-toast.on { opacity: 1; transform: none; }
.tv-gifts:has(.nib-toast.on) .nib-gifts-fine { opacity: 0 !important; visibility: hidden !important; }

/* ---------------------------------------------------------------- the title: where it was, on the top layer - in front of
   the TV where they meet (Wisse: "keep NIBBLES brand in front of the tv", "old position but first layer is what i meant") */
.nib-home .pet-title { position: relative; z-index: 45; }
.nib-home .pet-title > p.muted { font-size: 1.05rem; color: var(--nib-text); opacity: .85; }

/* ---------------------------------------------------------------- hiding the chat (Wisse: "also the option to hide chat
   completely"): its head's arrow hides it, the tab on the right edge brings it back; the TV takes the room */
.nib-chat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nib-chat-hide {
  all: unset; box-sizing: border-box; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  color: var(--nib-muted); background: rgba(255, 255, 255, .05);
}
.nib-chat-hide svg { width: 16px; height: 16px; }
.nib-chat-hide:hover { color: var(--nib-text); background: rgba(255, 255, 255, .1); }
.nib-chat-hide:focus-visible { outline: 3px solid var(--nib-lilac); outline-offset: 2px; }
.nib-chat-show {
  all: unset; box-sizing: border-box; cursor: pointer; position: fixed; z-index: 50; right: 0; top: 50%; transform: translateY(-50%);
  display: grid; justify-items: center; gap: 6px; padding: 12px 9px 12px 11px; border-radius: 14px 0 0 14px;
  background: var(--nib-panel-solid); border: 1px solid var(--nib-line-hi); border-right: 0; color: var(--nib-text);
  box-shadow: -8px 10px 30px rgba(0, 0, 0, .5); font: 800 .78rem/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
}
.nib-chat-show[hidden] { display: none; }
.nib-chat-show svg { width: 20px; height: 20px; color: var(--nib-slime); }
.nib-chat-show span { writing-mode: vertical-rl; }
.nib-chat-show:hover { background: #1f1832; padding-right: 13px; }
.nib-chat-show:focus-visible { outline: 3px solid var(--nib-lilac); outline-offset: 2px; }
.nib-nochat .pet-chatbox { display: none; }
.nib-watch .nib-chat-show { display: none; }
@media (min-width: 900px) {
  .nib-home.nib-nochat .pet-main > .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "tv" "menu" "note"; }
}
@media (min-width: 1200px) {
  .nib-home.nib-nochat .pet-main > .wrap {
    grid-template-columns: clamp(232px, 17vw, 290px) minmax(0, 1fr); grid-template-areas: "title tv" "menu tv" ". note";
  }
}

/* ---------------------------------------------------------------- the other pages in the look: gallery, contact, legal, 404 */
.nib-page .dr-title, .nib-page h1 {
  font-family: var(--nib-display); font-weight: 900; font-stretch: normal; letter-spacing: .01em;
}
.nib-page .pet-title .dr-title, .nib-page .nib-title {
  display: inline-block; transform: rotate(-2.5deg); transform-origin: 0 100%; margin: 6px 0 14px;
  font-size: clamp(2.4rem, 5vw, 4rem); line-height: .95; text-transform: uppercase; color: var(--nib-slime);
  text-shadow:
    3px 0 0 #1a1230, -3px 0 0 #1a1230, 0 3px 0 #1a1230, 0 -3px 0 #1a1230,
    2px 2px 0 #1a1230, -2px -2px 0 #1a1230, 2px -2px 0 #1a1230, -2px 2px 0 #1a1230,
    0 6px 0 #2c2048, 0 12px 24px rgba(0, 0, 0, .55);
}
.nib-page .pet-title { display: block; margin-bottom: 18px; }
.nib-page .pet-title p { max-width: 44em; }
.nib .card { background: var(--nib-panel-solid); border-color: var(--nib-line); border-radius: 16px; }
.nib .hero { padding-top: 48px; }
.nib .draft-note { border-color: color-mix(in srgb, var(--nib-gold) 70%, transparent); background: rgba(255, 209, 102, .05); }
.nib .prose th, .nib .prose td { border-bottom-color: var(--nib-line); }
.nib .prose blockquote { border-left-color: var(--nib-lilac); background: var(--nib-panel-solid); }
.nib .toc a { color: var(--nib-lilac); }
.nib .updated { color: var(--nib-dim); }
.nib-page .pet-offline { border: 2px solid var(--nib-line-hi) !important; background: var(--nib-panel-solid); }
/* the gallery: paintings in dark frames on the wall of the dark room */
.nib .gal-card {
  background: linear-gradient(180deg, #1b1530, #130e21); border: 2px solid var(--nib-line-hi); border-radius: 14px;
  box-shadow: inset 0 0 0 1px #000, 0 14px 30px -10px rgba(0, 0, 0, .7);
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s;
}
.nib .gal-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: inset 0 0 0 1px #000, 0 22px 40px -12px rgba(0, 0, 0, .8), 0 0 30px rgba(169, 139, 255, .18); }
.nib .gal-card:nth-child(even):hover { transform: translateY(-4px) rotate(.6deg); }
.nib .gal-card h2 { color: var(--nib-text); font-family: var(--nib-display); }
.nib .gal-for { background: var(--nib-brain); color: #2a0b19; }
.nib .gal-big { background: var(--nib-panel-solid); border-color: var(--nib-line-hi); border-radius: 18px; color: var(--nib-text); }
.nib .gal-big-text h2 { color: var(--nib-slime); font-family: var(--nib-display); }
.nib .gal-sea { --glow: var(--nib-sky); }
@media (prefers-reduced-motion: reduce) { .nib .gal-card { transition: none; } .nib .gal-card:hover { transform: none; } }
/* 404: a TV with no signal */
.nib .dr-hero .backrooms {
  background:
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .12) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .3) 0 1px, transparent 1px 2px),
    radial-gradient(80% 70% at 50% 40%, #3a3150, #120e1d 70%);
  background-size: 7px 9px, 5px 6px, auto;
  animation: tv-snow .18s steps(3) infinite;
}
.nib .dr-hero .backrooms::before { display: none; }
.nib .dr-hero .backrooms::after { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px); }
.nib .dr-hero .backrooms .light { display: none; }
.nib .dr-hero .shade { background: linear-gradient(180deg, transparent 20%, rgba(13, 11, 20, .85) 75%, var(--nib-bg)); }
.nib .dr-hero .dr-title { color: var(--nib-slime); font-size: clamp(4rem, 16vw, 9rem); text-shadow: 0 6px 0 #2c2048, 0 0 40px rgba(159, 232, 112, .35); }
@media (prefers-reduced-motion: reduce) { .nib .dr-hero .backrooms { animation: none; } }

/* ---------------------------------------------------------------- the knobs work: channel (a joke) and volume */
button.tv-knob { border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
button.tv-knob:focus-visible { outline: 3px solid var(--nib-lilac); outline-offset: 4px; }
.tv-knob.small { cursor: ns-resize; touch-action: none; transition: transform .12s ease-out; }
.pet-view:hover .tv-knob:not(.small) { transform: none; }
.tv-chan {
  position: absolute; z-index: 6; left: 50%; top: 42%; transform: translate(-50%, -50%); margin: 0; pointer-events: none;
  font: 800 clamp(1rem, 2.4vw, 1.8rem)/1.2 var(--nib-mono); letter-spacing: .08em; color: #eafff0;
  text-shadow: 0 0 8px rgba(159, 232, 112, .8), 2px 2px 0 #000; white-space: nowrap;
}
.tv-chan:empty { display: none; }
.nib-chan .tv-glass {
  background:
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .5) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .5) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, rgba(150, 150, 170, .7) 40%, rgba(0, 0, 0, .6) 100%);
  background-size: 7px 9px, 5px 6px, auto, auto;
  animation: tv-snow .12s steps(3) infinite;
}
.nib-chan .pet-screen canvas { filter: blur(2px) brightness(.4); }
@media (min-width: 900px) and (max-width: 1199px) {
  .nib-home .pet-chatbox { align-self: stretch; position: sticky; top: 12px; max-height: calc(100vh - 24px); }
}

/* (the names the Characters / Town pages' CSS reads - assets/characters.css, town.css, by the pet-tabs session) */
.nib { --nib-accent: var(--nib-slime); --nib-card: var(--nib-panel-solid); --nib-frame: var(--nib-line-hi); --nib-deep: var(--nib-bg); }

/* ---------------------------------------------------------------- the antenna, better (Wisse: "the antenna on top can do with
   improvement"): rabbit ears - a domed base with a chrome pivot, two telescoping chrome rods (a thick lower piece, a
   joint, a thin upper piece, a ball on top) that sway a little, and wobble when you touch the TV */
.nib-home .tv-antenna {
  top: 0; width: clamp(70px, 6vw, 92px); height: clamp(20px, 1.8vw, 26px); transform: translate(-50%, calc(-100% + 3px));
}
.nib-home .tv-antenna::before {   /* the base: a plastic dome */
  border-radius: 50% 50% 6px 6px / 100% 100% 6px 6px;
  background:
    radial-gradient(60% 80% at 35% 20%, rgba(255, 255, 255, .28), transparent 60%),
    linear-gradient(180deg, #5d4a86, #2d2147 70%, #1f1733);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .5), 0 2px 0 rgba(0, 0, 0, .35);
}
.nib-home .tv-antenna::after {    /* the chrome pivot on top */
  content: ""; position: absolute; left: 50%; top: -5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d9d4e6 30%, #8a849f 65%, #4f4966);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.nib-home .tv-antenna i {           /* the lower, thicker piece of each rod */
  bottom: calc(100% + 2px); width: 5px; height: clamp(26px, 3.6vh, 40px); margin-left: -2.5px; border-radius: 3px; z-index: 1;
  background: linear-gradient(90deg, #5f5a74, #f6f3fd 38%, #b7b1c8 58%, #57526b);
  transform: rotate(-34deg); animation: ant-sway-l 6.5s ease-in-out infinite;
}
.nib-home .tv-antenna i + i { height: clamp(24px, 3.3vh, 36px); transform: rotate(27deg); animation: ant-sway-r 7.3s ease-in-out infinite; }
.nib-home .tv-antenna i::after {    /* the upper, thinner piece, out of the lower one, with a joint ring */
  content: ""; position: absolute; left: 50%; bottom: calc(100% - 1px); width: 3px; height: clamp(34px, 4.8vh, 54px); margin-left: -1.5px;
  border-radius: 2px; background: linear-gradient(90deg, #6a6580, #ffffff 40%, #b9b3ca 60%, #625d78);
  box-shadow: 0 1px 0 1px #8b85a0;
}
.nib-home .tv-antenna i::before {   /* the ball on top */
  content: ""; position: absolute; left: 50%; top: auto; bottom: calc(100% + clamp(30px, 4.4vh, 50px)); width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #fff, #cfc9de 45%, #6d6684);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
@keyframes ant-sway-l { 0%, 100% { transform: rotate(-34deg); } 50% { transform: rotate(-31.5deg); } }
@keyframes ant-sway-r { 0%, 100% { transform: rotate(27deg); } 50% { transform: rotate(29.5deg); } }
@keyframes ant-wob-l { 0% { transform: rotate(-34deg); } 25% { transform: rotate(-26deg); } 50% { transform: rotate(-38deg); } 75% { transform: rotate(-31deg); } 100% { transform: rotate(-34deg); } }
@keyframes ant-wob-r { 0% { transform: rotate(27deg); } 25% { transform: rotate(35deg); } 50% { transform: rotate(23deg); } 75% { transform: rotate(30deg); } 100% { transform: rotate(27deg); } }
.nib-home .pet-view.wobble .tv-antenna i { animation: ant-wob-l .9s ease-out 1; }
.nib-home .pet-view.wobble .tv-antenna i + i { animation: ant-wob-r .9s ease-out 1; }
@media (max-width: 699px) {
  .nib-home .tv-antenna i { height: 24px; } .nib-home .tv-antenna i + i { height: 22px; }
  .nib-home .tv-antenna i::after { height: 32px; } .nib-home .tv-antenna i::before { bottom: calc(100% + 30px); }
}
@media (prefers-reduced-motion: reduce) { .nib-home .tv-antenna i, .nib-home .tv-antenna i + i { animation: none !important; } }

/* ---------------------------------------------------------------- pressing a TV button: down, a little bounce back */
@keyframes tv-press-deep {
  0% { transform: translateY(0); border-bottom-width: 4px; }
  35% { transform: translateY(3px); border-bottom-width: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 2px 4px rgba(0, 0, 0, .25); }
  70% { transform: translateY(-1px); border-bottom-width: 5px; }
  100% { transform: translateY(0); border-bottom-width: 4px; }
}
@keyframes tv-press-flat {
  0% { transform: translateY(0); filter: none; }
  35% { transform: translateY(2px) scale(.97); filter: brightness(.82); }
  70% { transform: translateY(-1px); }
  100% { transform: none; filter: none; }
}
@keyframes tv-press-knob { 0% { scale: 1; } 40% { scale: .93; } 75% { scale: 1.03; } 100% { scale: 1; } }
.nib-home .tv-gifts .nib-gift.tv-pressed, .tv-btn.tv-pressed { animation: tv-press-deep .24s cubic-bezier(.3, .7, .4, 1.4); }
.nib-home .tv-sound #pet-sound > button.tv-pressed, .tv-watchbar button.tv-pressed { animation: tv-press-flat .22s ease-out; }
button.tv-knob.tv-pressed { animation: tv-press-knob .22s ease-out; }
/* the picture while it's tuning in: a little snow */
.nib-tuning .tv-glass {
  background:
    radial-gradient(90% 70% at 28% 14%, rgba(255, 255, 255, .16), transparent 52%),
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .12) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, rgba(90, 90, 110, .25) 40%, rgba(0, 0, 0, .6) 100%);
  background-size: auto, 7px 9px, auto, auto;
  animation: tv-snow .2s steps(3) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .nib-home .tv-gifts .nib-gift.tv-pressed, .tv-btn.tv-pressed, .nib-home .tv-sound #pet-sound > button.tv-pressed,
  .tv-watchbar button.tv-pressed, button.tv-knob.tv-pressed, .nib-tuning .tv-glass { animation: none; }
}
/* (antenna, take 2: longer, thicker rods with a visible joint; the TV leaves room for it) */
@media (min-width: 700px) {
  .nib-home .pet-view { margin-top: clamp(64px, 9vh, 92px); }
  .nib-home .tv-antenna { width: clamp(84px, 7vw, 108px); height: clamp(22px, 2vw, 28px); }
  .nib-home .tv-antenna i { width: 6px; margin-left: -3px; height: clamp(30px, 4.2vh, 44px); }
  .nib-home .tv-antenna i + i { height: clamp(28px, 3.9vh, 40px); }
  .nib-home .tv-antenna i::after { width: 3.5px; margin-left: -1.75px; height: clamp(36px, 5vh, 52px); box-shadow: 0 1px 0 1.5px #9a94ae, 0 2px 0 1.5px #57526b; }
  .nib-home .tv-antenna i::before { width: 11px; height: 11px; margin-left: -5.5px; bottom: calc(100% + clamp(33px, 4.6vh, 48px)); }
  .nib-home .tv-antenna::after { width: 16px; height: 16px; margin-left: -8px; top: -6px; }
}
@media (min-width: 1200px) {
  .nib-home .pet-view { width: min(100%, calc((100vh - 340px) * 4 / 3 + var(--tv-panel) + 78px)); }
}

/* ---------------------------------------------------------------- the two volume knobs: MUSIC and FX */
.tv-vols { display: flex; gap: 8px; justify-content: center; }
.tv-vol { display: grid; justify-items: center; gap: 7px; }
.tv-vol .tv-label { margin: 0; font-size: .52rem; }
.tv-vols .tv-knob.small { width: clamp(30px, 2.6vw, 38px); transform: none; }
.tv-knob.is-off { opacity: .45; cursor: not-allowed; }
@media (max-width: 699px) { .tv-vols .tv-knob.small { width: 28px; } .tv-vol .tv-label { display: block; } }

/* ---------------------------------------------------------------- polish: the TV stands on a low cabinet; the chat fades at its
   top; on a phone the site's menu is one row you can swipe */
.tv-stand {
  position: absolute; z-index: -3; left: -7%; right: -7%; bottom: -44px; height: 30px; pointer-events: none; border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 30%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 23px),
    linear-gradient(180deg, #2f2346, #1b1429);
  box-shadow: 0 18px 30px -8px rgba(0, 0, 0, .75), inset 0 -3px 0 rgba(0, 0, 0, .35);
}
.nib-home .pet-view::after { bottom: -60px; }
.nib-watch .tv-stand { display: none; }
.nib-home .pet-view { margin-bottom: 64px; }
@media (max-width: 699px) { .tv-stand { bottom: -36px; height: 22px; } .nib-home .pet-view { margin-bottom: 50px; } }
.nib-home .chat-log {
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 28px);
          mask-image: linear-gradient(180deg, transparent, #000 28px);
  padding-top: 18px;
}
@media (max-width: 600px) {
  .nib .site-header .wrap { flex-wrap: nowrap; gap: 10px; }
  .nib .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: -4px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nib .nav::-webkit-scrollbar { display: none; }
  .nib .nav li { flex: none; }
  .nib .brand b { font-size: 1.3rem; } .nib .brand span { font-size: .95rem; }
}

/* (Wisse: "For antenna, put it on a layer behind the tv": the TV box no longer makes its own layer, so the antenna, the
   feet, the stand, its light and its shadow all sit BEHIND the cabinet; the antenna's foot hides behind its top edge) */
.nib-home .pet-view { isolation: auto; }
.nib-home .tv-antenna { z-index: -1; transform: translate(-50%, calc(-100% + 12px)); }
.tv-stand { left: -3%; right: -3%; }
.nib-home .pet-side > .nib-close, .nib-home .pet-fund > .nib-close { position: absolute; top: 12px; right: 12px; float: none; margin: 0; }
.nib-home .pet-side, .nib-home .pet-fund { padding-top: 20px; }
.nib-home .pet-side-head, .nib-home .pet-acct-head, .nib-home .pet-fund-text { padding-right: 40px; }

/* ---------------------------------------------------------------- Items, not gifts (Wisse: "i dont quite like that hes held items
   and brains and fingers are on the same button"): the Items panel shows only what he carries - Brains and Fingers are
   the TV's buttons; the quick log-in (from Chat) links to the account page */
.nib-home .pet-side .pet-give { display: none !important; }
.nib-home[data-panel="items"] .nib-acct-link { display: none; }
.nib-acct-link { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--nib-line); }
.nib-acct-link a, .nib-acct-back a { color: var(--nib-lilac); font-weight: 700; text-decoration: none; }
.nib-acct-link a:hover, .nib-acct-back a:hover { text-decoration: underline; }
/* the gifts' small print rides along under the TV (and on the buttons' hover), never hidden */
.nib-gift-small { display: block; margin-top: 6px; }
.nib-gift-small[hidden] { display: none; }

/* ---------------------------------------------------------------- the account page (account.html) */
.nib-acct .pet-main { padding: 0 0 20px; }
.nib-acct .pet-title, .nib-acct .pet-view, .nib-acct .pet-chatbox, .nib-acct .pet-fund, .nib-acct .pet-ai-note,
.nib-acct .pet-side > .pet-side-head, .nib-acct .pet-side > .pet-items, .nib-acct .nib-acct-link, .nib-acct noscript { display: none !important; }
.nib-acct .nib-acct-hero { max-width: 560px; margin: 30px auto 20px; }
.nib-acct .nib-acct-hero .lead { color: var(--nib-muted); margin: 8px 0 0; }
.nib-acct .pet-game { display: block; max-width: 560px; margin: 0 auto; padding: 0; background: none; border: 0; box-shadow: none; }
.nib-acct .pet-side {
  display: grid; gap: 14px; padding: 24px 24px 20px; border-radius: 22px;
  background: linear-gradient(180deg, #1a1429, var(--nib-panel-solid)); border: 1px solid var(--nib-line-hi);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.nib-acct .pet-acct-head { font: 900 1.35rem/1.2 var(--nib-display); letter-spacing: .01em; color: var(--nib-text); border: 0; padding: 0; margin: 0; }
.nib-acct .pet-offline { max-width: 560px; margin: 0 auto 16px; }
.nib .acct-form { gap: 8px; }
.nib .acct-form input, .nib .acct-lang select {
  background: #0b0912; border: 1px solid var(--nib-line-hi); border-radius: 10px; padding: 10px 12px; color: var(--nib-text);
}
.nib .acct-form input:focus, .nib .acct-lang select:focus { border-color: var(--nib-slime); box-shadow: 0 0 0 3px rgba(159, 232, 112, .15); }
.nib .acct-form .btn { --glow: var(--nib-slime); }
.nib .acct-form .btn.ghost, .nib .acct-in .btn.ghost { --glow: var(--nib-lilac); }
.nib-acct .acct-form { grid-template-columns: 1fr; }
.nib-acct .acct-in { gap: 10px; }
.nib-acct-tokens { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; }
.nib-acct-tokens strong { color: var(--nib-gold); font-variant-numeric: tabular-nums; }
.nib-coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--nib-gold) 45%, #b8862b); box-shadow: 0 0 6px rgba(255, 209, 102, .55);
}
.nib-acct-back { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--nib-line); }

/* (Wisse: "make the bottom of the metal part of the antenna less round, rounded in the middle and then straight at the
   bottom for a half circle with smooth edges an the bottom": the chrome pivot is a half dome sitting on the TV's top edge;
   the plastic foot is all behind the TV; the rods come out of the dome) */
.nib-home .tv-antenna { top: 0; transform: translate(-50%, 0); }
.nib-home .tv-antenna::after {
  top: auto; bottom: 100%; width: 28px; height: 14px; margin-left: -14px;
  border-radius: 14px 14px 4px 4px / 14px 14px 4px 4px;
  background:
    radial-gradient(70% 90% at 35% 25%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #e9e5f2, #a9a3bd 55%, #6f6987 90%, #5a5470);
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 255, 255, .25), 0 2px 3px rgba(0, 0, 0, .45);
}
.nib-home .tv-antenna i { bottom: calc(100% + 9px); z-index: -1; }
.nib .nav .btn.nib-me::before {   /* (your name in the menu: a little person in front) */
  content: ""; width: .85em; height: .85em; flex: none; border-radius: 50% 50% 40% 40%; position: static; opacity: 1;
  background: radial-gradient(circle at 50% 32%, currentColor 0 28%, transparent 30%), radial-gradient(ellipse 60% 45% at 50% 100%, currentColor 0 98%, transparent 100%);
  z-index: auto; transition: none;
}
@media (max-width: 600px) { .nib .nav { min-width: 0; flex: 1 1 auto; } .nib .brand { flex: none; } }   /* (the swipe row may shrink: no page wider than the phone) */

/* ---------------------------------------------------------------- TV static on the big titles (Wisse: "maybe some TV static on the
   Nibbles logo and big titles like Your Account"): snow crawling over the letters, faint scanlines, and now and then
   a glitch - a jump with a red/blue split. The words are copied into data-text by the few lines at the page's bottom. */
.nib-static { position: relative; animation: title-glitch 7s infinite; }
.nib-static::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; z-index: 1;
  font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; color: transparent; text-shadow: none;
  background:
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .95) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(10, 6, 20, .95) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(10, 6, 20, .55) 0 1px, transparent 1px 4px);
  background-size: 7px 9px, 5px 6px, auto;
  -webkit-background-clip: text; background-clip: text;
  mix-blend-mode: overlay; opacity: .6;
  animation: tv-snow .2s steps(3) infinite;
}
@keyframes title-glitch {
  0%, 93%, 100% { translate: 0 0; filter: none; }
  93.6% { translate: -4px 0; filter: drop-shadow(3px 0 0 rgba(255, 77, 94, .85)) drop-shadow(-3px 0 0 rgba(124, 200, 255, .85)); }
  94.2% { translate: 3px 1px; filter: drop-shadow(-2px 0 0 rgba(255, 77, 94, .85)) drop-shadow(2px 0 0 rgba(124, 200, 255, .85)); }
  94.8% { translate: -1px 0; filter: none; }
  95.4% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .nib-static, .nib-static::after { animation: none; } }
/* (the TV's light on the wall and its stand may reach past the page's sides: clipped there, so a phone never gets a page
   wider than itself; clip, not hidden - the sticky chat keeps working) */
.nib-home .pet-main { overflow-x: clip; }

/* ---------------------------------------------------------------- the VCR clock in the picture's corner (your own time) */
.tv-clock {
  position: absolute; z-index: 3; right: 7%; top: 6.5%; margin: 0; pointer-events: none;
  font: 700 clamp(.72rem, 1vw, .9rem)/1.3 var(--nib-mono); letter-spacing: .08em;
  color: var(--nib-slime); text-shadow: 0 0 6px rgba(159, 232, 112, .65), 1px 1px 0 #000;
}
.tv-clock:empty { display: none; }
.tv-colon { animation: nib-blink 1s steps(2) infinite; }
.nib-home .pet-mood { max-width: 58%; }
.nib-watch .tv-clock { right: 24px; top: 20px; }
.nib-watch.nib-watch-chat .tv-clock { display: none; }
.nib-home .pet-screen.is-3d canvas { cursor: zoom-in; }
.nib-watch .pet-screen.is-3d canvas { cursor: zoom-out; }
@media (prefers-reduced-motion: reduce) { .tv-colon { animation: none; } }

/* small finish: highlighted text in slime, smooth jumps to a page's parts */
.nib ::selection { background: rgba(159, 232, 112, .35); color: #fff; }
html:has(body.nib) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(body.nib) { scroll-behavior: auto; } }
/* (a short laptop screen: the menu tightens so all of it fits beside the TV) */
@media (min-width: 1200px) and (max-height: 820px) {
  .nib-menu { gap: 7px; }
  .nib-menu .btn.nib-go { padding-block: 7px; }
  .nib-go.first { padding-block: 9px; }
  .nib-go.first .nib-label { font-size: 1.15rem; }
  .nib-go .nib-ico { width: 32px; height: 32px; }
  .nib-home .pet-title > p.muted { font-size: .95rem; line-height: 1.4; margin-top: 6px; }
  .nib-home .pet-title .dr-title { font-size: clamp(2.6rem, 4.4vw, 4.4rem); }
}
@media (max-width: 699px) {   /* (a phone: your Tokens under the two gift buttons, not squeezed beside them) */
  .tv-gifts { flex-wrap: wrap; gap: 6px 8px; }
  .nib-gifts-tokens { order: 2; }
}

/* ---------------------------------------------------------------- out of Tokens: the button flashes red, a card on the picture */
.nib-gifts-tokens { display: none !important; }   /* (no Tokens count beside the gifts - Wisse) */
@keyframes gift-broke {
  0% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), 0 0 0 0 rgba(255, 77, 94, .9); }
  20% { translate: -3px 0; } 40% { translate: 3px 0; } 60% { translate: -2px 0; } 80% { translate: 1px 0; }
  30% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 77, 94, .9), 0 0 24px rgba(255, 77, 94, .85); }
  100% { translate: 0 0; box-shadow: 0 3px 6px rgba(0, 0, 0, .55), 0 0 0 0 rgba(255, 77, 94, 0); }
}
.nib-home .tv-gifts .btn.nib-gift.is-broke {
  animation: gift-broke .9s ease-out; background: linear-gradient(180deg, #ffd9dd, #f0a9b1); border-bottom-color: #b5525f;
}
.tv-broke {
  position: absolute; z-index: 8; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(84%, 340px); margin: 0;
  padding: 18px 18px 16px; text-align: center; border-radius: 16px; overflow: hidden;
  background: rgba(14, 10, 22, .94); border: 2px solid var(--nib-live); color: var(--nib-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .7), 0 0 40px rgba(255, 77, 94, .3);
  animation: broke-in .28s cubic-bezier(.2, 1.4, .4, 1);
}
.tv-broke[hidden] { display: none; }
@keyframes broke-in { from { transform: translate(-50%, -50%) scale(.85); opacity: 0; } }
.tv-broke-h { margin: 0 0 6px; font: 900 clamp(1.2rem, 2vw, 1.6rem)/1.1 var(--nib-display); color: var(--nib-live); text-transform: uppercase; letter-spacing: .02em; }
.tv-broke-t { margin: 0 0 12px; font-size: .95rem; color: var(--nib-muted); }
.tv-broke-t b { color: var(--nib-gold); font-variant-numeric: tabular-nums; }
.tv-broke-soon { margin: -4px 0 12px; color: var(--nib-muted); }
.tv-broke-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tv-broke-row .btn { font: inherit; font-weight: 800; padding: 8px 16px; border-radius: 10px; }
.tv-broke-buy { --glow: var(--nib-gold); }
.tv-broke-no { --glow: var(--nib-lilac); }
@media (prefers-reduced-motion: reduce) { .tv-broke, .nib-home .tv-gifts .btn.nib-gift.is-broke { animation: none; } }

/* ---------------------------------------------------------------- the gift buttons glow in their tier as the presses add up
   (Wisse: "also glowing colour in the amount of brains sent, up to holy") - the same tiers as the picture on them
   (pet_shop.js: normal, bronze, silver, gold, diamond, holy) */
.nib-home .tv-gifts .btn.nib-gift { --tier: transparent; --tier-spread: 0px; }
.nib-home .tv-gifts .btn.nib-gift:is(.tier-bronze, .tier-silver, .tier-gold, .tier-diamond, .tier-holy) {
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 14px var(--tier-spread) var(--tier), 0 0 2px 1px var(--tier);
  transition: box-shadow .3s ease;
}
.nib-home .tv-gifts .btn.nib-gift.tier-bronze { --tier: rgba(214, 133, 56, .85); --tier-spread: 2px; border-bottom-color: #8a5326; }
.nib-home .tv-gifts .btn.nib-gift.tier-silver { --tier: rgba(214, 224, 240, .9); --tier-spread: 3px; border-bottom-color: #8b93a3; }
.nib-home .tv-gifts .btn.nib-gift.tier-gold { --tier: rgba(245, 197, 66, .95); --tier-spread: 4px; border-bottom-color: #a6801f; animation: tier-pulse 1.6s ease-in-out infinite; }
.nib-home .tv-gifts .btn.nib-gift.tier-diamond { --tier: rgba(143, 243, 255, .95); --tier-spread: 5px; border-bottom-color: #4f9fab; animation: tier-pulse 1.1s ease-in-out infinite; }
.nib-home .tv-gifts .btn.nib-gift.tier-holy {
  --tier: rgba(255, 246, 196, 1); --tier-spread: 7px; border-bottom-color: #c9a64a;
  background: linear-gradient(180deg, #fffdf2, #f6e7b4);
  animation: tier-pulse .9s ease-in-out infinite;
}
.nib-home .tv-gifts .btn.nib-gift.tier-holy::after {   /* light rays turning behind it */
  content: ""; position: absolute; z-index: -1; inset: -22px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 238, 160, .55) 0 8deg, transparent 8deg 24deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  animation: tier-rays 6s linear infinite;
}
@keyframes tier-pulse {
  0%, 100% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 12px var(--tier-spread) var(--tier), 0 0 2px 1px var(--tier); }
  50% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 24px calc(var(--tier-spread) + 4px) var(--tier), 0 0 3px 2px var(--tier); }
}
@keyframes tier-rays { to { rotate: 360deg; } }
.nib-home .tv-gifts .btn.nib-gift.is-broke { animation: gift-broke .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .nib-home .tv-gifts .btn.nib-gift:is(.tier-gold, .tier-diamond, .tier-holy), .nib-home .tv-gifts .btn.nib-gift.tier-holy::after { animation: none; }
}

/* (Wisse: "fullscreen button can glow green when pressed") */
@keyframes full-glow {
  0% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 0 0 rgba(159, 232, 112, 0); }
  30% { box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 0 #fff, 0 0 0 3px rgba(159, 232, 112, .95), 0 0 26px 6px rgba(159, 232, 112, .8); }
  100% { box-shadow: 0 3px 6px rgba(0, 0, 0, .55), inset 0 1px 0 #fff, 0 0 0 0 rgba(159, 232, 112, 0); }
}
.tv-btn:active { box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 0 #fff, 0 0 0 3px rgba(159, 232, 112, .95), 0 0 22px 5px rgba(159, 232, 112, .75); color: #1c4a0c; }
.tv-btn.tv-pressed { animation: tv-press-deep .24s cubic-bezier(.3, .7, .4, 1.4), full-glow .7s ease-out; color: #1c4a0c; }
@media (prefers-reduced-motion: reduce) { .tv-btn.tv-pressed { animation: none; } }

/* ================================================================ THE WOW PASS (Wisse: "we need the wow factor on the website") */

/* ---- the TV switching on, once a visit: the room dark, the TV's light blinking, a flash, the glow fills the room, then the
   title, the menu and the chat come in one after another. Everything ends visible on its own (forwards / both). */
html.nib-intro body::after {
  content: ""; position: fixed; inset: 0; z-index: 2500; pointer-events: none; background: #040308;
  animation: intro-dark 1.5s ease .75s forwards;
}
@keyframes intro-dark { to { opacity: 0; visibility: hidden; } }
html.nib-intro .tv-led { animation: intro-led .75s steps(2) 1, none; background: #ffd166; box-shadow: 0 0 8px 2px rgba(255, 209, 102, .8); }
@keyframes intro-led { 50% { opacity: .2; } }
html.nib-intro .nib-home .pet-screen, html.nib-intro .pet-screen { animation: intro-flash 1.1s ease .7s both; }
@keyframes intro-flash { 0% { filter: brightness(0); } 12% { filter: brightness(4) saturate(0); } 40% { filter: brightness(1.4); } 100% { filter: none; } }
html.nib-intro .nib-home .pet-view::before { animation: intro-glow 1.8s ease .8s both; }
@keyframes intro-glow { from { opacity: 0; transform: scale(.6); } 30% { opacity: 1.3; } }
html.nib-intro .pet-title { animation: intro-up .8s cubic-bezier(.2, .9, .2, 1.2) 1.15s both; }
html.nib-intro .nib-menu > * { animation: intro-left .55s cubic-bezier(.2, .9, .3, 1.15) both; }
html.nib-intro .nib-menu > :nth-child(1) { animation-delay: 1.35s; }
html.nib-intro .nib-menu > :nth-child(2) { animation-delay: 1.42s; }
html.nib-intro .nib-menu > :nth-child(3) { animation-delay: 1.49s; }
html.nib-intro .nib-menu > :nth-child(4) { animation-delay: 1.56s; }
html.nib-intro .nib-menu > :nth-child(5) { animation-delay: 1.63s; }
html.nib-intro .nib-menu > :nth-child(6) { animation-delay: 1.7s; }
html.nib-intro .nib-menu > :nth-child(7) { animation-delay: 1.77s; }
html.nib-intro .pet-chatbox { animation: intro-right .75s cubic-bezier(.2, .9, .3, 1) 1.55s both; }
html.nib-intro .site-header { animation: intro-fade .8s ease 1.9s both; }
html.nib-intro .tv-antenna i { animation: ant-wob-l 1s ease-out 1.1s 1 both; }
html.nib-intro .tv-antenna i + i { animation: ant-wob-r 1s ease-out 1.15s 1 both; }
@keyframes intro-up { from { opacity: 0; translate: 0 22px; } }
@keyframes intro-left { from { opacity: 0; translate: -26px 0; } }
@keyframes intro-right { from { opacity: 0; translate: 30px 0; } }
@keyframes intro-fade { from { opacity: 0; } }

/* ---- the glare on the glass follows your pointer (nibbles_home.js sets --gx / --gy) */
.nib-home .tv-glass {
  background:
    radial-gradient(90% 70% at var(--gx, 28%) var(--gy, 14%), rgba(255, 255, 255, .17), rgba(255, 255, 255, .035) 38%, transparent 52%),
    radial-gradient(60% 40% at calc(110% - var(--gx, 28%)) 92%, rgba(255, 255, 255, .05), transparent 60%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .13) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, transparent 56%, rgba(0, 0, 0, .58) 100%);
}

/* ---- dust drifting in the TV's light (behind the cabinet, in its glow) */
.tv-dust { position: absolute; z-index: -1; inset: -12% -10% -4%; pointer-events: none; overflow: hidden; }
.tv-dust i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(220, 215, 255, .55);
  box-shadow: 0 0 6px rgba(200, 190, 255, .6); opacity: 0; animation: dust 14s linear infinite;
}
.tv-dust i:nth-child(1) { left: 6%; top: 70%; animation-delay: -1s; animation-duration: 16s; }
.tv-dust i:nth-child(2) { left: 14%; top: 40%; animation-delay: -5s; }
.tv-dust i:nth-child(3) { left: 22%; top: 85%; animation-delay: -9s; animation-duration: 18s; width: 2px; height: 2px; }
.tv-dust i:nth-child(4) { left: 31%; top: 15%; animation-delay: -3s; }
.tv-dust i:nth-child(5) { left: 44%; top: 92%; animation-delay: -11s; animation-duration: 20s; }
.tv-dust i:nth-child(6) { left: 52%; top: 5%; animation-delay: -7s; width: 2px; height: 2px; }
.tv-dust i:nth-child(7) { left: 61%; top: 88%; animation-delay: -2s; animation-duration: 15s; }
.tv-dust i:nth-child(8) { left: 70%; top: 20%; animation-delay: -13s; }
.tv-dust i:nth-child(9) { left: 79%; top: 60%; animation-delay: -6s; animation-duration: 19s; width: 4px; height: 4px; }
.tv-dust i:nth-child(10) { left: 88%; top: 35%; animation-delay: -10s; }
.tv-dust i:nth-child(11) { left: 94%; top: 80%; animation-delay: -4s; animation-duration: 17s; width: 2px; height: 2px; }
.tv-dust i:nth-child(12) { left: 3%; top: 25%; animation-delay: -12s; }
.tv-dust i:nth-child(13) { left: 97%; top: 10%; animation-delay: -8s; animation-duration: 21s; }
.tv-dust i:nth-child(14) { left: 38%; top: 50%; animation-delay: -14s; width: 2px; height: 2px; }
@keyframes dust {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: .9; }
  50% { transform: translate(14px, -40px); }
  85% { opacity: .7; }
  100% { opacity: 0; transform: translate(-8px, -90px); }
}
.nib-watch .tv-dust { display: none; }

/* ---- SHARE on the TV panel */
.tv-share { height: 34px; }
.tv-share svg { width: 18px; height: 18px; }
.tv-share-ok {
  position: absolute; z-index: 30; right: calc(var(--tv-panel) + 30px); bottom: 70px; margin: 0; padding: 7px 12px; border-radius: 10px;
  background: var(--nib-slime); color: #10200a; font: 800 .82rem/1.2 var(--font); box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
  animation: broke-in .25s cubic-bezier(.2, 1.4, .4, 1);
}
.tv-share-ok[hidden] { display: none; }
@media (max-width: 699px) { .tv-share-ok { right: 14px; bottom: 64px; } }

/* ---- a count of new chat lines on the Chat buttons while the chat is out of sight */
.nib-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--nib-live); color: #fff; font: 800 .7rem/1 var(--font); letter-spacing: 0; writing-mode: horizontal-tb;
  box-shadow: 0 0 0 2px var(--nib-panel-solid), 0 0 10px rgba(255, 77, 94, .6); animation: badge-pop .3s cubic-bezier(.2, 1.6, .4, 1);
}
.nib-badge[hidden] { display: none; }
.nib-chat-show .nib-badge { position: absolute; top: -8px; left: -8px; }
.tv-chatbtn .nib-badge { margin-left: 2px; }
@keyframes badge-pop { from { transform: scale(.4); } }

/* ---- fullscreen: the channel's logo in the corner, like real TV */
.tv-bug { display: none; }
.nib-watch .tv-bug {
  display: flex; align-items: center; gap: 8px; position: absolute; z-index: 4; top: 18px; right: 24px; margin: 0; pointer-events: none;
  font: 900 1.05rem/1 var(--nib-display); text-transform: uppercase; letter-spacing: .04em; color: rgba(255, 255, 255, .78);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
.nib-watch .tv-bug b { color: var(--nib-slime); opacity: .9; }
.nib-watch .tv-bug span {
  font: 800 .62rem/1 var(--font); letter-spacing: .16em; padding: 4px 7px; border-radius: 4px; background: rgba(255, 77, 94, .85); color: #fff;
}
.nib-watch.nib-off .tv-bug span { background: rgba(120, 110, 140, .8); }
.nib-watch .tv-clock { top: 46px; }

/* ---- ? : the remote's keys */
.nib-keys {
  position: fixed; z-index: 3500; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 320px); padding: 18px 20px;
  border-radius: 18px; background: rgba(16, 12, 26, .96); border: 1px solid var(--nib-line-hi); box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  cursor: pointer; animation: broke-in .25s cubic-bezier(.2, 1.4, .4, 1);
}
.nib-keys[hidden] { display: none; }
.nib-keys-h { margin: 0 0 12px; font: 900 1.2rem/1.1 var(--nib-display); color: var(--nib-text); }
.nib-keys dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; align-items: center; }
.nib-keys dt {
  min-width: 34px; padding: 4px 8px; text-align: center; border-radius: 7px; font: 800 .82rem/1 var(--nib-mono); color: #2a2040;
  background: linear-gradient(180deg, #f6f1e4, #d6cdb6); border-bottom: 3px solid #9a8f73;
}
.nib-keys dd { margin: 0; color: var(--nib-muted); font-size: .92rem; }

/* ---- the gallery while Nibbles is away: a TV with no signal */
.nib-page #gal-offline:not([hidden]) {
  position: relative; display: grid; place-items: center; min-height: 240px; margin: 10px 0 20px; padding: 30px 20px;
  text-align: center; border-radius: 24px / 22px; overflow: hidden; color: #fff; text-shadow: 0 2px 4px #000; font-size: 1rem;
  border: 10px solid #1b1429 !important; box-shadow: 0 0 0 2px var(--nib-line-hi), 0 20px 40px -10px rgba(0, 0, 0, .7), inset 0 0 40px rgba(0, 0, 0, .8);
  background:
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .22) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .35) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(80% 70% at 50% 45%, #4a4560, #16121f 75%);
  background-size: 7px 9px, 5px 6px, auto, auto;
  animation: tv-snow .2s steps(3) infinite;
}
.nib-page #gal-offline strong { display: block; font: 900 1.4rem/1.2 var(--nib-display); color: var(--nib-slime); margin-bottom: 6px; text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  .tv-dust { display: none; }
  .nib-page #gal-offline:not([hidden]), .nib-badge, .nib-keys, .tv-share-ok { animation: none; }
}

/* ---------------------------------------------------------------- the knobs, redone (Wisse: "the volume knobs can be a lot better,
   the grip lines dont look nice, maybe something different than grip lines"): a smooth glossy metal dome in a dark skirt,
   a coloured pointer that turns (the shine stays where the light is), a printed scale of ticks on the panel round it */
.nib-home .tv-knob {
  --rot: 0deg; --ptr: #f3efff; --ptr-glow: rgba(243, 239, 255, .6);
  position: relative; border-radius: 50%; transform: none !important;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 50% 50%, #e7e2f1 0 36%, #b5aec7 58%, #7a7392 78%, #4d4762 100%);
  box-shadow:
    0 0 0 3px #120d1d,                                   /* the skirt's edge */
    0 0 0 6px #2a2140,                                   /* the skirt */
    0 0 0 7px rgba(255, 255, 255, .08),
    0 5px 8px 4px rgba(0, 0, 0, .55),                    /* its shadow on the panel */
    inset 0 -3px 5px rgba(0, 0, 0, .35), inset 0 2px 2px rgba(255, 255, 255, .6);
  transition: none;
}
.nib-home .tv-knob::after {                               /* the pointer: from the middle to the rim, turning */
  content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 46%; margin: 0; border-radius: 3px;
  background: var(--ptr); box-shadow: 0 0 6px var(--ptr-glow), 0 1px 0 rgba(0, 0, 0, .4);
  transform-origin: 50% 0; transform: translate(-50%, 0) rotate(calc(var(--rot) + 180deg));
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1);
}
.nib-home .tv-knob::before {                              /* the printed scale round it, on the panel */
  content: ""; position: absolute; inset: -13px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from -135deg, transparent 0deg,
    repeating-conic-gradient(from -135deg, rgba(200, 192, 225, .75) 0 2.2deg, transparent 2.2deg 27deg) 0deg) ;
  -webkit-mask: radial-gradient(circle, transparent 0 66%, #000 67% 78%, transparent 79%);
          mask: radial-gradient(circle, transparent 0 66%, #000 67% 78%, transparent 79%);
  clip-path: polygon(50% 50%, 0 100%, 0 0, 100% 0, 100% 100%);   /* (no ticks at the bottom, like a real dial) */
}
.nib-home .tv-knob.small { --ptr: var(--nib-lilac); --ptr-glow: rgba(169, 139, 255, .7); }
.nib-home .tv-knob.small[data-vol="fx"] { --ptr: var(--nib-slime); --ptr-glow: rgba(159, 232, 112, .7); }
.nib-home .tv-knob.small::after { width: 3px; }
.nib-home .tv-knob.small::before { inset: -10px; }
.nib-home .tv-knob.is-off::after { background: #6f6690; box-shadow: none; }
.nib-home .tv-knob:hover { box-shadow:
    0 0 0 3px #120d1d, 0 0 0 6px #33284d, 0 0 0 7px rgba(255, 255, 255, .12), 0 5px 8px 4px rgba(0, 0, 0, .55),
    inset 0 -3px 5px rgba(0, 0, 0, .35), inset 0 2px 2px rgba(255, 255, 255, .6), 0 0 18px var(--ptr-glow); }
.nib-home .tv-vols { gap: 18px; margin-top: 4px; }
.nib-home .tv-vol { gap: 12px; }
@media (max-width: 699px) { .nib-home .tv-knob::before { inset: -8px; } .nib-home .tv-vols { gap: 12px; } }
@media (prefers-reduced-motion: reduce) { .nib-home .tv-knob::after { transition: none; } }
.nib-home .tv-knob::before {   /* (the scale, done right: ticks every 27 deg on a 270 deg arc, a thin ring round the knob) */
  background: repeating-conic-gradient(from -135deg, rgba(205, 197, 230, .8) 0 2.4deg, transparent 2.4deg 27deg);
  -webkit-mask: radial-gradient(circle, transparent 0 66%, #000 67% 80%, transparent 81%), conic-gradient(from -137deg, #000 0 274deg, transparent 274deg);
  -webkit-mask-composite: source-in;
          mask: radial-gradient(circle, transparent 0 66%, #000 67% 80%, transparent 81%) intersect, conic-gradient(from -137deg, #000 0 274deg, transparent 274deg);
  clip-path: none;
}
.nib-home .tv-knob::before {
  mask: radial-gradient(circle, transparent 0 66%, #000 67% 80%, transparent 81%), conic-gradient(from -137deg, #000 0 274deg, transparent 274deg);
  mask-composite: intersect;
}

/* ---------------------------------------------------------------- the knobs, matte (Wisse: "no gloss on the volume knob, theyre a
   bit to bright for me"): dark plum plastic, no shine, the coloured pointer stays */
.nib-home .tv-knob {
  background: radial-gradient(circle at 50% 42%, #4a3f63 0%, #372e4d 55%, #282038 85%, #1f1830 100%);
  box-shadow:
    0 0 0 3px #110c1b, 0 0 0 6px #241c36, 0 4px 7px 3px rgba(0, 0, 0, .55),
    inset 0 -2px 4px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(255, 255, 255, .08);
}
.nib-home .tv-knob:hover {
  box-shadow:
    0 0 0 3px #110c1b, 0 0 0 6px #2c2342, 0 4px 7px 3px rgba(0, 0, 0, .55),
    inset 0 -2px 4px rgba(0, 0, 0, .45), inset 0 1px 1px rgba(255, 255, 255, .1), 0 0 14px var(--ptr-glow);
}
.nib-home .tv-knob::after { box-shadow: 0 0 4px var(--ptr-glow); }
.nib-home .tv-knob::before { background: repeating-conic-gradient(from -135deg, rgba(180, 170, 210, .5) 0 2.4deg, transparent 2.4deg 27deg); }

/* a phone (or any touch screen): bigger knobs */
@media (pointer: coarse) {
  .nib-home .tv-vols .tv-knob.small { width: 38px; }
  .nib-home .tv-knob:not(.small) { width: 44px; }
}

/* tap a volume knob: a slider pops up above it (easy with a thumb); drag or the wheel still turn the knob itself */
.tv-volpop {
  position: absolute; z-index: 45; width: 220px; padding: 12px 14px 10px; border-radius: 14px;
  background: rgba(16, 12, 26, .97); border: 1px solid var(--nib-line-hi); box-shadow: 0 16px 40px rgba(0, 0, 0, .65);
  animation: broke-in .2s cubic-bezier(.2, 1.4, .4, 1);
}
.tv-volpop[hidden] { display: none; }
.tv-volpop-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font: 800 .8rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--nib-muted); }
.tv-volpop-top b { font: 700 .9rem/1 var(--nib-mono); color: var(--nib-text); letter-spacing: 0; }
.tv-volpop input[type="range"] { width: 100%; height: 34px; margin: 0; accent-color: var(--vol-c, var(--nib-slime)); cursor: pointer; touch-action: none; }
.tv-volpop::after {   /* its little point, down at the knob */
  content: ""; position: absolute; left: var(--tip, 50%); bottom: -7px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg);
  background: rgba(16, 12, 26, .97); border-right: 1px solid var(--nib-line-hi); border-bottom: 1px solid var(--nib-line-hi);
}

/* ================================================================ viewers, the TV guide, live reactions (Wisse, 25 Nov) */

/* ---- "LIVE · 12 watching" */
.nib-viewers { letter-spacing: .08em; color: var(--nib-muted); font-weight: 700; }
.nib-viewers b { color: var(--nib-text); font-variant-numeric: tabular-nums; }
.nib-viewers[hidden] { display: none; }
.nib-off .nib-viewers, .nib-tuning .nib-viewers { display: none; }

/* ---- the TV guide: a teletext page (opened from the menu like the other panels) */
.nib-home .nib-guide {
  position: fixed; z-index: 60; left: 50%; bottom: 0; width: min(100%, 520px); max-height: 84vh; overflow: auto; margin: 0; padding: 0;
  border-radius: 18px 18px 0 0; border: 1px solid var(--nib-line-hi); border-bottom: 0; background: #000;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .65);
  transform: translate(-50%, 104%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s;
}
@media (min-width: 1200px) {
  .nib-home .nib-guide {
    position: absolute; left: calc(clamp(232px, 17vw, 290px) + 40px); top: 4px; bottom: auto; width: 460px;
    max-height: calc(100vh - 110px); border-radius: 16px; border-bottom: 1px solid var(--nib-line-hi);
    transform: translateX(-16px); opacity: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .75);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s, visibility 0s .25s;
  }
}
.nib-home[data-panel="guide"] .nib-guide { visibility: visible; transform: translate(-50%, 0); opacity: 1; transition-delay: 0s; }
@media (min-width: 1200px) { .nib-home[data-panel="guide"] .nib-guide { transform: none; } }
.nib-guide > .nib-close { position: absolute; top: 10px; right: 10px; z-index: 3; color: #fff; background: rgba(255, 255, 255, .12); }
.ttx {
  position: relative; padding: 16px 18px 14px; color: #fff; font: 700 15px/1.35 var(--nib-mono); letter-spacing: .02em;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    #000;
}
.ttx-top { display: flex; gap: 10px; align-items: baseline; margin: 0 40px 10px 0; font-size: .82rem; }
.ttx-p { color: #fff; }
.ttx-brand { color: #ff4dff; }
.ttx-clock { margin-left: auto; color: #ffd400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ttx-h {
  margin: 0 0 2px; padding: 4px 10px; font: 900 1.6rem/1 var(--nib-mono) !important; letter-spacing: .06em; text-transform: uppercase;
  color: #000; background: #00e5ff; transform: scaleY(1.35); transform-origin: 0 0; margin-bottom: 14px;
}
.ttx-sub { margin: 0 0 10px; color: #00ff66; text-transform: uppercase; letter-spacing: .1em; }
.ttx-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.ttx-list li {
  display: grid; grid-template-columns: 4.2em minmax(0, 1fr) auto; grid-template-areas: "t name state" "t what what"; gap: 0 10px;
  padding: 6px 8px; background: #0a0a0a;
}
.ttx-t { grid-area: t; color: #ffd400; font-variant-numeric: tabular-nums; }
.ttx-name { grid-area: name; color: #fff; text-transform: uppercase; }
.ttx-what { grid-area: what; color: #00e5ff; font-weight: 400; font-size: .82rem; }
.ttx-state { grid-area: state; font-size: .72rem; letter-spacing: .12em; }
.ttx-list li.is-now { background: #b30000; }
.ttx-list li.is-now .ttx-state { color: #fff; animation: nib-blink 1s steps(2) infinite; }
.ttx-list li.is-now .ttx-what { color: #ffd400; }
.ttx-list li.is-next { background: #001b66; }
.ttx-list li.is-next .ttx-state { color: #ffd400; }
.ttx-list li.is-done { opacity: .45; }
.ttx-note { margin: 0 0 12px; color: #00ff66; font-weight: 400; font-size: .8rem; line-height: 1.45; }
.ttx-bar { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; font-size: .72rem; text-align: center; text-transform: uppercase; }
.ttx-bar span { padding: 4px 0; color: #000; }
.ttx-bar span:nth-child(1) { background: #ff3b3b; }
.ttx-bar span:nth-child(2) { background: #ffd400; }
.ttx-bar span:nth-child(3) { background: #7a7a7a; color: #fff; }
.nib-home[data-panel="guide"] .nib-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }

/* ---- live reactions: a row above the chat box; they float up over the picture */
.nib-reacts { display: flex; gap: 4px; justify-content: space-between; padding: 6px 2px 0; border-top: 1px solid var(--nib-line); }
.nib-react {
  all: unset; box-sizing: border-box; flex: 1 1 0; display: grid; place-items: center; height: 38px; border-radius: 10px; cursor: pointer;
  font-size: 1.25rem; line-height: 1; background: rgba(255, 255, 255, .04); transition: transform .12s, background .15s;
  user-select: none; touch-action: manipulation;
}
.nib-react:hover { background: rgba(255, 255, 255, .1); transform: translateY(-2px) scale(1.08); }
.nib-react:focus-visible { outline: 3px solid var(--nib-lilac); outline-offset: 1px; }
.nib-react.pop { animation: react-pop .35s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes react-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1); } }
.tv-reacts { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; border-radius: inherit; }
.tv-react {
  position: absolute; right: var(--x, 12%); bottom: 4%; font-size: var(--size, 1.6rem); line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); animation: react-float var(--dur, 3s) cubic-bezier(.25, .6, .4, 1) forwards;
}
.tv-react.mine { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
@keyframes react-float {
  0% { transform: translate(0, 0) scale(.3); opacity: 0; }
  10% { transform: translate(0, -20px) scale(1.15); opacity: 1; }
  25% { transform: translate(calc(var(--drift, 0px) * -.5), -90px) scale(1); }
  50% { transform: translate(var(--drift, 0px), -200px) rotate(8deg); }
  75% { transform: translate(calc(var(--drift, 0px) * -.3), -300px) rotate(-6deg); opacity: .9; }
  100% { transform: translate(calc(var(--drift, 0px) * .6), -400px) scale(.9); opacity: 0; }
}
.nib-watch.nib-watch-chat .nib-reacts { border-top-color: rgba(255, 255, 255, .12); }
@media (prefers-reduced-motion: reduce) {
  .tv-react { animation: react-fade 2s ease forwards; }
  @keyframes react-fade { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }
  .nib-react.pop { animation: none; }
  .ttx-list li.is-now .ttx-state { animation: none; }
}

/* ---------------------------------------------------------------- the fund: two meters, Brains and Fingers (Wisse: "so 2 meters
   1 brains 1 fingers"; the pet program's GET /brain fund.given / fund.goals - #fund-bar + #fund-bar-fingers) */
.nib-home .pet-fund .fund-bar { height: 16px; border-radius: 999px; background: #0b0912; border: 1px solid var(--nib-line-hi); overflow: hidden; }
.nib-home .pet-fund .fund-bar i { background: linear-gradient(90deg, #ff8fb5, #ffc2d6); box-shadow: 0 0 12px rgba(255, 143, 181, .55); }
.nib-home .pet-fund .fund-bar-fingers i { background: linear-gradient(90deg, #f3a36f, #ffd2a6); box-shadow: 0 0 12px rgba(243, 163, 111, .55); }
.nib-home .pet-fund #fund-amount, .nib-home .pet-fund .fund-amount-fingers {
  grid-column: 1 / -1; font: 700 .86rem/1.3 var(--font); color: var(--nib-text); font-variant-numeric: tabular-nums;
}
.nib-home .pet-fund #fund-amount::before, .nib-home .pet-fund .fund-amount-fingers::before {
  content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px;
  background: url("gift_brain.svg") center / contain no-repeat;
}
.nib-home .pet-fund .fund-amount-fingers::before { background-image: url("gift_finger.svg"); }
.nib-home .pet-fund .fund-amount-fingers { margin-top: 4px; }
.nib-home .pet-fund .pet-fund-text { grid-column: 1 / -1; }
.nib-home .pet-fund .pet-donate { grid-column: 1 / -1; grid-row: auto; justify-self: start; }

/* ================================================================ last check (Wisse: "one last check ... graphics or just that
   little extra ... take your time") */

/* ---- FIX: the glare-follow rule (.nib-home .tv-glass) came later and wiped the snow of off air / tuning in / channel
   change - the same rules again, stronger. Off air shows only snow (the room behind it means nothing then). */
.nib-home.nib-off .tv-glass {
  background:
    radial-gradient(90% 70% at var(--gx, 28%) var(--gy, 14%), rgba(255, 255, 255, .14), transparent 52%),
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .26) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .4) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, #57526b 0%, #2c2838 55%, #0d0b12 100%);
  background-size: auto, 7px 9px, 5px 6px, auto, auto;
  animation: tv-snow .18s steps(3) infinite;
}
.nib-home.nib-off .pet-screen canvas { visibility: hidden; }
.nib-home.nib-tuning .tv-glass {
  background:
    radial-gradient(90% 70% at var(--gx, 28%) var(--gy, 14%), rgba(255, 255, 255, .16), transparent 52%),
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .12) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, rgba(90, 90, 110, .25) 40%, rgba(0, 0, 0, .6) 100%);
  background-size: auto, 7px 9px, auto, auto;
  animation: tv-snow .2s steps(3) infinite;
}
.nib-home.nib-chan .tv-glass {
  background:
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .5) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, rgba(0, 0, 0, .5) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, rgba(150, 150, 170, .7) 40%, rgba(0, 0, 0, .6) 100%);
  background-size: 7px 9px, 5px 6px, auto, auto;
  animation: tv-snow .12s steps(3) infinite;
}
@media (prefers-reduced-motion: reduce) { .nib-home.nib-off .tv-glass, .nib-home.nib-tuning .tv-glass, .nib-home.nib-chan .tv-glass { animation: none; } }

/* ---- the cabinet: a fine plastic grain, so it reads as moulded plastic rather than a flat colour */
.nib-home .pet-view {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 18%),
    linear-gradient(0deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 26%),
    radial-gradient(120% 90% at 20% 0%, var(--nib-plastic-1), var(--nib-plastic-2) 55%, var(--nib-plastic-3));
}

/* ---- Nibbles' own lines in the chat: his little TV in front of his name */
.nib-home .chat-log .pet .who::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 5px; vertical-align: -3px;
  background: url("nibbles_icon.svg") center / contain no-repeat;
}

/* ---- the power light: a lit lamp, with a soft halo on the panel */
.nib-live .tv-led { box-shadow: 0 0 6px 2px rgba(159, 232, 112, .8), 0 0 18px 4px rgba(159, 232, 112, .35); }
.nib-off .tv-led { box-shadow: 0 0 6px 2px rgba(255, 77, 94, .75), 0 0 16px 3px rgba(255, 77, 94, .3); }
/* (Wisse: "the white markers around the volume we can do without": no tick scale round the MUSIC / FX knobs) */
.nib-home .tv-knob.small::before { display: none; }

/* ---------------------------------------------------------------- real TV static (assets/nibbles_static.js - Wisse: "for the static
   use a video of real TV static"): the canvas of live noise; the dotted CSS snow steps aside while it runs */
.tv-static {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; border-radius: inherit;
  image-rendering: auto; filter: contrast(1.15) brightness(.92) saturate(.6); opacity: 0; transition: opacity .22s ease;
}
.tv-static.on { opacity: 1; }
.nib-home.nib-static-on .tv-glass {
  background:
    radial-gradient(90% 70% at var(--gx, 28%) var(--gy, 14%), rgba(255, 255, 255, .17), rgba(255, 255, 255, .035) 38%, transparent 52%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px),
    radial-gradient(125% 118% at 50% 50%, transparent 52%, rgba(0, 0, 0, .62) 100%);
  animation: none;
}
.nib-static-host { isolation: isolate; background: #111 !important; animation: none !important; }
.nib-static-host > .tv-static { z-index: -1; opacity: .9; }
.nib .dr-hero .backrooms.nib-static-host > .tv-static { opacity: .55; }
/* (fix: off air hides only the 3D room, never the static; the static is soft, not pixel-sharp, and doesn't do the
   power-on squash) */
.nib-home.nib-off .pet-screen canvas.tv-static { visibility: visible; }
.nib-home.nib-off .pet-screen canvas:not(.tv-static) { visibility: hidden; }
.nib-home .pet-screen canvas.tv-static { image-rendering: auto; animation: none; }
/* (Wisse: "make the static look a bit softer using a filter": a touch of blur, less contrast, a little dimmer - the glow
   of a picture tube rather than sharp grain) */
.tv-static, .nib-home .pet-screen canvas.tv-static { filter: blur(.8px) contrast(.9) brightness(.82) saturate(.45); }
.nib-static-host > .tv-static { filter: blur(1px) contrast(.88) brightness(.8) saturate(.45); }

/* ---------------------------------------------------------------- a phone turned sideways (Wisse: "hows the horizontal view on
   mobile?" - the TV was taller than the screen): TV + chat side by side, the TV as tall as the screen allows, a one-row
   header, the title and the menu below; the antenna, feet and stand step aside, the side panel slims down */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1199px) {
  .nib-home .site-header .wrap { flex-wrap: nowrap; gap: 10px; padding-top: 6px; padding-bottom: 6px; }
  .nib-home .nav { flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1 1 auto; scrollbar-width: none; padding: 3px 2px; margin: -3px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .nib-home .nav::-webkit-scrollbar { display: none; }
  .nib-home .nav li { flex: none; }
  .nib-home .nav .btn { padding: 4px 9px; font-size: .82rem; }
  .nib-home .brand { flex: none; } .nib-home .brand b { font-size: 1.15rem; } .nib-home .brand span { font-size: .85rem; }

  .nib-home .pet-main { padding-top: 0; }
  .nib-home .pet-main > .wrap {
    padding: 0 10px; gap: 10px 12px;
    grid-template-columns: auto minmax(220px, 1fr);
    grid-template-areas: "tv chat" "title title" "menu menu" "note note";
  }
  .nib-home .pet-view {
    width: min(64vw, calc((100vh - 124px) * 4 / 3 + 86px)); min-width: 0; justify-self: start;
    margin: 2px 0 8px; padding: 8px; gap: 6px; border-radius: 22px / 20px;
    grid-template-columns: minmax(0, 1fr) 62px; grid-template-rows: auto auto;
  }
  .nib-home .pet-screen { margin: 6px; }
  .tv-antenna, .tv-feet, .tv-stand, .tv-dust { display: none !important; }
  .nib-home .pet-view::after { display: none; }
  .tv-panel { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; justify-content: center; padding: 8px 4px; gap: 8px; }
  .tv-plate, .tv-grille, .tv-label { display: none; }
  .nib-home .tv-knob:not(.small) { width: 34px; }
  .nib-home .tv-vols { flex-direction: column; gap: 10px; margin: 0; }
  .nib-home .tv-vols .tv-knob.small { width: 26px; }
  .tv-btn { width: 40px; height: 30px; }
  .tv-controls { grid-column: 1; grid-row: 2; margin: 0 6px; padding: 5px 8px; gap: 8px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .tv-lcd { display: none !important; }
  .nib-home .tv-gifts .btn.nib-gift { height: 40px; min-width: 48px; padding: 2px 6px; }
  .nib-home .tv-gifts .nib-gift .gift-icon { width: 22px; height: 22px; }
  .nib-home .tv-gifts .nib-gift .gift-price { font-size: .55rem; }
  .nib-home .tv-sound #pet-sound > button { height: 28px !important; min-width: 32px; }
  .nib-home .tv-sound #pet-sound input[type="range"] { display: none; }

  .nib-home .pet-chatbox { align-self: stretch; height: calc(100vh - 62px); min-height: 0; max-height: none; position: sticky; top: 6px; padding: 10px; gap: 6px; }
  .nib-home .chat-log { flex: 1 1 0; height: auto; min-height: 0; }
  .nib-home .nib-react { height: 32px; font-size: 1.05rem; }

  .nib-home .pet-title { text-align: left; display: flex; flex-wrap: wrap; align-items: end; gap: 4px 16px; }
  .nib-home .pet-title .nib-kicker { flex-basis: 100%; }
  .nib-home .pet-title .dr-title { font-size: 2.4rem; transform: rotate(-2deg); transform-origin: 0 100%; }
  .nib-home .pet-title > p.muted { margin: 0 0 6px; font-size: .9rem; }
  .nib-menu { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1199px) {
  .nib-home .pet-view { width: min(64vw, calc((100vh - 140px) * 4 / 3 + 86px)); }   /* (a little more room at the bottom) */
}

/* ---------------------------------------------------------------- dual-screen and folding phones (Wisse: "and for dual screen flip
   phones?"). Where the browser says the screen is two halves with a hinge (Surface Duo, foldables in book or laptop
   posture - viewport segments), nothing sits on the hinge: */
/* side by side, like a book: the TV and the title on the left screen, the chat on the right one */
@media (horizontal-viewport-segments: 2) {
  .nib-home .site-header .wrap { max-width: env(viewport-segment-width 0 0, 50vw); margin: 0; }
  .nib-home .pet-main > .wrap {
    max-width: none; padding: 0; row-gap: 12px;
    grid-template-columns: env(viewport-segment-width 0 0, 50vw) env(viewport-segment-width 1 0, 50vw);
    column-gap: calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw));
    grid-template-areas: "tv chat" "title chat" "menu chat" "note chat";
  }
  .nib-home .pet-view { width: calc(env(viewport-segment-width 0 0, 50vw) - 36px); min-width: 0; justify-self: center; }
  .nib-home .pet-title, .nib-home .nib-menu, .nib-home .pet-ai-note { padding: 0 18px; }
  .nib-home .pet-chatbox { position: sticky; top: 10px; height: calc(100vh - 20px); max-height: none; margin: 0 14px; align-self: start; }
  .nib-home .chat-log { flex: 1 1 0; height: auto; }
  .nib-chat-show { right: 0; }
}
/* folded like a laptop: the TV fits on the top screen, the rest on the bottom one */
@media (vertical-viewport-segments: 2) {
  .nib-home .pet-main > .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tv" "chat" "title" "menu" "note"; }
  .nib-home .pet-view {
    width: min(100%, calc((env(viewport-segment-height 0 0, 50vh) - 150px) * 4 / 3 + 120px)); justify-self: center; margin-top: 8px;
  }
  .tv-antenna { display: none; }
  .nib-home .pet-chatbox { margin-top: calc(env(viewport-segment-top 0 1, 50vh) - env(viewport-segment-bottom 0 0, 50vh) + 8px); height: calc(env(viewport-segment-height 0 1, 50vh) - 24px); }
}
/* (foldables: the header's menu is one swipeable row on anything up to a tablet's width, not only phones) */
@media (max-width: 899px) {
  .nib .site-header .wrap { flex-wrap: nowrap; gap: 10px; }
  .nib .nav { flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1 1 auto; scrollbar-width: none; padding: 4px 2px; margin: -4px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .nib .nav::-webkit-scrollbar { display: none; }
  .nib .nav li { flex: none; }
  .nib .brand { flex: none; }
}
/* (a flip phone's tiny cover screen: the TV first - the kicker, the line under the title and the antenna step aside) */
@media (max-width: 360px) and (max-height: 440px) {
  .nib-home .nib-kicker, .nib-home .pet-title > p.muted, .tv-antenna { display: none; }
  .nib-home .pet-title .dr-title { font-size: 1.9rem; }
  .nib-home .pet-view { margin-top: 10px; }
  .nib-home .pet-main > .wrap { gap: 8px; }
}

/* ================================================================ THE LOOK OF 25 NOV (Wisse: "Install all three"): a wood TV, a
   purple galaxy behind every page, and the TV standing in a 3D lawn (assets/nibbles_lawn.js) over dirt. Tried first as look ideas
   (G:\369Games-nibbles-site\tools\looks\), pictures in the notes (nibbles-main-site\looks_25nov). */

/* ---------------------------------------------------------------- INSTALLED 25 Nov 2026: a wood TV. Wisse, 25 Nov 2026: "a thing
   id like to consider on the site is a wood coloured tv". The cabinet in walnut veneer (the grain runs sideways, with a
   satin shine); the trim round the picture and the control panel in dark brown-black; the antenna's base and the feet in
   brown. Same shape; the knobs (matte plum, his pick), the badge, the buttons and the stand stay as they are. */
.nib-home .pet-view {
  background:
    linear-gradient(180deg, rgba(255, 236, 214, .17), rgba(255, 236, 214, 0) 15%),
    linear-gradient(0deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0) 24%),
    linear-gradient(102deg, rgba(255, 228, 196, 0) 20%, rgba(255, 228, 196, .08) 36%, rgba(255, 228, 196, 0) 50%),
    radial-gradient(130% 100% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .28)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .75' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12  0 0 0 0 .06  0 0 0 0 .02  1.3 0 0 0 -.58'/%3E%3C/filter%3E%3Crect width='1200' height='520' filter='url(%23p)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0032 .026' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='table' tableValues='0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix values='-.24 0 0 0 .55  -.17 0 0 0 .355  -.11 0 0 0 .215  0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='1200' height='520' filter='url(%23w)'/%3E%3C/svg%3E"),
    #7a4d2d;
  background-size: auto, auto, auto, auto, 1200px 520px, 1200px 520px, auto;
}
/* the trim round the picture tube: dark brown-black instead of purple */
.nib-home .pet-screen {
  box-shadow:
    0 0 0 3px #0b0806, 0 0 0 9px #1d1510, 0 0 0 10px rgba(255, 236, 214, .07),
    0 0 0 14px #120c08, 0 2px 0 14px rgba(255, 236, 214, .07);
}
/* the control panel and the strip under the picture (gifts, display, CC, mute): a dark brown inset */
.tv-panel { background: linear-gradient(180deg, #2b2019, #16100c); }
.nib-home .tv-controls { background: linear-gradient(180deg, #251b14, #17110c); }
.nib-watch .tv-controls { background: rgba(10, 8, 16, .62); }
.nib-home .tv-lcd { background: #0b0907; }
.tv-grille { background: repeating-linear-gradient(180deg, #0c0907 0 4px, rgba(255, 236, 214, .05) 4px 5px, transparent 5px 8px); }
@media (max-width: 699px) {
  .tv-grille { background: repeating-linear-gradient(90deg, #0c0907 0 4px, rgba(255, 236, 214, .05) 4px 5px, transparent 5px 8px); }
}
/* the knobs: matte brushed metal (Wisse: "the purple bar and knobs need to be changed, metal maybe?" - satin, not glossy:
   "no gloss on the volume knob, theyre a bit to bright for me"); the channel knob's pointer dark, the volume knobs keep
   their coloured pointers */
.nib-home .tv-knob {
  --ptr: #241d18; --ptr-glow: rgba(255, 236, 214, .35);
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .045) 0 1.5px, rgba(0, 0, 0, .045) 1.5px 3px),   /* (spun metal rings) */
    radial-gradient(circle at 50% 40%, #a29e98 0%, #8a8680 45%, #6d6a65 80%, #56534f 100%);
  box-shadow:
    0 0 0 3px #0e0b09, 0 0 0 6px #3b3734, 0 4px 7px 3px rgba(0, 0, 0, .55),
    inset 0 -2px 4px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .2);
}
.nib-home .tv-knob:hover {
  box-shadow:
    0 0 0 3px #0e0b09, 0 0 0 6px #46423e, 0 4px 7px 3px rgba(0, 0, 0, .55),
    inset 0 -2px 4px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .22), 0 0 14px var(--ptr-glow);
}
.nib-home .tv-knob.small { --ptr: var(--nib-lilac); --ptr-glow: rgba(169, 139, 255, .7); }
.nib-home .tv-knob.small[data-vol="fx"] { --ptr: var(--nib-slime); --ptr-glow: rgba(159, 232, 112, .7); }
.nib-home .tv-knob::before { background: repeating-conic-gradient(from -135deg, rgba(225, 214, 198, .5) 0 2.4deg, transparent 2.4deg 27deg); }
/* the bar under the TV: brushed dark steel instead of purple */
.tv-stand {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 32%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #5f5b57, #3b3835 60%, #2a2826);
}
/* CC and mute on the strip: dark steel too */
.nib-home .tv-sound #pet-sound > button {
  border-bottom-color: #1b1917 !important;
  background: linear-gradient(180deg, #5c5854, #383532) !important;
}
/* the antenna's base and the feet: brown plastic */
.nib-home .tv-antenna::before {
  background:
    radial-gradient(60% 80% at 35% 20%, rgba(255, 236, 214, .26), transparent 60%),
    linear-gradient(180deg, #5a3f2b, #2c1e14 70%, #1d140d);
}
.tv-feet i { background: linear-gradient(180deg, #2c1f15, #140d09); }

/* ---------------------------------------------------------------- INSTALLED 25 Nov 2026: a galaxy behind everything. Wisse, 25 Nov
   2026: "a galaxy star ish background", "we can keep the purple when going stars/galaxy", "fixed is good, slowly moving like
   real stars is beter", "it already moves enough but isnt distracting".
   The dark purple room becomes deep purple space, fixed behind the page (it doesn't scroll):
   - the page itself: the purple base, the TV's purple glow, a pink and a blue haze, a soft milky band across;
   - .nib::before: the sky - faint purple/pink clouds (nibbles_nebula.svg) and two star fields (nibbles_stars1/2.svg) - drifts
     very slowly (300 px in 15 minutes, then back), like the night sky turning;
   - html::before: a third, sparser star field (nibbles_stars3.svg) that drifts the same way and twinkles softly.
   Both move by transform/opacity only (no repainting). z-index -10: below the TV's glow, stand, feet and antenna (-3..-1). */
.nib {
  background-color: #0a0815;
  background-image:
    radial-gradient(70% 55% at 50% 36%, rgba(104, 84, 190, .18), transparent 70%),
    linear-gradient(122deg, transparent 28%, rgba(169, 139, 255, .06) 44%, rgba(236, 228, 255, .05) 50%, rgba(169, 139, 255, .06) 56%, transparent 72%),
    radial-gradient(48% 40% at 84% 16%, rgba(196, 96, 224, .13), transparent 70%),
    radial-gradient(44% 38% at 10% 82%, rgba(84, 96, 232, .11), transparent 70%),
    linear-gradient(180deg, #120e22, #08060f 85%);
  background-size: auto;
  background-attachment: fixed;
}
.nib::before, html:has(> body.nib)::before {
  content: ""; position: fixed; z-index: -10; inset: -340px; pointer-events: none;
  animation: nib-sky-drift 900s linear infinite alternate;
}
.nib::before {
  background:
    url("nibbles_stars2.svg") 0 0 / 1031px 947px,
    url("nibbles_stars1.svg") 0 0 / 613px 587px,
    url("nibbles_nebula.svg") 0 0 / 1400px 900px;
}
html:has(> body.nib)::before {
  background: url("nibbles_stars3.svg") 210px 140px / 829px 761px;
  animation: nib-sky-drift 900s linear infinite alternate, nib-twinkle 4.6s ease-in-out infinite alternate;
}
@keyframes nib-sky-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-300px, -90px, 0); } }
@keyframes nib-twinkle { 0% { opacity: .15; } 60% { opacity: .9; } 100% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .nib::before, html:has(> body.nib)::before { animation: none; }
  html:has(> body.nib)::before { opacity: .6; }
}

/* ---------------------------------------------------------------- INSTALLED 25 Nov 2026: the lawn in 3D (assets/nibbles_lawn.js -
   Wisse: "i think id like it to be 3D", "3d grass as in having more grass growing in front of one another"). Use instead of
   grass.css: the 3D lawn draws the grass (rows behind rows, over the TV's feet) and its front edge (turf into soil, blades
   hanging over it); this file is what's under it - the overhang's shadow, the roots, the soil getting darker as you scroll,
   the footer in deep dirt. Home page only. */
.nib-home .pet-main { overflow: clip; }
.nib-home .tv-stand {
  /* (where it always was: 51px under the TV box - the 3D lawn now reaches it, its front row hanging over; a shadow, roots) */
  left: -100vw; right: -100vw; top: calc(100% + 51px); bottom: auto; height: 400vh; border-radius: 0; box-shadow: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 22px),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 30px, rgba(0, 0, 0, .28) 130px, rgba(0, 0, 0, .5) 520px, rgba(0, 0, 0, .66) 1300px),
    url("nibbles_roots.svg") 0 -4px / 300px 90px repeat-x,
    url("nibbles_dirt.svg") 0 0 / 420px 420px;
}
@media (max-width: 699px) { .nib-home .tv-stand { top: calc(100% + 51px); bottom: auto; height: 400vh; } }
/* a tiny gap between the lawn's edge and what comes under the TV, just room for the grass to grow over the edge (Wisse: "i need
   empty space between the dirt and the menu", "only a tiny bit so grass can grow beyond it slightly for it doesnt grow straight
   up", "no soil", "some empty space between the menu and the grass dirt and tv. this way the grass can grow slightly forward
   creating a 3D effect"): the edge is 51px under the TV box, the menu 33px under that, the 3D lawn's front row grows into it */
.nib-home .pet-view { margin-bottom: 84px; }
@media (max-width: 699px) { .nib-home .pet-view { margin-bottom: 82px; } }
.nib-home .pet-view::after { display: none; }       /* (the lawn has the TV's shadow) */
.nib-lawn3d { position: absolute; z-index: 3; display: block; pointer-events: none; }
/* the menu, the chat and the small print stand in front of the lawn (it runs the window's width behind them) */
.nib-home .nib-menu, .nib-home .pet-ai-note { position: relative; z-index: 4; }
.nib-home .pet-chatbox { z-index: 4; }
@media (max-width: 899px) { .nib-home .pet-chatbox { position: relative; } }
.nib-watch .nib-lawn3d { display: none; }
/* a phone held sideways hides the old shelf (.tv-stand); it's the dirt now, so it shows there too (Wisse: "on panoramic phone
   view the dirt doesnt show") */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1199px) {
  .nib-home .tv-stand { display: block !important; }
}
.nib-home .site-footer {
  margin-top: 0; border-top: 0;
  background: linear-gradient(rgba(0, 0, 0, .66), rgba(0, 0, 0, .74)), url("nibbles_dirt.svg") 0 0 / 420px 420px;
}

/* the home page waits, hidden, until it's all there - the lawn's first frame, the fonts, the soil - then fades in at once (Wisse:
   "hold off till the entire site is loaded so not to have it show dirt without grass for a few frames"). html.nib-hold is set by
   a line in the head and taken off by assets/nibbles_lawn.js (6 s after the 18+ gate at the most). The galaxy shows meanwhile;
   the page keeps its layout (the lawn measures the TV); animations wait so the TV's switch-on plays whole. */
html.nib-hold body.nib-home > :not(.age-gate) { opacity: 0; }
body.nib-home > :not(.age-gate) { transition: opacity .3s ease; }
html.nib-hold body.nib-home *, html.nib-hold body.nib-home *::before, html.nib-hold body.nib-home *::after { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- in-page tabs (assets/nibbles_tabs.js - Wisse: "is it possible to
   keep Nibbles loaded when clicking another tab like account or gallery?", "Hidden, paused"): Characters, Town and Gallery show
   in a .nib-tab-view with the home page (#main) hidden; Account is the home page's own panel the way account.html shows it
   (body.nib-acct), minus the home page's own parts */
.nib-tab-on #main { display: none !important; }
.nib-tab-view[hidden] { display: none !important; }
.nib-tab-view { min-height: 56vh; }
.nib-view-account .nib-menu, .nib-view-account .nib-guide, .nib-view-account .nib-scrim, .nib-view-account .nib-keys,
.nib-view-account .pet-side > .nib-close { display: none !important; }
.nib-home .nib-acct-hero, .nib-home .nib-acct-back { display: none; }
