/* The DeadRooms pet page (pet.html) only - laid out like an old-school MMO (Wisse, 20 Nov 2026: "an OSRS type layout
   with a chatbox"): the room top left, the chatbox under it, the side panel with Items and Needs on the right.
   In DeadRooms' own dark-and-yellow look. The room is drawn by assets/pet3d.js (or, without WebGL, assets/pet.js). */

.pet-main { padding-top: 28px; }
/* (an element with "hidden" stays hidden even where a rule below gives it a display - the Account tab's two halves) */
.pet-main [hidden] { display: none !important; }
.pet-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; margin-bottom: 14px; }
.pet-title .dr-title { font-size: clamp(2.6rem, 8vw, 4.2rem); margin: 0; }
.pet-title p { margin: 0; max-width: 34em; }

.pet-offline { margin: 0 0 14px; border-color: var(--accent) !important; }

/* the frame */
.pet-game {
  display: grid; gap: 10px; padding: 10px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "view" "side" "chat" "fund";
  background: #100f08; border: 2px solid var(--dr-wall-dark); border-radius: 12px;
  box-shadow: inset 0 0 0 1px #000, 0 10px 40px rgba(0, 0, 0, .45);
}
@media (min-width: 900px) {
  .pet-game { grid-template-columns: minmax(0, 1fr) 272px; grid-template-areas: "view side" "chat side" "fund side"; }
}
.pet-view { grid-area: view; min-width: 0; }
.pet-side { grid-area: side; min-width: 0; }
.pet-chatbox { grid-area: chat; min-width: 0; }

/* the room */
.pet-screen {
  position: relative; overflow: hidden; border-radius: 6px; aspect-ratio: 4 / 3;
  border: 1px solid #000; outline: 1px solid var(--dr-line);
}
.pet-screen canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges; touch-action: manipulation;
}
.pet-screen.is-3d canvas { image-rendering: auto; }
.pet-mood, .pet-overhead {
  position: absolute; z-index: 2; margin: 0; pointer-events: none; font-weight: 700; line-height: 1.3;
  color: #f4e46c; text-shadow: 1px 1px 0 #000, 0 0 6px rgba(0, 0, 0, .7);
}
.pet-mood { top: 8px; left: 10px; right: 10px; font-size: .95rem; }
.pet-overhead {
  left: 50%; top: 24%; transform: translate(-50%, -100%); width: max-content; max-width: min(72%, 420px);
  text-align: center; font-size: .98rem; color: #ffef5a;
}

/* below the chat: the fund meter + Donate (Ko-fi); under the room: the brain meter (21 Nov) */
.pet-fund {
  grid-area: fund; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 8px 10px;
  background: var(--dr-card); border: 1px solid var(--dr-line); border-radius: 6px;
}
.pet-fund-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.pet-fund-text strong { color: var(--accent); }
.pet-fund-text span { font-size: .88rem; font-variant-numeric: tabular-nums; }
.pet-fund .fund-bar { grid-column: 1; height: 12px; }
.pet-donate { grid-column: 2; grid-row: 1 / span 2; font: inherit; font-weight: 700; padding: 7px 14px; white-space: nowrap; }
/* crypto tips under the meter (21 Nov - "crypto wallet for Nibbles": its PUBLIC Solana address, a copy button, a wallet link) */
.pet-sol { grid-column: 1 / -1; display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--dr-line); }
.pet-sol p { margin: 0; }
.pet-sol strong { color: var(--accent); }
.pet-sol-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pet-sol-row code { padding: 4px 8px; border-radius: 6px; background: #0b0a06; border: 1px solid var(--dr-line); font-size: .8rem; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.pet-sol-row .btn { font: inherit; font-weight: 700; font-size: .82rem; padding: 4px 10px; }
.pet-brain { margin: 6px 0 0; padding: 0 2px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  .pet-fund { grid-template-columns: minmax(0, 1fr); }
  .pet-donate { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* the side panel */
.pet-side {
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: var(--dr-card); border: 1px solid var(--dr-line); border-radius: 6px;
}
.pet-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pet-side-head strong { color: var(--accent); font-size: 1.1rem; }
.pet-side-head span { font-size: .88rem; }
/* (23 Nov - Wisse: "id like hes items to show up next to the screen and id like account logout forget etc to be moved
   below it": his items first, the account under them) */
.pet-items { display: grid; gap: 6px; }
.pet-side .pet-items-head, .pet-side .pet-acct-head { margin: 0; font-size: 1.05rem; line-height: 1.2; letter-spacing: .04em; }
.pet-acct-head { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--dr-line); }
.pet-items-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pet-item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--dr-line); border-radius: 6px;
}
.pet-item-icon svg { width: 24px; height: 24px; display: block; }
.pet-item-name { font-weight: 700; }
.pet-item-where { font-size: .85rem; white-space: nowrap; }
.pet-item-icon { min-height: 24px; }
/* (23 Nov - "Nibbles can carry 5 items at once": the empty slots, dim) */
.pet-item-empty { border-style: dashed; opacity: .55; }
.pet-item-empty .pet-item-name { font-weight: 400; font-size: .85rem; }
.pet-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
/* the tabs, the chat's filters and the item tiles are the game's menu buttons too (site.css .btn; the open tab /
   filter is the picked one, full of the colour) - here only their size */
