:root {
  --bg: #0b1d2c;
  --panel: #10283c;
  --panel-2: #163550;
  --border: #23496a;
  --text: #e6f1fa;
  --muted: #8fb0c9;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --gold: #facc15;
  --danger: #ef4444;
  --radius: 10px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------- Top bar ---------- */

#topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

#topbar > * {
  white-space: nowrap;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.currency {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 700;
}

.coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fde68a, var(--gold) 60%, #b45309);
}

.player {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#game {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

#game canvas {
  display: block;
}

#panel {
  width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
}

#tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.tab {
  position: relative;
  flex: 1 0 auto;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  background: var(--panel-2);
  color: var(--text);
}

.tab.active {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}

.badge:not(:empty) {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 11px;
}

#tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 24px;
}

h2 {
  margin: 8px 0 10px;
  font-size: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.gold-text {
  color: var(--gold);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 8px;
}

.small-text {
  font-size: 12px;
}

code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Lists ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.row-main {
  flex: 1;
  min-width: 0;
}

/* Social, Twitch tab: the bonuses you earn on Twitch */
.twitch-reward {
  border-left: 3px solid #9146ff;
}

.twitch-reward.active {
  box-shadow: inset 0 0 0 1px #9146ff;
}

.twitch-cost {
  flex: none;
  color: #c4a6ff;
  white-space: nowrap;
}

.good-text {
  color: #86efac;
}

.name {
  font-weight: 700;
}

.sub {
  color: var(--muted);
  font-size: 12px;
}

.value {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 25%, transparent);
  border: 2px solid var(--c);
  color: var(--c);
  font-weight: 900;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.stat {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #0d2233;
  color: #a7f3d0;
}

/* ---------- Gear slots ---------- */

.slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 2px solid var(--c);
  min-height: 84px;
}

.empty-slot {
  border-style: dashed;
}

.slot-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #1b4061;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: #22507a;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent-2);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent);
}

.btn.danger {
  background: #7f1d1d;
  border-color: var(--danger);
}

.btn.small {
  padding: 4px 9px;
  font-size: 12px;
}

.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-row.end {
  justify-content: flex-end;
  margin-top: 14px;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Leaderboard ---------- */

.lb {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.lb-row {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
}

.lb-row:nth-child(odd) {
  background: var(--panel-2);
}

.lb-row.you {
  background: #134e4a;
  outline: 1px solid #2dd4bf;
}

.rank {
  width: 36px;
  color: var(--muted);
  font-weight: 700;
}

.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Stats table ---------- */

.kv {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.kv td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--border);
}

.kv td:last-child {
  text-align: right;
  font-weight: 700;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 10, 18, 0.65);
  z-index: 10;
}

.modal {
  width: min(420px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin-top: 0;
}

.nick-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.error {
  color: #fca5a5;
  font-size: 12px;
}

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  z-index: 20;
}

.toast {
  padding: 8px 14px;
  border-radius: 999px;
  background: #0f2f47;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  transition: opacity 0.4s, transform 0.4s;
}

.toast.hide {
  opacity: 0;
  transform: translateY(8px);
}

/* ---------- v2: essence, zones, ascension, collection ---------- */

[hidden] {
  display: none !important;
}

.essence-text {
  color: #c4b5fd;
}

.essence-gem {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: linear-gradient(135deg, #ede9fe, #8b5cf6);
}

h3 {
  margin: 14px 0 6px;
  font-size: 14px;
}

.stat.up {
  color: #86efac;
  outline: 1px solid #166534;
}

.stat.down {
  color: #fca5a5;
  outline: 1px solid #7f1d1d;
}

.stat.implicit {
  font-weight: 700;
}

/* How well a gear stat (or the whole piece, by its name) rolled: a share of its best roll (the worst is about 54%) */
.roll {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 400;
  color: #9aa58a;
}

.roll-range {
  margin-left: 2px;
  font-size: 10px;
  font-weight: 400;
  color: #7f8a70;
}

.tip-title .roll {
  font-size: 12px;
}

.roll.good {
  color: #d9e6b8;
}

.roll.great {
  color: #ffd54f;
}

.roll.perfect {
  color: #ff9f43;
  font-weight: 700;
}

.muts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 2px 0;
}

.mut {
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 4px;
  color: var(--c);
  border: 1px solid var(--c);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

select {
  margin-left: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.seg {
  display: flex;
  gap: 4px;
}

.lb-sort,
.lb-board {
  margin-bottom: 10px;
}

.btn.buy {
  min-width: 86px;
}

.btn.wide {
  width: 100%;
  margin: 10px 0 4px;
  padding: 10px;
  font-size: 15px;
}

.btn.essence {
  background: #6d28d9;
  border-color: #a78bfa;
  color: #fff;
}

.btn.essence:hover:not(:disabled) {
  background: #7c3aed;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #134e4a;
  color: #5eead4;
  white-space: nowrap;
}

.pill.warn {
  background: #3b2a0a;
  color: #fbbf24;
}

.row.current {
  outline: 2px solid #2dd4bf;
}

.row.locked {
  opacity: 0.6;
}

.asc-card {
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #2e1065, #10283c 70%);
  border: 1px solid #5b21b6;
  margin-bottom: 12px;
}

.asc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  margin-bottom: 10px;
}

.big {
  font-size: 22px;
  font-weight: 800;
}

.progress {
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #0b1d2c;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--c, var(--border));
  color: var(--c, var(--text));
  background: var(--panel-2);
}

.chip.unknown {
  opacity: 0.5;
  border-style: dashed;
}

.lb-asc {
  color: #c4b5fd;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
}

/* ---------- Small screens ---------- */

@media (max-width: 800px) {
  main {
    flex-direction: column;
  }

  #game {
    flex: none;
    height: 48vh;
  }

  #panel {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  #topbar {
    gap: 12px;
    flex-wrap: wrap;
  }

  .score {
    display: none;
  }
}

/* ---------- v3: Twitch sign-in, companies, admin, cheats ---------- */

.btn.twitch {
  display: inline-block;
  background: #9146ff;
  border-color: #a970ff;
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.btn.twitch:hover {
  background: #a970ff;
}

a.btn {
  text-decoration: none;
  color: inherit;
}

#landing {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 30%, #1f78b4, var(--bg) 70%);
}

