/* Windows XP chrome over a locally rendered Blender landscape. */
@font-face {
  font-family: Byrd;
  src: url("./font/byrd-bold.ttf") format("truetype");
  font-weight: 400 700;
}
:root {
  --dock-width: 280px;
  --edge: 20px;
  --taskbar: 40px;
}
body {
  background: #609137;
  min-height: 100vh;
  color-scheme: light;
}
button, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #164bb5;
  outline-offset: 1px;
}
.xp-title-bar button:focus-visible, .xp-taskbar button:focus-visible, .desktop-icon:focus-visible {
  outline-color: white;
}
[hidden] { display: none !important; }
#desktop { position: relative; height: calc(100vh - var(--taskbar)); height: calc(100dvh - var(--taskbar)); }
.meadow-wallpaper { position: absolute; inset: 0 0 calc(0px - var(--taskbar)); overflow: hidden; pointer-events: none; }
.meadow-film {
  position: absolute; top: 50%; left: 50%;
  width: max(100%, 160vh); width: max(100%, 160dvh); aspect-ratio: 8 / 5;
  transform: translate(-50%, -50%);
  background: #589bd4 url("./bonerin-sky.png") center / 100% 100% no-repeat;
}
.meadow-film::after {
  content: ""; position: absolute; inset: 0;
  background: url("./bonerin-turf.webp") center / 100% 100% no-repeat;
}
/* Two identical cloud strips, each 1.5 camera widths. Moving by one strip
   gives continuous wind; the static foreground covers it along the real ridge. */
.meadow-clouds {
  position: absolute; top: 0; right: -25%; width: 300%; height: 70%;
  background: url("./bonerin-cumulus.webp") left top / 50% auto repeat-x;
  animation: meadow-wind 660s linear infinite;
}
@keyframes meadow-wind { to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .meadow-clouds { animation-play-state: paused; } }
#model-area { position: absolute; inset: 0 0 calc(0px - var(--taskbar)); }
#model-frame { position: absolute; inset: 0 calc(var(--dock-width) + var(--edge) + 4px) var(--taskbar) calc(88px + var(--edge)); pointer-events: none; }
/* The shadow extends past the body's frame. Scale the still about the same aim point
   as the standing camera, including its horizontal fit on very tall, narrow screens. */
