:root {
  --human: #1f6fb8;
  --human-l: #58b6f0;
  --zombie: #4d9c22;
  --zombie-l: #8fd85a;
  --danger: #d8232a;
  --gold: #f0b429;
  --ink: #1d2430;
  --dim: #5d6b7d;
  --panel: rgba(252, 250, 244, 0.92);
  --edge: rgba(40, 50, 65, 0.14);
  --font: 'Rajdhani', 'DIN Alternate', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --shadow: 0 4px 18px rgba(30, 35, 45, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #e9e2d4;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; font-weight: 600; }

#topbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#phase {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
  padding: 5px 18px; box-shadow: var(--shadow);
}
#phaseName { font-size: 12px; letter-spacing: .22em; color: var(--dim); }
#phaseTimer { font-size: 26px; font-variant-numeric: tabular-nums; }
#phase.urgent #phaseTimer { color: var(--danger); animation: pulse .9s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

#phaseHint {
  font-size: 11px; letter-spacing: .12em; color: var(--ink);
  background: var(--panel); border: 1px solid var(--edge); border-radius: 7px;
  padding: 3px 10px; box-shadow: var(--shadow); font-weight: 600;
}
#counts { display: flex; gap: 8px; font-size: 12px; letter-spacing: .12em; }
.cnt { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 3px 10px; box-shadow: var(--shadow); }
.cnt.human b { color: var(--human); }
.cnt.zombie b { color: var(--zombie); }

#feed {
  position: absolute; top: 12px; right: 16px; width: 320px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.fitem {
  background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--zombie);
  border-radius: 7px; padding: 4px 9px; font-size: 13px; box-shadow: var(--shadow);
  animation: slideIn .22s ease-out; max-width: 100%;
}
.fitem.info { border-left-color: var(--human); color: var(--dim); }
.fitem.warn { border-left-color: var(--danger); }
.fitem .k { color: var(--zombie); }
.fitem .v { color: var(--human); }
.fitem .pts { color: var(--gold); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }

#bottomleft { position: absolute; left: 16px; bottom: 16px; width: 300px; }
#statusRow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
#roleTag {
  font-size: 11px; letter-spacing: .18em; padding: 3px 9px; border-radius: 6px;
  background: var(--panel); border: 1px solid currentColor; box-shadow: var(--shadow);
}
#roleTag.human { color: var(--human); }
#roleTag.zombie { color: var(--zombie); }
.stat {
  display: flex; align-items: baseline; gap: 4px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 6px;
  padding: 2px 8px; box-shadow: var(--shadow);
}
.stat label { font-size: 9px; letter-spacing: .14em; color: var(--dim); }
.stat b { font-variant-numeric: tabular-nums; }
#ptsTag { color: var(--gold); }

#doses { display: flex; gap: 3px; align-items: center; }
.dose {
  width: 11px; height: 15px; border-radius: 4px;
  background: rgba(255,255,255,.7); border: 1px solid var(--edge);
}
.dose.on {
  background: linear-gradient(180deg, #9fe9ff, #2fa8e0);
  border-color: #2fa8e0; box-shadow: 0 0 6px rgba(47,168,224,.5);
}

#growthWrap, #staminaWrap {
  position: relative; height: 13px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 7px; overflow: hidden;
  margin-bottom: 5px; box-shadow: var(--shadow);
}
#growth { height: 100%; width: 0%; background: linear-gradient(90deg, #f0b429, #e0562f); transition: width .15s linear; }
#stamina { height: 100%; width: 100%; background: linear-gradient(90deg, #1f6fb8, #58b6f0); transition: width .08s linear; }
#stamina.low { background: linear-gradient(90deg, #e0562f, #d8232a); }
#stamina.zombie { background: linear-gradient(90deg, #3d7d1c, #8fd85a); }
.barLabel {
  position: absolute; inset: 0; font-size: 8.5px; letter-spacing: .28em;
  display: flex; align-items: center; justify-content: center; color: rgba(25,30,40,.62);
}

#abilities { display: flex; gap: 7px; margin-top: 8px; pointer-events: auto; }
.ab.clickable { cursor: pointer; }
.ab.clickable:hover { border-color: var(--zombie); }
.ab {
  position: relative; width: 58px; height: 58px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--edge); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  box-shadow: var(--shadow);
}
.ab .icon { font-size: 19px; line-height: 1; }
.ab .key { font-size: 8.5px; letter-spacing: .08em; color: var(--dim); }
.ab .tname { font-size: 8px; letter-spacing: .04em; color: var(--dim); text-align: center; }
.ab .cool {
  position: absolute; inset: 0; background: rgba(240,236,226,.86);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-variant-numeric: tabular-nums; color: var(--danger);
}
.ab.ready { border-color: rgba(31,111,184,.45); }

#chatbox { position: absolute; left: 16px; bottom: 190px; width: 340px; }
#chatlog {
  display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px;
  padding: 7px 9px; border-radius: 9px;
  background: rgba(58, 64, 74, .68);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(3px);
}
#chatlog:empty { display: none; }
.cline { font-size: 13px; color: #f2f5f8; animation: slideIn .2s; }
.cline .who { color: #7fc4ff; }
.cline.z .who { color: #9fe06a; }
.cline.sys { color: #c3ccd6; font-style: italic; }
/* A rule reminder only the person who tripped it can see. */
.cline.warn {
  color: #ff8b8b; font-weight: 700; letter-spacing: .02em;
  border-left: 3px solid #ff5c5c; padding-left: 7px;
}
.guest-tag { color: #9aa7b4; font-weight: 700; }
#chatinput {
  display: none; width: 100%; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 8px;
  padding: 7px 10px; color: var(--ink); font-family: var(--font); font-size: 14px; outline: none;
}
#chatinput.on { display: block; }

/* --------------------------------------------------------------- INVENTORY */
#invBar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: auto;
}
.slot {
  position: relative; width: 58px; height: 58px; border-radius: 11px;
  background: var(--panel); border: 2px solid var(--edge);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: grab; user-select: none;
  transition: transform .08s, border-color .1s;
}
.slot:hover { transform: translateY(-2px); }
.slot.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,180,41,.4); }
.slot.drag { opacity: .45; cursor: grabbing; }
.slot.over { border-color: var(--human); }
.slot .ic { width: 40px; height: 40px; display: block; pointer-events: none; }
.slot .num {
  position: absolute; top: 2px; left: 5px; font-size: 9px;
  color: var(--dim); font-family: var(--mono); pointer-events: none;
}
.slot .qty {
  position: absolute; bottom: 2px; right: 5px; font-size: 11px;
  font-weight: 700; color: var(--gold); pointer-events: none;
}
.slot .nm {
  position: absolute; bottom: -15px; left: 0; right: 0; text-align: center;
  font-size: 8.5px; letter-spacing: .06em; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

#minimapWrap {
  position: absolute; right: 16px; bottom: 16px; padding: 6px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
  box-shadow: var(--shadow);
}
#minimap { display: block; border-radius: 6px; }

/* Top left belongs to the social buttons now, so the net readout sits above
   the minimap where nothing else does. */
#netinfo {
  position: absolute; right: 16px; bottom: 210px; font-size: 11px; color: var(--dim);
  font-family: var(--mono); background: var(--panel); padding: 3px 8px;
  border-radius: 6px; border: 1px solid var(--edge);
}