.landing-card {
  width: min(420px, 100%);
  padding: 28px 24px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.landing-card h1 {
  margin: 4px 0 8px;
}

.landing-logo {
  font-size: 44px;
}

.dev-login {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Idle Angler account sign-in (no Twitch) */
.account-login {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.landing-card .account-login input {
  flex: none;
}

.account-login .account-tabs {
  justify-content: center;
}

.account-login .account-note {
  margin: 0;
  text-align: left;
}

.signin-choice h2 {
  margin: 14px 0 10px;
  font-size: 20px;
}

.signin-option {
  text-align: left;
}

.signin-option p {
  margin: 8px 0 4px;
}

.signin-option ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.signin-option li + li {
  margin-top: 3px;
}

.signin-choice .landing-or {
  margin: 14px 0 10px;
}

.account-login .back-to-choice {
  align-self: flex-start;
}

.landing-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.landing-or::before,
.landing-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.dev-login .btn-row,
.inline-form {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
}

.dev-login input,
.account-login input,
.inline-form input,
.sim-form input,
.sim-form select {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.sim-form {
  display: grid;
  gap: 8px;
}

.sim-form label {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 8px;
}

.sim-form select {
  margin-left: 0;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.player-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.company-tag {
  font-size: 11px;
  font-weight: 600;
  color: #c4b5fd;
}

.buff-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.buff {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--c);
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  white-space: nowrap;
}

#test-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px;
  background: repeating-linear-gradient(45deg, #7c2d12, #7c2d12 12px, #9a3412 12px, #9a3412 24px);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

#app {
  flex: 1;
  min-height: 0;
  height: auto;
}

body {
  display: flex;
  flex-direction: column;
}

.tab.admin-tab {
  color: #fca5a5;
}

.pill.bad {
  background: #450a0a;
  color: #fca5a5;
}

.company-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #3b0764, #10283c 75%);
  border: 1px solid #6d28d9;
}

.company-card .inline-form {
  width: 100%;
  margin: 2px 0;
}

.company-name {
  font-size: 18px;
  font-weight: 800;
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.events li {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel-2);
}

.list.compact .row {
  padding: 6px 8px;
}

.admin-row .btn-row {
  margin-top: 6px;
}

.cheat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.cheat-row > span {
  width: 80px;
  color: var(--muted);
}

.cheat-row select {
  margin-left: 0;
}

.lb-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.toast.error-toast {
  border-color: var(--danger);
  color: #fca5a5;
}

/* ---------- v4: world, market, settings ---------- */

.world-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: help;
}

.world-chip[data-weather='rain'],
.world-chip[data-weather='cloudy'] {
  border-color: #60a5fa;
}

.world-chip[data-weather='storm'] {
  border-color: #facc15;
  color: #fde68a;
}

.world-chip[data-weather='fog'] {
  border-color: #cbd5e1;
}

.world-chip[data-weather='cursed'] {
  border-color: #a3e635;
  color: #d9f99d;
}

.autosell {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.autosell .toggle {
  margin: 0;
}

.setting {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
}

.setting input {
  margin-top: 3px;
}

.setting .sub {
  display: block;
}

.setting-select {
  display: block;
  margin: 2px 0 10px 4px;
}

.ask-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ask-fields input,
.ask-fields select {
  flex: 1;
  min-width: 0;
  margin-left: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.ask-fields input[type='number'] {
  flex: 0 0 90px;
}

/* =====================================================================
   Theme: Mossy Cottage (lichen stone, birch and moss, mushroom-red buttons)
   Fonts: Pixelify Sans, Jacquard 24 and Metamorphous (SIL OFL). The frames are
   pixel art drawn by tools/ui-frames.mjs into /assets/ui/moss/. Cursor:
   "Medieval (Pixel Art) UI Asset Pack" by BloodAssassin (CC BY 4.0). See CREDITS.md.
   ===================================================================== */

@font-face {
  font-family: 'Pixelify Sans';
  src: url('/assets/fonts/pixelify-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'Jacquard 24';
  src: url('/assets/fonts/jacquard24-latin.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Metamorphous';
  src: url('/assets/fonts/metamorphous-latin.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #121a10;
  --panel: #1d2a1b;
  --panel-2: #24331f;
  --border: #4a5a3e;
  --text: #e7efd8;
  --muted: #a7b894;
  --accent: #dfe38a;
  --accent-2: #6f9a49;
  --gold: #f6c445;
  --danger: #c4533c;
  --radius: 2px;
  --title: 'Metamorphous', 'Jacquard 24', serif;
  /* Numbers (money, rates, counts): a plain sans with even, lining digits, easy to read at any size */
  --num: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --on-btn: #eef5dc; /* text on the moss buttons */
  --on-red: #fff1e6; /* text on the mushroom-red buttons */
  --on-birch: #2c3a24; /* text on birch plaques */
  /* Frames: one art pixel is 3 screen pixels (see tools/ui-frames.mjs) */
  --fr-panel: url('/assets/ui/moss/panel.svg') 5 fill / 15px / 0 stretch;
  --fr-tip: url('/assets/ui/moss/tip.svg') 3 fill / 9px / 0 stretch;
  --fr-chat: url('/assets/ui/moss/chat.svg') 3 fill / 9px / 0 stretch;
  --fr-plate: url('/assets/ui/moss/plate.svg') 3 fill / 9px / 0 stretch;
  --fr-btn: url('/assets/ui/moss/btn.svg') 2 fill / 6px / 0 stretch;
  --fr-btn-on: url('/assets/ui/moss/btn-on.svg') 2 fill / 6px / 0 stretch;
  --fr-key: url('/assets/ui/moss/key.svg') 2 fill / 6px / 0 stretch;
  --fr-bar: url('/assets/ui/moss/bar.svg') 3 fill / 9px / 0 stretch;
}

html,
body {
  font-family: var(--font);
  font-size: 15px;
  cursor: url('/assets/ui/cursor.png') 2 2, auto;
  font-variant-numeric: lining-nums; /* Georgia's old-style digits drop below the line */
  /* Pixelify Sans' "fi" ligature reads like an "A" */
  font-variant-ligatures: none;
  font-feature-settings: 'liga' 0, 'clig' 0;
}

button,
input,
select {
  font-variant-ligatures: none;
}

button,
a,
select,
label,
.tab,
[data-action] {
  cursor: url('/assets/ui/cursor.png') 2 2, pointer;
}

h1,
h2,
.brand,
.company-name,
.big {
  font-family: var(--title);
  font-weight: 400;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 26px;
  color: var(--accent);
  margin: 10px 0 8px;
}

h3 {
  color: var(--accent);
}

.brand {
  font-size: 32px;
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
}

#topbar {
  background: linear-gradient(#263522, #182214);
  border-bottom: 3px solid var(--accent-2);
  box-shadow: 0 2px 0 #000;
}

#panel {
  background: var(--panel);
  border-left: none;
  border-image: var(--fr-panel);
  border-style: solid;
}

#tabs {
  border-bottom: 2px solid var(--border);
}

.tab {
  font-family: var(--font);
  border-radius: 0;
  color: var(--muted);
}

.tab:hover {
  background: var(--panel-2);
  color: var(--text);
}

.tab.active {
  color: var(--on-red);
  border: none;
  border-image: var(--fr-btn-on);
  border-style: solid;
  background: none;
}

.tab.admin-tab {
  color: #e57373;
}

.badge:not(:empty) {
  background: #8b1e1e;
  border-radius: 0;
  box-shadow: 0 0 0 1px #000;
}

/* Buttons: moss-green pixel frames; the main choice is mushroom red */
.btn {
  border-radius: 0;
  border: none;
  border-image: var(--fr-btn);
  border-style: solid;
  background: none;
  color: var(--on-btn);
  font-family: var(--font);
  font-weight: 600;
  padding: 5px 12px;
}

.btn:hover:not(:disabled) {
  background: none;
  filter: brightness(1.25);
}

.btn.primary {
  border-image-source: url('/assets/ui/moss/btn-on.svg');
  color: var(--on-red);
}

.btn.twitch {
  border-image-source: url('/assets/ui/moss/btn-twitch.svg');
  color: #fff;
}

.btn.essence {
  border-image-source: url('/assets/ui/moss/btn-essence.svg');
  color: #fff;
}

.btn.danger {
  border-image-source: url('/assets/ui/moss/btn.svg');
  color: #ffb4a0;
}

.btn.small {
  padding: 3px 9px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.4;
}

/* Lists, cards and frames */
.row,
.slot,
.setting,
.autosell,
.events li {
  background: var(--panel-2);
  border: 2px solid #3a4a30;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px #000;
}

.row.current {
  outline: 2px solid var(--accent);
}

.asc-card,
.company-card {
  border: none;
  border-image: var(--fr-panel);
  border-style: solid;
  background: none;
  padding: 14px;
}

.slot {
  border: 2px solid var(--c);
}

.empty-slot {
  border-style: dashed;
}

.stat {
  border-radius: 0;
  background: #141d10;
  color: #c5e1a5;
}

.mut,
.chip,
.pill,
.buff,
.world-chip {
  border-radius: 0;
}

.pill {
  background: #2a3824;
  color: var(--gold);
}

.world-chip {
  background: #141d10;
  border: 2px solid var(--accent-2);
}

.buff {
  border-width: 2px;
}

.kv td {
  border-bottom: 1px dashed #3a4a30;
}

.lb-row:nth-child(odd) {
  background: var(--panel-2);
}

.lb-row.you {
  background: #34452a;
  outline: 2px solid var(--accent);
}

.progress {
  border-radius: 0;
  border: 2px solid #000;
  background: #141d10;
}

.progress > div {
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--accent-2) 6px 8px);
}

.gold-text {
  color: var(--gold);
}

.coin {
  border-radius: 0;
  box-shadow: 0 0 0 2px #000;
  background: var(--gold);
}

/* Inputs */
input,
select,
.nick-form input,
.inline-form input,
.ask-fields input,
.ask-fields select,
.sim-form input,
.sim-form select,
.dev-login input,
.account-login input {
  border-radius: 0;
  border: 2px solid var(--accent-2);
  background: #141d10;
  color: var(--text);
  font-family: var(--font);
}

/* Modals, landing and toasts */
.modal,
.landing-card {
  border: none;
  border-image: var(--fr-panel);
  border-style: solid;
  background: none;
  box-shadow: none;
  padding: 18px 26px;
}

.modal-backdrop {
  background: rgba(6, 10, 5, 0.7);
}

#landing {
  background: radial-gradient(circle at 50% 30%, #2c3d26, var(--bg) 70%);
}

.landing-card h1 {
  font-size: 54px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
}

.toast {
  border-radius: 0;
  border: none;
  border-image: var(--fr-plate);
  border-style: solid;
  background: none;
  color: var(--on-birch);
}

.toast.error-toast {
  border-image: var(--fr-btn-on);
  color: var(--on-red);
}

#test-banner {
  background: repeating-linear-gradient(45deg, #5c1a0b, #5c1a0b 12px, #7a2410 12px, #7a2410 24px);
}

/* Sprite icons (art packs, 32px cells shown at 1:1 or 2:1 with hard edges) */
.icon {
  border-radius: 0;
  background: #141d10;
  width: 40px;
  height: 40px;
}

.sprite-icon {
  display: grid;
  place-items: center;
}

.sprite {
  display: block;
  image-rendering: pixelated;
}

.chest-sprite {
  width: 33px;
  height: 18px;
  image-rendering: pixelated;
}

/* Collection grid */
.dex {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 6px;
}

.dex-cell {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  background: var(--panel-2);
  border: 2px solid var(--c);
  box-shadow: inset 0 0 0 1px #000;
}

.dex-cell b {
  color: var(--c);
  font-weight: 600;
  line-height: 1.1;
}

.dex-cell.unknown .sprite {
  filter: brightness(0) opacity(0.45);
}

.dex-cell.unknown {
  border-style: dashed;
  opacity: 0.85;
}

.credits li {
  margin-bottom: 6px;
}

/* =====================================================================
   v6: Alpha v1 (readable font, text size, scene HUD, tooltips)
   ===================================================================== */

:root {
  --font: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --ui-scale: 1;
}

body.font-pixel {
  --font: 'Pixelify Sans', 'Segoe UI', sans-serif;
}

/* The readable font gets plain, legible headings; the pixel font keeps the blackletter ones. */
body:not(.font-pixel) h2,
body:not(.font-pixel) .company-name {
  font-family: var(--font);
  font-weight: 700;
  font-variant: small-caps;
  font-size: 22px;
  letter-spacing: 0.3px;
}

body:not(.font-pixel) .btn,
body:not(.font-pixel) .tab {
  letter-spacing: 0.2px;
}

/* Text size: scale whole UI blocks (positioned overlays scale their content instead) */
#topbar,
#panel,
.modal,
.landing-card,
.toast,
#tooltip > * {
  zoom: var(--ui-scale);
}

/* Version badge next to the title */
.version {
  position: relative;
  top: -5px;
  margin-left: 6px;
  padding: 1px 7px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
  text-shadow: none;
  background: #2a3824;
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 1px #000;
}

.version:hover {
  filter: brightness(1.3);
}

/* ---------- Scene HUD (HTML over the canvas: crisp text, smooth bar) ---------- */

#scene-hud {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--font);
  color: var(--text);
}

#scene-hud > div {
  position: absolute;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 0 2px 4px rgba(0, 0, 0, 0.6);
}

