/* One Hero Adventure admin - the game's "Modern Hybrid" look: deep navy glass, gold accents */
:root {
  --bg: #0b1020;
  --bg2: #141c33;
  --glass: rgba(28, 38, 66, 0.82);
  --glass-soft: rgba(40, 52, 88, 0.6);
  --line: rgba(140, 170, 230, 0.18);
  --text: #eef2ff;
  --muted: #9aa8c8;
  --gold: #ffc94a;
  --gold-dark: #3a2a05;
  --teal: #5fe0d0;
  --red: #ff6b5e;
  --green: #66e38a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.45 "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(95, 224, 208, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 201, 74, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

h1, h2, .brand { font-family: "Lilita One", "Nunito", sans-serif; font-weight: 400; letter-spacing: 0.3px; }
h1 { font-size: 26px; margin: 0 0 14px; }
h2 { font-size: 18px; margin: 18px 0 8px; color: var(--gold); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px 24px;
  background: rgba(10, 14, 28, 0.85);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.brand { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.gem {
  width: 18px; height: 18px; transform: rotate(45deg); border-radius: 4px;
  background: linear-gradient(135deg, #8ff6ff, #3a8dff); box-shadow: 0 0 12px rgba(95, 224, 255, 0.6);
}
.top nav { display: flex; gap: 6px; }
.top nav a { color: var(--text); padding: 6px 12px; border-radius: 999px; font-weight: 700; }
.top nav a:hover { background: var(--glass-soft); text-decoration: none; }
.logout { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  min-width: 0;
}
.card.narrow { max-width: 420px; margin: 60px auto; }

.grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row label { flex: 1 1 100px; }
.row label.grow { flex: 3 1 180px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.choice { display: flex; gap: 18px; flex-wrap: wrap; }
.choice label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-weight: 400; font-size: 14px; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: rgba(6, 10, 22, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255, 201, 74, 0.6); border-color: transparent; }
input.upper { text-transform: uppercase; }
input[type=radio] { accent-color: var(--gold); }
textarea.codes { width: 100%; font-family: ui-monospace, Consolas, monospace; }

.btn {
  font: 800 14px "Nunito", sans-serif;
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  color: var(--text); background: var(--glass-soft);
  border: 1px solid var(--line);
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: linear-gradient(180deg, #ffd96b, #f0a92c); color: var(--gold-dark); border: 0; box-shadow: 0 4px 0 #a86d10; }
.btn.danger { background: rgba(255, 107, 94, 0.15); color: var(--red); border-color: rgba(255, 107, 94, 0.4); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: 13px; }

.hint, .muted { color: var(--muted); }
.hint { margin: -4px 0 0; font-size: 13px; }
.small { font-size: 12px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 700; }
.flash.ok { background: rgba(102, 227, 138, 0.14); color: var(--green); border: 1px solid rgba(102, 227, 138, 0.35); }
.flash.error { background: rgba(255, 107, 94, 0.14); color: var(--red); border: 1px solid rgba(255, 107, 94, 0.35); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bar h1 { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid rgba(140, 170, 230, 0.08); vertical-align: top; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
h1.code { font-size: 28px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.actions form { margin: 0; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.on { background: rgba(102, 227, 138, 0.15); color: var(--green); }
.pill.off { background: rgba(154, 168, 200, 0.15); color: var(--muted); }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.stats div { background: var(--glass-soft); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 120px; }
.stats b { font-size: 20px; color: var(--text); }
.stats span { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  main { padding: 14px; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 4px 0; }
  .actions { justify-content: flex-start; }
}

/* live services */
.red { color: var(--red); }
pre.chat { white-space: pre-wrap; margin: 6px 0 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text); }
.public main { max-width: 560px; }
.warn { background: rgba(255, 201, 74, 0.12); border: 1px solid rgba(255, 201, 74, 0.35); color: var(--gold); padding: 10px 14px; border-radius: 10px; font-weight: 700; }

/* dashboard */
.dash-title { display: flex; align-items: flex-end; justify-content: space-between; margin: 4px 0 16px; }
.dash-title h1 { font-size: 32px; margin: 0; }
.dash-title p { margin: 4px 0 0; }

.ico { width: 20px; height: 20px; display: block; }

/* the four big numbers at the top */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { position: relative; overflow: hidden; border-radius: 18px; padding: 18px 20px 16px;
        background: linear-gradient(160deg, rgba(40, 52, 88, 0.95), rgba(22, 30, 54, 0.95));
        border: 1px solid rgba(140, 170, 230, 0.14); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
               background: radial-gradient(circle, var(--tone-a), transparent 70%); opacity: 0.22; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--tone-a), var(--tone-b)); }
.tile-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.tile-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--tone-a);
            background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }
.tile b { display: block; margin-top: 12px; font-family: "Lilita One", "Nunito", sans-serif; font-weight: 400; font-size: 42px; line-height: 1; color: var(--tone-a); }
.tile em { display: block; margin-top: 8px; font-style: normal; color: var(--muted); font-size: 13px; }
.live-dot { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--tone-a); box-shadow: 0 0 0 0 var(--tone-a); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 224, 208, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(95, 224, 208, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 224, 208, 0); } }

/* colour themes */
.tone-teal { --tone-a: #5fe0d0; --tone-b: #2a9d8f; }
.tone-gold { --tone-a: #ffd96b; --tone-b: #f0a92c; }
.tone-green { --tone-a: #7ef0a0; --tone-b: #2fbf6a; }
.tone-blue { --tone-a: #8fb8ff; --tone-b: #3d6fe0; }
.tone-violet { --tone-a: #c4a6ff; --tone-b: #8a5cf0; }
.tone-pink { --tone-a: #ff9ccb; --tone-b: #e0508e; }
.tone-red { --tone-a: #ff8a7a; --tone-b: #e04848; }

/* section headers */
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sec-head h1 { margin: 0; }
.sec-head p { margin: 2px 0 0; }
.sec-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--gold);
           background: rgba(255, 201, 74, 0.1); border: 1px solid rgba(255, 201, 74, 0.25); }
.sec-ico .ico { width: 22px; height: 22px; }

/* small cards */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.grid2 > .card { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.kpi { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
       background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(140, 170, 230, 0.12); border-left: 3px solid var(--tone-a); }
.kpi-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--tone-a); background: rgba(255, 255, 255, 0.05); }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-body span { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-body b { font-family: "Lilita One", "Nunito", sans-serif; font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-body em { font-style: normal; font-size: 11px; color: var(--muted); }

/* charts and empty states */
svg.chart { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.empty { display: flex; align-items: center; gap: 14px; padding: 22px; border-radius: 14px; color: var(--muted);
         background: rgba(255, 255, 255, 0.025); border: 1px dashed rgba(140, 170, 230, 0.22); margin: 6px 0 10px; }
.empty .ico { width: 34px; height: 34px; flex: none; opacity: 0.7; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }
.empty span { font-size: 13px; }

/* tables */
.gold-text { color: var(--gold); font-weight: 800; }
.rank-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 800; font-size: 13px;
          background: rgba(140, 170, 230, 0.12); color: var(--text); }
.rank-n.r1 { background: linear-gradient(#ffe08a, #e0a52a); color: #3a2800; }
.rank-n.r2 { background: linear-gradient(#eef2f8, #a9b4c6); color: #232a36; }
.rank-n.r3 { background: linear-gradient(#f0b27a, #b86b2c); color: #2e1606; }

@media (max-width: 1100px) { .strip { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .strip { grid-template-columns: 1fr; } .tile b { font-size: 34px; } }
/* characters */
.pill.bad { background: rgba(255, 107, 94, 0.15); color: var(--red); margin-left: 4px; }
h1 .pill { vertical-align: middle; font-family: "Nunito", sans-serif; }
label.tick { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }
.items { display: flex; flex-wrap: wrap; gap: 6px; }
.item { background: var(--glass-soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 13px; }
details summary { cursor: pointer; color: var(--gold); font-family: "Lilita One", "Nunito", sans-serif; font-size: 18px; margin: 18px 0 8px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 14px 0 0; }
.filters input[name=q] { flex: 1 1 220px; }
/* trades and gem cards: same-IP rows */
tr.flagged td { background: rgba(255, 90, 90, 0.08); }