#toast {
  position: absolute; top: 24%; left: 50%; transform: translateX(-50%);
  font-size: 46px; letter-spacing: .1em; text-align: center; opacity: 0;
  white-space: pre-line; line-height: 1.05; color: #16202c;
  text-shadow: 0 3px 0 rgba(255,255,255,.6), 0 8px 26px rgba(0,0,0,.22);
}
#toast.show { animation: toast 2.6s ease-out forwards; }
#toast .sub { display: block; font-size: 15px; letter-spacing: .28em; color: var(--dim); margin-top: 8px; text-shadow: none; }
@keyframes toast {
  0% { opacity: 0; transform: translateX(-50%) scale(.86); }
  12% { opacity: 1; transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1.04); }
}

/* ----------------------------------------------------------------- SHOP */
/* Sits directly above the net readout and grows upward, so the bottom of the
   HUD stays clear whatever is for sale. */
#shop {
  position: absolute; right: 16px; bottom: 238px;
  width: 370px; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px;
  box-shadow: 0 16px 50px rgba(30,35,45,.28); overflow: hidden;
}
.shop-head { padding: 12px 16px 10px; border-bottom: 1px solid var(--edge); }
.shop-head h3 { font-size: 14px; letter-spacing: .24em; }
.shop-pts { font-size: 13px; color: var(--gold); margin-top: 2px; }
.shop-hint { font-size: 11px; color: var(--dim); margin-top: 3px; font-weight: 500; }
#shopList {
  display: flex; flex-direction: column; overflow-y: auto;
  max-height: min(46vh, calc(100vh - 400px));
}
.shop-item {
  display: grid; grid-template-columns: 18px 32px 1fr auto; align-items: center; gap: 9px;
  padding: 9px 14px; background: none; border: none; border-bottom: 1px solid rgba(40,50,65,.07);
  font-family: var(--font); text-align: left; cursor: pointer; color: var(--ink);
  transition: background .12s;
}
.shop-item:hover { background: rgba(31,111,184,.09); }
.si-key { font-size: 10px; color: var(--dim); font-family: var(--mono); }
.si-icon { width: 32px; height: 32px; display: block; pointer-events: none; }
.si-name { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.si-desc { font-size: 11px; color: var(--dim); font-weight: 500; line-height: 1.25; }
.si-cost { font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: .06em; }
.shop-item.locked { opacity: .42; }
.shop-item.owned .si-cost { color: var(--human); }
.shop-item.equipped { background: rgba(77,156,34,.13); }
.shop-item.equipped .si-cost { color: var(--zombie); }
.shop-foot { padding: 8px 14px; font-size: 10.5px; color: var(--dim); letter-spacing: .1em; }

/* -------------------------------------------------------- CUSTOMIZATION */
#customizer {
  display: flex; gap: 22px; align-items: center; justify-content: center;
  margin: 14px auto 2px; padding: 14px 18px; max-width: 620px;
  background: rgba(255,255,255,.55); border: 1px solid var(--edge); border-radius: 14px;
}
.cust-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#avatar {
  width: 132px; height: 132px; border-radius: 12px;
  background: radial-gradient(circle at 50% 42%, #f2ecdd, #ded5c2);
  border: 1px solid var(--edge);
}
#avatarFlip {
  font-family: var(--font); font-size: 10.5px; letter-spacing: .12em; font-weight: 600;
  background: none; border: 1px solid var(--edge); border-radius: 6px;
  padding: 3px 9px; color: var(--dim); cursor: pointer;
}
#avatarFlip:hover { color: var(--ink); border-color: var(--zombie); }
#customRows { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.cust-row { display: flex; align-items: center; gap: 10px; }
.cust-label {
  font-size: 10px; letter-spacing: .18em; color: var(--dim); width: 44px;
  text-align: right; flex: none;
}
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch {
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  border: 2px solid rgba(40,50,65,.18); padding: 0; transition: transform .1s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(255,255,255,.9) inset; }
.acc {
  font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 6px; cursor: pointer; color: var(--dim);
  background: rgba(255,255,255,.7); border: 1px solid var(--edge);
}
.acc:hover { color: var(--ink); }
.acc.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ----------------------------------------------------------------- MENU */
#menu {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  /* Late afternoon rather than midday: a warm lamp behind the logo, grass
     going gold at the edges, and the corners falling away into shade. The old
     flat lime was bright but cold — nothing to sit down in. */
  background:
    radial-gradient(900px 600px at 50% 2%, rgba(255, 233, 168, .95), transparent 64%),
    radial-gradient(900px 700px at 10% 98%, rgba(112, 176, 204, .5), transparent 60%),
    radial-gradient(1100px 760px at 94% 90%, rgba(248, 188, 108, .68), transparent 62%),
    linear-gradient(180deg, #4f8f34 0%, #79b453 22%, #c6c495 58%, #d9bf90 100%);
}
/* the shade in the corners, and a soft grain over the whole thing */
#menu::before,
#menu::after {
  content: ''; position: fixed; inset: 0; pointer-events: none;
}
#menu::before {
  background: radial-gradient(115% 85% at 50% 40%, transparent 46%, rgba(38, 50, 26, .42) 100%);
}
#menu::after {
  opacity: .35;
  background-image:
    radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
    radial-gradient(rgba(90, 80, 50, .16) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 4px;
}
#menu.hidden { display: none; }

/* Exactly one screen is on at a time and it owns the whole window. Home is
   buttons only; everything else is a page you navigate to and BACK out of. */
.screen {
  min-height: 100%; padding: 30px 20px 48px;
  display: flex; flex-direction: column; align-items: center;
}
.screen.hidden { display: none !important; }
/* Home is short enough to sit in the middle of the window; the pages are not. */
.screen[data-screen="home"] { justify-content: center; }

/* --- everything that is not home opens over it ---------------------------
   The home screen never goes away: pages float above it as one centred card
   on a dimmed backdrop, so leaving one puts you back exactly where you were
   instead of rebuilding the screen you came from. */
