/* ---------- Extras: away message, pet-able critters, Konami egg, seasons, hit counter (js/extras.js) ---------- */

/* AIM-style away message window */
.aim {
  width: min(320px, 100%);
  margin: 18px auto 0;
  text-align: left;
  background: #ece9d8;
  border: 2px solid #0a246a;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 4px 5px 0 rgba(43, 26, 82, .25);
  transform: rotate(-1deg);
}
.aim-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: linear-gradient(#3a8cf0, #0a5fd8 45%, #0848b8);
  color: #fff;
  font: bold 12px Tahoma, Verdana, sans-serif;
  border-radius: 5px 5px 0 0;
  text-shadow: 1px 1px 0 #00246b;
}
.aim-man { font-size: 13px; filter: hue-rotate(10deg); }
.aim-x {
  margin-left: auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 10px;
  background: linear-gradient(#e8836c, #c4361b);
  border: 1px solid #fff;
  border-radius: 3px;
}
.aim-body {
  margin: 4px;
  padding: 8px 10px;
  background: #fff;
  border: 1px inset #b9b6a8;
  font: 13px/1.45 Tahoma, Verdana, sans-serif;
}
.aim-away { margin: 0 0 6px; color: #0000ff; font-family: "Comic Sans MS", "Comic Sans", var(--f-hand); font-size: 14px; }
.aim-label { margin: 0; font-weight: bold; color: #c00000; }
.aim-lines { list-style: none; margin: 2px 0 0; padding: 0; }
.aim-lines li { margin: 1px 0; }
.aim-emoji { display: inline-block; width: 20px; }
.aim-lines b { color: #0a246a; }
.aim-updated { margin: 6px 0 0; font-size: 10px; color: #8a8492; text-align: right; }

/* Pet-able critters */
button.critter-photo { cursor: pointer; padding: 0; font: inherit; color: inherit; transition: transform .15s; }
button.critter-photo:hover { transform: scale(1.05) rotate(-3deg); }
button.critter-photo:active { transform: scale(.94); }
.critter-pets { min-height: 1.2em; margin: 4px 0 0; font: 700 12px var(--f-round); color: #e0457b; }
.pet-total {
  margin: 4px auto 0;
  text-align: center;
  font: 700 15px var(--f-round);
  color: #fff;
  text-shadow: 0 2px 0 var(--green-dark), 2px 0 0 var(--green-dark), -2px 0 0 var(--green-dark), 0 -2px 0 var(--green-dark);
}
.pet-heart {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  color: #ff4d8d;
  font-size: 22px;
  translate: -50% -50%;
  animation: pet-heart .9s ease-out forwards;
}
@keyframes pet-heart {
  to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; }
}

/* Konami code: tomato cursor + raining chickens */
body.tomato-cursor, body.tomato-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='26' font-size='26'%3E%F0%9F%8D%85%3C/text%3E%3C/svg%3E") 12 12, auto !important;
}
.egg-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.egg-chicken {
  position: absolute;
  top: -60px;
  animation: egg-fall linear forwards;
}
@keyframes egg-fall {
  to { transform: translateY(calc(100vh + 120px)) rotate(var(--spin)); }
}
.egg-toast {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--cream);
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 0 5px 0 #e8d9b0, 0 0 0 4px #fff, 0 8px 20px rgba(0, 0, 0, .25);
  font: 700 15px var(--f-round);
  text-align: center;
}
.egg-toast[hidden] { display: none; }

/* Seasonal decorations: behind the page content, above the photo wall */
.season-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.season-bit {
  position: absolute;
  top: -40px;
  opacity: .8;
  animation: season-fall linear infinite;
}
@keyframes season-fall {
  0% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(var(--sway), 55vh) rotate(160deg); }
  100% { transform: translate(0, calc(100vh + 60px)) rotate(320deg); }
}
body[data-season="winter"] .season-bit { color: #fff; text-shadow: 0 0 4px rgba(90, 168, 240, .8); }

/* "You are visitor #…" (Newgrounds portal side panel) */
.visitor {
  background: var(--ng-panel);
  border: 2px solid #000;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  color: #fff;
  font: bold 11px var(--f-body);
}
.visitor p { margin: 0; }
.visitor-num { display: inline-flex; gap: 2px; margin: 6px 0 4px !important; background: #000; padding: 3px; border-radius: 4px; }
.visitor-num span {
  display: inline-block;
  min-width: 16px;
  padding: 2px 0;
  background: linear-gradient(#333, #111 50%, #222);
  color: var(--ng-orange);
  font: 12px var(--f-pixel);
  border-radius: 2px;
}
.visitor-since { color: #8a8492; font-size: 10px; }

/* Arcade high scores (Newgrounds portal side panel) */
.hiscores { background: var(--ng-panel); border: 2px solid #000; border-radius: 10px; overflow: hidden; color: #fff; }
.hiscores h3 {
  margin: 0;
  padding: 6px 10px;
  background: linear-gradient(#ffd25a, var(--ng-orange) 55%, #f07d00);
  color: #fff;
  font: 700 14px var(--f-round);
  -webkit-text-stroke: 1px #6b2d00;
  text-shadow: 0 2px 0 #6b2d00;
}
.hiscores-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; }
.hiscores-tabs button {
  flex: 1 1 auto;
  padding: 3px 6px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #34303b;
  color: #ccc;
  font: bold 10px var(--f-body);
  cursor: pointer;
}
.hiscores-tabs button[aria-pressed="true"] { background: var(--ng-orange); border-color: #000; color: #2b1a52; }
.hiscores-list { margin: 0; padding: 8px 10px 10px 30px; font: 9px/2 var(--f-pixel); }
.hiscores-list li::marker { color: #8a8492; }
.hiscores-list li b { font-weight: 400; color: var(--yellow); }
.hiscores-list li span { float: right; color: #7dff7d; }
.hiscores-list .hiscores-empty { list-style: none; margin-left: -20px; font: 600 12px/1.4 var(--f-round); color: #ccc; }

/* Rabbit & Frog hall of fame */
.hall {
  text-align: center;
  background: linear-gradient(#fff6c9, #ffe9a8);
  border: 5px solid #fff;
  border-radius: 28px;
  box-shadow: 0 0 0 5px #e0a800, 0 10px 0 5px rgba(43, 26, 82, .2);
  padding: 22px 20px 24px;
}
.hall[hidden] { display: none; }
.hall-title {
  margin: 0;
  font: 400 clamp(26px, 5vw, 38px)/1.1 var(--f-logo);
  color: #3f8f2e;
  -webkit-text-stroke: 1px #1f4d15;
  text-shadow: 2px 2px 0 #fff, 4px 5px 0 #e0a800;
}
.hall-intro { max-width: 620px; margin: 8px auto 16px; font: 400 20px/1.3 var(--f-hand); }
.hall-empty { margin: 8px 0 0; font: 400 20px var(--f-hand); color: #6b4a1f; }
.hall-grades { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.hall-grade {
  flex: 0 1 200px;
  background: #fff;
  border: 3px dashed #e0c98e;
  border-radius: 18px;
  padding: 10px 12px 12px;
  box-shadow: 0 5px 0 rgba(224, 168, 0, .5);
}
.hall-grade h3 { margin: 0 0 6px; font: 700 17px var(--f-round); color: #6b4a1f; }
.hall-count { background: #ffd23f; border-radius: 999px; padding: 1px 8px; font-size: 13px; }
.hall-grade ul { list-style: none; margin: 0; padding: 0; font: 400 20px/1.35 var(--f-hand); }
.hall-photos { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 18px; }
.hall-photos:empty { display: none; }
.hall-photo { margin: 0; width: 170px; background: #fff; padding: 8px 8px 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, .18); }
.hall-photo:nth-child(odd) { transform: rotate(-2deg); }
.hall-photo:nth-child(even) { transform: rotate(2deg); }
.hall-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.hall-photo figcaption { font: 400 17px/1.2 var(--f-hand); padding-top: 4px; }

/* Critter Corner: community "Most Petted" board */
.pet-board {
  max-width: 460px;
  margin: 12px auto 0;
  background: var(--cream);
  border: 3px dashed #e0c98e;
  border-radius: 22px;
  padding: 12px 16px 10px;
  box-shadow: 0 5px 0 rgba(63, 143, 46, .5);
}
.pet-board[hidden] { display: none; }
/* Collapsible (a <details>, closed by default): the summary shows the title and the community total */
.pet-board > summary {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-right: 22px;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.pet-board > summary::-webkit-details-marker { display: none; }
.pet-board > summary::after {
  content: "▼";
  position: absolute;
  right: 2px;
  top: 50%;
  margin-top: -8px;
  color: #c9a46a;
  font-size: 13px;
  transition: transform .2s;
}
.pet-board[open] > summary::after { transform: rotate(180deg); }
.pet-board[open] > summary { margin-bottom: 8px; }
.pet-board-title { font: 700 18px var(--f-round); color: #6b4a1f; }
.pet-board-total { font: 700 14px var(--f-round); color: #e0457b; }
.pet-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pet-board-list li {
  display: grid;
  grid-template-columns: 28px 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  font: 600 15px var(--f-round);
}
.pet-board-list li:nth-child(-n+3) { background: #fff6d6; }
.pb-rank { text-align: center; font-size: 18px; }
.pb-photo { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #dff3ff; display: grid; place-items: center; font-size: 16px; }
.pb-photo img { width: 100%; height: 100%; object-fit: cover; }
.pb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-count { color: #e0457b; font-variant-numeric: tabular-nums; }

/* Away message lives in the welcome card's right column (170px), under "This day in Yvy history" */
.side-right .aim { width: 100%; margin: 0; transform: rotate(-1.5deg); }
.side-right .aim-bar { gap: 4px; padding: 2px 4px; font-size: 10px; }
.side-right .aim-man { font-size: 11px; }
.side-right .aim-x { width: 14px; height: 14px; font-size: 8px; }
.side-right .aim-body { margin: 3px; padding: 6px 7px; font-size: 11px; line-height: 1.35; }
.side-right .aim-away { font-size: 12px; margin-bottom: 4px; }
.side-right .aim-emoji { width: 16px; }
.side-right .aim-updated { font-size: 9px; margin-top: 4px; }
@media (max-width: 820px) {
  .side-right .aim { width: 220px; }
}

/* Sample certificate under the hall of fame intro */
.hall-cert { margin: 0 auto 18px; max-width: 560px; }
.hall-cert[hidden] { display: none; }
.hall-cert a { display: block; }
.hall-cert img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px #e0a800, 0 8px 18px rgba(43, 26, 82, .2);
  transform: rotate(-1deg);
  transition: transform .15s;
}
.hall-cert a:hover img { transform: rotate(0) scale(1.02); }
.hall-cert figcaption { margin-top: 10px; font: 400 19px/1.3 var(--f-hand); color: #6b4a1f; }

/* Pixel emoji (js/pixel-emoji.js): hand-drawn 12×12 sprites scaled up with crisp pixels.
   Sized like text (1.15em of the font size around them). !important because photo frames
   (.oval img, .polaroid-photo img...) stretch or position every <img> inside them. */
img.px-emoji {
  display: inline-block !important;
  position: static !important;
  width: calc(1.15em * var(--px-ratio, 1)) !important;
  height: 1.15em !important;
  max-width: none !important;
  object-fit: fill !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 .03em;
  vertical-align: -.2em;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  pointer-events: none;
}

/* ---------- Music player in Yvy's Extras (extras.js → buildMusic): a tiny retro MP3 player ---------- */
/* The Extras column can't grow to fit the scrolling song name (it would push past a phone screen) */
.extras { min-width: 0; }
.extra-music { padding: 8px 10px 9px; background: linear-gradient(#b9a4f0, #8a6fdc); }
.extra-music[hidden] { display: none; }
.mp-head { margin: 0 0 5px; font: 700 12px var(--f-round); }
.mp-screen {
  overflow: hidden;
  background: #c7e8a1;
  border: 3px solid #2b1a52;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #a5cf78;
  padding: 4px 6px;
  color: #23401a;
  font: 8px/1.4 var(--f-pixel);
  white-space: nowrap;
}
.mp-scroll { display: inline-block; }
.is-playing .mp-scroll { animation: mp-marquee 9s linear infinite; padding-left: 100%; }
@keyframes mp-marquee { to { transform: translateX(-100%); } }
.mp-bar { display: flex; align-items: center; gap: 6px; margin: 5px 0 4px; }
.mp-seek { flex: 1; min-width: 0; height: 6px; accent-color: #ffd23f; cursor: pointer; }
.mp-time { font: 7px var(--f-pixel); min-width: 30px; text-align: right; }
.mp-buttons { display: flex; align-items: center; gap: 5px; }
.mp-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 20px;
  padding: 0;
  background: #fff;
  color: #2b1a52;
  fill: currentColor;
  border: 2px solid #2b1a52;
  border-radius: 5px;
  box-shadow: 0 2px 0 #2b1a52;
  cursor: pointer;
}
.mp-btn:active { transform: translateY(2px); box-shadow: none; }
.mp-play { width: 32px; background: #ffd23f; }
.mp-btn svg { fill: currentColor; }
.mp-mute { width: 22px; margin-left: 4px; }
.mp-mute.is-muted { background: #e2dbef; opacity: .8; }
.mp-vol { width: 56px; min-width: 0; height: 6px; accent-color: #ffd23f; cursor: pointer; }
.mp-count { margin-left: auto; font: 7px var(--f-pixel); opacity: .85; }
@media (prefers-reduced-motion: reduce) {
  .is-playing .mp-scroll { animation: none; padding-left: 0; }
}