.hud-where {
  font-size: calc(14px * var(--ui-scale));
  font-weight: 700;
}

.hud-name {
  transform: translate(-50%, -100%);
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
}

/* Company members on the water: their names, a little quieter than yours */
.hud-name.mate-name {
  opacity: 0.8;
  font-weight: 600;
}

.hud-name.mate-name[hidden] {
  display: none;
}

.hud-bar {
  width: 220px;
  height: 12px;
  overflow: hidden;
  background: #141d10;
  border: 2px solid #000;
  box-shadow: 0 0 0 2px var(--accent-2);
}

.hud-fill {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--accent-2) 6px 8px);
}

.hud-phase {
  font-size: calc(14px * var(--ui-scale));
  font-weight: 700;
}

/* Frenzy: sustained clicking raises luck */
.hud-frenzy {
  display: grid;
  gap: 2px;
  transition: opacity 0.3s, visibility 0.3s;
}

.hud-frenzy.idle {
  opacity: 0.55;
}

.hud-frenzy.away {
  opacity: 0;
  visibility: hidden;
}

.hud-frenzy-bar {
  height: 8px;
  overflow: hidden;
  background: #141d10;
  border: 2px solid #000;
  box-shadow: 0 0 0 1px #5b2a86;
}

.hud-frenzy-fill {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
  background: linear-gradient(90deg, #7c3aed, #e879f9 70%, #fde68a);
}

.hud-frenzy.hot .hud-frenzy-bar {
  box-shadow: 0 0 0 1px #f0abfc, 0 0 10px 2px rgba(232, 121, 249, 0.75);
}

.hud-frenzy-text {
  font-size: calc(12px * var(--ui-scale));
  font-weight: 700;
  color: #f0abfc;
}

.frenzy-text {
  color: #f0abfc;
}

.offline-gold {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
  font-size: 26px;
}

/* Catch card: pops up in place */
#scene-hud > .catch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  min-width: 240px;
  max-width: min(420px, 92%);
  padding: 10px 16px;
  white-space: normal;
  text-shadow: 1px 1px 0 #000;
  border: 15px solid;
  border-image: var(--fr-panel);
  box-shadow: 0 0 0 2px var(--c), 0 6px 18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%) scale(calc(var(--ui-scale) * 0.8));
  transition:
    transform 0.16s cubic-bezier(0.3, 1.6, 0.5, 1),
    opacity 0.1s;
}

#scene-hud > .catch-card.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(var(--ui-scale));
}

#scene-hud > .catch-card.hide {
  opacity: 0;
  transition: opacity 0.2s;
}

.catch-icon {
  display: grid;
  place-items: center;
  min-width: 64px;
}

.catch-rarity {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c);
}

.catch-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--c);
}

.catch-tag {
  font-size: 13px;
  font-weight: 700;
}

.catch-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Tooltip (anything with data-tip) ---------- */

#tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(500px, calc(100vw - 16px));
  padding: 8px 12px;
  pointer-events: none;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  border: 9px solid;
  border-image: var(--fr-tip);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

#tooltip[hidden] {
  display: none;
}

.tip-title {
  margin: 2px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.tip-head {
  margin-bottom: 2px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.tip-sep {
  margin: 6px 0;
  border-top: 1px dashed var(--border);
}

.tip-fish {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tip-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 14px;
}

#tooltip .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.world-chip,
.buff {
  cursor: url('/assets/ui/cursor.png') 2 2, help;
}

.buff.event {
  box-shadow: 0 0 0 1px #000, 0 0 6px var(--c);
}

/* ---------- Settings: display + character ---------- */

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}

.char-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 4px 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-2);
  border: 2px solid #3a4a30;
  box-shadow: inset 0 0 0 1px #000;
}

.char-card:hover {
  filter: brightness(1.15);
}

.char-card.selected {
  color: var(--accent);
  border-color: var(--accent);
}

.char-card .sprite {
  pointer-events: none;
}

.char-card.selected .sprite,
.char-card:hover .sprite {
  animation: char-loop 0.9s steps(4) infinite;
}

@keyframes char-loop {
  to {
    background-position: -384px 0;
  }
}

/* ---------- Company + admin ---------- */

.btn.more {
  display: block;
  margin: 6px auto 0;
}

.online-dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  background: #4ade80;
  box-shadow: 0 0 0 2px #000;
}

.bad-text {
  color: #ff8a80;
}

.event-form {
  margin-top: 6px;
}

/* ---------- Changelog ---------- */

.changelog-body {
  max-height: calc(60vh / var(--ui-scale));
  overflow-y: auto;
  padding-right: 6px;
}

.changelog-body h4 {
  margin: 8px 0 2px;
  color: var(--gold);
}

.changelog {
  margin: 0;
  padding-left: 20px;
}

.changelog li {
  margin-bottom: 3px;
}

.tab.active.admin-tab {
  color: var(--on-red);
}

/* zoom scales the modal's own lengths too, so divide the viewport limits by it */
.modal {
  width: min(420px, calc((100vw - 32px) / var(--ui-scale)));
  max-height: calc(85vh / var(--ui-scale));
}

.modal:has(.changelog-body) {
  width: min(520px, calc((100vw - 32px) / var(--ui-scale)));
}

/* ---------- List filters, per-type auto-sell, collapsible upgrades ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 4px 0 8px;
}

.filter-bar select {
  margin-left: auto;
}

.filter-bar .toggle {
  margin: 0 0 0 auto;
}

/* Per-type auto-sell: two aligned columns of "Type  [rarity]" */
.slot-sell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.slot-sell-grid label {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.slot-sell-grid select {
  width: 100%;
  min-width: 0;
  margin: 0;
}

@media (max-width: 420px) {
  .slot-sell-grid {
    grid-template-columns: 1fr;
  }
}

button.link {
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  background: none;
  border: none;
}

.fold {
  flex: none;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
  background: #141d10;
  border: 2px solid var(--border);
}

.fold:hover {
  color: var(--gold);
  border-color: var(--accent-2);
}

.folded-row {
  padding-top: 4px;
  padding-bottom: 4px;
  opacity: 0.75;
}

/* One line each: name, level, what it gives (cut short with … when narrow) */
.folded-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folded-desc {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted, #9ca3af);
}

.folded-row .fold {
  align-self: center;
}

/* Connection banner when the server runs the game */
#conn-status {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  transform: translateX(-50%);
  font-family: var(--font);
  font-weight: 700;
  color: var(--text);
  border: 15px solid;
  border-image: var(--fr-panel);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

#conn-status.replaced,
#conn-status.kicked {
  top: 40%;
}

