/* Aion 2 Market Italia — design system shared by every page: tokens, type, header, footer, controls.
   Two themes named after the two sides of Atreia: Asmodae (dark, default) and Elysea (light).
   Colour roles: --accent (Kinah gold) marks what is selected or interactive; --up / --down are price movements;
   grade colours (--g-*) are the game's own and are never used for anything else. */
@font-face { font-family: 'Bricolage Grotesque'; src: url(../fonts/bricolage-grotesque.woff) format('woff'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(../fonts/figtree.woff) format('woff'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(../fonts/figtree-italic.woff) format('woff'); font-weight: 300 900; font-style: italic; font-display: swap; }

:root {
  --bg: #15111c; --panel: #1d1727; --card: #251d32; --field: #120e18; --line: #352b48; --faint: rgba(233, 220, 255, .055);
  --text: #f2edf8; --dim: #ab9fbe; --accent: #ecbd4f; --accent-fill: #e6b23c; --on-accent: #1d1503;
  --up: #5fd6a0; --down: #ff8a80; --kinah: #ecbd4f; --discord: #5865f2;
  --g-white: #dcd6e6; --g-green: #5fd88a; --g-blue: #6aaeff; --g-gold: #f5c84c; --g-orange: #ff9750; --g-teal: #45dcc8;
  --shadow: 0 16px 40px rgba(5, 2, 10, .55);
  --r: 14px; --r-sm: 9px;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* aliases used by the tracker scripts and the map */
  --bg2: var(--bg); --panel-solid: var(--panel);
  color-scheme: dark;
}
:root[data-theme="elysea"] {
  --bg: #eceef4; --panel: #ffffff; --card: #f4f5fa; --field: #f7f8fc; --line: #d3d7e3; --faint: rgba(30, 40, 80, .05);
  --text: #1b1f2e; --dim: #596074; --accent: #8a5a00; --accent-fill: #f0bb3d; --on-accent: #221802;
  --up: #0f6e46; --down: #b3301e; --kinah: #8a5a00;
  --g-white: #4b5162; --g-green: #1c7a3e; --g-blue: #1d56b4; --g-gold: #8a5b06; --g-orange: #ad4708; --g-teal: #0b6f64;
  --shadow: 0 14px 34px rgba(40, 50, 90, .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; text-wrap: balance; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.g-white { color: var(--g-white); } .g-green { color: var(--g-green); } .g-blue { color: var(--g-blue); } .g-gold { color: var(--g-gold); } .g-orange { color: var(--g-orange); } .g-teal { color: var(--g-teal); }
.up { color: var(--up); } .down { color: var(--down); } .err { color: var(--down); }
.coin { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c4, #e2b74c 55%, #8a6a22); margin-right: 6px; vertical-align: -1px; flex: none; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- header: brand, sections, server, settings ---------- */
.bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px; padding: 0 max(20px, calc((100% - 1760px) / 2)); min-height: 60px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.015em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
/* the tricolour: the only place the flag appears, a three-stripe tag after the name */
.brand .flag { display: inline-flex; width: 18px; height: 12px; border-radius: 3px; overflow: hidden; margin-left: 2px; box-shadow: 0 0 0 1px var(--line); }
.brand .flag i { flex: 1; } .brand .flag i:nth-child(1) { background: #1f9d55; } .brand .flag i:nth-child(2) { background: #f4f1ea; } .brand .flag i:nth-child(3) { background: #d5362f; }
.tabs { display: flex; align-self: stretch; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14.5px; white-space: nowrap; border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs a span { font-size: 12px; font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.tabs a span:empty { display: none; }
.tabs .gap { flex: none; width: 1px; margin: 18px 8px; background: var(--line); }
.barend { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; position: relative; }
.srvbtn { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; }
.srvbtn small { color: var(--dim); font-size: 12px; }
.srvbtn b { font-weight: 700; }
.srvbtn::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); margin: -3px 2px 0 2px; }
.srvbtn:hover, .srvbtn[aria-expanded="true"], .menubtn:hover, .menubtn[aria-expanded="true"] { border-color: var(--accent); }
.menubtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--dim); cursor: pointer; }
.menubtn svg { width: 19px; height: 19px; }
.pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.srvpop { width: min(420px, calc(100vw - 24px)); }
.srvpop h2 { font-size: 16px; margin-bottom: 2px; }
.srvpop p { margin: 0 0 10px; color: var(--dim); font-size: 13px; }
.srvpop input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); margin-bottom: 10px; }
.srvlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: min(52vh, 420px); overflow: auto; }
.srvlist button { all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srvlist button:hover { background: var(--faint); }
.srvlist button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.srvlist button[aria-current="true"] { background: var(--accent-fill); color: var(--on-accent); }
.srvlist p { grid-column: 1 / -1; margin: 6px 2px; }
.bar .right { display: none; width: 320px; flex-direction: column; gap: 14px; }
.bar.menu-open .right { display: flex; }
.setrow { display: flex; flex-direction: column; gap: 6px; }
.setrow:has(.acct:empty) { display: none; }
.setlbl { font-size: 12.5px; font-weight: 600; color: var(--dim); }
.setrow b { font-size: 15px; }
.themes { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.themes button { all: unset; box-sizing: border-box; flex: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--dim); }
.themes button i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.themes button:hover { color: var(--text); }
.themes button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.themes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.acct img { width: 28px; height: 28px; border-radius: 50%; }
.acct button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); font-weight: 600; }
.acct button:first-child:not(.out) { background: var(--discord); border-color: var(--discord); color: #fff; }
.acct button:hover { border-color: var(--accent); }
.acct button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct button.del { color: var(--dim); font-size: 12.5px; font-weight: 500; }
.acct button.del[data-armed] { color: var(--down); border-color: var(--down); }
.acct .dc { width: 18px; height: 18px; }
.loginerr { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 999; max-width: min(92vw, 720px); padding: 10px 16px; border-radius: 10px; background: #6b1f25; color: #fff; font-size: 14px; box-shadow: var(--shadow); }

/* ---------- buttons, footer ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
footer.foot { margin-top: auto; padding: 28px max(20px, calc((100% - 1180px) / 2)) 34px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13.5px; display: grid; grid-template-columns: minmax(0, 1.5fr) auto; gap: 16px 40px; }
footer.foot p { margin: 0 0 6px; max-width: 78ch; }
footer.foot nav { display: flex; flex-direction: column; gap: 4px; }
footer.foot a { color: var(--text); }

@media (max-width: 1180px) { .srvbtn small { display: none; } .bar { gap: 14px; } .tabs a { padding: 0 9px; font-size: 14px; } .tabs .gap { margin: 18px 4px; } }
@media (max-width: 900px) {
  .bar { flex-wrap: wrap; gap: 0 10px; padding: 8px 12px 0; }
  .brand { font-size: 17px; min-height: 40px; }
  .tabs { order: 3; flex: 1 0 100%; margin: 6px -12px 0; padding: 0 6px; min-height: 42px; border-top: 1px solid var(--line); }
  .tabs a { padding: 0 10px; }
  .bar .right { width: min(320px, calc(100vw - 24px)); }
  footer.foot { grid-template-columns: 1fr; }
  html { scroll-padding-top: 110px; }
}
@media (max-width: 420px) { .brand .bt { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