#model-poster-frame { position: absolute; inset: 0; z-index: 10001; container-type: size; pointer-events: none; }
#model-poster {
  position: absolute; left: 50%; top: 54.6%; transform: translate(-50%, -54.6%);
  height: 100%; height: min(100cqh, calc(294cqw + 1.95cqh), 310cqw); width: auto; max-width: none;
}
#model-area:is(.model-ready, .model-error) #model-poster-frame { display: none; }
#character-stage { position: absolute; inset: 0; touch-action: none; }
#character-stage:focus-visible { outline: 2px solid white; outline-offset: -3px; }
/* Paint over the desktop windows and shortcuts, with the taskbar in front. */
#character-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10001; pointer-events: none; }
.xp-taskbar { z-index: 10002; }
.bg-title {
  top: 18%; font-size: clamp(64px, calc(14vw - 42px), 190px);
  text-shadow: 0 1px 2px #17497555, 0 2px 6px #17497526;
}
#model-message {
  position: absolute; left: 50%; top: 49%; transform: translate(-50%, -50%);
  border: 1px solid #716f64; background: #ece9d8; padding: 6px 12px; color: #222;
  font: 13px Tahoma, sans-serif; text-align: center; box-shadow: 2px 2px 5px #0004;
}
#model-area:not(.model-error) #model-message {
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; border: 0;
}
#retry-model { margin-top: 5px; pointer-events: auto; }
.desktop-icons { --shortcut-size: 56px; pointer-events: none; }
.desktop-icon { width: 88px; color: white; line-height: 1.25; text-decoration: none; pointer-events: auto; }
button.desktop-icon { border: 0; background-color: transparent; font: inherit; }
button.desktop-icon:hover { background-color: #fff3; }
.desktop-icon i { font-size: var(--shortcut-size); line-height: 1; }
.desktop-icon .fa-x-twitter { filter: drop-shadow(0 1px 1px #163952b3) drop-shadow(1px 2px 2px #16395280); }
.desktop-icon img { width: var(--shortcut-size); height: var(--shortcut-size); object-fit: contain; }
.desktop-icon span { font-size: 13px; }
.desktop-icon[aria-disabled="true"], .start-link[aria-disabled="true"], #ca-display:disabled { cursor: default; }
.window-dock {
  position: absolute; top: var(--edge); right: 0; bottom: 8px; width: calc(var(--dock-width) + var(--edge));
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 var(--edge) 6px 0;
  overflow-y: auto; scrollbar-width: thin; pointer-events: none;
}
.window-dock > .xp-window { flex: none; pointer-events: auto; }
.window-dock #token-info-window, .window-dock #size-info-window, .window-dock #about-window {
  display: flex; position: relative; inset: auto; width: 100%;
}
#about-window .xp-content { min-height: 72px; }
#about-window p + p { margin-top: 6px; }
.xp-window:focus { outline: none; }
.xp-title-bar { flex: none; touch-action: none; }
.xp-btn { font-family: Tahoma, sans-serif; font-size: 15px; font-weight: bold; line-height: 1; }
.xp-content { font: 12px/1.5 Tahoma, Arial, sans-serif; }
.xp-content a { color: #164bb5; text-decoration: underline; }
.token-header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
#token-name { overflow-wrap: anywhere; }
#connection-label { color: #555; font-size: 11px; text-align: right; }
#connection-label:empty { display: none; }
#price-only-value, #market-cap-only-value { font-family: Byrd, Tahoma, sans-serif; }
#market-cap-display p, #size-info p { margin: 0; }
#market-cap-display, #size-info { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#size-info p + p { margin-top: 7px; }
[data-trend="up"] { color: #087331; }
[data-trend="down"] { color: #c01824; }
#address-value { user-select: all; }
.classic-button {
  color: #181818; background: linear-gradient(#fff, #ece9d8); border: 1px solid #7991ab; border-radius: 3px;
  padding: 2px 8px; font: 12px/1.55 Tahoma, sans-serif; box-shadow: inset 1px 1px white;
}
.classic-button:hover, .classic-button:focus-visible { border-color: #2054ac; }
#memes-window {
  /* The viewer follows the canvas in paint order. Keep generic window raises below this layer. */
  position: fixed; inset: 0 0 var(--taskbar); margin: auto; z-index: 10001 !important;
  /* Fit a 5:4 picture within the available height after the caption, toolbar and window borders. */
  --meme-fit-width: max(248px, calc((100dvh - var(--taskbar) - 128px) * 1.25 + 16px));
  width: min(740px, calc(100vw - 24px), var(--meme-fit-width));
  height: fit-content; max-height: calc(100dvh - var(--taskbar) - 24px); min-width: 0;
}
#memes-window:is(.is-dragged, .is-maximized) { margin: 0; }
#memes-window:not(.is-maximized) .meme-stage { flex-basis: auto; aspect-ratio: 5 / 4; }
.meme-title-icon { width: 18px; height: 18px; object-fit: contain; }
.meme-content {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 5px;
  color: #222; background: #ece9d8; font: 12px/1.4 Tahoma, Arial, sans-serif;
}
.meme-figure { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.meme-stage {
  flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
  overflow: hidden; background: white; border: 1px solid; border-color: #8c8a7c white white #8c8a7c;
}
#meme-image { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; }
#meme-error { grid-area: 1 / 1; padding: 8px; text-align: center; }
.meme-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 3px; }
#meme-name { min-width: 0; overflow-wrap: anywhere; }
#meme-count { flex: none; color: #4b4a41; font-variant-numeric: tabular-nums; }
.meme-controls { display: flex; justify-content: center; gap: 5px; padding-top: 5px; border-top: 1px solid #c6c3b3; }
.meme-controls .classic-button { min-width: 72px; min-height: 26px; }
#rotation-toggle { display: block; margin: 9px auto 0; font-size: 11px; }
.model-credit { padding: 4px 8px; color: #484a53; font-size: 12px; }
.model-credit p { margin: 4px 0; }
.model-credit a { color: #164bb5; text-decoration: underline; }
.xp-window.is-dragged, #desktop .xp-window.is-dragged {
  position: fixed; inset: auto; left: var(--drag-x); top: var(--drag-y);
  width: var(--drag-width); max-height: calc(100dvh - var(--taskbar) - 8px);
}
#desktop .xp-window.is-maximized {
  position: fixed; inset: 8px 8px calc(var(--taskbar) + 8px); width: auto; height: auto; max-height: none;
}
.xp-window.is-maximized .xp-content { flex: 1; }
#start-menu:not([hidden]) { display: flex; z-index: 10003; max-height: calc(100dvh - var(--taskbar) - 2px); overflow-y: auto; }
.start-link { width: 100%; text-align: left; }
.start-link img { object-fit: contain; }
.start-menu-header img, .xp-start-btn img { object-fit: contain; }
.start-menu-links hr { margin: 4px; border-top: 1px solid #d8d8d8; }
.xp-system-tray { white-space: nowrap; }
.xp-task-items { min-width: 0; }
.xp-task-item { min-width: 100px; }
.xp-task-item span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) {
  :root { --edge: 9px; }
  html { scroll-padding-top: 8px; scroll-padding-bottom: 50px; }
  body { background: #639038; overflow-x: hidden; overflow-y: auto; }
  #desktop {
    --stage-height: min(clamp(310px, 54svh, 570px), calc(100svh - var(--taskbar) - 72px));
    display: flex; flex-direction: column; min-height: calc(100dvh - var(--taskbar)); height: auto;
    padding-bottom: calc(var(--taskbar) + 8px);
  }
  .meadow-wallpaper { inset: 0; }
  /* The top 4:3 portion frames the model. The same film extends down into the grass behind the windows. */
  .meadow-film {
    width: max(100%, calc(var(--stage-height) * 4 / 3)); aspect-ratio: 4 / 9;
    top: min(0px, calc((var(--stage-height) - 75vw) / 2)); transform: translateX(-50%);
    background-image: url("./bonerin-sky-tall.png");
  }
  .meadow-film::after { background-image: url("./bonerin-turf-tall.webp"); }
  .meadow-clouds { height: 27%; background-image: url("./bonerin-cumulus-tall.webp"); }
  /* Leave a touch-scrollable strip below the orbit surface on short screens. */
  #model-area { position: relative; inset: auto; width: 100%; height: var(--stage-height); flex: none; }
  #model-frame { inset: 0; }
  .bg-title { font-size: min(18vw, 138px, calc(var(--stage-height) / 4)); top: 12%; }
  .desktop-icons { --shortcut-size: 36px; position: static; flex-direction: row; justify-content: center; gap: 10px; margin-bottom: 8px; }
  .desktop-icon { width: auto; min-height: 44px; padding: 4px 7px; flex-direction: row; gap: 7px; }
  .desktop-icon i, .desktop-icon img { margin: 0; }
  .window-dock { position: static; width: min(100%, 560px); align-self: center; overflow: visible; padding: 0 10px; }
  .xp-title-bar { touch-action: auto; cursor: auto; }
  .xp-window-controls { gap: 4px; }
  .xp-btn { width: 24px; height: 23px; }
  #memes-window { width: min(680px, calc(100vw - 12px), var(--meme-fit-width)); max-height: calc(100dvh - var(--taskbar) - 12px); }
  .meme-controls .classic-button { min-height: 34px; }
  .xp-task-items { gap: 4px; padding: 0 6px; }
  .xp-task-item { flex: 0 1 auto; min-width: 0; padding: 0 6px; gap: 4px; }
  .xp-start-btn { padding: 0 9px; gap: 4px; }
  .xp-system-tray { padding: 0 6px; }
}
@media (max-width: 490px) {
  .xp-system-tray { display: none; }
  .xp-task-items { justify-content: center; padding: 0 3px; gap: 3px; }
  .xp-task-item { min-height: 35px; padding: 0 3px; gap: 3px; font-size: 11px; }
  .xp-task-item span { line-height: 11px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
}