/* Emberscales (the gift-sub currency) */
.ember-icon {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 19px;
  vertical-align: -3px;
  background: url('/assets/icons/emberscale.svg') center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 3px rgba(255, 110, 40, 0.55));
}

.ember-icon.small {
  width: 11px;
  height: 13px;
  vertical-align: -2px;
}

.ember-text {
  color: #ff8a4a;
}

/* Amounts with their currency icon (buttons and lists) */
.amt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.coin.sm {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
}

.essence-gem.sm {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 1px;
}

/* Admin */
.danger-text {
  color: #f87171;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid #7f1d1d;
  background: rgba(127, 29, 29, 0.18);
}

.warn-box {
  padding: 8px 10px;
  border: 2px solid #a16207;
  background: rgba(161, 98, 7, 0.16);
}

.btn.more {
  margin: 4px 0 10px;
}

/* Player level */
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--gold);
}

.xp-bar {
  display: inline-block;
  width: 70px;
  height: 6px;
  background: #141d10;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--accent-2);
}

.xp-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6f9a49, #e9e27a);
  transition: width 0.3s;
}

/* Diablo-style gear */
.quality {
  margin-left: 4px;
  padding: 0 4px;
  font-size: 0.75em;
  font-weight: 700;
  border: 1px solid currentColor;
  vertical-align: 1px;
}

.quality.q1 {
  color: #d39b54;
}

.quality.q2 {
  color: #ff4a4a;
}

.item-quality {
  font-weight: 700;
  font-size: 0.9em;
}

.item-card.q1 {
  box-shadow: inset 3px 0 0 #d39b54;
  padding-left: 8px;
}

.item-card.q2 {
  box-shadow: inset 3px 0 0 #ff4a4a;
  padding-left: 8px;
}

.power-line,
.power-text {
  color: #ff9a3c;
}

.power-line {
  margin-top: 4px;
  font-size: 0.9em;
}

.set-text {
  color: #5ff0b4;
}

.set-block {
  margin-top: 6px;
  font-size: 0.9em;
}

.bad-text {
  color: #f87171;
}

/* Upgrade milestones and collection milestones */
.milestone {
  margin-top: 2px;
  font-size: 0.85em;
  color: var(--gold);
}

.milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 6px;
}

.milestones .ms {
  padding: 1px 6px;
  font-size: 0.78em;
  color: var(--muted, #8a9a78);
  border: 1px solid #3a4a30;
}

.milestones .ms.got {
  color: #fde68a;
  border-color: #a16207;
  background: rgba(161, 98, 7, 0.18);
}

.trophy {
  filter: drop-shadow(0 0 3px rgba(253, 230, 138, 0.8));
}

/* ==========================================================================
   Alpha v1.2: the game fills the screen; windows pop up over it from the
   action bar (Character, Bags, ...); chat in the bottom-left corner.
   ========================================================================== */

#stage {
  position: relative;
  flex: 1;
  display: block;
  min-height: 0;
  overflow: hidden;
}

#stage > #game {
  position: absolute;
  inset: 0;
  height: auto;
}

/* Icons from game-icons.net, recoloured with CSS (the SVG is a mask) */
.ui-icon {
  display: inline-block;
  flex: none;
  width: 1.4em;
  height: 1.4em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

kbd {
  display: inline-block;
  min-width: 16px;
  padding: 0 3px;
  font: 700 10px/14px var(--font);
  text-align: center;
  color: var(--on-birch);
  background: #ddd5c0;
  border: 1px solid #0f160c;
  box-shadow: 0 1px 0 #000;
}

/* ---------- Windows ---------- */

#windows {
  position: absolute;
  inset: 0 0 86px;
  z-index: 3;
  pointer-events: none;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 8px);
  pointer-events: auto;
  background: none;
  border: 15px solid;
  border-image: var(--fr-panel);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  animation: win-pop 0.14s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes win-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

.window.focused {
  box-shadow: 0 0 24px rgba(233, 226, 122, 0.22), 0 14px 40px rgba(0, 0, 0, 0.75);
}

.win-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 26px;
  margin: -4px -4px 0;
  padding: 2px 2px 6px;
  border-bottom: 2px solid #3a4a30;
  color: var(--accent);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

/* The title sits on a birch plaque across the top of the frame */
.win-title {
  position: absolute;
  left: 50%;
  top: -24px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 96px);
  padding: 0 12px;
  transform: translateX(-50%);
  color: #3c5a24;
  border: 9px solid;
  border-image: var(--fr-plate);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.win-title .ui-icon {
  width: 1.15em;
  height: 1.15em;
}

.win-head:active {
  cursor: grabbing;
}

.window .win-head h2 {
  margin: 0;
  overflow: hidden;
  /* tall enough for Metamorphous' descenders (g, y) and the shadow, which overflow:hidden would clip */
  font: 400 21px/27px var(--title);
  font-variant: normal;
  letter-spacing: 0.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-birch);
  text-shadow: 0 1px 0 #f7f3e8;
}

.win-close {
  width: 26px;
  height: 26px;
  padding: 0;
  font: 700 14px var(--font);
  color: var(--muted);
  background: #141d10;
  border: 1px solid #5c6650;
}

.win-close:hover {
  color: #fff;
  background: #8f3022;
}

.win-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px 12px;
  zoom: var(--ui-scale);
}

.win-body > h2:first-child {
  margin-top: 0;
}

.win-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 2px solid #3a4a30;
}

.win-tab {
  padding: 6px 12px;
  font: 600 14px var(--font);
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.win-tab:hover {
  color: var(--text);
}

.win-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* A window's own tabs (Angler, Harbour, Map...): they stay at the top while the tab scrolls */
.panel-tabs {
  position: sticky;
  top: -10px; /* the body's top padding */
  z-index: 3;
  margin: -10px -8px 10px;
  padding: 6px 8px 0;
  background: #223020; /* the panel art's fill */
  flex-wrap: wrap;
}

.panel-tabs .win-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-tabs kbd {
  font-size: 10px;
  opacity: 0.7;
}

.tab-badge {
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger, #c0392b);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

/* Phones have no keyboard: tabs drop their key hints so they fit on one line */
@media (max-width: 640px) {
  .panel-tabs kbd {
    display: none;
  }
  .panel-tabs .win-tab {
    padding: 6px 8px;
  }
}

/* The bag under your gear (Angler window, Gear tab) */
.bag-tabs {
  margin-top: 14px;
}

.center {
  text-align: center;
}

/* ---------- Action bar and XP bar (bottom centre) ---------- */

#hotbar {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 8px;
  z-index: 4;
  display: grid;
  justify-content: center; /* as wide as the action bar, centred */
  gap: 4px;
  pointer-events: none;
}

#hotbar > * {
  pointer-events: auto;
}

#xp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 13px;
  text-shadow: 1px 1px 0 #000;
}

/* Ascension progress: this run's money toward the next ascension (above the XP bar) */
#asc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font: inherit;
  font-size: 13px;
  color: inherit;
  text-shadow: 1px 1px 0 #000;
  background: none;
  border: 0;
  cursor: pointer;
}

#asc-row .lvl,
#xp-row .lvl {
  min-width: 50px; /* the two bars start in line */
}

#asc-row .lvl {
  white-space: nowrap;
}

#asc-row .asc-bar {
  flex: 1;
  width: auto;
  min-width: 80px;
  height: 7px;
}

#asc-row .asc-bar > span {
  background: linear-gradient(90deg, #6d4bb8, #c4b5fd);
}

#asc-row.ready .asc-bar > span {
  background: linear-gradient(90deg, #a78bfa, #f5f3ff);
  animation: asc-glow 1.6s ease-in-out infinite;
}

@keyframes asc-glow {
  50% {
    filter: brightness(1.35);
  }
}

#asc-text {
  font-size: 11px;
  white-space: nowrap;
}

#xp-row .lvl {
  color: var(--gold);
  white-space: nowrap;
}

#xp-row .xp-bar,
.xp-bar.wide {
  flex: 1;
  width: auto;
  min-width: 80px;
  height: 7px;
}

