:root {
  --dogs: #3b82f6;
  --dogs-2: #93c5fd;
  --horses: #ef4444;
  --horses-2: #fca5a5;
  --cats: #a855f7;
  --cats-2: #d8b4fe;
  --gold: #fbbf24;
  --panel: rgba(17, 22, 30, 0.82);
  --panel-2: rgba(30, 38, 52, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --ok: #4ade80;
  --title: 'Lilita One', 'Trebuchet MS', system-ui, sans-serif;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; color: var(--text); font-family: var(--ui); }
#view { position: fixed; inset: 0; }
#view canvas { display: block; }
button { font-family: var(--ui); cursor: pointer; }
kbd { background: #1f2937; border: 1px solid #374151; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.85em; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#loading { background: radial-gradient(ellipse at center, #1e293b 0%, #0b1220 70%); }
#menu { background: linear-gradient(180deg, rgba(8, 12, 22, 0.55) 0%, rgba(8, 12, 22, 0.25) 40%, rgba(8, 12, 22, 0.75) 100%); overflow-y: auto; justify-content: flex-start; padding-top: 7vh; }
.screen.dim { background: rgba(5, 8, 15, 0.6); backdrop-filter: blur(3px); }

.logo { font-family: var(--title); font-size: clamp(36px, 7vw, 84px); letter-spacing: 2px; text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 0, 0, 0.4); line-height: 1; text-align: center; }
.logo .dogs { color: var(--dogs-2); }
.logo .horses { color: var(--horses-2); }
.logo .cats { color: var(--cats-2); }
.logo .vs { color: #fff; font-size: 0.55em; vertical-align: middle; }
.tagline { margin: 10px 0 28px; color: #e5e7eb; text-shadow: 0 2px 6px #000; text-align: center; font-size: 17px; }

.loadbar { width: min(420px, 80vw); height: 10px; border-radius: 99px; background: #1f2937; overflow: hidden; margin-top: 30px; }
#loadfill { height: 100%; width: 0; background: linear-gradient(90deg, var(--dogs), var(--horses)); transition: width 0.2s; }
#loadtext { margin-top: 12px; color: var(--muted); }

.menu-page { width: min(860px, 100%); display: flex; flex-direction: column; align-items: center; }
.menu-page h2 { font-family: var(--title); font-size: 36px; margin: 0 0 14px; font-weight: 400; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; width: 100%; }
.mode { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; color: var(--text); padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform 0.12s, border-color 0.12s, background 0.12s; backdrop-filter: blur(6px); }
.mode:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.4); background: var(--panel-2); }
.mode .mi { font-size: 34px; }
.mode .mi small { font-size: 14px; color: var(--muted); }
.mode b { font-size: 19px; }
.mode span { color: var(--muted); font-size: 13.5px; }
.link { background: none; border: none; color: #e5e7eb; text-decoration: underline; margin-top: 20px; font-size: 15px; text-shadow: 0 2px 4px #000; }

.menu-page:not(#menu-main) { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; width: min(640px, 100%); backdrop-filter: blur(8px); }
.label { align-self: flex-start; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 6px; display: flex; gap: 8px; align-items: center; }
.seg { display: flex; gap: 6px; align-self: stretch; }
.seg button { flex: 1; padding: 11px; border-radius: 12px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; font-size: 15px; }
.seg button.on { background: #e5e7eb; color: #111827; }
.seg button.on.dogs { background: var(--dogs); color: #fff; }
.seg button.on.horses { background: var(--horses); color: #fff; }
.row { display: flex; gap: 10px; margin-top: 22px; align-self: stretch; justify-content: flex-end; }
.row button, .card button { padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; font-size: 15px; }
button.go { background: linear-gradient(180deg, #22c55e, #15803d); border-color: #16a34a; color: #fff; }
button.go:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.mini { padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: #1f2937; color: var(--text); }
input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0f172a; color: var(--text); font-family: var(--ui); font-size: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-self: stretch; }
.cols > div { display: flex; flex-direction: column; }
.cols .go { margin-top: 12px; padding: 11px; border-radius: 12px; font-weight: 800; }
.joinrow { display: flex; gap: 6px; }
.joinrow input { text-transform: uppercase; letter-spacing: 3px; }
.joinrow button { padding: 0 16px; border-radius: 10px; font-weight: 800; }
#roomList { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow: auto; }
#roomList .room { display: flex; justify-content: space-between; align-items: center; background: #0f172a; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
#roomList .room button { padding: 4px 12px; border-radius: 8px; border: none; font-weight: 800; }
#waiting { margin-top: 18px; text-align: center; }
#waiting .code { font-size: 22px; }
#waiting b { font-family: var(--title); font-size: 34px; letter-spacing: 4px; color: var(--gold); }
.warn { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.pvp-help { display: grid; gap: 10px; align-self: stretch; }
.pvp-help > div { padding: 12px 14px; border-radius: 12px; background: #0f172a; border-left: 4px solid #6b7280; line-height: 1.6; }
.pvp-help .dogs-c { border-color: var(--dogs); }
.pvp-help .horses-c { border-color: var(--horses); }
.how { line-height: 1.6; padding-left: 20px; margin: 0; align-self: stretch; }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: stretch; width: min(1100px, calc(100vw - 120px)); pointer-events: none; }
#teamboxes { flex: 1; display: flex; gap: 10px; }
.teambox { flex: 1; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: 14px; padding: 6px 12px; backdrop-filter: blur(6px); min-width: 0; }
.teambox.out { opacity: 0.45; filter: grayscale(0.7); }
.tname { font-family: var(--title); font-size: 18px; letter-spacing: 0.5px; color: var(--tl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { font-family: var(--ui); font-size: 12px; color: var(--muted); }
.hqbar { position: relative; height: 15px; background: #111827; border-radius: 99px; margin-top: 4px; overflow: hidden; }
.hqbar .fill { position: absolute; inset: 0; width: 100%; transition: width 0.2s; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 60%, #000), var(--tc)); }
.hqbar span { position: absolute; inset: 0; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px #000; }
#clock { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; text-align: center; min-width: 120px; backdrop-filter: blur(6px); }
#time { font-family: var(--title); font-size: 24px; line-height: 1.1; }
#wave { font-size: 12px; color: var(--muted); }
#overtime { font-size: 12px; color: #fb923c; font-weight: 800; }

.buildpanel { position: absolute; top: 92px; width: 238px; max-height: calc(100vh - 106px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: 16px; padding: 10px; backdrop-filter: blur(6px); scrollbar-width: thin; }
.buildpanel.left { left: 10px; }
.buildpanel.right { right: 10px; }
.buildpanel.bottom { top: auto; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 520px)); min-width: 420px; max-height: 46vh; }
.buildpanel.bottom .bp-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buildpanel.dead { opacity: 0.4; pointer-events: none; }
.sq-routes { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.bp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bp-head .title { font-family: var(--title); font-size: 18px; }
.bp-gold { font-family: var(--title); font-size: 26px; color: var(--gold); }
.bp-gold small { font-family: var(--ui); font-size: 12px; color: var(--muted); margin-left: 4px; }
.bp-sec { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 8px 2px 5px; }
.cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.bcard { position: relative; background: #1a2230; border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 6px 2px 5px; display: flex; flex-direction: column; align-items: center; gap: 1px; transition: border-color 0.1s, transform 0.1s; }
.bcard:hover { border-color: rgba(255, 255, 255, 0.45); transform: translateY(-1px); }
.bcard .ic { font-size: 23px; line-height: 1.1; }
.bcard .nm { font-size: 10.5px; font-weight: 800; text-align: center; line-height: 1.1; min-height: 23px; display: flex; align-items: center; }
.bcard .cost { font-size: 12px; font-weight: 800; color: var(--gold); }
.bcard .hk { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--muted); }
.bcard.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35) inset; }
.bcard.poor { opacity: 0.5; }
.bcard.poor .cost { color: #f87171; }
.wide-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #1a2230; color: var(--text); font-weight: 800; font-size: 13px; }
.wide-btn .cost { color: var(--gold); }
.wide-btn.poor .cost { color: #f87171; }
.wide-btn:hover { border-color: rgba(255, 255, 255, 0.45); }
.squad { display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: center; margin-bottom: 4px; font-size: 12px; font-weight: 800; }
.squad .sq-name { display: flex; flex-direction: column; line-height: 1.15; }
.squad .sq-name small { color: var(--gold); }
.squad button { padding: 5px 7px; border-radius: 8px; border: 1px solid var(--line); background: #1a2230; color: var(--text); font-weight: 800; font-size: 11px; }
.squad button:hover { border-color: rgba(255, 255, 255, 0.45); }
.squad.poor small { color: #f87171; }
.bp-stats { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; margin-top: 8px; }
.tip { font-size: 11.5px; color: #cbd5e1; background: #0f172a; border-radius: 8px; padding: 6px 8px; margin-top: 6px; min-height: 30px; }

#selpanel { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); min-width: 320px; max-width: min(520px, calc(100vw - 20px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(6px); }
#selpanel .sp-top { display: flex; gap: 12px; align-items: center; }
#selpanel .sp-ic { font-size: 34px; }
#selpanel .sp-name { font-family: var(--title); font-size: 21px; }
#selpanel .stars { color: var(--gold); letter-spacing: 2px; }
#selpanel .sp-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #cbd5e1; margin: 8px 0 4px; }
#selpanel .sp-stats b { color: #fff; }
#selpanel .sp-btns { display: flex; gap: 8px; margin-top: 8px; }
#selpanel .sp-btns button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; }
#selpanel .sp-btns .up { background: linear-gradient(180deg, #f59e0b, #b45309); border-color: #d97706; }
#selpanel .sp-btns .sell { background: #3f1d1d; }
#selpanel { border-top: 3px solid var(--tc, #fff); }
#selpanel .sp-target { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; }
#selpanel .sp-target button { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; font-size: 12px; }
#selpanel .sp-target button.on { background: #e5e7eb; color: #111827; }

#padmenu { position: absolute; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: grid; grid-template-columns: repeat(3, 72px); gap: 5px; transform: translate(-50%, -110%); backdrop-filter: blur(6px); }
#padmenu .bcard .nm { font-size: 10px; }

#cvcbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.cvcstats { font-size: 13px; display: flex; gap: 16px; }
.cvcstats .d { color: var(--dogs-2); }
.cvcstats .h { color: var(--horses-2); }
.speeds { display: flex; gap: 4px; }
.speeds button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; }
.speeds button.on { background: #e5e7eb; color: #111827; }

#corner { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
#corner button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: #fff; font-size: 18px; }
#toasts { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(15, 23, 42, 0.92); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 14px; animation: toast 2.2s forwards; }
.toast.bad { border-color: rgba(248, 113, 113, 0.6); color: #fecaca; }
.toast.big { font-family: var(--title); font-size: 22px; font-weight: 400; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px 26px; display: flex; flex-direction: column; gap: 10px; min-width: 280px; text-align: center; }
.card h2 { font-family: var(--title); font-weight: 400; margin: 0 0 6px; font-size: 32px; }
.card.wide { min-width: min(560px, 100%); }
.gotitle { font-family: var(--title); font-size: clamp(36px, 7vw, 64px); line-height: 1.05; }
#goStats { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
#goStats th, #goStats td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
#goStats th { color: var(--muted); font-weight: 600; text-align: left; }
#goStats td { text-align: center; font-weight: 800; }
#goStats .d { color: var(--dogs-2); }
#goStats .h { color: var(--horses-2); }

@media (max-width: 760px) {
  .buildpanel { width: 200px; top: 120px; }
  #topbar { flex-wrap: wrap; }
  #clock { order: -1; width: 100%; }
  .cols { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ setup + lobby */
.menu-links { display: flex; gap: 22px; align-items: center; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.menu-links .link { margin-top: 0; }
.gfx { color: #e5e7eb; text-shadow: 0 2px 4px #000; display: flex; gap: 8px; align-items: center; font-size: 15px; }
.mini-seg button { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.seg button small { display: block; font-weight: 600; color: inherit; opacity: 0.7; font-size: 12px; }
#slots, #lobbySlots { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.slot { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 8px; align-items: center; background: #0f172a; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 12px; padding: 8px 10px; }
.slot .num { font-family: var(--title); font-size: 20px; color: var(--muted); text-align: center; }
.slot select { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-family: var(--ui); font-weight: 800; font-size: 14px; }
.slot .fixed { font-weight: 800; padding: 8px 4px; color: var(--tl); }
.lslot { display: flex; justify-content: space-between; align-items: center; background: #0f172a; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 12px; padding: 10px 12px; font-weight: 800; }
.lslot .who { font-size: 14px; }
.lslot button { padding: 5px 12px; border-radius: 8px; border: none; font-weight: 800; }
#lobby { align-self: stretch; margin-top: 10px; }
#lobby .code { font-size: 20px; text-align: center; margin-bottom: 10px; }
#lobby .code b { font-family: var(--title); font-size: 32px; letter-spacing: 4px; color: var(--gold); }
#setupHint { margin-top: 8px; align-self: flex-start; }

/* ------------------------------------------------------------ card hand (Clash Royale style) */
.hand { --tc: #fff; }
#hand { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: auto; }
.hand.dead { opacity: 0.35; pointer-events: none; }
.cards4 { display: flex; gap: 8px; align-items: flex-end; }
.gcard { position: relative; width: 92px; height: 118px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.25); color: #fff; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 55%, #1e293b), #0f172a 85%); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform 0.12s, box-shadow 0.12s, filter 0.12s; padding: 6px 4px 4px; }
.gcard.spell { background: linear-gradient(180deg, #7c2d12, #1c0f0a 85%); }
.gcard:hover { transform: translateY(-6px); }
.gcard.sel { transform: translateY(-16px) scale(1.06); border-color: #fde047; box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.5), 0 12px 24px rgba(0, 0, 0, 0.5); }
.gcard.poor { filter: grayscale(0.85) brightness(0.75); }
.gcard .cic { font-size: 40px; line-height: 1.05; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)); }
.gcard .cname { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.1; min-height: 24px; display: flex; align-items: center; }
.gcard .ccost { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f0abfc, #a21caf 70%);
  font-family: var(--title); font-size: 16px; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px #000; border: 2px solid #fae8ff; }
.gcard .ckey { position: absolute; top: 5px; right: 7px; font-size: 11px; color: rgba(255, 255, 255, 0.6); font-weight: 800; }
.gcard .cfill { position: absolute; left: 0; right: 0; top: 0; background: rgba(0, 0, 0, 0.45); pointer-events: none; transition: height 0.15s linear; }
.gcard.dealt { animation: deal 0.35s ease-out; }
@keyframes deal { 0% { transform: translateY(40px) scale(0.6) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cnext { width: 52px; height: 70px; border-radius: 10px; background: rgba(15, 23, 42, 0.85); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 4px; }
.cnext small { font-size: 10px; color: var(--muted); }
.cnext .nic { font-size: 26px; }
.elixir { display: flex; align-items: center; gap: 8px; width: 100%; }
.ebar { position: relative; flex: 1; height: 16px; border-radius: 99px; background: rgba(15, 23, 42, 0.9); border: 2px solid rgba(250, 232, 255, 0.5); overflow: hidden; display: flex; }
.ebar .efill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #a21caf, #e879f9); box-shadow: 0 0 12px #e879f9; transition: width 0.1s linear; }
.ebar i { flex: 1; border-right: 2px solid rgba(15, 23, 42, 0.7); position: relative; z-index: 1; }
.enum { font-family: var(--title); font-size: 22px; color: #f5d0fe; min-width: 24px; text-shadow: 0 2px 4px #000; }
.mini-hand { margin: 6px 0 8px; }
.mini-hand .cards4 { gap: 4px; }
.mini-hand .gcard { width: 46px; height: 62px; padding: 2px; border-radius: 9px; }
.mini-hand .gcard .cic { font-size: 22px; }
.mini-hand .gcard .cname { display: none; }
.mini-hand .gcard .ccost { width: 18px; height: 18px; font-size: 11px; top: 2px; left: 2px; border-width: 1px; }
.mini-hand .gcard .ckey { top: 2px; right: 3px; font-size: 9px; }
.mini-hand .cnext { width: 30px; height: 44px; }
.mini-hand .cnext .nic { font-size: 16px; }
.mini-hand .enum { font-size: 16px; }
.buildpanel.bottom .mini-hand { grid-column: 1 / -1; }
#cardtip { position: absolute; transform: translate(-50%, -100%); background: rgba(15, 23, 42, 0.95); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; max-width: 260px; pointer-events: none; z-index: 30; line-height: 1.45; }
#cardtip .tcost { color: #f0abfc; font-weight: 800; }
#selpanel { bottom: 168px; }

/* ------------------------------------------------------------ hype banners */
#banners { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 15; }
.banner { font-family: var(--title); font-size: clamp(30px, 5.5vw, 64px); color: #fff; letter-spacing: 1px; white-space: nowrap;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 180, 60, 0.75); -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.35);
  animation: bannerPop 2s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.banner.good { color: #fde047; }
.banner.bad { color: #fca5a5; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 60, 60, 0.8); }
.banner.epic { color: #f0abfc; font-size: clamp(40px, 7vw, 86px); }
@keyframes bannerPop { 0% { transform: scale(0.2) rotate(-6deg); opacity: 0; } 12% { transform: scale(1.15) rotate(2deg); opacity: 1; } 22% { transform: scale(1); }
  80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1) translateY(-20px); } }

/* ------------------------------------------------------------ accounts */
.logo.small { font-size: clamp(30px, 5vw, 60px); margin-bottom: 18px; }
#signin { background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.88) 0%, rgba(8, 12, 22, 0.97) 70%); backdrop-filter: blur(6px); z-index: 25; }
.signin-card { width: min(480px, 100%); text-align: left; gap: 12px; }
.signin-card .joinrow input { font-size: 18px; letter-spacing: 0; text-transform: none; }
.signin-card .joinrow button { font-size: 16px; padding: 0 22px; white-space: nowrap; }
#signinRecent { display: flex; flex-wrap: wrap; gap: 6px; }
#signinRecent .label { width: 100%; margin: 8px 0 0; }
.pill { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; }
.pill:hover { border-color: rgba(255, 255, 255, 0.5); }
#acctChip { position: fixed; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px 10px; backdrop-filter: blur(8px); z-index: 21; }
#acctChip .who { display: flex; gap: 9px; align-items: center; background: none; border: none; color: var(--text); text-align: left; padding: 0 6px 0 0; }
#acctChip .who small { display: block; color: var(--muted); font-size: 11.5px; }
#acctChip .av { font-size: 28px; }
#acctChip .tro { margin-left: 8px; font-family: var(--title); font-size: 17px; color: var(--gold); }
#acctChip > button:not(.who) { padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line); background: #1f2937; color: var(--text); font-weight: 800; font-size: 14px; }
#acctChip > button:not(.who):hover, #acctChip > button.on { border-color: rgba(255, 255, 255, 0.45); }
#acctChip .lvl { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 99px; background: #111827; overflow: hidden; }
#acctChip .lvl i { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #a78bfa); }
#onlinePanel { position: fixed; top: 70px; right: 12px; width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; backdrop-filter: blur(8px); z-index: 21; max-height: 60vh; overflow: auto; }
.op-head { font-weight: 800; margin-bottom: 6px; }
#onlineCount { background: #334155; border-radius: 99px; padding: 0 7px; font-size: 12px; }
#onlineCount.some { background: #16a34a; }
.orow { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); }
.orow .av { font-size: 22px; }
.on-name { display: flex; flex-direction: column; font-weight: 800; font-size: 14px; flex: 1; min-width: 0; }
.on-name small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.orow .st { font-size: 11px; color: var(--muted); }
.orow .st.playing { color: #fb923c; }
.orow .st.lobby { color: #4ade80; }
.orow .mini { padding: 4px 8px; font-size: 12px; font-weight: 800; }
.wide-page.menu-page:not(#menu-main) { width: min(1040px, 100%); }
.nameline { align-self: flex-start; margin: 6px 0; }
.prof-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; align-self: stretch; margin-bottom: 14px; }
.bigav { font-size: 64px; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: 22px; border: 2px solid var(--line); }
.pname { font-family: var(--title); font-size: 34px; }
.xpbar { position: relative; height: 18px; border-radius: 99px; background: #0f172a; overflow: hidden; margin-top: 6px; border: 1px solid var(--line); }
.xpbar i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #22d3ee, #a78bfa); }
.xpbar i.grow { animation: xpgrow 1.4s 0.3s ease-out forwards; width: var(--from); }
@keyframes xpgrow { to { width: var(--to); } }
.xpbar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.xpbar.small { height: 8px; }
.tiny { font-size: 11.5px; }
.prof-arena { display: flex; gap: 10px; align-items: center; background: #0f172a; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; min-width: 210px; }
.prof-arena .aicon { font-size: 40px; }
.prof-arena b { font-family: var(--title); font-size: 24px; color: var(--gold); font-weight: 400; }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-self: stretch; }
.pcard { background: #0f172a; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pcard h3 { margin: 4px 0 8px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: #111827; border-radius: 10px; padding: 8px; text-align: center; }
.stats b { display: block; font-family: var(--title); font-size: 22px; font-weight: 400; }
.stats span { font-size: 11px; color: var(--muted); }
.frows { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.frow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; font-weight: 800; }
.fbar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #1f2937; overflow: hidden; }
.fbar i { display: block; height: 100%; }
.achs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ach { background: #111827; border-radius: 10px; padding: 6px; display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0.35; filter: grayscale(1); }
.ach.got { opacity: 1; filter: none; border: 1px solid rgba(253, 224, 71, 0.4); }
.ach span { font-size: 24px; }
.ach b { font-size: 12px; }
.ach small { font-size: 10.5px; color: var(--muted); }
.avpick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 10px; }
.avpick button { position: relative; font-size: 22px; padding: 4px 0; border-radius: 9px; border: 1px solid var(--line); background: #111827; }
.avpick button.on, .skinpick button.on, .favpick button.on { border-color: #fde047; box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.35); }
.avpick button small { position: absolute; bottom: 0; right: 3px; font-size: 9px; color: #fbbf24; }
.avpick button:disabled { opacity: 0.35; }
.skinpick, .favpick { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.skinpick button, .favpick button { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: #111827; color: var(--text); font-weight: 800; font-size: 12.5px; }
.skinpick button:disabled { opacity: 0.4; }
.skinpick i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.skinpick small { color: #fbbf24; font-size: 10px; }
.hist { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.hrow { display: grid; grid-template-columns: 48px 1.2fr 1.2fr 0.9fr 0.6fr 0.8fr; gap: 6px; align-items: center; font-size: 12.5px; padding: 6px 8px; border-radius: 9px; background: #111827; border-left: 3px solid #ef4444; }
.hrow.w { border-left-color: #22c55e; }
.hrow .res { font-weight: 800; }
.hrow.w .res { color: #4ade80; }
.up { color: #4ade80; font-weight: 800; }
.down { color: #f87171; font-weight: 800; }
table.lb { width: 100%; border-collapse: collapse; align-self: stretch; }
table.lb th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; padding: 6px 8px; }
table.lb td { padding: 8px; border-top: 1px solid var(--line); font-size: 14px; }
table.lb tr.me td { background: rgba(253, 224, 71, 0.08); }
table.lb .av { font-size: 20px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e; }
#goRewards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; text-align: left; }
.rw { background: #0f172a; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.rw.other { opacity: 0.85; }
.rw-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rw-top .av { font-size: 26px; }
.rw-xp { color: #67e8f9; font-weight: 800; }
.rw-tro { font-weight: 800; }
.rw-level { margin-top: 6px; font-family: var(--title); font-size: 20px; color: #fde047; }
.rw-ach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rw-ach span { background: rgba(253, 224, 71, 0.12); border: 1px solid rgba(253, 224, 71, 0.4); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; }
.slot.with-name { grid-template-columns: 34px 1fr 1fr 1fr; }
.toast.invite { display: flex; gap: 10px; align-items: center; pointer-events: auto; animation: toast 9s forwards; }
.toast.invite button { padding: 4px 12px; border-radius: 8px; border: none; font-weight: 800; }
#gameover .card.wide { max-height: 92vh; overflow-y: auto; }
@media (max-width: 1100px) { .prof-grid { grid-template-columns: 1fr; } }
#notices { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 40; }
.linkish { align-self: center; background: none !important; border: none !important; box-shadow: none !important; color: var(--muted); text-decoration: underline; font-weight: 600; font-size: 13px; }
#menu.wide #onlinePanel, #menu.wide #acctChip { display: none; }
.slot select.who { color: #fde68a; }
#leadersBody, #profileBody { align-self: stretch; }
#signinBtn { position: fixed; top: 12px; right: 12px; z-index: 21; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 800; backdrop-filter: blur(8px); }
