/* The website in the client mods' look (ClientMods/welcome/home.as, aboutme/profile_card.as, hud/reskin.py): navy glass
   panels with pale blue rims, purple ones for referees, gold accents, gradient buttons with a light rim, and headings in
   the client's Free Realms font with the loading screen's outlined, gradient lettering, in Free Realms: Umbral's colours
   (Branding/README.md). */

@font-face {
  font-family: "Free Realms";
  src: url("/site/game/FreeRealmsDemiBold.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* home.as / profile_card.as colours */
  --navy-top: #2d57c2;
  --navy-bottom: #16296e;
  --frame-top: #2e4fb0;
  --frame-bottom: #141f55;
  --tile-top: #284a9e;
  --tile-bottom: #162660;
  --chip-top: #1b2f78;
  --chip-bottom: #13215a;
  --rim: #9db8ff;
  --rim-soft: rgb(157 184 255 / 45%);
  --line: rgb(191 211 255 / 25%);
  --inset: rgb(10 20 64 / 40%);
  --inset-hover: rgb(77 116 216 / 70%);
  --purple-top: #5b3fc4;
  --purple-bottom: #2b1e73;
  --purple-rim: #d9ccff;
  --purple-card-top: #5a41b8;
  --purple-card-bottom: #3a2a8c;
  --gold: #ffd54a;
  --gold-label: #ffc531;
  --gold-rim: #fff4c2;
  --soft: #c9d6ff;
  --purple-soft: #d9ccff;
  --green: #7ce046;
  --busy: #ffb13b;
  --white: #fff;
  --shadow: #050a24;
  --outline: #0a1030;
  --danger: #ff8a7a;
  --sky-top: #341e70;
  --sky-bottom: #0c0c28;

  --display: "Free Realms", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scrollbar-color: #e79a13 rgb(10 20 64 / 50%); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font: 15px/1.5 var(--text);
  /* The loading screen's starry sky (loadingscreen/background.py), or its gradient before the art is built. */
  background: var(--sky-bottom) url("/site/game/backdrop.jpg") center top / cover fixed;
  background-image: url("/site/game/backdrop.jpg"), linear-gradient(var(--sky-top), var(--sky-bottom));
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

::selection { background: #e79a13; color: #3a2400; }

/* --- lettering ------------------------------------------------------------------------------------------- */

.display, h1, h2, h3, .button, .nav a, .chip, .tile-value, .sticker, .badge {
  font-family: var(--display);
  font-weight: normal;
  letter-spacing: 0.2px;
}

/* The GlowFilter outline the mods put on titles and numbers (0x0A1030, blur 3, strength 4). */
.outlined {
  text-shadow:
    0 0 2px var(--outline), 0 0 2px var(--outline), 0 0 3px var(--outline),
    0 2px 3px rgb(10 16 48 / 90%);
}

/* The loading screen's lettering: a gradient fill under a dark outline, with a soft drop shadow. Gold as "Free Realms"
   is in the logo, and violet as "Umbral" is (.umbral). */
.lettering {
  display: inline-block;
  color: transparent;
  background: linear-gradient(#fff1c8, #ff9234 85%);
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(0 0 1px #180a3a) drop-shadow(0 0 1px #180a3a) drop-shadow(0 0 1.5px #180a3a)
    drop-shadow(0 4px 3px rgb(6 2 24 / 75%));
}

.lettering.umbral { background-image: linear-gradient(#e8d6ff, #8452f0 90%); }

h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

p { margin: 0 0 10px; }

.muted { color: var(--soft); }
.small { font-size: 13px; }

/* --- page frame ----------------------------------------------------------------------------------------- */

.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 16px; }

/* The referee banner: the welcome screen's Referee Picks panel, as a strip. */
.referee-banner {
  background: linear-gradient(var(--purple-top), var(--purple-bottom));
  border-bottom: 2px solid var(--purple-rim);
  box-shadow: 0 4px 14px rgb(5 10 36 / 60%);
}

.referee-banner .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.referee-banner img { width: 36px; height: 36px; }
.referee-banner .text { flex: 1; min-width: 0; }
.referee-banner strong { font-family: var(--display); font-weight: normal; font-size: 17px; }
.referee-banner .muted { color: var(--purple-soft); font-size: 13px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(rgb(46 79 176 / 96%), rgb(20 31 85 / 96%));
  border-bottom: 2px solid var(--rim-soft);
  box-shadow: 0 6px 18px rgb(5 10 36 / 60%);
  backdrop-filter: blur(6px);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 40px; width: auto; filter: drop-shadow(0 3px 4px rgb(5 10 36 / 70%)); }
.brand .short { display: none; }

.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--soft);
  font-size: 17px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav a:hover { color: var(--white); text-decoration: none; background: var(--inset); border-color: var(--line); }

.nav a.active {
  color: var(--white);
  background: linear-gradient(#3d63c9, #223f94);
  border-color: var(--rim);
}

.account { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  color: var(--white);
  background: var(--inset);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 16px;
}

.me:hover { text-decoration: none; border-color: var(--gold-rim); background: var(--inset-hover); }
.me img { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(#fff, #bfd3ff); object-fit: cover; }

main { padding: 28px 0 80px; }

footer {
  padding: 24px 0 40px;
  color: var(--soft);
  font-size: 13px;
  text-align: center;
}

footer a { color: var(--soft); text-decoration: underline; }

/* --- panels --------------------------------------------------------------------------------------------- */

/* homePanel: a navy glass gradient with a pale blue rim, a soft light in its top corner and a drop shadow. */
.panel {
  position: relative;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(143 180 255 / 30%), transparent 60%),
    linear-gradient(var(--navy-top), var(--navy-bottom));
  border: 3px solid rgb(157 184 255 / 80%);
  box-shadow: 0 6px 18px rgb(5 10 36 / 60%);
}

.panel.purple {
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(217 204 255 / 22%), transparent 60%),
    linear-gradient(var(--purple-top), var(--purple-bottom));
  border-color: rgb(217 204 255 / 85%);
}

/* The welcome screen's and About Me's outer frame. */
.panel.frame {
  border-radius: 30px;
  background:
    radial-gradient(90% 70% at 10% 0%, rgb(143 180 255 / 32%), transparent 60%),
    linear-gradient(var(--frame-top), var(--frame-bottom));
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head img { width: 48px; height: 48px; flex: none; }
.panel-head .titles { flex: 1; min-width: 0; }
.panel-head h2 { font-size: 26px; }
.panel-head .muted { font-size: 14px; margin: 2px 0 0; }
.panel.purple .panel-head .muted { color: var(--purple-soft); }

/* A darker well inside a panel (lists, posts). */
.inset {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--inset);
  border: 1px solid var(--line);
}

.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.grid-home { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }

@media (max-width: 900px) {
  .grid-home, .grid-two, .grid-side { grid-template-columns: 1fr; }
}

/* --- buttons -------------------------------------------------------------------------------------------- */

/* HOME_BUTTON_COLORS: green (Play), gold (actions), purple (picks), blue (secondary): top, bottom, rim. */
.button {
  --top: #5e8cf0;
  --bottom: #2b4fb0;
  --button-rim: #bfd3ff;
  --ink: var(--white);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border: 2px solid var(--button-rim);
  border-radius: 999px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
  cursor: pointer;
  background:
    linear-gradient(rgb(255 255 255 / 22%), rgb(255 255 255 / 0%) 55%),
    linear-gradient(var(--top), var(--bottom));
  box-shadow: 0 3px 8px rgb(5 10 36 / 55%);
  text-shadow: 0 1px 2px rgb(16 24 58 / 80%);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.button:hover { text-decoration: none; filter: brightness(1.1); transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.6; cursor: default; transform: none; filter: none; }

.button.green { --top: #8be04e; --bottom: #3f9b17; --button-rim: #d9ffb0; }
.button.gold { --top: #ffe066; --bottom: #e79a13; --button-rim: #fff4c2; --ink: #5a2a00; text-shadow: 0 1px 0 rgb(255 244 194 / 60%); }
.button.purple { --top: #a98bff; --bottom: #6440d6; --button-rim: #e6dcff; }
.button.small { padding: 5px 14px; font-size: 15px; }
.button.big { padding: 13px 30px; font-size: 22px; }

.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.link-button:hover { color: var(--white); }

/* --- chips, stickers, badges ---------------------------------------------------------------------------- */

/* pcMakeChip: a gold label and a white value on a navy pill. */
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 15px;
  background: linear-gradient(var(--chip-top), var(--chip-bottom));
  border: 1px solid rgb(157 184 255 / 35%);
  font-size: 15px;
  white-space: nowrap;
}

.chip .label { color: var(--gold-label); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* The NEW! sticker on the newest What's New card. */
.sticker {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(#ffe066, #e79a13);
  border: 2px solid #fff;
  color: #6a2c00;
  font-size: 14px;
  transform: rotate(-8deg);
  box-shadow: 0 2px 6px rgb(5 10 36 / 50%);
}

/* The numbered gold badge on a Referee Pick. */
.badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(#ffe066, #e79a13);
  border: 2px solid #fff;
  color: #5a2a00;
  font-size: 15px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 70%);
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.dot.away { background: #6c7ba8; box-shadow: none; }

/* --- news and picks --------------------------------------------------------------------------------------- */

.news-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--inset);
  border: 1px solid var(--line);
}

.news-card.lead {
  background:
    radial-gradient(70% 120% at 0% 50%, rgb(191 224 255 / 25%), transparent 60%),
    rgb(10 20 64 / 30%);
}

.news-card .art { position: relative; flex: none; width: 72px; height: 72px; }
.news-card .art img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 4px rgb(5 10 36 / 60%)); }
.news-card .art .sticker { position: absolute; top: -10px; left: -14px; }
.news-card h3 { font-size: 20px; margin-bottom: 4px; }
.news-card p { color: var(--soft); margin: 0; }
.news-card .ingame { margin-top: 10px; }

.pick {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(rgb(90 65 184 / 70%), rgb(58 42 140 / 70%));
  border: 2px solid rgb(217 204 255 / 35%);
}

.pick .art { position: relative; flex: none; width: 56px; height: 56px; border-radius: 12px; background: rgb(26 17 80 / 45%); border: 2px solid rgb(255 255 255 / 25%); }
.pick .art img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pick .badge { position: absolute; top: -10px; left: -10px; width: 24px; height: 24px; font-size: 13px; }
.pick h3 { font-size: 17px; }
.pick p { color: var(--purple-soft); margin: 2px 0 0; font-size: 14px; }

/* --- hero ------------------------------------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
}

.hero .emblem { width: 100%; max-width: 300px; justify-self: center; }
.hero h1 { margin-bottom: 10px; }
.hero p { font-size: 17px; color: var(--soft); max-width: 560px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.hero-cast {
  position: absolute;
  right: 12px;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.hero-cast img { height: 190px; filter: drop-shadow(0 6px 8px rgb(5 10 36 / 60%)); margin-left: -34px; }
.hero-text { position: relative; z-index: 1; padding-right: 260px; }

@media (max-width: 1000px) {
  .hero-cast { display: none; }
  .hero-text { padding-right: 0; }
}

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .emblem { max-width: 220px; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero .actions { justify-content: center; }
}

/* --- "Free. No Micro-transactions!" ----------------------------------------------------------------------- */

/* A navy panel with a gold rim, and a pool of gold light behind the chest. */
.riches {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 22px;
  overflow: hidden;
  border-color: var(--gold);
  background:
    radial-gradient(45% 75% at 20% 50%, rgb(255 213 74 / 38%), transparent 70%),
    radial-gradient(120% 90% at 100% 0%, rgb(143 180 255 / 25%), transparent 60%),
    linear-gradient(var(--navy-top), var(--navy-bottom));
  box-shadow: 0 6px 18px rgb(5 10 36 / 60%), 0 0 30px rgb(255 213 74 / 35%), inset 0 0 0 1px rgb(255 244 194 / 45%);
}

/* Coins rain on the treasure only, so the words stay easy to read. */
.coin-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask: linear-gradient(transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(transparent, #000 12%, #000 88%, transparent); }

.coin-rain .coin {
  position: absolute;
  top: -50px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0.8;
  filter: drop-shadow(0 2px 2px rgb(5 10 36 / 60%));
  animation: coin-fall var(--time) linear var(--delay) infinite;
}

@keyframes coin-fall {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(400px) rotate(calc(var(--spin) * 540deg)); }
}

.riches-art { position: relative; z-index: 1; height: 320px; display: grid; place-items: center; }

/* Light turning behind the chest, like the score screen's sunburst. */
.rays {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgb(255 232 140 / 30%) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 62%);
  mask: radial-gradient(circle, #000 8%, transparent 62%);
  animation: turn 30s linear infinite;
}

@keyframes turn { to { transform: rotate(360deg); } }

.chest {
  position: relative;
  z-index: 2;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: bob 3.2s ease-in-out infinite;
}

.chest img {
  width: 210px;
  height: 210px;
  filter: drop-shadow(0 0 18px rgb(255 213 74 / 70%)) drop-shadow(0 10px 10px rgb(5 10 36 / 60%));
  transition: transform 0.15s ease;
}

.chest:hover img { transform: scale(1.06) rotate(-3deg); }
.chest:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 24px; }
.chest.pop img { animation: chest-pop 0.5s ease; }

@keyframes bob { 50% { transform: translateY(-10px); } }

@keyframes chest-pop {
  30% { transform: scale(1.18, 0.86) rotate(-4deg); }
  60% { transform: scale(0.94, 1.1) rotate(3deg); }
}

.treasure {
  position: absolute;
  z-index: 1;
  filter: drop-shadow(0 6px 6px rgb(5 10 36 / 55%));
  animation: float 4.2s ease-in-out infinite;
}

.treasure.gold-bar { width: 96px; left: 0; bottom: 34px; animation-delay: -1s; }
.treasure.ruby { width: 70px; left: 26px; top: 26px; animation-delay: -2.2s; }
.treasure.topaz { width: 66px; right: 22px; top: 18px; animation-delay: -0.4s; }
.treasure.aquamarine { width: 76px; right: 0; bottom: 44px; animation-delay: -3s; }
.treasure.pot { width: 74px; left: 50%; bottom: 0; margin-left: 40px; animation-delay: -1.6s; }

@keyframes float {
  50% { transform: translateY(-12px) rotate(6deg); }
}

.twinkle {
  position: absolute;
  z-index: 3;
  width: 54px;
  pointer-events: none;
  animation: twinkle 2.6s ease-in-out infinite;
}

.twinkle.one { left: 34%; top: 14%; }
.twinkle.two { right: 30%; top: 40%; width: 40px; animation-delay: -0.9s; }
.twinkle.three { left: 22%; bottom: 26%; width: 36px; animation-delay: -1.7s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(25deg); }
}

.loot { position: absolute; z-index: 4; pointer-events: none; filter: drop-shadow(0 3px 3px rgb(5 10 36 / 60%)); }

.riches-copy { position: relative; z-index: 1; }
.riches-title { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.1; }
.riches-friends { margin: 8px 0 12px; font-family: var(--display); font-size: clamp(22px, 3vw, 32px); }
.riches-copy > .muted { font-size: 16px; max-width: 560px; }
.riches-copy .chips { margin: 14px 0 18px; }
.riches-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* "Free." with light running across it. */
.lettering.shine {
  font-size: 1.25em;
  background-image: linear-gradient(110deg, #fff1c8 0%, #ff9234 38%, #fffaf0 50%, #ff9234 62%, #fff1c8 100%);
  background-size: 250% 100%;
  animation: shine 3.2s linear infinite;
}

@keyframes shine {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

/* The Station Cash coin, struck out. */
.crossed { position: relative; display: inline-block; width: 22px; height: 22px; align-self: center; }
.crossed img { width: 22px; height: 22px; opacity: 0.8; }
.crossed::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: #ff5a4a;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 70%);
  transform: rotate(-35deg);
}

@media (max-width: 900px) {
  .riches { grid-template-columns: 1fr; text-align: center; }
  .riches-art { height: 260px; }
  .chest img { width: 170px; height: 170px; }
  .riches-copy > .muted { margin-left: auto; margin-right: auto; }
  .riches-copy .chips, .riches-copy .actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .coin-rain { display: none; }
  .rays, .chest, .chest.pop img, .treasure, .twinkle, .lettering.shine { animation: none; }
  .twinkle { opacity: 0.8; transform: none; }
}

/* --- stat tiles (pcMakeTile) ---------------------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }

.tile {
  position: relative;
  padding: 12px 8px 10px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(60px 60px at 50% 18px, rgb(255 255 255 / 28%), transparent 70%),
    linear-gradient(var(--tile-top), var(--tile-bottom));
  border: 1.5px solid var(--rim-soft);
  box-shadow: 0 4px 10px rgb(5 10 36 / 50%);
}

.tile img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 3px rgb(5 10 36 / 60%)); }
.tile-value { display: block; font-size: 26px; line-height: 1.1; margin-top: 4px; }
.tile-label { display: block; color: var(--soft); font-size: 13px; }

/* --- characters ------------------------------------------------------------------------------------------ */

/* The About Me card's portrait frame: white to pale blue with a gold rim. */
.portrait-frame {
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(#fff, #bfd3ff);
  border: 3px solid var(--gold-label);
  box-shadow: 0 4px 12px rgb(5 10 36 / 55%);
}

.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait-frame img.silhouette { object-fit: contain; padding: 10%; }

.avatar {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(#fff, #bfd3ff);
  border: 2px solid rgb(255 255 255 / 60%);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img.silhouette { object-fit: contain; padding: 6px; }
.avatar.small { width: 36px; height: 36px; border-radius: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }

/* A friend row on the welcome screen: a dark well that lights up blue with a cream rim. */
.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  color: var(--white);
  background: var(--inset);
  border: 1px solid var(--line);
  transition: background 0.12s ease, border-color 0.12s ease;
}

a.card:hover { text-decoration: none; background: var(--inset-hover); border-color: var(--gold-rim); }

/* One of your own heroes on the account page, with Play beside their card. */
.hero-play { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hero-play .card { flex: 1; min-width: 0; }

.card .name { font-family: var(--display); font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .title { color: var(--gold); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { color: var(--soft); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.card .meta img { width: 18px; height: 18px; }

/* --- profile --------------------------------------------------------------------------------------------- */

.profile-head { display: flex; gap: 22px; align-items: flex-start; }
.profile-head .tiles { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.profile-head .tile-value { font-size: 23px; }

/* The portrait the client renders for the About Me card is 180 x 330. */
.portrait-frame.tall { width: 170px; aspect-ratio: 180 / 330; }
.portrait-frame img.headshot { object-fit: contain; }

@media (max-width: 640px) {
  .profile-head { flex-direction: column; align-items: center; text-align: center; }
  .profile-head .chips { justify-content: center; }
  .portrait-frame.tall { width: 140px; }
}
.profile-head h1 { font-size: clamp(28px, 4.5vw, 40px); }
.profile-head .title { color: var(--gold); font-family: var(--display); font-size: 18px; margin: 2px 0 10px; }

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.job {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--inset);
  border: 1px solid var(--line);
}

.job img { width: 40px; height: 40px; flex: none; }
.job .name { font-family: var(--display); font-size: 15px; line-height: 1.1; }
.job .level { color: var(--gold); font-size: 12px; }

.icon-list { display: flex; flex-wrap: wrap; gap: 10px; }

.thing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 14px;
  background: var(--inset);
  border: 1px solid var(--line);
  font-size: 14px;
}

.thing img { width: 36px; height: 36px; flex: none; object-fit: contain; }
.thing .stars { color: var(--gold); font-size: 12px; }

img.missing { visibility: hidden; }

.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 20px; }
.section-title img { width: 30px; height: 30px; }
.section-title:first-child { margin-top: 0; }

/* --- boards ---------------------------------------------------------------------------------------------- */

.composer { display: grid; gap: 10px; margin-bottom: 14px; }
.composer .row { flex-wrap: wrap; }

.post { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.post .body { flex: 1; min-width: 0; }
.post .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.post .who a { font-family: var(--display); font-size: 16px; color: var(--white); }
.post .who .on { color: var(--soft); font-size: 13px; }
.post .text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .when { color: var(--soft); font-size: 12px; }

/* --- forms ----------------------------------------------------------------------------------------------- */

form.stack { gap: 14px; }

label { display: grid; gap: 6px; font-size: 14px; color: var(--soft); }

input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgb(191 211 255 / 40%);
  background: rgb(10 20 64 / 55%);
  color: var(--white);
  font: 15px/1.4 var(--text);
}

textarea { resize: vertical; min-height: 84px; }
select { width: auto; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold-rim);
  box-shadow: 0 0 0 3px rgb(255 213 74 / 25%);
}

.narrow { max-width: 440px; margin: 0 auto; }

.error {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgb(120 24 24 / 45%);
  border: 1px solid rgb(255 138 122 / 60%);
  color: #ffd9d2;
  font-size: 14px;
}

.note {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgb(63 155 23 / 30%);
  border: 1px solid rgb(217 255 176 / 50%);
  font-size: 14px;
}

/* --- about ----------------------------------------------------------------------------------------------- */

.steps { counter-reset: step; display: grid; gap: 12px; }

.step { display: flex; gap: 14px; align-items: flex-start; }
.step .badge { width: 34px; height: 34px; font-size: 18px; }

.copy-box { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.copy-box code {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgb(10 20 64 / 60%);
  border: 1px solid var(--line);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.cast { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 4px; }
.cast img { height: 150px; filter: drop-shadow(0 6px 8px rgb(5 10 36 / 60%)); }

/* --- loading --------------------------------------------------------------------------------------------- */

/* The in-game browser's running squirrel; its black backdrop drops out over the sky. */
.loading { display: grid; place-items: center; gap: 8px; padding: 60px 0; color: var(--soft); font-family: var(--display); font-size: 18px; }
.loading img { width: 90px; height: 90px; mix-blend-mode: screen; }

.empty { color: var(--soft); text-align: center; padding: 18px; }

.search { display: flex; gap: 10px; }
.search input { flex: 1; }

@media (max-width: 900px) {
  .brand .wide { display: none; }
  .brand .short { display: block; }
  .nav a { padding: 6px 10px; font-size: 16px; }
}

@media (max-width: 640px) {
  .topbar .wrap { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .account { margin-left: auto; }
  .panel { padding: 16px; border-radius: 20px; }
  .news-card { flex-direction: column; }
  .referee-banner .muted { display: none; }
  .nav a { padding: 6px 9px; font-size: 15px; }
}