.pet-tabs .btn, .chat-filter { font: inherit; font-weight: 700; font-size: .9rem; padding: 6px 8px; }
/* (22 Nov - no Items / Needs tabs any more: only Account, so no tab row - unless the owner's tab joins it) */
.pet-tabs:not(.has-more) { display: none; }
.pet-side .pet-tabs.has-more { grid-template-columns: 1fr 1fr; }

/* logging in (the Account tab) */
.acct-form { display: grid; gap: 6px; }
.acct-form p { margin: 0; }
.acct-form label { font-size: .85rem; font-weight: 700; color: var(--dr-muted); }
.acct-form input {
  font: inherit; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--dr-line);
  background: #0d0c07; color: var(--dr-text); min-width: 0;
}
.acct-form input:focus { outline: none; border-color: var(--accent); }
.acct-form .btn, .acct-in .btn { font: inherit; font-weight: 700; cursor: pointer; padding: 7px 16px; }
.acct-msg { min-height: 1.3em; font-size: .88rem; color: #e8836a; }
.acct-in { display: grid; gap: 8px; justify-items: start; }
.acct-in p { margin: 0; }
/* (24 Nov 2026 - the Preferred language: the website's, the chat's and the subtitles' - assets/pet.js acctLang) */
.acct-lang { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--dr-line); }
.acct-lang[hidden] { display: none; }
.acct-lang p { margin: 0; }
.acct-lang label { font-size: .85rem; font-weight: 700; color: var(--dr-muted); }
.acct-lang select {
  font: inherit; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--dr-line);
  background: #0d0c07; color: var(--dr-text); min-width: 0; cursor: pointer;
}
.acct-lang select:focus { outline: none; border-color: var(--accent); }

/* (22-23 Nov - the give block under his items and the Shop tab, assets/pet_shop.js: Tokens, Brains and Fingers, the
   packs through Stripe; the legal lines small, as in DeadRooms' store - Wisse: "make all legal things small letters" -
   but never hidden or pre-ticked) */
.pet-shop #shop-out, .pet-shop #shop-in, .pet-give, .pet-give #give-in { display: grid; gap: 8px; }
.pet-shop #shop-out[hidden], .pet-shop #shop-in[hidden], .pet-shop [hidden], .pet-give [hidden] { display: none; }
.pet-shop p, .pet-give p { margin: 0; }
.pet-give { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--dr-line); }
.pet-give #give-out { cursor: pointer; }
.shop-wallet { font-size: 1.05rem; }
.shop-wallet strong { color: var(--accent); }
.pet-shop .btn, .pet-give .btn { font: inherit; font-weight: 700; cursor: pointer; padding: 7px 12px; }
/* (23 Nov - "a picture of a brain and a picture of a finger": two item tiles; press = one more, spam welcome. The picture
   changes with how many are pressed together - "a normal brain a bronze brain a zilver one a gold one a diamond one and
   then a holy one thats made of light" - the same tiers as the room's prop, pet_shop.js tierOf) */