.screen:not([data-screen="home"]) {
  position: fixed; inset: 0; z-index: 30; padding: 0;
  justify-content: center; align-items: center;
  background: rgba(24, 38, 26, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: popIn .16s ease-out;
}
.popout {
  display: flex; flex-direction: column; align-items: center;
  /* Sized by what is in it: a settings panel gets a settings-panel-sized card,
     the forums get the full width. A fixed 880 left small pages rattling
     around inside a mostly empty box. */
  width: fit-content; min-width: min(430px, 94vw); max-width: min(880px, 94vw);
  max-height: min(86vh, 900px);
  padding: 22px 24px 24px;
  background: linear-gradient(180deg, #f7f4ea, #eee8d8);
  border: 1px solid rgba(60, 74, 60, .18);
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(20, 32, 18, .38), 0 3px 0 rgba(255, 255, 255, .55) inset;
  animation: popCard .18s cubic-bezier(.2, .9, .3, 1.2);
}
.popout .page-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; padding: 2px; }
.popout .page-head { margin-bottom: 16px; }
@keyframes popIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popCard {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen:not([data-screen="home"]), .popout { animation: none; }
}

/* --- home: chunky, coloured, one button per page --- */
.logo {
  font-size: clamp(46px, 9.4vw, 88px); letter-spacing: .2em; margin-left: .2em;
  font-weight: 700; line-height: 1.06; color: #b7ef6b;
  -webkit-text-stroke: 7px #2c5417; paint-order: stroke fill;
  filter:
    drop-shadow(0 5px 0 rgba(30, 60, 16, .32))
    drop-shadow(0 14px 26px rgba(28, 48, 12, .30))
    drop-shadow(0 0 34px rgba(255, 236, 170, .55));
}
.tag {
  color: #fdf6e3; letter-spacing: .1em; font-size: 14.5px; text-align: center;
  font-weight: 700; margin-top: 8px; padding: 6px 18px; border-radius: 999px;
  background: rgba(44, 84, 23, .72);
  box-shadow: 0 3px 0 rgba(24, 52, 10, .38), 0 0 0 1px rgba(255, 255, 255, .12) inset;
  backdrop-filter: blur(2px);
}

/* left rail · play column · right rail */
.home {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-top: 30px; flex-wrap: wrap;
}
.rail { display: flex; flex-direction: column; gap: 12px; }

/* Every coloured button in the menu is cut from this one shape: a flat face,
   a darker lip underneath, and a press that squashes it into the lip. */
.rbtn, .bigbtn, .chip-btn.in, .chip-btn.up {
  --c: #2f7dd1; --d: #1c5493;
  cursor: pointer; border: 0; color: #fff;
  font-family: var(--font); letter-spacing: .14em; font-weight: 700;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0)) var(--c);
  box-shadow: 0 5px 0 var(--d), 0 9px 18px rgba(35, 40, 50, .22);
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.rbtn:hover, .bigbtn:hover, .chip-btn.in:hover, .chip-btn.up:hover {
  filter: brightness(1.08); transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--d), 0 13px 22px rgba(35, 40, 50, .26);
}
.rbtn:active, .bigbtn:active, .chip-btn.in:active, .chip-btn.up:active {
  transform: translateY(5px); box-shadow: 0 0 0 var(--d), 0 3px 8px rgba(35,40,50,.25);
}

.rbtn {
  width: 188px; padding: 14px 16px; border-radius: 15px; font-size: 13px;
  display: flex; align-items: center; gap: 11px; text-align: left;
}
.rbtn .ri { font-size: 22px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }

/* the middle column */
/* The middle column sits on something, so it reads as a porch rather than as
   text floating on a lawn. */
.play {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: min(348px, 90vw); padding: 18px 18px 20px;
  background: linear-gradient(180deg, rgba(255, 252, 243, .82), rgba(250, 243, 226, .72));
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 24px;
  box-shadow:
    0 18px 44px rgba(38, 52, 26, .22),
    0 2px 0 rgba(255, 255, 255, .8) inset;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* The rails get the same treatment, so the three columns read as one hub. */
.rail:not(:empty) {
  padding: 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 243, .5), rgba(250, 243, 226, .38));
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 12px 30px rgba(38, 52, 26, .14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#homeAvatar {
  width: 138px; height: 138px; border-radius: 20px;
  background: radial-gradient(circle at 50% 40%, #fffdf6, #e2dac6);
  border: 3px solid #fff; box-shadow: 0 6px 0 rgba(120,110,90,.28), 0 12px 26px rgba(40,45,55,.2);
}
#nameInput {
  width: 100%; padding: 14px 16px; font-size: 18px; font-family: var(--font);
  letter-spacing: .08em; font-weight: 600; text-align: center; color: var(--ink);
  background: #fff; border: 3px solid #fff; border-radius: 13px; outline: none;
  box-shadow: 0 5px 0 rgba(120,110,90,.24), 0 8px 18px rgba(40,45,55,.14);
}
#nameInput:focus { border-color: #7ed13c; }