#xp-text {
  font-size: 11px;
  white-space: nowrap;
}

#actionbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 0 1px;
  background: none;
  border: 9px solid;
  border-image: var(--fr-bar);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.action-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 17px;
  color: #cfe0a8;
  background: none;
  border: 6px solid;
  border-image: var(--fr-key);
}

.action-btn:hover {
  color: #f4f0b0;
  filter: brightness(1.2);
}

.action-btn.active {
  color: var(--on-red);
  border-image: var(--fr-btn-on);
}

.action-btn.admin {
  color: #e57373;
}

.action-btn kbd {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 12px;
  padding: 0 2px;
  font-size: 9px;
  line-height: 11px;
}

/* Whole pixels so the icon lands dead centre in the key */
.action-btn .ui-icon {
  width: 24px;
  height: 24px;
}

/* Badges sit on the corner, so an empty one never nudges the icon */
.action-btn .badge,
.chat-toggle .badge {
  position: absolute;
}

.action-btn .badge:not(:empty) {
  position: absolute;
  top: -6px;
  right: -6px;
  margin: 0;
  font-size: 10px;
  line-height: 14px;
}

/* ---------- Character (paper doll) ---------- */

.paperdoll {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: radial-gradient(ellipse at center, rgba(223, 227, 138, 0.12), transparent 70%);
}

.slot-col {
  display: grid;
  gap: 10px;
}

.gear-slot,
.bag-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  font-size: 30px;
  color: var(--c, #6b7a5a);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c, #000) 22%, #1a2416), #0e150b 75%);
  border: 2px solid var(--c, #3a4a30);
  box-shadow: inset 0 0 0 1px #000, 0 0 8px -2px var(--c, transparent);
}

.gear-slot:hover,
.bag-cell:not(.empty):hover {
  filter: brightness(1.25);
}

.gear-slot.empty {
  color: #3f4f36;
  border-color: #3a4a30;
  border-style: dashed;
  box-shadow: none;
}

.slot-label {
  position: absolute;
  bottom: 2px;
  font-size: 10px;
  color: #6b7a5a;
}

.gear-slot .ilvl,
.bag-cell .ilvl {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font: 700 10px var(--font);
  color: #f1e4c4;
  text-shadow: 1px 1px 0 #000;
}

/* Ancient: bronze corner; Primal: red corner and glow; set: mint (its colour) */
.gear-slot.q1::after,
.bag-cell.q1::after,
.gear-slot.q2::after,
.bag-cell.q2::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #d39b54 50%, transparent 50%);
}

.gear-slot.q2::after,
.bag-cell.q2::after {
  background: linear-gradient(135deg, #ff4a4a 50%, transparent 50%);
}

.gear-slot.q2,
.bag-cell.q2 {
  box-shadow: inset 0 0 0 1px #000, 0 0 12px 1px #ff4a4a;
}

.doll-center {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.doll-name {
  font: 400 26px var(--title);
  color: var(--accent);
}

.doll-level {
  color: var(--gold);
  font-weight: 700;
}

.doll-sprite {
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6));
}

.doll-xp {
  display: grid;
  width: 100%;
  max-width: 260px;
  gap: 2px;
  justify-items: center;
}

.char-extras {
  display: grid;
  gap: 2px;
  margin: 6px 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #3a4a30;
}

.char-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 16px;
}

.stat-group h3 {
  margin: 6px 0 4px;
  font-size: 14px;
  border-bottom: 1px solid #3a4a30;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
}

.stat-row:hover {
  background: rgba(223, 227, 138, 0.1);
}

/* ---------- Bags ---------- */

.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 52px);
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}

.bag-grid .bag-cell {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

/* Bag search and the power-or-set / rarity / sort dropdowns: one row on desktop, wrapping on phones */
.bag-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 2px 0 4px;
  padding: 5px 8px;
  font-size: 14px;
}

.bag-selects select {
  flex: 1 1 150px;
  min-width: 0;
  max-width: 100%;
  margin-left: 0;
}

/* Auto-sell: keep only some Legendaries and set pieces */
.keep-only {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.keep-only .chips {
  gap: 4px;
}

.keep-quality select {
  margin-left: 6px;
}

.keep-summary {
  color: var(--accent);
}

.bag-cell.empty {
  border-style: dashed;
  border-color: #2a3824;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.25);
}

.bag-cell.cant {
  opacity: 0.55;
}

.bag-cell.cant .ilvl {
  color: #f87171;
}

.bag-cell .lock {
  position: absolute;
  top: 0;
  right: 1px;
  font-size: 10px;
}

details.autosell > summary {
  font-weight: 700;
  color: var(--accent);
  cursor: url('/assets/ui/cursor.png') 2 2, pointer;
}

details.autosell[open] > summary {
  margin-bottom: 6px;
}

/* ---------- Chat (bottom-left) ---------- */

.chat-toggle {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 22px;
  color: #cfe0a8;
  background: none;
  border: 6px solid;
  border-image: var(--fr-key);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.chat-toggle .ui-icon {
  width: 30px;
  height: 30px;
}

.chat-toggle:hover {
  color: #f4f0b0;
  filter: brightness(1.2);
}

.chat-toggle.open {
  color: var(--on-red);
  border-image: var(--fr-btn-on);
}

.chat-toggle .badge:not(:empty) {
  position: absolute;
  top: -6px;
  right: -6px;
  margin: 0;
  font-size: 10px;
}

/* Players online right now (the server sends the count), just right of the chat button */
.online-count {
  position: absolute;
  left: 64px;
  bottom: 21px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  font-size: 13px;
  color: #cfe0a8;
  white-space: nowrap;
  background: rgba(10, 14, 8, 0.72);
  border: 2px solid rgba(207, 224, 168, 0.35);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.online-count[hidden] {
  display: none;
}

.online-count b {
  color: #f4f0b0;
}

.online-count .online-dot {
  width: 8px;
  height: 8px;
  margin-right: 5px;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
}

/* Phones: the action bar starts right of the chat button, so the count sits on top of the button */
@media (max-width: 640px) {
  .online-count {
    left: 10px;
    bottom: 62px;
    padding: 2px 6px 2px 4px;
    font-size: 11px;
  }

  .online-count .online-label {
    display: none;
  }
}

.chat {
  position: absolute;
  left: 10px;
  bottom: 64px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100% - 20px));
  height: min(300px, calc(100% - 160px));
  background: none;
  border: 9px solid;
  border-image: var(--fr-chat);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.chat[hidden] {
  display: none;
}

.chat-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
  border-bottom: 2px solid #3a4a30;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.35;
}

.chat-msg {
  position: relative;
  padding: 1px 0;
  overflow-wrap: anywhere;
}

.chat-msg .who {
  font-weight: 700;
  color: #ffcf7a;
}

.chat-msg .lv {
  color: #8fa6ff;
  font-size: 11px;
}

.chat-msg .co {
  color: var(--muted);
  font-size: 11px;
}

.chat-msg.system {
  color: #fde68a;
  font-style: italic;
}

.chat-msg.admin .who {
  color: #f87171;
}

.chat-msg .mod {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
}

.chat-msg:hover .mod {
  display: inline-flex;
  gap: 2px;
}

.chat-msg .mod button {
  padding: 0 4px;
  font-size: 10px;
}

.chat-form {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-top: 2px solid #3a4a30;
}

.chat-form input {
  flex: 1;
  min-width: 0;
}

/* ---------- Floating catch text (replaces the catch card) ---------- */

.catch-float {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1px;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  animation: catch-rise 2.6s ease-out forwards;
}

.catch-float .cf-name {
  font: 700 calc(17px * var(--ui-scale)) var(--font);
  color: var(--c);
}

.catch-float.big .cf-name {
  font: 400 calc(30px * var(--ui-scale)) var(--title);
  filter: drop-shadow(0 0 8px var(--c));
}

.catch-float .cf-sub {
  font-size: calc(12px * var(--ui-scale));
  color: #d5dcc4;
}

.catch-float .cf-gold {
  font-weight: 700;
  font-size: calc(14px * var(--ui-scale));
  color: var(--gold);
}

.catch-float .cf-mut {
  font-weight: 700;
  font-size: calc(13px * var(--ui-scale));
  color: var(--m, #fff59d);
  animation: shimmer 0.9s linear infinite alternate;
}

@keyframes catch-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.7);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1.06);
  }
  18% {
    transform: translate(-50%, -100%) scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 70px)) scale(1);
  }
}