.gift-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pet-give .shop-give { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; touch-action: manipulation; user-select: none; }
.shop-give .gift-icon { width: 48px; height: 48px; transition: filter .25s ease, transform .12s ease; }
.shop-give .gift-name { font-size: .95rem; }
.shop-give .gift-price { font-size: .78rem; font-weight: 400; color: var(--dr-muted); }
.shop-give.counting .gift-icon { transform: scale(1.12); }
.shop-give:active .gift-icon { transform: scale(.92); }
.shop-give.tier-bronze .gift-icon { filter: sepia(1) saturate(2.4) hue-rotate(-20deg) brightness(.85); }
.shop-give.tier-silver .gift-icon { filter: grayscale(1) brightness(1.45) contrast(1.15); }
.shop-give.tier-gold .gift-icon { filter: sepia(1) saturate(4.5) hue-rotate(8deg) brightness(1.15) drop-shadow(0 0 3px #f5c542); }
.shop-give.tier-diamond .gift-icon { filter: grayscale(1) sepia(1) hue-rotate(155deg) saturate(3.5) brightness(1.35) drop-shadow(0 0 4px #8ff3ff); }
.shop-give.tier-holy .gift-icon { filter: grayscale(.7) brightness(2.3) drop-shadow(0 0 5px #fff6c4) drop-shadow(0 0 12px #ffe27a); animation: gift-holy 1.2s ease-in-out infinite alternate; }
@keyframes gift-holy { to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .shop-give.tier-holy .gift-icon { animation: none; } }
.shop-h { margin: 8px 0 0; font-size: .95rem; color: var(--accent); }
.shop-test { color: #1a1300; background: #e9c46a; border-radius: 4px; padding: 2px 6px; font-weight: 700; justify-self: start; }
.shop-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pet-shop .shop-pack { display: grid; gap: 2px; padding: 6px; text-align: center; font-weight: 400; }
.shop-pack strong { font-size: .92rem; }
.shop-pack .fine { font-size: .72rem; min-height: 1em; }
.shop-eur { font-weight: 700; }
.shop-pack.on { outline: 2px solid var(--accent); }
.shop-consent { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.shop-consent input { margin-top: 2px; flex: none; }
.shop-small { font-size: 12px; }
.pet-shop .acct-msg:not(.bad), .pet-give .acct-msg:not(.bad) { color: var(--dr-muted); }

/* (the fund meter's bar) */
.pet-bar { grid-column: 1 / -1; display: block; height: 10px; border-radius: 999px; background: #0d0c07; border: 1px solid var(--dr-line); overflow: hidden; }
.pet-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .5s ease, background-color .5s ease; }
.pet-bar.low i { background: #d8553a; }

/* the chatbox */
.pet-chatbox {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: #0b0a06; border: 1px solid var(--dr-line); border-radius: 6px;
}
.chat-tabs { display: flex; gap: 4px; }
.chat-filter { padding: 3px 12px; font-size: .82rem; }
.chat-log {
  height: 168px; overflow-y: auto; padding: 4px 6px; overscroll-behavior: contain;
  font-size: .95rem; line-height: 1.4;
}
@media (max-width: 899px) { .chat-log { height: 200px; } }
.chat-log .line { margin: 0 0 2px; overflow-wrap: anywhere; }
.chat-log .game { color: var(--dr-muted); }
.chat-log .game.bad { color: #e8836a; }
.chat-log .who { font-weight: 700; }
.chat-log .player .who { color: #c9c2a0; }
.chat-log .mine .who { color: var(--accent); }
.chat-log .pet .who { color: #9fc27f; }
.chat-log .to { color: #8fb1d9; font-weight: 700; }
.chat-log .to-me { background: rgba(230, 211, 106, .08); border-radius: 4px; }
.chat-log .to-me .to { color: var(--accent); }
.chat-log time { color: #6f6950; font-size: .8rem; }
/* (22 Nov - a player's friend level with Nibbles, in front of their name: Friend XP, capped at 999) */
.chat-log .lv { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 6px; font-size: .72rem;
  font-weight: 800; line-height: 1.45; vertical-align: 1px; letter-spacing: .02em; border: 1px solid currentColor; }
.chat-log .lv-grey { color: #a59f86; background: rgba(165, 159, 134, .12); }
.chat-log .lv-green { color: #8fcf6a; background: rgba(143, 207, 106, .12); }
.chat-log .lv-blue { color: #6fb2e8; background: rgba(111, 178, 232, .12); }
.chat-log .lv-purple { color: #c08ae8; background: rgba(192, 138, 232, .14); }
.chat-log .lv-gold { color: #f0c94a; background: rgba(240, 201, 74, .16); box-shadow: 0 0 6px rgba(240, 201, 74, .35); }
.chat-log[data-show="game"] .line:not(.game) { display: none; }
.chat-log[data-show="talk"] .line.game { display: none; }

.chat-form { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--dr-line); padding-top: 6px; }
.chat-who { font-weight: 700; color: var(--accent); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; padding: 6px 4px; border: 0; border-bottom: 1px dashed var(--dr-line);
  background: transparent; color: var(--dr-text);
}
.chat-form input:focus { outline: none; border-bottom-color: var(--accent); }
.chat-form .btn { font: inherit; font-weight: 700; cursor: pointer; padding: 6px 16px; }
.chat-form input:disabled { opacity: .45; cursor: not-allowed; }

.pet-ai-note { margin: 12px 0 0; max-width: 60em; }

@media (prefers-reduced-motion: reduce) { .pet-bar i { transition: none; } }