.bigbtn {
  width: 100%; padding: 15px 18px; border-radius: 15px;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.bigbtn .mt { font-size: 19px; letter-spacing: .16em; }
.bigbtn .ms { font-size: 11px; font-weight: 600; letter-spacing: .02em; opacity: .9; }
.bigbtn:disabled { filter: grayscale(.7) brightness(.95); cursor: wait; }

/* one colour per destination, so the button and its page belong together */
.c-play    { --c: #55b81f; --d: #337a0e; }
.c-solo    { --c: #2f7dd1; --d: #1c5493; }
.c-look    { --c: #e0603c; --d: #a83c1e; }
.c-profile { --c: #3d8fd8; --d: #256196; }
.c-ranks   { --c: #efa419; --d: #b06f06; }
.c-shop    { --c: #24a98d; --d: #147663; }
.c-daily   { --c: #d4477e; --d: #9c2555; }
.c-pass    { --c: #8256e0; --d: #5b34a8; }
.c-market  { --c: #1f9bb5; --d: #10697e; }
.c-trade   { --c: #6b8f2f; --d: #47611b; }
.c-friends { --c: #db7a1f; --d: #a3540b; }
.c-clan    { --c: #5865d8; --d: #38429e; }

/* --- who you are, top left --- */
.chip {
  position: fixed; top: 16px; left: 18px; z-index: 2;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 14px;
  background: rgba(255,255,255,.86); border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 0 rgba(120,110,90,.2), 0 10px 22px rgba(40,45,55,.16);
}
.chip-who {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font); font-size: 15px; color: var(--ink);
}
.chip-lvl {
  font: 700 10px/1 var(--font); letter-spacing: .1em; color: #fff;
  background: #3d8fd8; padding: 5px 8px; border-radius: 7px;
}
.chip-cores {
  font: 700 12px/1 var(--font); color: #6b4b06;
  background: #ffd76b; padding: 5px 9px; border-radius: 7px;
}
.chip-guest {
  font: 700 10px/1 var(--font); letter-spacing: .1em; color: #5d6b7d;
  background: rgba(40,50,65,.10); padding: 6px 9px; border-radius: 7px;
}
.chip-btn {
  font: 700 10.5px/1 var(--font); letter-spacing: .12em; cursor: pointer;
  padding: 9px 12px; border-radius: 9px;
}
.chip-btn.in { --c: #2f7dd1; --d: #1c5493; }
.chip-btn.up { --c: #55b81f; --d: #337a0e; }
.chip-btn.out {
  color: var(--dim); background: rgba(40,50,65,.07); border: 1px solid var(--edge);
}
.chip-btn.out:hover { color: var(--ink); }

/* the forums live in the opposite corner from your account */
.corner-btn {
  position: fixed; top: 16px; right: 18px; z-index: 2;
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font: 700 11px/1 var(--font); letter-spacing: .14em; color: #fff;
  padding: 12px 15px; border-radius: 12px; border: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #c2571f;
  box-shadow: 0 5px 0 #8d3a0e, 0 9px 18px rgba(35,40,50,.22);
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.corner-btn span { font-size: 15px; }
.corner-btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.corner-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #8d3a0e; }
.screen:not([data-screen="home"]) .corner-btn { display: none; }

/* --- page shell: header with BACK, then the page's own body --- */
.page-head {
  width: 100%; display: grid; grid-template-columns: 92px 1fr 92px;
  align-items: center; margin-bottom: 20px;
}
.page-head h2 {
  font-size: clamp(15px, 2.4vw, 21px); letter-spacing: .24em; color: var(--ink);
  text-align: center;
}
.back {
  justify-self: start; font: 700 11px/1 var(--font); letter-spacing: .12em;
  color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #667a92;
  border: 0; border-radius: 10px; cursor: pointer; padding: 11px 14px;
  box-shadow: 0 4px 0 #44546a, 0 8px 16px rgba(35,40,50,.2);
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.back:hover { filter: brightness(1.08); }
.back:active { transform: translateY(4px); box-shadow: 0 0 0 #44546a; }

/* a page wears the colour of the button that opened it */
.page-head h2 { color: var(--pc, var(--ink)); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
[data-screen="look"]    { --pc: #a83c1e; }
[data-screen="profile"] { --pc: #256196; }
[data-screen="ranks"]   { --pc: #b06f06; }
[data-screen="shop"]    { --pc: #147663; }
[data-screen="daily"]   { --pc: #9c2555; }
[data-screen="pass"]    { --pc: #5b34a8; }
[data-screen="market"]  { --pc: #10697e; }
[data-screen="trade"]   { --pc: #47611b; }
[data-screen="friends"] { --pc: #a3540b; }
[data-screen="clan"]    { --pc: #38429e; }
[data-screen="server"]  { --pc: #337a0e; }
[data-screen="solo"]    { --pc: #1c5493; }
[data-screen="auth"]    { --pc: #1c5493; }
.online { justify-self: end; color: var(--zombie); font-weight: 700; font-size: 11px; letter-spacing: .1em; }
.page-body { width: 100%; }
.page-body.narrow { width: min(560px, 100%); }

/* --- server list, one row per server, top to bottom --- */
#serverList { display: flex; flex-direction: column; gap: 8px; }
.srv {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 13px 16px; cursor: pointer; text-align: left;
  font-family: var(--font); border-radius: 11px;
  border: 1px solid var(--edge); background: rgba(255,255,255,.78);
  transition: transform .1s, box-shadow .1s, border-color .1s;
}
.srv:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--zombie); }
.srv-name { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.srv-sub { font-size: 10.5px; color: var(--dim); letter-spacing: .08em; }
.srv-count { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--zombie); }
.srv-count.empty { color: var(--dim); }
.srv-go { font-size: 18px; color: var(--dim); }

/* --- singleplayer settings --- */
.cfg-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 18px; text-align: left; padding: 16px 18px;
  background: rgba(255,255,255,.7); border: 1px solid var(--edge); border-radius: 14px;
}
.cfg-grid label {
  display: block; font-size: 10.5px; letter-spacing: .14em; color: var(--dim);
}
.cfg-grid b { color: var(--ink); float: right; font-size: 12px; letter-spacing: 0; }
.cfg-grid input[type=range] { width: 100%; margin-top: 4px; accent-color: var(--zombie); }
#soloStart { margin: 14px auto 0; max-width: 240px; }
#connStatus { font-size: 12px; color: var(--dim); letter-spacing: .08em; min-height: 16px; text-align: center; }

.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 24px; text-align: left; }
.hcol h3 { font-size: 12px; letter-spacing: .2em; color: var(--human); margin-bottom: 8px; }
.hcol:nth-child(2) h3 { color: var(--gold); }
.hcol:nth-child(3) h3 { color: var(--zombie); }
.hcol ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.hcol li { font-size: 13px; color: #3c4757; font-weight: 500; }

/* ----------------------------------------------------------- SCOREBOARD */
/* The board never takes over the screen or the game: it floats, the round keeps
   running underneath it, and only its close button accepts clicks. */
#scoreboard {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  z-index: 15; pointer-events: none;
}
.sb-card {
  position: relative;
  width: min(560px, 92vw); padding: 20px 24px 16px;
  animation: boardIn .28s ease-out;
  background: rgba(18, 20, 24, .5);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  color: rgba(255,255,255,.9);
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
}
#sbClose {
  position: absolute; top: 8px; right: 10px; pointer-events: auto;
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.9); font-size: 13px; line-height: 1;
  font-family: var(--font); font-weight: 700;
}
#sbClose:hover { background: rgba(255,255,255,.22); }
.sb-card h2 {
  font-size: 30px; letter-spacing: .22em; text-align: center; margin-bottom: 16px;
  color: rgba(255,255,255,.92); font-weight: 700;
  text-shadow: 0 3px 18px rgba(0,0,0,.5);
}
@keyframes boardIn {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.sb-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-card th {
  text-align: left; font-size: 10px; letter-spacing: .18em;
  color: rgba(255,255,255,.55);
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.16); font-weight: 600;
}
.sb-card td {
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  font-variant-numeric: tabular-nums; color: rgba(255,255,255,.9);
}
.sb-card tr.me td { color: #ffd98a; font-weight: 700; }
.sb-card td.z { color: #9fe06a; }
.sb-card td.h { color: #7fc4ff; }
.sb-card .bot {
  font-size: 9px; letter-spacing: .1em; color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 3px; padding: 0 4px; margin-left: 6px; vertical-align: middle;
}

@media (max-width: 900px) {
  #customizer { flex-direction: column; gap: 12px; }
  .cust-label { width: auto; }
  .help { grid-template-columns: 1fr; gap: 14px; }
  .chip { position: static; margin: 0 auto 10px; justify-content: center; }
  .corner-btn { position: static; margin: 0 auto 14px; }
  .home { gap: 14px; }
  .rail { flex-direction: row; flex-wrap: wrap; justify-content: center; width: min(430px, 94vw); }
  .rbtn { width: calc(50% - 6px); padding: 12px; font-size: 12px; }
  .play { order: -1; }        /* playing comes before browsing on a phone */
  #chatbox { display: none; }
  #shop { width: 300px; }
  /* --------------------------------------------------------------- INVENTORY */
#invBar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: auto;
}
.slot {
  position: relative; width: 58px; height: 58px; border-radius: 11px;
  background: var(--panel); border: 2px solid var(--edge);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: grab; user-select: none;
  transition: transform .08s, border-color .1s;
}
.slot:hover { transform: translateY(-2px); }
.slot.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,180,41,.4); }
.slot.drag { opacity: .45; cursor: grabbing; }
.slot.over { border-color: var(--human); }
.slot .ic { width: 40px; height: 40px; display: block; pointer-events: none; }
.slot .num {
  position: absolute; top: 2px; left: 5px; font-size: 9px;
  color: var(--dim); font-family: var(--mono); pointer-events: none;
}
.slot .qty {
  position: absolute; bottom: 2px; right: 5px; font-size: 11px;
  font-weight: 700; color: var(--gold); pointer-events: none;
}
.slot .nm {
  position: absolute; bottom: -15px; left: 0; right: 0; text-align: center;
  font-size: 8.5px; letter-spacing: .06em; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

#minimapWrap { transform: scale(.8); transform-origin: bottom right; }
}

/* ------------------------------------------------- in-game social panels */
/* The HUD ignores clicks, so anything interactive has to ask for them back. */
#socialBar {
  position: absolute; top: 14px; left: 14px; display: none; gap: 7px;
  pointer-events: auto; z-index: 6;
}
body.in-game #socialBar { display: flex; }
body.in-game #socialBar.hidden { display: none; }
.ig-btn {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font: 700 10px/1 var(--font); letter-spacing: .12em; color: var(--ink);
  background: var(--panel); border: 1px solid var(--edge); border-radius: 9px;
  padding: 8px 10px; box-shadow: var(--shadow);
}
.ig-btn span { font-size: 14px; line-height: 1; }
.ig-btn:hover { border-color: var(--zombie); }
.ig-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

#socialPanel {
  position: absolute; top: 58px; left: 14px; z-index: 6; pointer-events: auto;
  width: min(430px, 92vw); max-height: min(70vh, 620px);
  display: flex; flex-direction: column;
  background: rgba(252, 250, 244, .97); border: 1px solid var(--edge);
  border-radius: 14px; box-shadow: 0 18px 44px rgba(30, 35, 45, .3);
  animation: slideIn .16s ease-out;
}
#socialPanel.hidden { display: none; }
#socialPanel header {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--edge);
}
.sp-title { font-size: 12px; letter-spacing: .22em; color: var(--ink); flex: 1; }
.sp-x {
  width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 12px;
  background: rgba(40,50,65,.07); border: 1px solid var(--edge); color: var(--dim);
}
.sp-x:hover { color: var(--ink); }
.sp-body { overflow-y: auto; padding: 12px 14px 16px; }
.sp-body .acc-group:first-child { margin-top: 4px; }

/* ---------------------------------------------------------------- forums */
/* Same language as the menu: solid colour, a darker lip, presses that move. */
.fo-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.fo-sorts {
  display: flex; gap: 0; flex: 1; max-width: 320px;
  background: rgba(255,255,255,.75); border: 1px solid var(--edge);
  border-radius: 12px; padding: 4px; box-shadow: inset 0 1px 3px rgba(40,50,65,.08);
}
.fo-sorts button {
  flex: 1; cursor: pointer; border: 0; background: none; color: var(--dim);
  font: 700 11px/1 var(--font); letter-spacing: .14em; padding: 10px 6px; border-radius: 9px;
}
.fo-sorts button:hover { color: var(--ink); }
.fo-sorts button.on {
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0)) #2f7dd1;
  color: #fff; box-shadow: 0 3px 0 #1c5493; text-shadow: 0 1px 1px rgba(0,0,0,.25);
}

.fo-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.fo-cats button {
  font: 700 10.5px/1 var(--font); letter-spacing: .1em; cursor: pointer;
  padding: 10px 13px; border-radius: 10px; color: var(--dim);
  background: rgba(255,255,255,.8); border: 1px solid var(--edge);
  box-shadow: 0 3px 0 rgba(120,110,90,.18);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.fo-cats button:hover { color: var(--ink); transform: translateY(-1px); }
.fo-cats button:active { transform: translateY(3px); box-shadow: none; }
.fo-cats button.on {
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0)) var(--ink);
  color: #fff; border-color: transparent; box-shadow: 0 3px 0 #0b1017;
}
/* the picker in the compose box wears each category's own colour */
.fo-cats.pick button.on { background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0)) var(--cc, var(--ink)); box-shadow: 0 3px 0 var(--ccd, #0b1017); }
.fo-cats.pick button[data-pick="bug"] { --cc: #c0392b; --ccd: #8c2419; }
.fo-cats.pick button[data-pick="report"] { --cc: #8e44ad; --ccd: #642e7c; }
.fo-cats.pick button[data-pick="feature"] { --cc: #1f8b4c; --ccd: #146134; }
.fo-cats.pick button[data-pick="qa"] { --cc: #2f7dd1; --ccd: #1c5493; }
.fo-cats.pick button[data-pick="offtopic"] { --cc: #7a8798; --ccd: #56606d; }

/* --- thread rows --- */
.fo-thread {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: rgba(255,255,255,.85); border: 1px solid var(--edge);
  border-left: 5px solid var(--rowc, #7a8798); border-radius: 13px;
  box-shadow: 0 3px 0 rgba(120,110,90,.16);
  transition: transform .08s, box-shadow .08s;
}
.fo-thread:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(120,110,90,.2), var(--shadow); }
.fo-thread:active { transform: translateY(2px); box-shadow: none; }
.fo-thread.c-bug { --rowc: #c0392b; }
.fo-thread.c-report { --rowc: #8e44ad; }
.fo-thread.c-feature { --rowc: #1f8b4c; }
.fo-thread.c-qa { --rowc: #2f7dd1; }
.fo-thread.c-offtopic { --rowc: #7a8798; }

.fo-score {
  min-width: 44px; text-align: center; font-weight: 700; font-size: 17px;
  color: var(--ink); background: rgba(40,50,65,.07);
  border-radius: 10px; padding: 9px 6px; font-variant-numeric: tabular-nums;
}
.fo-score.up { background: rgba(31,139,76,.16); color: #1a6f3d; }
.fo-score.down { background: rgba(192,57,43,.14); color: #a5322a; }
.fo-tmain { flex: 1; min-width: 0; }
.fo-title { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.fo-meta { font-size: 12px; color: var(--dim); margin-top: 5px; font-weight: 600; }
.fo-go { color: var(--dim); font-size: 20px; }

.fo-cat {
  display: inline-block; font: 700 9px var(--font); letter-spacing: .12em;
  padding: 4px 8px; border-radius: 6px; margin-right: 7px; color: #fff;
  background: #7a8798; text-transform: uppercase; vertical-align: 1px;
}
.fo-cat.c-bug { background: #c0392b; }
.fo-cat.c-report { background: #8e44ad; }
.fo-cat.c-feature { background: #1f8b4c; }
.fo-cat.c-qa { background: #2f7dd1; }
.fo-cat.c-offtopic { background: #7a8798; }

/* --- one thread --- */
.fo-crumb {
  font: 700 10px/1 var(--font); letter-spacing: .14em; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #c2571f;
  border: 0; border-radius: 9px; padding: 9px 12px; margin-bottom: 12px;
  box-shadow: 0 3px 0 #8d3a0e; text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.fo-crumb:hover { filter: brightness(1.08); }
.fo-crumb:active { transform: translateY(3px); box-shadow: none; }

.fo-post {
  background: rgba(255,255,255,.88); border: 1px solid var(--edge);
  border-radius: 16px; padding: 18px; margin-bottom: 18px;
  box-shadow: 0 4px 0 rgba(120,110,90,.16);
}
.fo-ptitle { font-size: 23px; color: var(--ink); margin: 8px 0 12px; line-height: 1.2; }
.fo-body { font-size: 15px; color: #37424f; line-height: 1.6; white-space: pre-wrap; font-weight: 500; }

/* --- the bar under every post and comment --- */
.fo-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; }
.fo-vote {
  width: 34px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 12px; line-height: 1;
  background: rgba(255,255,255,.9); border: 1px solid var(--edge); color: var(--dim);
  box-shadow: 0 3px 0 rgba(120,110,90,.18);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.fo-vote:hover { color: var(--ink); filter: brightness(1.03); }
.fo-vote:active { transform: translateY(3px); box-shadow: none; }
.fo-vote.up.on {
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0)) #1f8b4c;
  border-color: transparent; color: #fff; box-shadow: 0 3px 0 #146134;
}
.fo-vote.down.on {
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0)) #c0392b;
  border-color: transparent; color: #fff; box-shadow: 0 3px 0 #8c2419;
}
.fo-count {
  min-width: 30px; text-align: center; font-weight: 700; font-size: 15px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.fo-comments-n {
  font: 700 12px var(--font); color: var(--dim); margin-left: 6px;
  background: rgba(40,50,65,.06); padding: 7px 10px; border-radius: 8px;
}
.fo-mini {
  font: 700 9.5px var(--font); letter-spacing: .12em; cursor: pointer;
  padding: 9px 11px; border-radius: 9px; color: #fff; border: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #7a8798;
  box-shadow: 0 3px 0 #56606d; text-shadow: 0 1px 1px rgba(0,0,0,.22);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.fo-mini:hover { filter: brightness(1.09); }
.fo-mini:active { transform: translateY(3px); box-shadow: none; }
.fo-mini.reply { background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #2f7dd1; box-shadow: 0 3px 0 #1c5493; }
.fo-mini.flag { background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #b0603c; box-shadow: 0 3px 0 #7d3d22; }
.fo-mini.danger { background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #c0392b; box-shadow: 0 3px 0 #8c2419; }

/* --- comments --- */
.fo-comments { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.fo-comment {
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
  border-left: 4px solid #b9c4d1; border-radius: 12px; padding: 13px 15px;
  margin-bottom: 10px;
}
.fo-comment .fo-comment { background: rgba(255,255,255,.6); border-left-color: #cdd6e0; }
.fo-comment .fo-body { font-size: 14px; }
.fo-comment .fo-actions { margin-top: 10px; }

/* --- writing --- */
.fo-form {
  display: flex; flex-direction: column; gap: 10px; margin: 12px 0 18px;
  background: rgba(255,255,255,.8); border: 1px solid var(--edge);
  border-radius: 14px; padding: 14px; box-shadow: 0 3px 0 rgba(120,110,90,.14);
}
.fo-form.small { padding: 11px; margin: 10px 0; }
.fo-form input, .fo-form textarea {
  background: #fff; border: 2px solid var(--edge); color: var(--ink);
  padding: 12px; border-radius: 10px; font: 600 14.5px var(--font); resize: vertical;
}
.fo-form input:focus, .fo-form textarea:focus { outline: none; border-color: var(--zombie); }
.fo-form .acc-rowbtns { margin: 0; }
/* the generic list-button rule would otherwise wash the primary out */
.fo-form .acc-rowbtns .acc-primary, .fo-bar .acc-primary {
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #55b81f;
  color: #fff; border-color: transparent; box-shadow: 0 4px 0 #337a0e;
}

.fo-report {
  /* floats over the post instead of stretching it open */
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 5px; padding: 11px;
  background: #fff; border: 1px solid var(--edge); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(30,35,45,.18); max-width: 280px;
}
.fo-rtitle { font: 700 10px var(--font); letter-spacing: .14em; color: var(--dim); margin-bottom: 3px; }
.fo-report button {
  font: 600 12.5px var(--font); text-align: left; cursor: pointer; padding: 9px 11px;
  border-radius: 9px; background: rgba(40,50,65,.05); border: 1px solid transparent; color: var(--ink);
}
.fo-report button:hover { background: rgba(192,57,43,.1); border-color: #c0392b; }
.acc-rename { width: 100%; max-width: 420px; margin: 0 auto; text-align: left; }

/* ----------------------------------------------------------------- party */
.party-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
  border-radius: 13px; padding: 12px 15px;
}
.party-count { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.party-count span { font-size: 14px; color: var(--dim); }
.party-crown {
  font: 700 9px var(--font); letter-spacing: .12em; color: #6b4b06;
  background: #ffd76b; border-radius: 5px; padding: 4px 7px;
}
.party-invite { border-color: var(--zombie); background: rgba(143,216,90,.16); }

/* ================================================================ ACCOUNTS */
/* Every account screen is a page of the menu, so it wears the menu's clothes:
   paper panels, ink text, green accents. Nothing dark, nothing bolted on. */

.acc-panel { width: 100%; }
.acc-headright { min-width: 40px; }
.acc-spacer { flex: 1; }
.acc-group {
  font: 700 11px/1 var(--font); letter-spacing: .18em;
  color: var(--dim); margin: 22px 0 10px;
}
.acc-note { color: var(--dim); font-size: 13px; line-height: 1.5; font-weight: 500; }
.acc-err { color: var(--danger); font-size: 13px; min-height: 16px; font-weight: 600; }
.acc-lvl { font-size: 11px; color: var(--dim); letter-spacing: .08em; font-weight: 700; }
.acc-cores { color: #9a6f0d; font-weight: 700; letter-spacing: .04em; }
.acc-pts { color: #9a6f0d; font-weight: 700; font-size: 13px; }
.acc-bp { color: #7a3fd0; font-weight: 700; font-size: 12px; }
.acc-up { color: #2f7a12; font-weight: 700; }
.acc-down { color: var(--danger); font-weight: 700; }
.acc-ctag { color: var(--human); font-weight: 700; }
.acc-tagl { font-size: 9.5px; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.acc-guest {
  font-size: 9.5px; letter-spacing: .12em; color: var(--dim); font-weight: 700;
  border: 1px solid var(--edge); border-radius: 5px; padding: 3px 6px;
}

/* Nameplate colours were picked for a dark backdrop, so they get one. */
.plate {
  font-weight: 700; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 7px; background: rgba(24, 30, 39, .92);
}
.plate.boxed { padding: 2px 9px; }

/* ------------------------------------------------------------- buttons --- */
.acc-primary, .acc-ghost, .acc-buy, .acc-list button,
.acc-addfriend button, .acc-rowbtns button, .acc-card button, .acc-tierrow button {
  font: 700 11px/1 var(--font); letter-spacing: .1em;
  padding: 11px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--edge); background: rgba(255,255,255,.85); color: var(--ink);
  transition: transform .1s, box-shadow .1s, border-color .1s, filter .1s;
}
.acc-primary {
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #55b81f;
  border-color: transparent; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #337a0e, 0 8px 16px rgba(35,40,50,.18);
  transition: transform .07s, box-shadow .07s, filter .1s;
}
.acc-primary:hover { filter: brightness(1.08); }
.acc-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #337a0e; }
.acc-ghost {
  background: rgba(255,255,255,.85); color: var(--ink);
  box-shadow: 0 3px 0 rgba(120,110,90,.28);
}
.acc-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120,110,90,.28); }
.acc-list button:hover, .acc-addfriend button:hover, .acc-rowbtns button:hover,
.acc-card button:hover, .acc-ghost:hover, .acc-tierrow button:hover {
  border-color: var(--zombie); color: var(--ink); transform: translateY(-1px);
}
.acc-card button.acc-buy {
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0)) #efa419;
  border-color: transparent; color: #4a3405; font-weight: 700;
  box-shadow: 0 4px 0 #b06f06, 0 7px 14px rgba(35,40,50,.16);
}
.acc-card button.acc-buy:active { transform: translateY(3px); box-shadow: 0 1px 0 #b06f06; }
.acc-on { font: 700 10px var(--font); letter-spacing: .14em; color: var(--zombie); padding: 10px; }
.acc-locked { font: 700 10px var(--font); letter-spacing: .14em; color: var(--dim); padding: 10px; }

/* ---------------------------------------------------------------- auth --- */
.acc-auth { max-width: 360px; margin: 6px auto; display: flex; flex-direction: column; gap: 13px; }
.acc-switch { display: flex; gap: 7px; max-width: 420px; margin: 0 auto 8px; }
.acc-switch button, .acc-sortrow button {
  flex: 1; padding: 12px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  font: 700 10.5px/1 var(--font); letter-spacing: .1em;
  background: rgba(255,255,255,.75); color: var(--dim); border: 1px solid var(--edge);
}
.acc-switch button.on, .acc-sortrow button.on {
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,0)) #2f7dd1;
  color: #fff; border-color: transparent; text-shadow: 0 1px 1px rgba(0,0,0,.25);
  box-shadow: 0 3px 0 #1c5493;
}
.acc-sortrow { display: flex; gap: 6px; margin: 0 auto 14px; flex-wrap: wrap; max-width: 620px; }
.acc-sortrow.hidden { display: none; }
.acc-auth label, .acc-clanmake label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; color: var(--dim); letter-spacing: .12em; font-weight: 700;
}
.acc-auth label.hidden { display: none; }
.acc-auth input, .acc-addfriend input, .acc-tradeform input {
  background: #fff; border: 1px solid var(--edge); color: var(--ink);
  padding: 12px; border-radius: 9px; font: 600 15px var(--font); letter-spacing: .04em;
}
.acc-auth input:focus, .acc-addfriend input:focus, .acc-tradeform input:focus,
.acc-tradeform select:focus { outline: none; border-color: var(--zombie); }
.acc-or { text-align: center; color: var(--dim); font-size: 11px; letter-spacing: .14em; }

/* a page that needs an account, without one */
.acc-gate {
  max-width: 420px; margin: 30px auto; padding: 30px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: rgba(255,255,255,.68); border: 1px solid var(--edge); border-radius: 16px;
}
.acc-gate .acc-note { font-size: 14px; }

/* ------------------------------------------------------------- profile --- */
.acc-idcard {
  text-align: center; padding: 18px 14px; border-radius: 16px;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
}
.acc-nameline { font-size: 26px; }
.acc-sub { color: var(--dim); font-size: 13px; margin-top: 8px; letter-spacing: .06em; font-weight: 600; }
.acc-clanline { color: var(--human); font-size: 13px; margin-top: 5px; font-weight: 700; }
.acc-rank {
  display: inline-block; font-weight: 700; font-size: 12px; letter-spacing: .12em; margin-top: 8px;
  background: rgba(24,30,39,.92); padding: 4px 11px; border-radius: 7px;
}
.acc-xp { margin: 14px auto; max-width: 460px; }
.acc-xpbar { height: 9px; border-radius: 5px; background: rgba(40,50,65,.12); overflow: hidden; }
.acc-xpbar span { display: block; height: 100%; background: linear-gradient(90deg, #7ed13c, #3f8f19); }
.acc-xptext { font-size: 12px; color: var(--dim); text-align: center; margin-top: 7px; font-weight: 600; }
.acc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; margin: 18px 0; }
.acc-stat {
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
  border-radius: 12px; padding: 13px; text-align: center;
}
.acc-stat b { display: block; font-size: 22px; color: var(--ink); }
.acc-stat span { font-size: 10px; color: var(--dim); letter-spacing: .12em; font-weight: 700; }
.acc-profile { display: flex; flex-direction: column; }
.acc-profile > button { align-self: center; min-width: 200px; }

/* ---------------------------------------------------------------- shop --- */
.acc-shophead {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 15px; border-radius: 12px;
  background: rgba(255,255,255,.62); border: 1px solid var(--edge);
}
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 11px; }
.acc-card {
  background: rgba(255,255,255,.78); border: 1px solid var(--edge);
  border-radius: 13px; padding: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 8px;
}
.acc-card.on { border-color: var(--zombie); background: rgba(143,216,90,.18); }
.acc-swatch {
  height: 78px; display: grid; place-items: center; overflow: hidden;
  border-radius: 10px; margin-bottom: 2px;
  background: radial-gradient(120% 120% at 50% 0%, #f3ecdb, #ddd3bb);
  border: 1px solid rgba(40,50,65,.08);
}
.acc-cname { font-weight: 700; font-size: 14px; color: var(--ink); }
.acc-crar {
  font-size: 9.5px; letter-spacing: .16em; font-weight: 700; align-self: center;
  background: rgba(24,30,39,.92); padding: 3px 9px; border-radius: 6px;
}
.acc-cdesc { font-size: 12px; color: var(--dim); line-height: 1.45; flex: 1; font-weight: 500; }
.sw-none { color: var(--dim); }
.sw-fx {
  width: 26px; height: 26px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 16px var(--c), 0 0 4px var(--c); opacity: .95;
}
.sw-pet {
  width: 20px; height: 20px; border-radius: 40% 40% 50% 50%; background: var(--c);
  box-shadow: 0 3px 9px rgba(40,45,55,.35);
}

/* the shop stage: a live scene, what it is, and what it costs */
.shop-stage {
  display: grid; grid-template-columns: minmax(240px, 1.1fr) 1fr; gap: 16px;
  align-items: center; position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.62));
  border: 1px solid var(--edge); border-radius: 18px; padding: 16px;
  box-shadow: 0 4px 0 rgba(120,110,90,.16);
}
.shop-scene {
  width: 100%; height: 190px; border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(143,216,90,.35), transparent 70%),
    linear-gradient(180deg, #f3eddf, #e6ddc8);
  border: 1px solid var(--edge);
}
.shop-info { display: flex; flex-direction: column; gap: 7px; }
.shop-iname { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: .04em; }
.shop-irar { font: 700 10.5px var(--font); letter-spacing: .18em; }
.shop-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 4px; }
.shop-act .acc-primary.broke { --c: #9aa3ad; background: #9aa3ad; box-shadow: 0 4px 0 #6f7780; }
.shop-purse { position: absolute; top: 14px; right: 16px; font-size: 15px; }
.shop-tabs { max-width: 460px; margin: 18px auto 12px; }
.shop-prev { width: 100%; height: 74px; display: block; }
.acc-card { cursor: pointer; transition: transform .1s, border-color .1s, box-shadow .1s; }
.acc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.acc-card.sel { border-color: var(--zombie); box-shadow: 0 0 0 2px rgba(77,156,34,.35); }
.acc-card.locked { opacity: .62; }
.shop-cost { font: 700 12px var(--font); letter-spacing: .06em; color: #9a6f0d; }
.shop-cost.short { color: #b0505f; opacity: .75; }
.shop-have { font: 700 10px var(--font); letter-spacing: .14em; color: var(--dim); }

@media (max-width: 700px) {
  .shop-stage { grid-template-columns: 1fr; }
  .shop-purse { position: static; }
}

/* --------------------------------------- rows: friends, clans, ladders --- */
.acc-list { display: flex; flex-direction: column; gap: 6px; }
.acc-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
  border-radius: 11px; font-size: 14px; color: var(--ink); font-weight: 600;
}
.acc-row.me { border-color: var(--zombie); background: rgba(143,216,90,.2); }
.acc-row button { padding: 8px 10px; font-size: 10px; }
.acc-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(40,50,65,.25); flex: none; }
.acc-dot.on { background: var(--zombie); box-shadow: 0 0 8px rgba(77,156,34,.6); }
.acc-row .acc-rank { margin: 0; width: 34px; background: none; color: var(--dim); padding: 0; text-align: center; }
.acc-addfriend { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.acc-addfriend input { flex: 1; min-width: 120px; }
.acc-rowbtns { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }

/* ---------------------------------------------------------------- clan --- */
.acc-clanhead {
  text-align: center; padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
}
.acc-clanhead h3 { margin: 0; font-size: 24px; color: var(--ink); letter-spacing: .06em; }
.acc-motd { color: var(--dim); font-size: 13px; margin-top: 9px; font-style: italic; }

/* ------------------------------------------------ challenges and pass --- */
.acc-chal {
  background: rgba(255,255,255,.75); border: 1px solid var(--edge);
  border-radius: 13px; padding: 14px; display: flex; flex-direction: column; gap: 9px;
}
.acc-chal.done { border-color: var(--zombie); background: rgba(143,216,90,.16); }
.acc-chaltop, .acc-chalfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-chaltop b { color: var(--ink); font-size: 15px; }

.acc-passhead {
  text-align: center; padding: 16px; margin-bottom: 8px; border-radius: 16px;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
}
.acc-passhead h3 { margin: 0 0 4px; font-size: 24px; letter-spacing: .14em; color: var(--ink); }
.acc-passhead .acc-xpbar { max-width: 420px; margin: 14px auto 4px; }
.acc-prem { color: #9a6f0d; font-weight: 700; letter-spacing: .14em; font-size: 12px; margin-top: 10px; }
.acc-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.acc-tier {
  background: rgba(255,255,255,.55); border: 1px solid var(--edge);
  border-radius: 12px; padding: 11px; opacity: .55;
}
.acc-tier.open { opacity: 1; background: rgba(255,255,255,.82); }
.acc-tiernum { font: 700 11px var(--font); color: var(--dim); letter-spacing: .14em; margin-bottom: 7px; }
.acc-tierrow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); padding: 3px 0; font-weight: 600; }
.acc-tierrow.prem { color: #9a6f0d; }
.acc-tierlabel { font-size: 9.5px; letter-spacing: .12em; color: var(--dim); width: 54px; flex: none; }
.acc-tierrow button { margin-left: auto; padding: 6px 9px; font-size: 9.5px; }

/* --------------------------------------------------------------- trade --- */
.acc-traderow {
  background: rgba(255,255,255,.75); border: 1px solid var(--edge);
  border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 9px;
}
.acc-tradeside { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.acc-give { color: #b4530e; } .acc-want { color: var(--human); } .acc-arrow { color: var(--dim); }
.acc-tradeform {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.62); border: 1px solid var(--edge);
  border-radius: 13px; padding: 14px;
}
.acc-tradeform select {
  background: #fff; border: 1px solid var(--edge); color: var(--ink);
  border-radius: 9px; padding: 8px; font: 600 13px var(--font);
}
.acc-tradeform input[type=number] { max-width: 160px; }

/* -------------------------------------------------------------- market --- */
.acc-mkthead {
  display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap;
  background: rgba(255,255,255,.72); border: 1px solid var(--edge);
  border-radius: 13px; padding: 15px; margin-bottom: 6px;
}
.acc-stock {
  background: rgba(255,255,255,.75); border: 1px solid var(--edge);
  border-radius: 13px; padding: 13px; display: flex; flex-direction: column; gap: 10px;
}
.acc-stocktop { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); flex-wrap: wrap; font-weight: 600; }
.acc-price { color: var(--ink); font-weight: 700; }
.acc-stockbody { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.acc-stockside { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 8px; }
.acc-spark { width: 120px; height: 34px; flex: none; }

@media (max-width: 620px) {
  .acc-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .acc-track { grid-template-columns: 1fr 1fr; }
}

/* The waiting room needs no minimap — it is one room, and you can see all of it. */
body.lobby-view #minimapWrap { display: none; }

/* --- feats: earned ones step forward, the rest wait their turn --- */
.acc-chal.feat.done { background: rgba(77,156,34,.10); border-color: rgba(77,156,34,.35); }
.acc-chal.feat:not(.done) { opacity: .74; }
.feat-note { display: block; margin: -2px 0 10px; }
[data-screen="feats"] { --pc: #8a5a12; }

/* --- dust in the light -----------------------------------------------------
   Six specks drifting up through the lamp glow. Purely atmosphere: they sit
   behind everything and ignore the mouse. */
.motes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.motes i {
  position: absolute; bottom: -12px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 214, .95), rgba(255, 240, 180, 0) 70%);
  animation: drift linear infinite;
}
.motes i:nth-child(1) { left: 12%; animation-duration: 26s; animation-delay: -3s; transform: scale(.8); }
.motes i:nth-child(2) { left: 28%; animation-duration: 34s; animation-delay: -12s; }
.motes i:nth-child(3) { left: 47%; animation-duration: 30s; animation-delay: -20s; transform: scale(1.3); }
.motes i:nth-child(4) { left: 63%; animation-duration: 38s; animation-delay: -7s; transform: scale(.7); }
.motes i:nth-child(5) { left: 79%; animation-duration: 28s; animation-delay: -17s; }
.motes i:nth-child(6) { left: 91%; animation-duration: 33s; animation-delay: -25s; transform: scale(1.1); }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(.9); opacity: 0; }
  12%  { opacity: .85; }
  88%  { opacity: .7; }
  100% { transform: translate(38px, -102vh) scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .motes { display: none; } }