@keyframes shimmer {
  to {
    filter: brightness(1.6) drop-shadow(0 0 4px var(--m, #fff59d));
  }
}

/* ---------- Narrow screens: windows fill the play area ---------- */

@media (max-width: 720px) {
  #topbar .brand,
  #topbar .player-text,
  #buffs {
    display: none;
  }

  .window {
    left: 4px !important;
    right: 4px;
    top: 18px !important;
    width: auto !important;
    max-height: calc(100% - 8px);
  }

  #hotbar {
    left: 60px;
    right: 4px;
  }

  .action-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  /* Narrow phones: all nine buttons on one row */
  @media (max-width: 440px) {
    #actionbar {
      gap: 2px;
    }

    .action-btn {
      width: 30px;
      height: 30px;
      border-width: 5px;
    }

    .action-btn .ui-icon {
      width: 18px;
      height: 18px;
    }
  }

  .paperdoll {
    grid-template-columns: auto auto;
  }

  .doll-center {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

/* The chat sits above the action bar when there isn't room beside it */
@media (max-width: 1150px) {
  .chat {
    bottom: 112px;
  }
}

/* Toasts float above the action bar */
#toasts {
  bottom: 112px;
}

/* Numbers from fmtHtml and fmtDecHtml: the plain number font */
.num {
  font-family: var(--num);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

/* In the number font a suffix (K, M, B…) reads fine as it is */
.num .unit,
.money .unit {
  margin-left: 0;
  font-family: inherit;
  font-size: 0.92em;
  font-weight: inherit;
}

/* Number suffixes (K, M, B…) in the title font: in Pixelify Sans a B looks like an 8 */
.unit {
  margin-left: 1px;
  font-family: var(--title);
  font-size: 0.86em;
  font-weight: 400;
  letter-spacing: 0;
}

/* Sail to the next zone: glass tabs on the edges of the scene. At rest they show a chevron and a
   status icon; hover (or focus, or a first tap on touch screens) slides them open with the zone's
   name and what it takes to get there. */
#scene-hud > .sail-arrow {
  position: absolute;
  pointer-events: auto;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  transform: translateY(-50%);
}

#scene-hud > .sail-arrow.right {
  transform: translate(-100%, -50%);
}

#scene-hud > .sail-arrow[hidden] {
  display: none;
}

.sail-arrow:focus-visible {
  outline: none;
}

.sail-tab {
  zoom: var(--ui-scale);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 44px;
  height: 100px;
  padding: 0 16px 0 15px;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  color: var(--text);
  background: rgba(14, 22, 13, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 176, 150, 0.4);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: max-width 0.25s ease, background-color 0.25s;
}

.sail-arrow.right .sail-tab {
  border-right: none;
  border-radius: 14px 0 0 14px;
}

.sail-arrow.left .sail-tab {
  border-left: none;
  border-radius: 0 14px 14px 0;
}

.sail-arrow:hover .sail-tab,
.sail-arrow:focus-visible .sail-tab,
.sail-arrow.open .sail-tab {
  max-width: 300px;
  background-color: rgba(20, 30, 18, 0.84);
}

.sail-arrow:focus-visible .sail-tab {
  border-color: var(--accent);
}

.sail-lead {
  display: grid;
  justify-items: center;
  gap: 10px;
  flex: none;
  width: 14px;
}

.sail-chev {
  width: 10px;
  height: 18px;
  background: var(--accent);
  -webkit-mask: url('/assets/icons/hud/chevron.svg') center / contain no-repeat;
  mask: url('/assets/icons/hud/chevron.svg') center / contain no-repeat;
}

.sail-arrow.left .sail-chev {
  transform: scaleX(-1);
}

.sail-arrow.boat .sail-chev,
.sail-arrow.power .sail-chev,
.sail-arrow.ascend .sail-chev {
  background: var(--muted);
}

.sail-arrow.boat.afford .sail-chev {
  background: var(--gold);
}

.sail-lead .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.sail-text {
  display: grid;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.sail-arrow:hover .sail-text,
.sail-arrow:focus-visible .sail-text,
.sail-arrow.open .sail-text {
  opacity: 1;
}

.sail-text b {
  font: 400 18px/1.25 var(--title);
  color: var(--text);
}

.sail-text small {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 12px var(--font);
  color: var(--muted);
}

.sail-text small .ui-icon {
  width: 13px;
  height: 13px;
}

.sail-cost {
  font-variant-numeric: tabular-nums;
}

.sail-arrow.afford .sail-cost {
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .sail-tab,
  .sail-text {
    transition: none;
  }
}

/* Player level on the leaderboard */
.lb-lv {
  display: inline-block;
  margin-right: 2px;
  padding: 0 4px;
  font-size: 0.75em;
  font-weight: 700;
  color: #b9c8ff;
  border: 1px solid #3d4f8f;
  background: rgba(61, 79, 143, 0.25);
  vertical-align: 1px;
}

/* Build priorities (Bags) */
.build-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #3a4a30;
}

.build-bar .btn {
  margin-left: auto;
}

.build-picker {
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid #3a4a30;
}

.build-chip {
  font: inherit;
  cursor: url('/assets/ui/cursor.png') 2 2, pointer;
}

.build-chip.on {
  color: #1b2616;
  background: var(--accent);
  border-color: #f4f0b0;
}

.bag-cell .upg {
  position: absolute;
  top: 1px;
  left: 2px;
  font: 700 9px var(--font);
  text-shadow: 1px 1px 0 #000;
}

.mkt-upg {
  margin-left: 4px;
  padding: 1px 6px;
  font: 700 11px var(--font);
  white-space: nowrap;
  vertical-align: 1px;
}

.mkt-upg.up {
  color: #6ee787;
  background: #10301a;
  box-shadow: 0 0 0 1px #2f6b3d;
}

.mkt-upg.down {
  color: #f87171;
}

.bag-cell .upg.up {
  color: #6ee787;
}

.bag-cell .upg.down {
  color: #f87171;
}

.build-tip {
  margin-bottom: 4px;
  padding: 3px 6px;
  border: 1px solid #3a4a30;
}

.build-tip.up b {
  color: #6ee787;
}

.build-tip.down b {
  color: #f87171;
}

/* ==========================================================================
   Top bar: a slim strip over the top of the scene that fades into the sky.
   The Gold coin and the time and weather icons are pixel art drawn by
   tools/ui-frames.mjs.
   ========================================================================== */

:root {
  --topbar-h: 46px;
}

/* The Gold coin, in the Emberscale's style (shown at 1× or 2× so the pixels stay square) */
.coin {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 0;
  box-shadow: none;
  background: url('/assets/icons/gold-coin.svg') center / contain no-repeat;
  image-rendering: pixelated;
}

#app {
  position: relative;
}

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  height: var(--topbar-h);
  padding: 0 14px 0 18px;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: none; /* clicks in the gaps reach the scene */
}

#topbar::before {
  content: '';
  position: absolute;
  inset: 0 0 -22px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(8, 13, 8, 0.9), rgba(8, 13, 8, 0.72) 62%, rgba(8, 13, 8, 0));
}

#topbar > * {
  pointer-events: auto;
}

#topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 20px;
  text-shadow: 1px 1px 0 #000;
}

#topbar .version {
  position: static;
  margin: 0;
  padding: 0;
  font: 12px 'Pixelify Sans', var(--font);
  color: var(--muted);
  background: none;
  border: none;
  box-shadow: none;
}

#topbar .version:hover {
  color: var(--text);
  filter: none;
}

#topbar .currencies {
  display: flex;
  align-items: center;
  gap: 18px;
}

#topbar .currency {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 600 17px var(--num);
  font-variant-numeric: lining-nums tabular-nums;
  text-shadow: 1px 1px 0 #000;
}

#topbar .coin {
  filter: drop-shadow(0 0 3px rgba(246, 196, 69, 0.35));
}

#topbar .ember-icon {
  width: 22px;
  height: 26px;
}

/* Gold per second: big enough for the pixel font to stay sharp, bright on a dark pill */
#topbar .rate {
  padding: 1px 8px;
  font-size: 15px;
  font-weight: 500;
  color: #c6f29a;
  text-shadow: none;
  background: rgba(10, 18, 8, 0.6);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(155, 227, 106, 0.4);
}

#topbar .rate .per {
  color: #8fbf6c;
}

#topbar .rate:empty {
  display: none;
}

/* Time and weather */
#topbar .world-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 0;
  font: 600 14px var(--num);
  color: var(--text);
  text-shadow: 1px 1px 0 #000;
  background: none;
  border: none;
}

#topbar .world-chip img {
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

#topbar .world-chip small {
  font-size: 12px;
  color: var(--muted);
}

#topbar .world-chip small + img {
  margin-left: 4px;
}

