/* ==========================================================================
   Emberleaf — Minecraft link page
   Every texture comes from the official Minecraft 26.3 client (assets/mc).
   One Minecraft GUI pixel = 2 CSS pixels ("GUI scale 2") unless noted.
   ========================================================================== */

@font-face {
  font-family: "Minecraft";
  src: url("../assets/font/minecraft.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Minecraft";
  src: url("../assets/font/minecraft-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* vertical FOV 85°: perspective = (h / 2) / tan(42.5°) */
  --persp: 54.57vh;
  --size: 109.14vh;
  color-scheme: dark;
}
@supports (height: 1lvh) {
  :root { --persp: 54.57lvh; --size: 109.14lvh; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: #2a1a12;
  color: #fff;
  font: 400 16px/18px "Minecraft", ui-monospace, monospace;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
b, strong { font-weight: 700; }

/* --- Text colours: the game's chat formatting codes, with their exact drop shadows --- */
.t        { text-shadow: .125em .125em 0 #3f3f3f; }
.gray     { color: #aaaaaa; text-shadow: .125em .125em 0 #2a2a2a; }
.dgray    { color: #555555; text-shadow: .125em .125em 0 #151515; }
.yellow   { color: #ffff55; text-shadow: .125em .125em 0 #3f3f15; }
.gold     { color: #ffaa00; text-shadow: .125em .125em 0 #3f2a00; }
.green    { color: #55ff55; text-shadow: .125em .125em 0 #153f15; }
.aqua     { color: #55ffff; text-shadow: .125em .125em 0 #153f3f; }
.red      { color: #ff5555; text-shadow: .125em .125em 0 #3f1515; }
.purple   { color: #ff55ff; text-shadow: .125em .125em 0 #3f153f; }

/* &0–&f colour codes and &l &o &n &m formats, as typed in the admin panel */
.c-0 { color: #000000; text-shadow: .125em .125em 0 #000000; }
.c-1 { color: #0000aa; text-shadow: .125em .125em 0 #00002a; }
.c-2 { color: #00aa00; text-shadow: .125em .125em 0 #002a00; }
.c-3 { color: #00aaaa; text-shadow: .125em .125em 0 #002a2a; }
.c-4 { color: #aa0000; text-shadow: .125em .125em 0 #2a0000; }
.c-5 { color: #aa00aa; text-shadow: .125em .125em 0 #2a002a; }
.c-6 { color: #ffaa00; text-shadow: .125em .125em 0 #3f2a00; }
.c-7 { color: #aaaaaa; text-shadow: .125em .125em 0 #2a2a2a; }
.c-8 { color: #555555; text-shadow: .125em .125em 0 #151515; }
.c-9 { color: #5555ff; text-shadow: .125em .125em 0 #15153f; }
.c-a { color: #55ff55; text-shadow: .125em .125em 0 #153f15; }
.c-b { color: #55ffff; text-shadow: .125em .125em 0 #153f3f; }
.c-c { color: #ff5555; text-shadow: .125em .125em 0 #3f1515; }
.c-d { color: #ff55ff; text-shadow: .125em .125em 0 #3f153f; }
.c-e { color: #ffff55; text-shadow: .125em .125em 0 #3f3f15; }
.c-f { color: #ffffff; text-shadow: .125em .125em 0 #3f3f3f; }
.f-l { font-weight: 700; }
.f-o { font-style: italic; }
.f-n { text-decoration: underline; text-decoration-thickness: .125em; text-underline-offset: .125em; }
.f-m { text-decoration: line-through; text-decoration-thickness: .125em; }
.f-n.f-m { text-decoration: underline line-through; }

/* ==========================================================================
   Backdrop: panorama cube (same 85° FOV and 10° pitch as the title screen)
   ========================================================================== */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #7fa7e8;
}
.panorama {
  position: absolute;
  inset: 0;
  perspective: var(--persp);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.panorama.ready { opacity: 1; }
.cube {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform: translateZ(var(--persp)) rotateX(-10deg);
}
.face {
  position: absolute;
  width: calc(var(--size) * 1.004);
  height: calc(var(--size) * 1.004);
  left: calc(var(--size) * -.502);
  top: calc(var(--size) * -.502);
  background-size: 100% 100%;
  backface-visibility: hidden;
  image-rendering: auto;
}
.face[data-face="0"] { background-image: url("../assets/mc/panorama/panorama_0.webp"); transform: translateZ(calc(var(--size) / -2)); }
.face[data-face="1"] { background-image: url("../assets/mc/panorama/panorama_1.webp"); transform: rotateY(-90deg) translateZ(calc(var(--size) / -2)); }
.face[data-face="2"] { background-image: url("../assets/mc/panorama/panorama_2.webp"); transform: rotateY(180deg) translateZ(calc(var(--size) / -2)); }
.face[data-face="3"] { background-image: url("../assets/mc/panorama/panorama_3.webp"); transform: rotateY(90deg) translateZ(calc(var(--size) / -2)); }
.face[data-face="4"] { background-image: url("../assets/mc/panorama/panorama_4.webp"); transform: rotateX(-90deg) translateZ(calc(var(--size) / -2)); }
.face[data-face="5"] { background-image: url("../assets/mc/panorama/panorama_5.webp"); transform: rotateX(90deg) translateZ(calc(var(--size) / -2)); }

.leaves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 30% 45%, transparent 35%, rgba(18, 8, 4, .55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .10) 0%, rgba(0, 0, 0, 0) 30%, rgba(10, 4, 2, .45) 100%);
}

/* ==========================================================================
   Shared widgets
   ========================================================================== */

/* Vanilla button, nine-sliced exactly like the game (3px border, tiled centre) */
.mc-btn {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 6px solid transparent;
  border-image: url("../assets/mc/textures/gui/sprites/widget/button.png") 3 fill / 6px / 0 repeat;
  image-rendering: pixelated;
  color: #fff;
  text-shadow: .125em .125em 0 #3f3f3f;
  white-space: nowrap;
}
.mc-btn:hover, .mc-btn:focus-visible, .cta:hover .mc-btn, .cta:focus-visible .mc-btn {
  border-image-source: url("../assets/mc/textures/gui/sprites/widget/button_highlighted.png");
  outline: none;
}
.mc-btn > .t { transform: translateY(1px); }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: #ff5555;
  box-shadow: 2px 2px 0 #3f1515;
  vertical-align: 2px;
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 50% { opacity: .25; } }
.is-offline .live-dot, .card--offline .live-dot { background: #555; box-shadow: 2px 2px 0 #151515; animation: none; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 12px;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12);
}
.live-pill .live-dot { margin-right: 0; }
.live-pill:hover { box-shadow: inset 0 0 0 2px #fff; }
.music-btn { display: inline-flex; gap: 8px; align-items: center; padding: 0 10px 0 4px; }
.music-btn img { width: 32px; height: 32px; margin: -6px 0; }
.music-btn[aria-pressed="true"] img { animation: disc 1.8s linear infinite; }
.music-btn[aria-pressed="true"] .music-state { color: #55ff55; text-shadow: .125em .125em 0 #153f15; }
@keyframes disc { to { transform: rotate(360deg); } }

/* ==========================================================================
   Layout
   ========================================================================== */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 84px 16px 40px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
/* soft scrim so the copy stays legible whichever way the panorama is facing */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -20%;
  right: -20%;
  top: 38%;
  bottom: -6%;
  background: radial-gradient(closest-side, rgba(16, 7, 3, .62), rgba(16, 7, 3, .38) 55%, transparent);
  pointer-events: none;
}

/* Name "logo": in-game glyphs, gold-block texture, stepped extrusion */
.title {
  position: relative;
  display: grid;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
  margin: 0 0 4px;
  font-size: var(--fs-m, 40px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  animation: rise .9s cubic-bezier(.2, .9, .2, 1) both;
}
.title-depth, .title-face { grid-area: 1 / 1; white-space: nowrap; }
.title-depth {
  color: var(--d1, #5c3a00);
  text-shadow:
    0 .125em 0 var(--d2, #4a2e00),
    0 .25em 0 var(--d3, #3a2200),
    .125em .375em 0 rgba(0, 0, 0, .55);
  -webkit-text-stroke: 0;
}
.title-face {
  color: transparent;
  /* --tex is set per page: the name-logo block picked in the admin panel */
  background: var(--tex, url("../assets/mc/textures/block/gold_block.png")) 0 0 / 2em 2em;
  -webkit-background-clip: text;
  background-clip: text;
  image-rendering: pixelated;
}

.splash {
  position: absolute;
  right: -18px;
  bottom: -6px;
  font-size: 16px;
  font-weight: 400;
  color: #ffff55;
  text-shadow: .125em .125em 0 #3f3f15;
  white-space: nowrap;
  transform-origin: 50% 50%;
  transform: translate(35%, 0) rotate(-20deg);
  cursor: pointer;
  user-select: none;
  outline: none;
}
/* the pulse lives on the inner span so the rotation above stays put */
.splash-inner { display: inline-block; animation: splash .5s infinite; }
@keyframes splash {
  0%   { transform: scale(1);     animation-timing-function: cubic-bezier(.33, 1, .68, 1); }
  50%  { transform: scale(.944);  animation-timing-function: cubic-bezier(.32, 0, .67, 0); }
  100% { transform: scale(1); }
}

.player {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 4px 0 2px;
  animation: rise 1s .1s cubic-bezier(.2, .9, .2, 1) both;
}
.player canvas { position: relative; z-index: 1; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.player canvas:active { cursor: grabbing; }
.player-shadow {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 132px;
  height: 36px;
  transform: translateX(-50%);
  background: url("../assets/mc/textures/misc/shadow.png") center / 100% 100%;
  opacity: .55;
  image-rendering: auto;
}

.bio  { margin: 6px 0 0; max-width: 30ch; line-height: 20px; }
.sched { margin: 6px 0 0; }

/* Experience bar as a follower goal */
.xp {
  width: min(364px, 100%);
  margin-top: 22px;
  animation: rise 1s .2s cubic-bezier(.2, .9, .2, 1) both;
}
.xp-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}
.xp-track { position: relative; padding-top: 14px; }
.xp-level {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  color: #80ff20;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000;
  z-index: 1;
}
.xp-bar {
  position: relative;
  aspect-ratio: 182 / 5;
  background: url("../assets/mc/textures/gui/sprites/hud/experience_bar_background.png") 0 0 / 100% 100%;
}
.xp-fill {
  position: absolute;
  inset: 0;
  background: url("../assets/mc/textures/gui/sprites/hud/experience_bar_progress.png") 0 0 / 100% 100%;
  clip-path: inset(0 calc((1 - var(--xp-now, 0)) * 100%) 0 0);
}

/* Hotbar with social links */
.hotbar {
  position: relative;
  width: min(364px, 100%);
  margin-top: 14px;
  animation: rise 1s .28s cubic-bezier(.2, .9, .2, 1) both;
}
.held-name {
  display: block;
  height: 18px;
  margin-bottom: 8px;
  opacity: 0;
  transition: opacity .25s ease;
}
.held-name.show { opacity: 1; transition-duration: 0s; }
.hotbar-frame {
  position: relative;
  aspect-ratio: 182 / 22;
  background: url("../assets/mc/textures/gui/sprites/hud/hotbar.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
}
.slot {
  position: absolute;
  top: calc(100% / 22);
  width: calc(100% * 20 / 182);
  height: calc(100% * 20 / 22);
  display: grid;
  place-items: center;
  outline: none;
}
.slot img {
  width: 80%;
  height: 80%;
  transition: transform .15s ease;
}
/* official platform logos: vector/hi-res, so render smooth rather than pixelated */
.slot img.logo, .card-brand {
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45));
}
.slot img.logo { width: 64%; height: 64%; }
.slot:hover img, .slot:focus-visible img { transform: translateY(-2px); }
.hotbar-selection {
  position: absolute;
  z-index: 1;
  top: calc(-100% / 22);
  width: calc(100% * 24 / 182);
  height: calc(100% * 23 / 22);
  background: url("../assets/mc/textures/gui/sprites/hud/hotbar_selection.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
  pointer-events: none;
  transition: left .09s ease-out;
}

/* ==========================================================================
   Link panel — the blurred list of the modern menus
   ========================================================================== */
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100% + 32px);
  max-width: none;
  margin: 0 -16px;
  padding: 20px 16px 28px;
  /* menu_list_background (black @ 44%) over the blurred panorama, as in the modern menus */
  background: url("../assets/mc/textures/gui/menu_list_background.png") 0 0 / 32px 32px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: url("../assets/mc/textures/gui/header_separator.png") 0 0 / 64px 4px repeat-x;
  image-rendering: pixelated;
}
.panel::before { top: -4px; }
.panel::after { bottom: -4px; background-image: url("../assets/mc/textures/gui/footer_separator.png"); }
.panel > .label:first-of-type { margin-top: 10px; }

.label {
  margin: 14px 0 0;
  padding: 0 2px;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 12px;
}
.label::after {
  content: "";
  flex: 1;
  height: 4px;
  background: url("../assets/mc/textures/gui/header_separator.png") 0 0 / 64px 4px repeat-x;
  image-rendering: pixelated;
}

/* Toast-framed link card (now_playing sprite: 160x32, 4px nine-slice) */
.card, .video, .server {
  position: relative;
  display: block;
  width: 100%;
  border: 8px solid transparent;
  border-image: url("../assets/mc/textures/gui/sprites/toast/now_playing.png") 4 fill / 8px / 0 repeat;
  image-rendering: pixelated;
  transition: transform .14s ease, filter .14s ease;
  outline: none;
  animation: toast-in .6s cubic-bezier(.2, .9, .25, 1.05) both;
  animation-delay: calc(.35s + var(--i, 0) * .06s);
}
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-content: center;
  min-height: 64px;
  padding: 6px 8px 4px 52px;
}
.card::after, .video::after, .server::after, .cta::after {
  content: "";
  position: absolute;
  inset: -8px;
  box-shadow: inset 0 0 0 2px #fff;
  opacity: 0;
  pointer-events: none;
}
.card:hover, .card:focus-visible, .video:hover, .video:focus-visible, .server:hover, .server:focus-visible {
  transform: translateY(-2px);
}
.card:hover::after, .card:focus-visible::after,
.video:hover::after, .video:focus-visible::after,
.server:hover::after, .server:focus-visible::after,
.cta:focus-visible::after { opacity: 1; }

.card-icon {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.card:hover .card-icon, .video:hover .card-icon { transform: translateY(-3px) rotate(-8deg) scale(1.08); }
.card-title, .card-sub { grid-column: 1; min-width: 0; line-height: 18px; text-wrap: balance; }
.card-brand, .card-tag {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.card-brand {
  width: 32px;
  height: 32px;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.card:hover .card-brand, .card:focus-visible .card-brand { transform: scale(1.12); }
.card-tag {
  padding: 4px 6px 2px;
  background: rgba(85, 255, 85, .12);
  box-shadow: inset 0 0 0 2px rgba(85, 255, 85, .5);
}

.card--live .card-title .live-dot { margin-right: 8px; }

/* Latest upload with thumbnail */
.video { padding: 0; }
.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 8.2;
  overflow: hidden;
  margin: -4px -4px 0;
  border-bottom: 2px solid #000;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  image-rendering: auto;
  transition: transform .6s cubic-bezier(.2, .9, .2, 1);
}
.video:hover .video-thumb img { transform: scale(1.04); }
.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55));
}
.video-new, .video-time {
  position: absolute;
  z-index: 1;
  padding: 4px 6px 2px;
  background: rgba(0, 0, 0, .75);
}
.video-new  { left: 8px; top: 8px; background: #ff5555; text-shadow: .125em .125em 0 #3f1515; }
.video-time { right: 8px; bottom: 8px; }
.video-meta {
  position: relative;
  display: grid;
  row-gap: 4px;
  min-height: 56px;
  padding: 10px 8px 6px 52px;
}
.video-meta .card-icon { top: 10px; }

/* Server list entry */
.server {
  display: flex;
  gap: 12px;
  padding: 6px 8px 6px 6px;
  text-align: left;
}
.server-icon { position: relative; flex: none; width: 64px; height: 64px; }
.server-icon img { width: 64px; height: 64px; }
.server-join { position: absolute; inset: 0; opacity: 0; }
.server:hover .server-icon > img:first-child, .server:focus-visible .server-icon > img:first-child { filter: brightness(.55); }
.server:hover .server-join:not(.server-join--hi), .server:focus-visible .server-join:not(.server-join--hi) { opacity: 1; }
.server-icon:hover .server-join--hi { opacity: 1; }
.server-body { display: grid; row-gap: 4px; min-width: 0; flex: 1; align-content: center; }
.server-row { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.server-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.server-count img { width: 20px; height: 16px; }
.server-motd, .server-ip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Donate CTA — tooltip sprites + the enchantment glint
   ========================================================================== */
.cta {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon text" "btn btn";
  align-items: center;
  column-gap: 16px;
  row-gap: 14px;
  padding: 18px 16px 16px;
  isolation: isolate;
  outline: none;
  animation: rise 1s .3s cubic-bezier(.2, .9, .2, 1) both;
}
.cta::before {
  /* tooltip background: 100x100, 9px nine-slice with transparent margin */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 20px solid transparent;
  border-image: url("../assets/mc/textures/gui/sprites/tooltip/background.png") 10 fill / 20px / 16px stretch;
  image-rendering: pixelated;
}
.cta-glint {
  position: absolute;
  inset: 4px;
  z-index: -1;
  overflow: hidden;
  opacity: .55;
  mix-blend-mode: screen;
  pointer-events: none;
}
.cta-glint::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: url("../assets/mc/textures/misc/enchanted_glint_item.png") 0 0 / 512px 512px;
  transform: rotate(-10deg);
  animation: glint 7s linear infinite;
  image-rendering: auto;
}
@keyframes glint { to { background-position: 512px -512px; } }
.cta-frameline {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border: 20px solid transparent;
  border-image: url("../assets/mc/textures/gui/sprites/tooltip/frame.png") 10 / 20px / 16px stretch;
  image-rendering: pixelated;
}
.cta-frame {
  grid-area: icon;
  position: relative;
  width: 52px;
  height: 52px;
  background: url("../assets/mc/textures/gui/sprites/advancements/challenge_frame_obtained.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
}
.cta-item {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-3px); } }
.cta-text { grid-area: text; display: grid; row-gap: 4px; min-width: 0; }
.cta-title { font-size: 24px; line-height: 26px; font-weight: 700; }
.cta-sub { line-height: 18px; }
.cta-btn { grid-area: btn; width: 100%; min-height: 44px; font-size: 16px; }
.cta:hover .cta-item { animation-duration: .9s; }

.hearts { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 2; }
.heart {
  position: absolute;
  width: 16px;
  height: 16px;
  background: url("../assets/mc/textures/particle/heart.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
  animation: heart 1.1s cubic-bezier(.3, .7, .4, 1) forwards;
}
@keyframes heart {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -70px) scale(1); opacity: 0; }
}

/* ==========================================================================
   Footer: title-screen corner text
   ========================================================================== */
.corners {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 16px;
  line-height: 18px;
  color: #fff;
}

/* ==========================================================================
   Toasts (advancement.png, 160x32 at 2x) and the Now Playing toast
   ========================================================================== */
.toasts {
  position: fixed;
  z-index: 50;
  top: 12px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
}
.toast {
  position: relative;
  width: 320px;
  height: 64px;
  background: url("../assets/mc/textures/gui/sprites/toast/advancement.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.toast.in { transform: translateX(0); }
.toast img { position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; }
.toast .toast-title { position: absolute; left: 60px; top: 14px; }
.toast .toast-text  { position: absolute; left: 60px; top: 36px; right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.now-playing {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 20px 0 16px;
  border: 8px solid transparent;
  border-image: url("../assets/mc/textures/gui/sprites/toast/now_playing.png") 4 fill / 8px / 0 repeat;
  image-rendering: pixelated;
  transform: translateX(-105%);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.now-playing.in { transform: translateX(0); }
.np-notes {
  width: 32px;
  height: 32px;
  background: url("../assets/mc/textures/gui/sprites/icon/music_notes.png") 0 0 / 32px 256px;
  image-rendering: pixelated;
  animation: notes .8s steps(8) infinite;
}
@keyframes notes { to { background-position: 0 -256px; } }

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Wider screens: title-screen split — character left, links right
   ========================================================================== */
@media (max-width: 479px) {
  .wide-only { display: none; }
  .music-btn { padding: 0 4px; }
}
@media (max-width: 559px) {
  .splash { right: 0; bottom: -10px; transform: translate(12%, 0) rotate(-20deg); }
  .server-max { display: none; }
}
@media (min-width: 560px) {
  .title { font-size: var(--fs-t, 56px); }
  .splash { font-size: 20px; }
  .player { height: 340px; }
  .panel { width: 100%; max-width: 520px; margin: 0; padding: 20px 20px 28px; }
}

/* GUI scale 3 for the HUD pieces once there is room */
@media (min-width: 640px) {
  .xp, .hotbar { width: 546px; }
  .xp-track { padding-top: 20px; }
  .xp-level { font-size: 24px; top: -2px; text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000; }
  .held-name { font-size: 24px; height: 27px; }
}

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 540px;
    align-items: start;
    column-gap: 64px;
    padding: 0 48px;
  }
  .hero {
    position: sticky;
    top: 0;
    min-height: 100vh;
    max-width: 600px;
    justify-content: center;
    padding: 72px 0 40px;
  }
  .title { font-size: var(--fs-d, 72px); margin-bottom: 0; }
  .splash { font-size: 24px; right: -8px; bottom: -14px; }
  .player { height: clamp(260px, 44vh, 420px); }
  .hero::before { top: 44%; }
  .panel {
    width: 100%;
    margin: 96px 0 72px;
    padding: 24px 24px 32px;
  }
  .panel::before, .panel::after { left: 0; right: 0; }
  .corners {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 12px 10px;
  }
}

/* Short laptop screens: tighten the sticky hero so the hotbar never falls off */
@media (min-width: 1000px) and (max-height: 860px) {
  .hero { padding: 64px 0 20px; }
  .title { font-size: var(--fs-s, 56px); }
  .splash { font-size: 20px; bottom: -10px; }
  .player { height: clamp(200px, 36vh, 320px); margin: 0; }
  .bio { margin-top: 0; }
  .xp { margin-top: 14px; }
  .hotbar { margin-top: 6px; }
}
@media (min-width: 1000px) and (max-height: 640px) {
  .hero { position: relative; min-height: 0; }
}

/* Admin live preview re-renders on every edit: skip the entrance animations */
.preview *, .preview *::before, .preview *::after { animation-delay: 0s !important; }
.preview .title, .preview .player, .preview .xp, .preview .hotbar, .preview .cta,
.preview .card, .preview .video, .preview .server { animation: none !important; }
.preview .panorama { opacity: 1; transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .panorama { opacity: 1; }
}
