:root { --ink: #0b0f2e; --font: 'Lilita One', 'Arial Black', sans-serif; --body: 'Nunito', system-ui, sans-serif; --yellow: #ffd21e; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #10309a; color: #fff; font-family: var(--font); letter-spacing: 0.02em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ---------------------------------------------------------------- family gate */
/* The approved key art introduces the brawlers; a dark overlay keeps the family gate legible. */
.gate { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 16px; overflow: hidden; }
.g-art { position: fixed; inset: 0; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='124' height='104' viewBox='0 0 124 104'%3E%3Cdefs%3E%3Cpath id='s' fill-rule='evenodd' d='M32 5C17 5 7 14.5 7 28c0 7.5 3.6 12.6 8.5 15.6V51c0 4.2 3.3 7.5 7.5 7.5h18c4.2 0 7.5-3.3 7.5-7.5v-7.4C53.4 40.6 57 35.5 57 28 57 14.5 47 5 32 5zM12.6 25.6c.5-3.6 4.6-4.1 9.4-2.1l6.5 3.5c1.6 1 1.9 4 .9 6.1-2.1 4.5-9.1 5.5-13.1 3-3-1.9-4-6.5-3.7-10.5zM51.4 25.6c-.5-3.6-4.6-4.1-9.4-2.1l-6.5 3.5c-1.6 1-1.9 4-.9 6.1 2.1 4.5 9.1 5.5 13.1 3 3-1.9 4-6.5 3.7-10.5zM32 37.2l-3.4 5.6c2.1 1 4.7 1 6.8 0z'/%3E%3C/defs%3E%3Cg fill='%23fff' opacity='.07'%3E%3Cuse href='%23s' transform='translate(32 28) rotate(-7) scale(.76) translate(-32 -32)'/%3E%3Cuse href='%23s' transform='translate(94 80) rotate(6) scale(.76) translate(-32 -32)'/%3E%3Cuse href='%23s' transform='translate(-30 80) rotate(6) scale(.76) translate(-32 -32)'/%3E%3Cuse href='%23s' transform='translate(32 132) rotate(-7) scale(.76) translate(-32 -32)'/%3E%3Cuse href='%23s' transform='translate(94 -24) rotate(6) scale(.76) translate(-32 -32)'/%3E%3C/g%3E%3C/svg%3E") 0 0 / max(300px, 62vh) auto,
    radial-gradient(ellipse 75% 85% at 50% 45%, #0247bc 55%, #1337a5 100%); }
.gate .g-art { background: linear-gradient(rgba(4, 9, 35, 0.44), rgba(4, 9, 35, 0.66)), url('/assets/keyart.jpg') center / cover no-repeat; }
.g-card { position: relative; width: min(440px, 100%); text-align: center; padding: 0 22px 20px; border: 3px solid #000; border-radius: 12px; overflow: visible;
  background: linear-gradient(#2376ea, #1e6fe0 60%, #1a62d2); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), inset 0 3px 0 rgba(255, 255, 255, 0.25); animation: popIn 0.35s cubic-bezier(.2,1.5,.4,1); }
@keyframes popIn { from { transform: scale(0.7); opacity: 0; } }
/* The logo carries its own extrusion and hard drop shadow (in the SVG), so it animates as a plain
   composited layer: a 300 ms scale-in with a small overshoot, a beat after the card pops. */
.g-logo { position: absolute; left: 50%; bottom: calc(100% - 22px); display: block; width: min(500px, 92vw); margin: 0; transform: translateX(-50%); z-index: 1;
  transform-origin: 50% 70%; animation: logoIn 0.3s cubic-bezier(.2,.9,.3,1) 0.12s both; will-change: transform; }
svg.g-logo { height: auto; aspect-ratio: 640 / 340; overflow: visible; }
@keyframes logoIn {
  0% { transform: translateX(-50%) scale(0.35) rotate(-4deg); opacity: 0; }
  55% { transform: translateX(-50%) scale(1.12) rotate(1deg); opacity: 1; }
  80% { transform: translateX(-50%) scale(0.97) rotate(0deg); }
  100% { transform: translateX(-50%) scale(1); } }
.gate .g-card { margin-top: min(232px, 44vw); }
.g-card h1 { margin: 0 -22px 14px; padding: 22px 12px 12px; font-size: 30px; font-weight: normal; line-height: 1; color: #fff; background: #0b3c9e; border-bottom: 3px solid #000;
  border-radius: 9px 9px 0 0; paint-order: stroke fill; -webkit-text-stroke: 6px #000; text-shadow: 0 3px 0 #000; letter-spacing: 0.03em; }
.g-card p { margin: 0 0 14px; font-family: var(--body); font-weight: 800; font-size: max(17px, 2.5vh); line-height: 1.25; letter-spacing: 0; color: #e6eeff; }
form { display: flex; flex-direction: column; gap: 14px; }
input { width: 100%; font: 26px var(--font); text-align: center; letter-spacing: 0.12em; text-transform: uppercase; padding: 10px 12px; border-radius: 14px;
  border: 3px solid var(--ink); background: #fff; color: var(--ink); box-shadow: inset 0 4px 0 rgba(0,0,0,0.12); outline: none; }
input:focus { box-shadow: inset 0 4px 0 rgba(0,0,0,0.12), 0 0 0 4px rgba(255,210,30,0.6); }
input::placeholder { color: #9aa6c8; letter-spacing: 0.06em; }
.g-card input { border: 3px solid #000; border-radius: 10px; background: #0b1e4d; color: #fff; box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.35); padding: 12px; }
.g-card input::placeholder { color: #8fa6dc; }
.g-card input:focus { box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px #ffd21e; }
.g-btn, .a-btn { position: relative; font: 26px var(--font); color: #fff; padding: 10px 20px 14px; border-radius: 14px; border: 3px solid var(--ink); cursor: pointer;
  background: linear-gradient(#fff27a, var(--yellow) 45%, #f0a400); box-shadow: 0 6px 0 var(--ink), inset 0 -5px 0 rgba(0,0,0,0.18), inset 0 3px 0 rgba(255,255,255,0.6); }
.g-btn span, .a-btn span { paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); }
.g-btn:active, .a-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink), inset 0 -5px 0 rgba(0,0,0,0.18); }
/* Brawl Stars primary slab: flat yellow face, darker lip, black outline */
.g-card .g-btn { height: 64px; padding: 0; border: 3px solid #000; border-radius: 8px; background: linear-gradient(#f5c21b 0 84%, #c98a00 84%);
  box-shadow: inset 0 3px 0 #ffe46a, 0 4px 0 rgba(0, 0, 0, 0.35); font-size: 32px; transition: transform 0.08s; }
.g-card .g-btn span { -webkit-text-stroke: 6px #000; text-shadow: 0 3px 0 #000; }
.g-card .g-btn:active { transform: scale(0.95); box-shadow: inset 0 3px 0 #ffe46a; filter: brightness(0.92); }
form.busy .g-btn, form.locked .g-btn { filter: saturate(0.4); pointer-events: none; }
form.locked .g-btn { filter: grayscale(0.85) brightness(0.9); }
/* Wrong code: red field (border, ring, tinted well) and a quick 250 ms shake, like BS inputs. */
.g-card input.bad, .g-card input.bad:focus { border-color: #000; background: #4a0b1f; color: #ffd6d6;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px #ff3347, 0 0 14px 2px rgba(255, 40, 60, 0.55); animation: fieldShake 0.25s linear; }
.g-card input.bad::selection { background: rgba(255, 255, 255, 0.28); color: #fff; }
@keyframes fieldShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.g-err { min-height: 30px; margin-top: 10px; font-family: var(--body); font-weight: 900; letter-spacing: 0; }
.g-err:not(:empty) { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px; border: 2px solid #000; border-radius: 8px; color: #fff; font-size: 16px;
  background: linear-gradient(#ff4a55, #d91d33); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.3); animation: errIn 0.2s ease-out; }
.g-err:not(:empty)::before { content: '!'; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #d91d33;
  font: 17px var(--font); border: 2px solid #000; }
@keyframes errIn { from { transform: translateY(-6px); opacity: 0; } }
body.ok .g-card { animation: out 0.35s forwards; }
@keyframes out { to { transform: scale(1.15); opacity: 0; } }
@media (max-height: 520px) {
  .g-logo { width: min(280px, 80vw); bottom: calc(100% - 10px); }
  .gate .g-card { margin-top: 136px; padding-bottom: 10px; }
  .g-card h1 { font-size: 24px; padding: 12px 10px 9px; margin-bottom: 8px; }
  .g-card p { margin-bottom: 8px; font-size: 14px; }
  form { gap: 8px; }
  .g-card input { font-size: 20px; padding: 7px; }
  .g-card .g-btn { height: 48px; font-size: 26px; }
  .g-err { margin-top: 6px; min-height: 26px; }
  .g-err:not(:empty) { font-size: 14px; padding: 2px 12px 2px 4px; }
  .g-err:not(:empty)::before { width: 18px; height: 18px; font-size: 14px; }
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- admin */
body.adm { background: radial-gradient(circle at 50% 0%, #2e6cf0, #0f2472 70%) fixed; min-height: 100%; }
body.adm .gate { min-height: 100vh; }
/* Game-styled scrollbars (page, dialog, lists): 8 px navy track, blue thumb, no arrow buttons. Chrome
   ignores ::-webkit-scrollbar once scrollbar-color is set, so the standard property is Firefox-only. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0b1e4d; }
::-webkit-scrollbar-thumb { background: #3c6bd9; border-radius: 8px; border: 1px solid #0b1e4d; }
::-webkit-scrollbar-thumb:hover { background: #5a86f0; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { html, .adm * { scrollbar-color: #3c6bd9 #0b1e4d; scrollbar-width: thin; } }
.ic { display: inline-block; width: 22px; height: 22px; flex: none; vertical-align: middle; }
.a-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 18px; background: rgba(8,20,70,0.94);
  border-bottom: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,0.25); }
.a-logo { width: 104px; height: auto; aspect-ratio: 640 / 340; overflow: visible; }
.a-title { font-size: 24px; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); color: var(--yellow); }
.a-family { display: flex; align-items: center; gap: 10px; margin-left: auto; background: rgba(0,0,0,0.3); border-radius: 12px; padding: 5px 6px 5px 12px; }
.a-family small { display: block; font-size: 11px; opacity: 0.75; }
.a-family b { font-weight: normal; font-size: 20px; letter-spacing: 0.1em; }
.a-tabs { display: flex; gap: 4px; background: rgba(0,0,0,0.3); border-radius: 12px; padding: 4px; }
.a-tabs button { font: 16px var(--font); color: #b9c8ff; background: none; border: 0; border-radius: 9px; padding: 6px 14px; cursor: pointer; }
.a-tabs button.on { background: linear-gradient(#4f8bff, #2a58d8); color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), 0 2px 0 var(--ink); }
.a-chip { font: 15px var(--font); color: #fff; padding: 7px 12px; border-radius: 10px; border: 2px solid var(--ink); cursor: pointer;
  background: linear-gradient(#5ee06a, #1f9a38); box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.35); white-space: nowrap; }
.a-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.a-chip.ghost { background: rgba(255,255,255,0.12); }
.a-chip.gift { background: linear-gradient(#b27bff, #6a2fe0); }
.a-chip.red, .a-btn.red { background: linear-gradient(#ff6a5c, #e0283a 55%, #b8141f); }
.a-btn.grey { background: linear-gradient(#b8c3dc, #8793b3 55%, #6a7594); }
.a-chip .ic { width: 20px; height: 20px; margin: -3px 4px -3px -2px; }
.a-body { max-width: 1240px; margin: 0 auto; padding: 16px; }
/* List tools: search, the inactive filter, the count and the bulk delete. */
.a-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.a-search { position: relative; flex: 0 1 340px; min-width: 200px; }
.a-search .ic { position: absolute; left: 11px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); pointer-events: none; }
.a-bar input { font-size: 18px; text-align: left; letter-spacing: 0.02em; text-transform: none; padding: 8px 12px 8px 42px; border-radius: 12px; }
.a-toggle { display: inline-flex; align-items: center; gap: 8px; font: 15px var(--font); color: #dbe6ff; padding: 7px 12px 7px 8px; border-radius: 10px; border: 2px solid var(--ink); cursor: pointer;
  background: rgba(0,0,0,0.3); box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.a-toggle i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--ink); background: #0b1e4d; box-shadow: inset 0 2px 0 rgba(0,0,0,0.4); position: relative; }
.a-toggle[aria-pressed="true"] { color: #fff; background: linear-gradient(#4f8bff, #2a58d8); }
.a-toggle[aria-pressed="true"] i { background: #3fe03f; }
.a-toggle[aria-pressed="true"] i::after { content: ''; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #0a0a14; border-width: 0 3px 3px 0; transform: rotate(40deg); }
.a-toggle:active, .a-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.a-bar #count { flex: 1; }
.a-muted { font-family: var(--body); font-weight: 800; color: #b9c8ff; letter-spacing: 0; font-size: 14px; }
.center { text-align: center; padding: 30px; }
.a-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.a-players > .center { grid-column: 1 / -1; font-size: 17px; }
.a-player { border: 3px solid var(--ink); border-radius: 16px; padding: 12px; background: linear-gradient(160deg, #2b5fdc, #173a9c); box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.18); }
.a-p-head { display: flex; align-items: center; gap: 9px; }
.a-av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 10px; border: 3px solid var(--ink); overflow: hidden; background: radial-gradient(circle at 50% 35%, var(--tc), #1a2a6a 95%); }
.a-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.a-av .dot { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; }
.a-p-head b { font-weight: normal; font-size: 22px; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-p-head small { margin-left: auto; font-family: var(--body); font-weight: 800; color: #b9c8ff; letter-spacing: 0; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #6b7699; border: 2px solid var(--ink); }
.a-player.online .dot { background: #4dff6a; box-shadow: 0 0 8px #4dff6a; }
.a-player.online .a-p-head small { color: #7dff8a; }
.a-p-cur { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0; }
.a-p-cur span { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,0.35); border-radius: 9px; padding: 2px 9px 2px 3px; font-size: 16px; }
.a-p-cur span.pr { background: linear-gradient(90deg, rgba(120,50,220,0.8), rgba(40,80,200,0.8)); }
.a-p-roster { display: flex; gap: 5px; flex-wrap: wrap; }
/* Roster slots: model-render portraits on the rarity color; locked ones stay recognizable but greyed. */
.a-b { position: relative; width: 38px; height: 38px; border-radius: 9px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 35%, var(--tc), rgba(0,0,0,0.55) 95%); overflow: hidden; }
.a-b img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.a-b.no { background: #2a3456; }
.a-b.no img { filter: grayscale(1) brightness(0.62) contrast(0.9); opacity: 0.75; }
.a-b i { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 12px; paint-order: stroke fill; -webkit-text-stroke: 3px var(--ink); }
.a-b.prism, .a-rb.prism { box-shadow: 0 0 0 2px #fff, 0 0 10px 2px #c86bff; }
.a-p-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.a-p-foot small { font-family: var(--body); font-weight: 800; color: #b9c8ff; letter-spacing: 0; }
/* Activity log: time, a type badge, who, what. */
.a-log { display: flex; flex-direction: column; gap: 6px; }
.a-log-row { display: grid; grid-template-columns: 170px 38px 150px 1fr; gap: 10px; align-items: center; background: rgba(0,0,0,0.3); border-radius: 10px; padding: 6px 12px; }
.a-log-row small, .a-log-row span { font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.a-log-row small { color: #b9c8ff; }
.a-log-row b { font-weight: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-log-row span .ic { width: 20px; height: 20px; margin: -3px 0 0 3px; }
.a-log-row.del { background: rgba(120,10,30,0.45); }
.a-lt { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--ink); background: #0b1e4d; overflow: hidden; }
.a-log-row .a-lt .ic { width: 26px; height: 26px; margin: 0; }
.a-lt img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.a-lt.t-del { background: #5a0c18; }

.a-dlg { width: min(720px, 96vw); max-height: 92vh; padding: 0; border: 3px solid var(--ink); border-radius: 20px; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, #2e6cf0, #12308f); box-shadow: 0 8px 0 var(--ink); }
.a-dlg[open] { animation: dlgIn 0.2s cubic-bezier(.2,1.3,.4,1); }
@keyframes dlgIn { from { transform: scale(0.9); opacity: 0; } }
.a-dlg::backdrop { background: rgba(0,0,20,0.62); }
/* Head stays put (name + close); the sections scroll under it. */
.a-dlg form { display: flex; flex-direction: column; max-height: calc(92vh - 6px); padding: 14px 16px 0; }
.a-dlg-head { flex: none; display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid rgba(0,0,0,0.3); }
.a-dlg-ico { flex: none; width: 60px; height: 60px; border-radius: 12px; border: 3px solid var(--ink); overflow: hidden; background: radial-gradient(circle at 50% 35%, var(--tc, #ffd23f), #1a2a6a 95%); }
.a-dlg-ico img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.a-dlg-id { min-width: 0; }
.a-dlg-head b { display: block; font-weight: normal; font-size: 28px; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); }
.a-dlg-head small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--body); font-weight: 800; letter-spacing: 0; color: #dbe6ff; }
.a-dlg-head small > span { display: inline-flex; align-items: center; gap: 3px; }
.a-dlg-head small .ic { width: 19px; height: 19px; }
.a-on { color: #7dff8a; font-weight: 900; }
.a-dlg-head .x { margin-left: auto; align-self: flex-start; flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 10px; border: 3px solid var(--ink); cursor: pointer;
  background: linear-gradient(#ff6a5c, #e0283a 55%, #b8141f); box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.35); }
.a-dlg-head .x .ic { width: 24px; height: 24px; }
.a-dlg-head .x:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.a-dlg-tabs { display: flex; gap: 8px; flex: none; padding: 10px 0 2px; }
.a-dlg-tabs .a-chip { flex: 1; min-height: 38px; }
.a-dlg-tabs .a-chip.on { color: #171d3b; background: linear-gradient(#ffe779, #ffc21e); box-shadow: inset 0 2px 0 #fff5c2, 0 3px 0 var(--ink); }
.a-dlg-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -10px; padding: 0 10px 16px 0; }
.a-dlg-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); border-radius: 8px; margin: 10px 0 14px; }
.a-sec { background: rgba(0,0,0,0.25); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.a-sec h3 { margin: 0 0 8px; font-weight: normal; font-size: 18px; display: flex; align-items: center; gap: 7px; color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); }
.a-sec h3 .ic { width: 24px; height: 24px; }
.a-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.a-quick button { display: inline-flex; align-items: center; gap: 4px; font: 17px var(--font); color: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px 6px 12px; cursor: pointer;
  background: linear-gradient(#9d6bff, #5a28d0); box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,0.3); }
.a-quick button .ic { width: 20px; height: 20px; }
.a-quick button em { font-style: normal; font-size: 11px; opacity: 0.85; margin-left: 2px; }
.a-quick button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.a-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.a-row.end { justify-content: space-between; }
.a-row label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; flex: 1; min-width: 120px; }
.a-lbl { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; }
.a-row label.a-check { flex-direction: row; align-items: center; gap: 8px; font-size: 16px; }
.a-check input { width: 22px; height: 22px; }
.a-row input { font-size: 18px; padding: 7px 10px; letter-spacing: 0.02em; text-transform: none; text-align: left; }
.a-row input[type=number] { text-align: center; }
.a-btn { font-size: 20px; padding: 7px 18px 10px; }
.a-btn:disabled, .a-chip:disabled { filter: grayscale(0.8); pointer-events: none; }
.a-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.a-rb { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border: 2px solid var(--ink); border-radius: 11px; cursor: pointer; color: #fff; font-family: var(--font);
  background: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45)); }
.a-rb img { width: 50px; height: 50px; border-radius: 9px; border: 2px solid var(--ink); object-fit: cover; object-position: 50% 8%; background: radial-gradient(circle at 50% 35%, var(--tc), rgba(0,0,0,0.5) 95%); }
.a-rb:not(.own) img { filter: grayscale(1) brightness(0.7); background: #2a3456; }
.a-rb b { font-weight: normal; font-size: 14px; }
.a-rb small { font-size: 11px; color: var(--tc); }
.a-rb.on { outline: 3px solid var(--yellow); background: linear-gradient(rgba(255,210,30,0.35), rgba(0,0,0,0.3)); }
.a-hist { display: flex; flex-wrap: wrap; gap: 5px; max-height: 120px; overflow: auto; }
.a-h { display: inline-flex; align-items: center; gap: 4px; font-family: var(--body); font-weight: 800; font-size: 12px; letter-spacing: 0; padding: 2px 8px 2px 3px; border-radius: 8px; background: rgba(0,0,0,0.35); border-left: 4px solid var(--tc); }
.a-h .ic { width: 18px; height: 18px; }
.a-h img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; object-position: 50% 8%; background: var(--tc); }
.a-danger { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; background: rgba(120,10,30,0.35); border: 2px dashed rgba(255,90,90,0.55); }
.a-danger h3 { margin-bottom: 2px; color: #ff9a9a; }
/* Dialog message: floats over the bottom of the dialog for a moment. */
.a-dlg .a-toast { position: absolute; left: 50%; bottom: 14px; margin: 0; min-height: 0; padding: 8px 16px; border-radius: 12px; border: 2px solid var(--ink); background: #0b0f2e;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: transform 0.2s, opacity 0.2s; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.a-dlg .a-toast.show { transform: translate(-50%, 0); opacity: 1; }
.a-toast { min-height: 22px; margin-top: 10px; font-family: var(--body); font-weight: 900; letter-spacing: 0; text-align: center; }
.a-toast.good { color: #7dff8a; border-color: #3fbf4f; } .a-toast.bad { color: #ff9a9a; border-color: #ff5a5a; }
.a-toast-global { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; transition: 0.25s; background: #0b0f2e; border: 2px solid #4f8bff;
  border-radius: 12px; padding: 10px 16px; font-family: var(--body); font-weight: 900; letter-spacing: 0; z-index: 99; max-width: 92vw; word-break: break-all; }
.a-toast-global.show { transform: translate(-50%, 0); opacity: 1; }
.a-toast-global.bad { border-color: #ff5a5a; }
/* Confirm (delete): BS-style popup with a red header strip, never the browser's confirm(). */
.a-cfm { width: min(420px, 92vw); padding: 0 20px 20px; border: 3px solid var(--ink); border-radius: 16px; color: #fff; text-align: center; overflow: visible;
  background: linear-gradient(#2376ea, #1a62d2); box-shadow: 0 8px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,0.25); }
.a-cfm[open] { animation: dlgIn 0.2s cubic-bezier(.2,1.4,.4,1); }
.a-cfm::backdrop { background: rgba(0,0,20,0.55); }
.a-cfm-ico { width: 78px; height: 78px; margin: -40px auto 4px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 30%, #ffffff, #d4ddf0 70%, #aab8d8); box-shadow: 0 4px 0 var(--ink), inset 0 -4px 0 rgba(0,0,0,0.12); }
.a-cfm-ico .ic { width: 50px; height: 50px; }
.a-cfm h2 { margin: 4px 0 8px; font-weight: normal; font-size: 28px; paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.a-cfm p { margin: 0 0 16px; font-family: var(--body); font-weight: 800; font-size: 16px; letter-spacing: 0; line-height: 1.35; color: #e6eeff; }
.a-cfm p b { color: #fff; }
.a-cfm p em { display: block; margin-top: 6px; font-style: normal; font-size: 13px; color: #b9c8ff; max-height: 3.9em; overflow: hidden; }
.a-cfm-btns { display: flex; gap: 10px; }
.a-cfm-btns .a-btn { flex: 1; }
@media (max-width: 640px), (max-height: 520px) { .a-head { position: static; } }
@media (max-width: 960px) {
  .a-head { gap: 10px; padding: 6px 12px; }
  .a-logo { width: 88px; }
  .a-title { font-size: 20px; }
  .a-family { padding: 4px 5px 4px 10px; gap: 8px; }
  .a-family b { font-size: 18px; }
  .a-head .a-chip { font-size: 14px; padding: 6px 10px; }
  .a-tabs button { font-size: 15px; padding: 6px 11px; }
}
@media (max-width: 640px) {
  .a-head { gap: 8px 10px; padding: 6px 10px; }
  .a-logo { width: 78px; }
  .a-title { font-size: 19px; }
  #logout { order: 2; margin-left: auto; }
  .a-tabs { order: 3; flex: 1 1 100%; }
  .a-tabs button { flex: 1; }
  .a-family { margin-left: 0; order: 4; flex: 1 1 100%; justify-content: space-between; }
  .a-log-row { grid-template-columns: 34px 1fr; gap: 2px 10px; }
  .a-log-row small { grid-column: 1 / -1; }
  .a-log-row .a-lt { grid-row: span 2; }
  .a-players { grid-template-columns: 1fr; }
  .a-search { flex: 1 1 100%; }
  .a-danger { flex-direction: column; align-items: stretch; text-align: left; }
}
@media (max-height: 520px) {
  .a-dlg { max-height: 96vh; }
  .a-dlg form { max-height: calc(96vh - 6px); padding-top: 10px; }
  .a-dlg-ico { width: 48px; height: 48px; }
  .a-dlg-head b { font-size: 24px; }
}

/* ACCOUNT NUMBER sign-in on the gate (gate.html #nf) */
.g-link { display: block; margin: 6px auto 0; padding: 8px 10px; background: none; border: 0; cursor: pointer; font: 17px var(--font); color: #ffd21e; letter-spacing: 0.03em;
  paint-order: stroke fill; -webkit-text-stroke: 4px #000; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.g-link:active { transform: scale(0.96); }
.g-card input.g-num { text-transform: none; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; font-size: 24px; }