/* Buffs: pills with a line underneath that shortens as they run out */
#topbar .buff-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

#topbar .buff {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 5px;
  overflow: hidden;
  font: 600 12px var(--num);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, rgba(10, 16, 9, 0.6));
  border: none;
  border-radius: 999px;
  box-shadow: none;
}

#topbar .buff::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--left, 100%);
  height: 2px;
  background: var(--c);
  transition: width 1s linear;
}

#topbar .buff b {
  font-weight: 500;
  color: var(--text);
}

#topbar .buff.event {
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent);
}

/* You: avatar with a ring that fills with XP, your level on it, and a menu */
#topbar .player {
  position: relative;
  margin-left: 0;
}

.player-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: conic-gradient(#b7d36a calc(var(--xp, 0) * 1%), rgba(255, 255, 255, 0.14) 0);
}

.player-btn:hover {
  filter: brightness(1.15);
}

.player-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.player-btn .avatar {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.player-btn .initial {
  display: grid;
  place-items: center;
  font: 700 15px var(--font);
  color: #fff;
  background: #6f4ab0;
}

.player-btn .initial[hidden],
.player-btn .avatar[hidden] {
  display: none;
}

.ring-level {
  position: absolute;
  bottom: -5px;
  left: 50%;
  padding: 0 4px;
  transform: translateX(-50%);
  font: 500 10px/13px 'Pixelify Sans', var(--font);
  color: var(--on-birch);
  white-space: nowrap;
  background: #ddd5c0;
  box-shadow: 0 0 0 1px #0f160c;
}

.player-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  display: grid;
  min-width: 210px;
  padding: 4px;
  background: none;
  border: 9px solid;
  border-image: var(--fr-tip);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.player-menu[hidden] {
  display: none;
}

.pm-head {
  display: grid;
  gap: 1px;
  margin-bottom: 4px;
  padding: 4px 8px 8px;
  font-weight: 700;
  border-bottom: 1px solid #3a4a30;
}

.pm-head .company-tag {
  font-size: 12px;
}

.pm-item {
  padding: 6px 8px;
  font: 14px var(--font);
  text-align: left;
  color: var(--text);
  background: none;
  border: none;
}

.pm-item:hover,
.pm-item:focus-visible {
  outline: none;
  background: rgba(223, 227, 138, 0.12);
}

.pm-item.out {
  color: #ffb4a0;
}

/* Everything else in the play area starts below the strip */
#windows {
  top: calc(var(--topbar-h) * var(--ui-scale));
}

#scene-hud > .hud-where {
  margin-top: calc(var(--topbar-h) * var(--ui-scale));
}

#conn-status:not(.replaced, .kicked) {
  top: calc(var(--topbar-h) * var(--ui-scale) + 10px);
}

@media (max-width: 720px) {
  #topbar {
    gap: 12px;
    padding: 0 8px 0 10px;
  }

  #topbar .rate,
  #topbar .version,
  #topbar .buff-bar,
  #topbar .world-chip small {
    display: none;
  }
}

@media (max-width: 480px) {
  #topbar .brand {
    display: none;
  }
}

/* ---------- Resizable windows ---------- */
.win-resize {
  position: absolute;
  right: -14px;
  bottom: -14px;
  z-index: 2;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 0 55%, var(--accent-2) 55% 62%, transparent 62% 72%, var(--accent-2) 72% 79%, transparent 79%);
  opacity: 0.8;
}

.win-resize:hover {
  opacity: 1;
}

.window.resizing {
  user-select: none;
}

/* ---------- Gear sets and stat limits (Character window) ---------- */
.gearsets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0;
}

.gearset {
  display: inline-flex;
  gap: 2px;
}

.btn.icon-btn {
  min-width: 26px;
  padding-inline: 4px;
}

.stat-limits {
  margin-top: 10px;
}

.stat-limits summary {
  cursor: pointer;
  font-weight: 700;
}

.limit-grid {
  display: grid;
  gap: 6px;
}

.limit-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 170px);
  align-items: center;
  gap: 8px;
}

.limit-grid select {
  margin: 0;
}

.bag-cell .set-mark {
  position: absolute;
  bottom: 0;
  left: 2px;
  font-size: 10px;
  color: var(--accent);
}

.tip-desc {
  max-width: 300px;
  color: var(--text);
}

.warn-text {
  color: var(--gold);
}

/* ---------- Admin announcements ---------- */
.notice-banner {
  position: fixed;
  top: 52px;
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(640px, calc(100vw - 32px));
  padding: 8px 10px 8px 14px;
  transform: translateX(-50%);
  color: var(--text);
  background: rgba(20, 32, 18, 0.94);
  border: 2px solid var(--accent-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: win-pop 0.2s ease-out;
}

.notice-banner.warning {
  border-color: var(--gold);
}

.notice-banner .notice-text {
  font-weight: 700;
}

.notice-close {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
}

.notice-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--accent-2);
}

.notice-preview.warning {
  border-color: var(--gold);
}

.notice-form input[name='text'] {
  flex: 1 1 220px;
}

@media (max-width: 720px) {
  .win-resize {
    display: none;
  }
}

/* ---------- Bounty board ---------- */
.bounties {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.bounty {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.bounty.done {
  border-color: var(--gold);
}

.bounty.empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bounty-head .stars {
  color: var(--gold);
  letter-spacing: 1px;
}

.bounty-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bounty.done .bounty-bar span {
  background: var(--gold);
}

/* ---------- Open water ---------- */
.hud-spot {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  font-size: calc(13px * var(--ui-scale));
  font-weight: 700;
  line-height: 1.3;
  color: #f4f1e0;
  text-shadow: none; /* the overlay's outline smears small text on a panel */
  white-space: nowrap;
  background: rgba(10, 16, 9, 0.9);
  border: 2px solid var(--spot, #9fe0ff);
}

.hud-spot::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--spot, #9fe0ff);
  border: 1px solid #120c06;
}

.hud-spot b {
  color: var(--spot, #9fe0ff);
}

.hud-spot[hidden] {
  display: none;
}

.steer-btn {
  position: absolute;
  bottom: 120px;
  z-index: 2;
  display: none;
  width: 64px;
  height: 64px;
  font-size: 28px;
  color: var(--text);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: rgba(14, 22, 13, 0.72);
  border: 2px solid var(--accent-2);
}

.steer-btn.left {
  left: 16px;
}

.steer-btn.right {
  right: 16px;
}

/* Touch screens get on-screen buttons to sail (keyboards use A and D) */
@media (hover: none) {
  #scene-hud.at-sea .steer-btn {
    display: block;
  }
}

/* Buy Me a Coffee (index.html): hidden on phones, where it would sit over the game and its windows
   (the widget sets its position inline, hence !important). */
@media (max-width: 640px) {
  #bmc-wbtn {
    display: none !important;
  }
}

/* Power toward the next boat (Boat & Map window) */
.power-panel {
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
}
.power-panel .progress {
  margin: 6px 0;
}
.power-missing {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.9em;
}
/* Balance test build: banner, version tag and the note on the sign-in page */
#test-build-banner {
  position: fixed;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(150, 60, 20, 0.92);
  color: #fff;
  font-size: 0.85em;
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}
#version.test-build {
  color: #ffb070;
}
.landing-card .test-note {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 150, 80, 0.6);
  border-radius: 6px;
}

/* Not caught yet: species that can bite in the current weather or time of day */
.power-missing li.biting-now {
  font-weight: 600;
}
.pill.now {
  background: var(--accent, #f2b84b);
  color: #1a1206;
  font-size: 0.75em;
  padding: 0 6px;
  border-radius: 8px;
}

/* Money: gold, silver and copper coins */
.money { white-space: nowrap; font-family: var(--num); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.money i { font-style: normal; font-size: 0.8em; margin-left: 1px; }
.coin-g { color: #f4c542; }
.coin-s { color: #c9d3dc; }
.coin-c { color: #d98a4e; }

/* Discord and Twitch: round buttons the size of the coffee widget (64px, 18px from the edges), left of it */
.corner-btn {
  position: fixed;
  bottom: 18px;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

#discord-btn {
  right: 94px; /* 18px margin + 64px coffee button + 12px gap */
  background: #5865f2;
}

#twitch-btn {
  right: 170px; /* left of Discord: 94px + 64px + 12px gap */
  background: #9146ff;
}

/* The game's channel is live: a red LIVE badge on the Twitch button and a soft pulse */
#twitch-btn.live {
  animation: live-pulse 2s ease-in-out infinite;
}
#twitch-btn.live::after {
  content: 'LIVE';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 4px;
  background: #e91916;
  border: 2px solid #fff;
  font: 700 11px/1.3 system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #fff;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(233, 25, 22, 0.55); }
  50% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(233, 25, 22, 0); }
}
@media (prefers-reduced-motion: reduce) {
  #twitch-btn.live { animation: none; }
}

/* A player streaming right now, on the leaderboard */
.lb-live {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: #e91916;
  color: #fff;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  vertical-align: 1px;
}
.lb-live::before {
  content: '● ';
}
.lb-live:hover {
  filter: brightness(1.15);
}

.corner-btn:hover {
  transform: scale(1.1);
}

.corner-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.corner-btn svg {
  width: 34px;
  height: 34px;
}

#twitch-btn svg {
  width: 30px;
  height: 30px;
}

