* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

html {
  background-color: #000;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
body {
  background-color: transparent !important;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

html {
  cursor: url("cursor.png"), auto;
  scroll-behavior: smooth;
}

html.hide-cursor, html.hide-cursor * {
  cursor: none !important;
}

@media (min-aspect-ratio: 10001/10000) {
  a,
  button,
  [data-action],
  .window-control-btn,
  .window-header,
  .window-header.dragging,
  .footer-badge,
  .arch-badge {
    cursor: url("hover.png") 12 12, auto;
  }
}

.link-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--icon-gap);
  position: relative;
  z-index: 2;
}

.link-container a {
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  background-size: cover;
  transition: transform 0.1s linear;
}

.arch-badge {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.arch-badge:hover {
  opacity: 1;
}

@media (max-aspect-ratio: 1/1) {
  body {
    background: transparent !important;
    display: block;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100vw;
    position: relative;
  }

  .panels-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    margin: 0;
    transform: none;
    position: static;
    overflow-x: hidden;
  }

  .window {
    width: calc(100% - 32px);
    max-width: 400px;
    margin: 0 auto 0 auto;
    position: static;
    display: block;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    opacity: 1 !important;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  }

  .window-header, .fastfetch-window {
    display: none !important;
  }

  .window-body {
    width: 100%;
    padding: 12px;
    background: transparent !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  .steam-panel {
    margin-top: 40px !important;
    margin-bottom: 13px !important;
    z-index: 1;
    height: auto !important;
    display: block !important;
  }

  .steam-panel .window-body {
    margin-top: 0;
    margin-bottom: 0;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
    height: auto !important;
  }

  .steam-embed-container {
    width: 100%;
    height: 230px !important;
    overflow: hidden;
    position: relative;
    background: #0f0f0f;
    border-radius: 8px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
    transition: height 0.3s ease;
  }
  .steam-embed-container.in-game {
    height: 320px !important;
  }

  .steam-embed {
    width: 100%;
    min-width: 100%;
    height: 230px !important;
    border: none;
    display: block;
    transform: none !important;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    transition: height 0.3s ease;
  }
  .steam-embed-container.in-game .steam-embed {
    height: 320px !important;
  }

  .duo-panel, .enka-panel {
    margin-top: 0 !important;
    margin-bottom: 13px !important;
  }
  .footer-window { order: 1; }
  .enka-panel { order: 2; }

  .duo-embed {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
  }

  .links-panel {
    margin-bottom: 13px !important;
  }

  .link-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .link-container a {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }

  .footer-window {
    margin-bottom: 13px !important;
  }
  .enka-panel {
    margin-bottom: 40px !important;
  }

  .footer-window .window-body {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    margin-top: 0 !important;
  }

  .footer-badge {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
    margin-top: 0 !important;
  }

  .footer-badge > div {
    margin-bottom: 10px !important;
    display: block;
  }

  .footer-badge > div:last-child {
    margin-bottom: 0 !important;
  }
}

@font-face {
  font-family: 'WallowHmkBold';
  src: url('WallowHmkBold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PapyrusCustom';
  src: url('papyrus.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SpaceMono';
  src: url('SpaceMono.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.msm, .wuwa, .arc, .switch, .genshin, .text-arch {
  margin: 0 !important;
  padding: 0 !important;
}

.footer-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 6px 10px;
  color: #e6e6e6;
  opacity: 0.9;
  transition: opacity 0.3s;
  user-select: none;
  text-align: center;
}
.footer-badge:hover { opacity: 1; }

.papyrus { font-family: 'PapyrusCustom', serif; font-weight: 700; }
.msm-title { font-family: 'WallowHmkBold', serif; }
.msm-rest { font-family: 'PapyrusCustom', serif; font-weight: 700; }

.text-arch, .msm, .wuwa, .genshin { font-size: 18px; line-height: 1.2; }
.arch-inline {
  height: 1em;
  width: auto;
  vertical-align: -0.15em;
  opacity: 0.95;
}

.wuwa-inline {
  height: 0.9em;
  width: auto;
  max-width: 160px;
  vertical-align: -0.1em;
  opacity: 0.95;
}

.genshin-inline {
  height: 1.4em;
  width: auto;
  max-width: 180px;
  vertical-align: -0.18em;
  opacity: 0.95;
}

.arc-inline {
  height: 1.4em;
  width: auto;
  max-width: 240px;
  vertical-align: -0.15em;
  opacity: 0.95;
}

.switch-inline {
  height: 1.2em;
  width: auto;
  max-width: 220px;
  vertical-align: -0.12em;
  opacity: 0.95;
}

@media (max-aspect-ratio: 1/1) {
  .footer-badge {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    transform: none;
    left: auto;
    text-align: center;
    gap: 12px;
    padding: 4px 10px;
  }
}

.window {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.window-body {
  background: transparent;
  box-sizing: border-box;
  padding: 12px;
}

.window-body.pad-embed { padding: 0; }
.window-body.pad-links { padding: 12px; }

.window-header {
  position: relative;
  height: 26px;
  background: #202326;
  box-sizing: border-box;
  cursor: grab;
}

.window-header.dragging {
  cursor: grabbing;
}

.window-controls {
  position: absolute;
  top: 0;
  right: 0;
  width: 77px;
  height: 26px;
  pointer-events: none;
}

.window-control-btn {
  position: absolute;
  top: 4px;
  height: 19px;
  pointer-events: auto;
  cursor: pointer;
}

.window-control-btn.close {
  left: 51px;

  width: 24px;
}

.window-control-btn.max {
  left: 27px;

  width: 24px;
}

.window-control-btn.min {
  left: 3px;

  width: 24px;
}

.window-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #e6e6e6;
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
}

.window-corner {
  position: absolute;
  top: 0;
  height: 26px;
  width: auto;
  z-index: 2;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.window-corner-left {
  left: 0;
}

.window-corner-right {
  right: 0;
}

.window-header-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25px;
  right: 77px;
  background: #202326;
  z-index: 1;
}

@media (min-aspect-ratio: 10001/10000) and (min-height: 701px) {
  .window-body {
    background: black;
    box-sizing: border-box;
    padding: 0;
  }
}

.footer-window { margin: 0 auto 0 auto; }
.footer-window .window-body { padding: 12px 16px; }

@media (min-aspect-ratio: 10001/10000) and (min-height: 701px) {
  .panels-stack {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transform: none;
    margin: 0;
    z-index: 2;
  }

  .window {
    position: absolute;
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
  }

  .window.placed {
    opacity: 1;
  }
}

.steam-panel { margin: 0 auto 0 auto; }
.links-panel { margin: 0 auto; }
.panels-stack { position: relative; transform: translateY(-40px); }
.duo-panel .window-body {
  padding: 12px;
  background: black;
  box-sizing: border-box;
}

.duo-embed {
  width: 92%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 0 auto;
}

/* GitHub profile summary card: a 700x200 SVG from the summary-cards API with
   an overlay that patches out the "Joined GitHub ..." row. The overlay shares
   the image's viewBox, so its coordinates are the card's own coordinates, and
   `blank` has to match the theme's background colour (github_dark = #0d1117)
   or the patched row shows up as a coloured block. */
.gpsc {
  position: relative;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 700 / 200;
  margin: 0 auto;
}
.gpsc > img { display: block; width: 100%; height: 100%; border-radius: 6px; }
.gpsc > svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gpsc text { font-family: 'Segoe UI', Ubuntu, "Helvetica Neue", Sans-Serif; font-size: 14px; fill: #77909c; }
.gpsc .blank { fill: #0d1117; }
:root {
  --icon-size: 90px;
  --icon-gap: 8px;
  --icon-count: 4;
  --links-width: calc(var(--icon-size) * var(--icon-count) + var(--icon-gap) * (var(--icon-count) - 1));
  --panel-pad-x: 24px;
  --panel-pad-y-links: 16px;
  --panel-pad-y-embed: 0px;
  --embed-scale: 1.2;
}
.fixed-width { width: calc(var(--links-width) + (var(--panel-pad-x) * 2) + 2px); }

.window-body.pad-embed { padding: var(--panel-pad-y-embed) 0; }
.window-body.pad-links { padding: var(--panel-pad-y-links) var(--panel-pad-x); }

.steam-embed-container {
  width: 100%;
  height: 275px;
  overflow: hidden;
  position: relative;
  transition: height 0.3s ease;
}
.steam-embed-container.in-game {
  height: calc(320px * var(--embed-scale));
}

.steam-embed {
  width: calc(100% / var(--embed-scale));
  height: 275px;
  border: 0;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  transform: scale(var(--embed-scale));
  transform-origin: top center;
  transition: height 0.3s ease;
}
.steam-embed-container.in-game .steam-embed {
  height: 320px;
}

.enka-embed-container {
  width: 100%;
  overflow: hidden;
  position: relative;

  transform: translateZ(0);
  will-change: transform;
  contain: paint;
  isolation: isolate;
}
.enka-embed-container iframe {
  position: absolute;
  top: -75px;
  left: 0;
  width: 100%;
  height: calc(100% + 75px);
  border: none;
  border-radius: 12px;
  pointer-events: none;
}

.enka-panel {
  box-shadow: none;
  transform: translateZ(0);
  will-change: transform;
  background: #0f0f0f;
  border: 1px solid #2a2e33;

  overflow: visible;
  clip-path: inset(0 round 12px);
}
.embed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

.fastfetch-window { margin: 10px auto; }
.fastfetch-window .window-body {
  background: #232627;
  padding: 12px;
  box-sizing: border-box;
  min-height: 345px;
}
.fastfetch-body {
  font-family: 'SpaceMono', monospace;
  font-size: 9.5px;
  line-height: 1.22;
  color: #16a085;
  overflow-x: auto;
}
.fastfetch-scale { zoom: 0.90; }
.fastfetch-grid { display: flex; gap: 0 10px; }
.ff-logo { margin: 0; color: #16a085; white-space: pre; }
.ff-m { color: #ffffff; }
.ff-info { min-width: 0; }
.ff-lines { margin: 0; white-space: pre; }
.ff-label { color: #16a085; }
.ff-val { color: #fcfcfc; }
.ff-colors { margin-top: 10px; width: 168px; display: flex; flex-direction: column; }
.ff-cbrow { display: flex; }
.ff-square { flex: 1; aspect-ratio: 3 / 2; }

@media (min-aspect-ratio: 10001/10000) and (min-height: 701px) {
  .fastfetch-window {
    width: calc(var(--links-width) * 1.875 + (var(--panel-pad-x) * 2) + 2px);
  }
  /* The card is 700x200, so matching the Duolingo window's height needs a
     wider window. 606px into the panel padding lands the card's text at about
     the same rendered size as the Duolingo card's, and the window a touch
     taller than the Duolingo one. */
  .github-window {
    width: calc(606px + (var(--panel-pad-x) * 2) + 2px);
  }
}

@media (min-aspect-ratio: 10001/10000) and (max-height: 700px) {
  body {
    background: transparent !important;
    display: block;
    min-height: 100vh;
    overflow-y: hidden;
    overflow-x: auto;
    width: 100vw;
    position: relative;
    scroll-behavior: smooth;
  }
  .panels-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    width: max-content;
    padding: 0 40px;
    margin: 0;
    transform: none;
    position: static;
    gap: 20px;
  }
  .window {
    width: auto;
    min-width: 230px;
    height: 280px;
    margin: 0;
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    opacity: 1 !important;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
  }
  .window-header, .fastfetch-window {
    display: none !important;
  }
  .window-body {
    width: 100%;
    padding: 12px;
    background: transparent !important;
    box-sizing: border-box;
  }
  .steam-panel, .enka-panel {
    z-index: 1;
    display: flex !important;
    height: auto !important;
  }
  .footer-window { order: 1; }
  .enka-panel { order: 2; box-shadow: none; overflow: visible; }
  .steam-panel .window-body, .enka-panel .window-body {
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .steam-embed-container {
    width: 380px;
    height: 230px !important;
    background: #0f0f0f;
    border-radius: 8px;
    margin: 0;
    padding: 0;
    transition: height 0.3s ease;
  }
  .steam-embed-container.in-game {
    height: 320px !important;
  }
  .steam-embed {
    width: 100%;
    min-width: 100%;
    height: 230px !important;
    border: none;
    display: block;
    transform: none !important;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    transition: height 0.3s ease;
  }
  .steam-embed-container.in-game .steam-embed {
    height: 320px !important;
  }
  .enka-embed-container {
    width: 380px;
    background: #0f0f0f;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }
  .duo-embed {
    width: auto;
    height: 220px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
  }
  .link-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    width: 100%;
  }
  .link-container a {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }
  .footer-badge {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .footer-badge > div {
    margin-bottom: 0 !important;
    display: block;
  }
}

.enka-mobile-title {
  display: none;
}
.enka-mobile-backing {
  width: 100%;
}

@media (max-aspect-ratio: 1/1), (max-height: 700px) {
  .enka-mobile-title {
    display: block;
    font-family: 'PapyrusCustom', serif;
    font-weight: 700;
    font-size: 13px;
    color: #e6e6e6;
    text-align: center;
    padding: 3px 0;
    opacity: 0.9;
    pointer-events: none;
  }
  .enka-mobile-backing {
    background: #202326;
    border-radius: 0;

    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .enka-embed-container {
    height: var(--mobile-h) !important;
  }
  .enka-panel .window-body {
    padding: 12px !important;
  }
}

@media (min-aspect-ratio: 10001/10000) and (min-height: 701px) {
  html.progressive-loading .panels-stack { transform: none; }
  html.progressive-loading .window { visibility: hidden; opacity: 0; pointer-events: none; }
  html.progressive-loading.bg-ready .window.window-ready { visibility: visible; opacity: 1; pointer-events: auto; }
  html.progressive-loading.bg-ready .window.window-ready.window-opening { animation: windowOpening 360ms cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes windowOpening {
  from { opacity: 0; transform: translateY(12px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  html.progressive-loading.bg-ready .window.window-ready.window-opening { animation: none; }
}
