/* ReMine · web panel. One stylesheet, no framework; colours are tokens, so both themes are one set of rules. */
:root {
  --bg: #0e1014;
  --bg-2: #13161c;
  --panel: #171a21;
  --panel-2: #1d212a;
  --line: #262b36;
  --line-2: #323846;
  --text: #e7e9ee;
  --muted: #929aab;
  --faint: #6b7385;
  --accent: #f5c542;
  --accent-ink: #1c1603;
  --green: #4fce64;
  --red: #ff5f5f;
  --orange: #ffa53a;
  --blue: #5aa9ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-s: 9px;
  --mc-bg: #1a1c21;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f4f7;
    --bg-2: #eceef2;
    --panel: #ffffff;
    --panel-2: #f6f7f9;
    --line: #e2e5eb;
    --line-2: #d4d8e0;
    --text: #1b1e25;
    --muted: #5f6778;
    --faint: #8a91a1;
    --accent: #e0a800;
    --accent-ink: #1c1603;
    --green: #1f9d3a;
    --red: #d93636;
    --orange: #c46a00;
    --blue: #1f6fd1;
    --shadow: 0 10px 30px rgba(20, 30, 50, .12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 15px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }
.noscript { text-align: center; padding: 40px; }

/* --- Boot and sign-in ------------------------------------------------------------------------ */
.boot { min-height: 100%; display: grid; place-items: center; }
.boot-logo { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 22px; opacity: .8; }
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(245, 197, 66, .12), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(79, 206, 100, .10), transparent 60%);
}
.login-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; margin: 14px 0 4px; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: 30px; height: 30px; }
.brand b { color: var(--accent); }

/* --- Shell ----------------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px; background: var(--bg-2); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 4px 10px 16px; font-size: 17px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--muted); text-decoration: none; font-weight: 550;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 19px; height: 19px; flex: none; }
.sidebar .spacer { flex: 1; }
.me { padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.me b { font-weight: 650; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h2 { flex: 1; min-width: 160px; }
.content { padding: 24px 28px 60px; display: grid; gap: 18px; align-content: start; max-width: 1280px; width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 650; }
.chip.warn { border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); color: var(--orange); }
.chip.bad { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); color: var(--red); }
.chip.good { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); color: var(--green); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }

/* --- Cards and forms --------------------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card > header h3 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > select, .row > input { width: auto; flex: 1 1 160px; }
.grow { flex: 1; }
.stack { display: grid; gap: 10px; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 600; cursor: pointer; transition: transform .05s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, var(--panel-2)); border-color: color-mix(in srgb, var(--red) 45%, var(--line-2)); color: var(--red); }
.btn.good { background: color-mix(in srgb, var(--green) 14%, var(--panel-2)); border-color: color-mix(in srgb, var(--green) 45%, var(--line-2)); color: var(--green); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.error-text { color: var(--red); font-size: 14px; min-height: 1.2em; }
.note { font-size: 13px; color: var(--muted); }
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--orange); background: var(--panel-2);
  border-radius: var(--radius-s); padding: 12px 14px; font-size: 14px;
}
.callout.red { border-left-color: var(--red); }
.callout.green { border-left-color: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* --- Minecraft formatted text ------------------------------------------------------------------ */
.mc {
  display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--mc-bg); color: #fff;
  font-weight: 600; font-size: 13px; letter-spacing: .01em; line-height: 1.5; white-space: nowrap;
}
.mc-plain { background: none; padding: 0; color: inherit; }
.mc-l { font-weight: 800; }
.mc-o { font-style: italic; }
.mc-screen {
  background: #2b2723 linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .35));
  border-radius: var(--radius-s); padding: 22px; text-align: center; color: #fff; white-space: pre-wrap;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; line-height: 1.7;
  border: 1px solid #000; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06);
}

/* --- Players --------------------------------------------------------------------------------- */
.search { position: relative; }
.search input { padding-left: 42px; font-size: 16px; height: 48px; border-radius: 12px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--faint); }
.players { display: grid; gap: 8px; }
.player {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left; width: 100%;
}
.player:hover, .player:focus-visible { border-color: var(--line-2); background: var(--panel-2); outline: none; }
.player.selected { border-color: var(--accent); }
.avatar {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  color: #fff; text-transform: uppercase; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18);
}
.player .name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; font-size: 16px; }
.player .meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.player .badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.match { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 20; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); z-index: 21; background: var(--bg);
  border-left: 1px solid var(--line); overflow-y: auto; animation: slide .2s ease-out; box-shadow: var(--shadow);
}
.drawer > header {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 14px; align-items: center; padding: 18px 22px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.drawer > header .title { flex: 1; min-width: 0; }
.drawer > header h2 { overflow-wrap: anywhere; }
.drawer .body { padding: 20px 22px 60px; display: grid; gap: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.fact span { display: block; font-size: 12px; color: var(--muted); }
.fact b { font-weight: 650; overflow-wrap: anywhere; }
.list { display: grid; gap: 8px; }
.item {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
.item .grow { flex: 1; min-width: 200px; display: grid; gap: 3px; }
.item small { color: var(--muted); }
.history { width: 100%; border-collapse: collapse; font-size: 13px; }
.history th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.history td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.history tr.revoked td { color: var(--faint); }
.table-wrap { overflow-x: auto; }
.similar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.similar button { cursor: pointer; }

/* --- Staff ----------------------------------------------------------------------------------- */
.staff-row { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(140px, 1fr) minmax(170px, 1.2fr) auto; gap: 12px; align-items: center; }
.staff-row .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.staff-row .who button { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.staff-row .who button:hover { color: var(--accent); }

/* --- Maintenance ------------------------------------------------------------------------------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 650; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 52px; height: 30px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- Worlds and packs --------------------------------------------------------------------------- */
.drop {
  border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; display: grid; gap: 6px; justify-items: center;
}
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop svg { width: 34px; height: 34px; color: var(--faint); }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .2s; }
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.game { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.kept, .reset { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.kept li::marker { color: var(--green); }
.reset li::marker { color: var(--red); }
.fn { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; cursor: pointer; }
.fn:hover { border-color: var(--accent); color: var(--text); }

/* --- Dialogs and toasts ------------------------------------------------------------------------ */
dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--panel); color: var(--text);
  width: min(460px, calc(100% - 28px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog form { padding: 22px; display: grid; gap: 14px; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; width: min(380px, calc(100% - 36px)); }
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); animation: rise .2s ease-out; white-space: pre-line;
}
.toast.bad { border-left-color: var(--red); }
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8, 9, 12, .82); backdrop-filter: blur(6px); text-align: center; padding: 20px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 16px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- Phones ----------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 15; flex-direction: row;
    padding: 6px; border-right: 0; border-top: 1px solid var(--line); justify-content: space-around;
  }
  .sidebar .brand, .sidebar .spacer, .me { display: none; }
  .nav { display: contents; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 6px; flex: 1; }
  .nav a.active { box-shadow: inset 0 3px 0 var(--accent); }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 14px 96px; }
  .player { grid-template-columns: 40px 1fr; }
  .player .badges { grid-column: 1 / -1; justify-content: flex-start; }
  .staff-row { grid-template-columns: 1fr; }
  .drawer .body { padding: 16px 14px 60px; }
}