/* Phones: the Twitch and Discord buttons are hidden like the coffee button (they'd cover the game) */
@media (max-width: 640px) {
  .corner-btn {
    display: none;
  }
}

/* ---------- The cabin and the garden (homestead.js) ---------- */
/* While you're indoors or in the garden, the fishing overlay (bite bar, name, sail tabs) steps aside */
#scene-hud.at-home > :not(.home-ui) {
  display: none !important;
}

#scene-hud > .home-ui[hidden] {
  display: none !important;
}

#scene-hud > .home-title {
  top: calc(var(--topbar-h) * var(--ui-scale) + 8px); /* below the top bar, which covers the scene */
  left: 14px;
  font-family: var(--title-font, inherit);
  font-size: calc(20px * var(--ui-scale));
  font-weight: 700;
  color: #ffe6b0;
}

/* The garden's toolbar: seed, fertilizer, Plant all, Harvest all, Farming level */
#scene-hud > .farm-bar {
  top: calc(var(--topbar-h) * var(--ui-scale) + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  max-width: calc(100% - 24px);
  white-space: normal;
  text-shadow: none;
  pointer-events: auto;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 2px solid #5b3a22;
  box-shadow: 0 2px 0 #000;
}

.farm-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.farm-bar select {
  max-width: 200px;
  font: inherit;
  font-size: 13px;
}

@media (max-width: 640px) {
  #scene-hud > .home-title {
    display: none;
  }
}

.farm-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.farm-xp {
  width: 70px;
}

/* A clickable square over each plot (the plot itself is drawn on the canvas) */
#scene-hud > .farm-plots {
  inset: 0;
  pointer-events: none;
}

.farm-plot {
  position: absolute;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  pointer-events: auto;
}

.farm-plot:hover,
.farm-plot:focus-visible {
  border-color: rgba(255, 246, 192, 0.8);
  outline: none;
}

.farm-plot.g {
  cursor: default;
}

.farm-plot.r:hover {
  border-color: #ffd34d;
  box-shadow: 0 0 10px rgba(255, 211, 77, 0.6);
}

/* Coins floating up from a harvest */
#scene-hud > .farm-pop {
  transform: translate(-50%, 0);
  font-weight: 700;
  font-size: 15px;
  animation: farm-pop 1.4s ease-out forwards;
}

#scene-hud > .farm-pop.quality {
  font-size: 13px;
}

@keyframes farm-pop {
  to {
    transform: translate(-50%, -40px);
    opacity: 0;
  }
}

/* The village: a button over each building (the track inside moves with the camera), its name on a sign */
#scene-hud > .village-spots {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.village-track {
  position: absolute;
  inset: 0;
}

.village-spot {
  position: absolute;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

.village-spot .spot-name {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, -100%);
  display: grid;
  justify-items: center;
  padding: 3px 9px;
  white-space: nowrap;
  color: #ffe6b0;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 2px solid #5b3a22;
  box-shadow: 0 2px 0 #000;
  font-size: 13px;
  line-height: 1.2;
  text-shadow: none;
}

.village-spot .spot-name small {
  display: none;
  color: var(--muted, #c8b48a);
  font-size: 11px;
}

.village-spot:hover .spot-name,
.village-spot:focus-visible .spot-name {
  border-color: #ffd34d;
}

.village-spot:hover .spot-name small,
.village-spot:focus-visible .spot-name small {
  display: block;
}

.village-spot:focus-visible {
  outline: none;
}

/* The Blacksmith: your gear on the left, the picked piece on the right */
.smith {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) 1.1fr;
  gap: 12px;
  align-items: start;
}

.smith-picker {
  display: grid;
  gap: 4px;
  align-content: start;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.smith-picker h3 {
  margin: 4px 0 2px;
  font-size: 13px;
}

.smith-worn {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  gap: 6px;
  margin: 4px 0;
}

.smith-worn .gear-slot {
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.smith-picker .picked {
  outline: 3px solid #ffd34d;
  outline-offset: 1px;
  z-index: 1;
}

.smith-picker .cant {
  opacity: 0.35;
  cursor: default;
}

.reforge-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.reforge-cols h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.reforge-cols > div {
  display: grid;
  gap: 3px;
  align-content: start;
  max-height: 260px;
  overflow-y: auto;
}

.reforge-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 3px 6px;
  font: inherit;
  font-size: 12px;
  text-align: left;
  color: inherit;
  background: color-mix(in srgb, var(--panel) 75%, #000);
  border: 1px solid #4a3220;
  cursor: pointer;
}

.reforge-opt:hover,
.reforge-opt:focus-visible {
  border-color: #c9a35a;
}

.reforge-opt.on {
  border-color: #ffd34d;
  background: color-mix(in srgb, #ffd34d 14%, var(--panel));
}

.reforge-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid #8a7050;
  border-radius: 50%;
}

.reforge-dot.on {
  border-color: #ffd34d;
  background: radial-gradient(circle, #fff6c0 30%, #d8a83a 60%);
}

.reforge-what {
  margin: 8px 0 4px;
}

.reforge-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.reforge-bar > span:first-child {
  margin-right: auto;
}

.smith-wait {
  position: absolute;
  top: 1px;
  right: 3px;
  color: #ffd34d;
  font-weight: 700;
  font-size: 12px;
  text-shadow: 0 1px 0 #000;
}

.smith-detail h3 {
  margin: 10px 0 4px;
}

.smith-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.smith-choice {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  font: inherit;
  color: inherit;
  background: color-mix(in srgb, var(--panel) 70%, #000);
  border: 2px solid #5b3a22;
  cursor: pointer;
}

.smith-choice:hover,
.smith-choice:focus-visible {
  border-color: #ffd34d;
}

.smith-choice.keep {
  border-style: dashed;
}

@media (max-width: 640px) {
  .smith,
  .reforge-cols {
    grid-template-columns: 1fr;
  }

  .smith-picker {
    max-height: 260px;
  }
}

/* The stove (a tooltip spot over the drawing) */
#scene-hud > .home-spot {
  position: absolute;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: auto;
  cursor: help;
}

/* Crop and fertilizer icons in the farm windows */
.crop-icon,
.fert-icon {
  border-color: var(--c, #b98a52);
  background: color-mix(in srgb, var(--c, #b98a52) 14%, transparent);
}

.crop-icon.dim {
  filter: grayscale(1) brightness(0.6);
}

.farm-level-panel {
  display: grid;
  gap: 4px;
  margin: 6px 0 10px;
}

/* The action bar: the garden swaps some buttons for farming ones */
#actionbar:not([data-place='garden']) .action-btn[data-only='garden'],
#actionbar[data-place='garden'] .action-btn[data-hidein='garden'] {
  display: none;
}

/* Company bounties (Company window) */
.cb-card {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.cb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.cb-bar {
  position: relative;
  height: 12px;
  margin: 8px 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: visible;
}
.cb-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #c98b4a, #d9dde3 50%, #f4c542);
}
.cb-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.45);
}
.cb-mark.hit {
  background: #fff;
}
.cb-tiers {
  margin: 6px 0;
  padding: 0;
  list-style: none;
  font-size: 0.9em;
}
.cb-tiers li {
  opacity: 0.75;
}
.cb-tiers li.hit {
  opacity: 1;
}
.cb-bronze { color: #d08b4c; }
.cb-silver { color: #d9dde3; }
.cb-gold { color: #f4c542; }
.cb-top {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 0.88em;
}
.cb-top li.you {
  font-weight: 700;
}

/* Company level */
.company-level {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.company-lv {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: #34d399;
  color: #06281c;
  font-weight: 700;
}
.company-lv.small {
  padding: 0 5px;
  font-size: 0.75em;
  vertical-align: 1px;
}
.company-xp {
  height: 8px;
  margin: 6px 0 2px;
}
.company-xp .cb-fill {
  background: #34d399;
}
