/* MeckiCraft: Minecraft blocks meet the Imperium. Dark deepslate, gold trim, crimson banners. */
:root {
  --bg: #1b1b21;
  --text: #ece6d6;
  --muted: #a9a191;
  --gold: #f2c14e;
  --gold-dark: #b8860b;
  --gold-deep: #6e4f06;
  --crimson: #b3263a;
  --crimson-dark: #6a1220;
  --purple: #4b2a6b;
  --green: #7bc043;
  --red: #ff6b5e;
  --outline: #0b0b0e;
  --edge-light: #55555f;
  --edge-dark: #111115;
  --field: #0e0e12;
  --imperial: "Cinzel", "Trajan Pro", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg) url("../img/deepslate.c38b94c45322.svg") repeat;
  background-size: 64px 64px;
  image-rendering: pixelated;
}
img, svg { image-rendering: pixelated; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffe08a; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--field);
  border: 2px solid #3a3a44;
  padding: 0 .35em;
  color: #fff;
  white-space: nowrap;
}

/* Imperial headings: Roman capitals, gold, with Minecraft's hard text shadow. */
h1, h2, h3, .brand {
  font-family: var(--imperial);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  line-height: 1.25;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 .6rem; }
h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

.px-icon { width: 2rem; height: auto; flex: none; vertical-align: middle; }
.px-icon.big { width: 4rem; }

/* --- header & footer: obsidian with a gold and crimson trim --- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .7rem clamp(1rem, 4vw, 2rem);
  background: #150f1e url("../img/obsidian.98840dc2e442.svg") repeat; background-size: 64px 64px;
  border-bottom: 4px solid var(--gold-dark);
  box-shadow: 0 4px 0 var(--crimson-dark), 0 8px 0 rgba(0, 0, 0, .45);
}
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; text-decoration: none; }
.brand:hover { color: var(--gold); }
.site-header nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.site-header nav > a:not(.button) { color: var(--text); text-decoration: none; padding: .3rem .5rem; font-weight: 600; }
.site-header nav > a:not(.button):hover { color: var(--gold); }
.site-header nav form { margin: 0; }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.site-footer {
  text-align: center; padding: 1.2rem 1rem; color: var(--muted); font-size: .9rem;
  background: #150f1e url("../img/obsidian.98840dc2e442.svg") repeat; background-size: 64px 64px;
  border-top: 4px solid var(--gold-dark);
}
.site-footer a { color: var(--muted); }

/* --- panels: polished stone in a gold frame, like an imperial inventory --- */
.card {
  position: relative;
  background: #2f2f37 url("../img/stone.3a6f749b0639.svg") repeat; background-size: 64px 64px;
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 var(--edge-light), inset -3px -3px 0 var(--edge-dark), 0 0 0 3px var(--gold-dark), 0 0 0 6px var(--outline), 6px 10px 0 6px rgba(0, 0, 0, .35);
  padding: 1.4rem 1.6rem;
  margin: 6px 6px 2rem;
  overflow-x: auto;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card > h1:first-child, .card > h2:first-child { display: flex; align-items: center; gap: .6rem; }
.prose h2 { margin-top: 1.4rem; }

/* --- buttons: Minecraft's bevelled blocks; gold for the main action --- */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1rem/1 system-ui, sans-serif;
  padding: .75rem 1.2rem; min-height: 44px;
  cursor: pointer; text-decoration: none;
  color: #2b1c02; text-shadow: 1px 1px 0 rgba(255, 245, 200, .5);
  background: linear-gradient(#f7d06b, #d9a52e);
  border: 3px solid var(--outline);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .45), inset -3px -4px 0 rgba(0, 0, 0, .3);
}
.button:hover { background: linear-gradient(#ffe08a, #e8b640); color: #2b1c02; }
.button:active { box-shadow: inset -3px -3px 0 rgba(255, 255, 255, .3), inset 3px 4px 0 rgba(0, 0, 0, .3); }
.button:focus-visible, button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.button.secondary { color: #fff; text-shadow: 2px 2px 0 #333; background: linear-gradient(#8b8b8b, #6b6b6b); }
.button.secondary:hover { background: linear-gradient(#9aa3d6, #7680b8); color: #fff; }
.button.danger { color: #fff; text-shadow: 2px 2px 0 #3d0a12; background: linear-gradient(#c83a4c, var(--crimson)); }
.button.danger:hover { background: linear-gradient(#dc4c5e, #c52f43); color: #fff; }
.button.small { padding: .45rem .8rem; min-height: 36px; font-size: .9rem; }
button.link { background: none; border: 0; color: var(--text); cursor: pointer; font: 600 1rem system-ui, sans-serif; padding: .3rem .5rem; }
button.link:hover { color: var(--gold); }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* --- forms: Minecraft text fields --- */
form > div { margin-bottom: 1.1rem; }
label { display: block; font-weight: 700; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: .65rem .75rem; font: inherit; color: #fff;
  background: var(--field); border: 3px solid #8a8a8a; border-radius: 0;
  box-shadow: inset 2px 2px 0 #000;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus { border-color: var(--gold); outline: none; }
input::placeholder { color: #6f6f78; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--gold-dark); vertical-align: middle; margin-right: .4rem; }
label:has(input[type=checkbox]) { display: inline; font-weight: normal; }
.helptext { display: block; color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: .3rem 0; font-weight: 600; }

/* --- messages: like in-game toasts --- */
.messages { list-style: none; padding: 0; margin: 0 0 1.6rem; }
.messages li {
  padding: .8rem 1rem; margin-bottom: .6rem;
  background: rgba(12, 12, 16, .92); border: 3px solid var(--outline); border-left: 8px solid var(--gold-dark);
  box-shadow: inset 2px 2px 0 #3a3a44;
}
.messages .success { border-left-color: var(--green); }
.messages .error { border-left-color: var(--red); }
.messages .warning { border-left-color: var(--gold); }
.notice.warning {
  background: rgba(110, 79, 6, .35); border: 3px solid var(--gold-dark); padding: .8rem 1rem; margin-bottom: 1.2rem;
}

/* --- badges, tables, details --- */
.badge {
  display: inline-block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: .15rem .5rem; margin-left: .4rem; color: #fff;
  background: #4a4a55; border: 2px solid var(--outline);
}
.badge.approved { background: #3f7a22; }
.badge.pending { background: var(--gold-deep); }
.badge.rejected, .badge.banned { background: var(--crimson); }
.count { font-size: 1rem; color: var(--muted); font-family: system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-shadow: none; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--gold); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.table th, .table td { padding: .6rem .5rem; border-bottom: 2px solid #1f1f25; vertical-align: middle; }
.table tbody tr:hover { background: rgba(242, 193, 78, .06); }
form.decide { display: flex; gap: .4rem; align-items: center; margin: 0; min-width: 400px; }
form.decide input { flex: 1; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0 0 1.2rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.address { overflow-wrap: anywhere; font: 800 clamp(1.1rem, 3vw, 1.8rem)/1.2 ui-monospace, Consolas, monospace; color: #fff; text-shadow: 2px 2px 0 #000; margin: .3rem 0; }

/* --- home: imperial banner, server cards, features, steps --- */
.hero {
  text-align: center; padding: 2.6rem 1rem 2.2rem; margin: 6px 6px 2.4rem;
  background:
    linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .45)),
    linear-gradient(135deg, var(--crimson-dark), var(--crimson) 45%, var(--purple));
  border: 3px solid var(--outline);
  box-shadow: inset 0 0 0 3px var(--gold-dark), inset 0 0 0 6px var(--outline), 0 0 0 3px var(--gold-dark), 0 0 0 6px var(--outline);
}
.hero .crowns { display: flex; justify-content: center; gap: 1rem; margin-bottom: .6rem; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 4rem); margin-bottom: .2rem; }
.hero .motto { font-family: var(--imperial); letter-spacing: .2em; text-transform: uppercase; color: #fff3cf; margin: 0 0 1rem; }
.hero .lead { max-width: 40rem; margin: 0 auto; color: #f3e9d2; }
.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); margin-bottom: 2rem; }
.grid > .card { margin: 6px; }
.server-card .version { color: var(--muted); font-size: .9rem; margin: 0; }
.copy-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); margin: 0; padding: 0; list-style: none; }
.features li { display: flex; gap: .8rem; align-items: flex-start; background: rgba(0, 0, 0, .25); border: 2px solid #1f1f25; padding: .8rem; }
.features strong { display: block; color: var(--gold); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: .2rem 0 1rem 3.2rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  font: 800 1.1rem/1 var(--imperial); color: #2b1c02;
  background: linear-gradient(#f7d06b, #d9a52e); border: 3px solid var(--outline);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .45), inset -2px -3px 0 rgba(0, 0, 0, .3);
}
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.4rem; }
.choices .card { margin: 6px; }

@media (max-width: 600px) {
  .site-header { justify-content: center; }
  .card { padding: 1.1rem 1rem; margin-left: 6px; margin-right: 6px; }
  main { padding: 1.2rem .6rem 2rem; }
  .features li { flex-direction: column; }
  form.decide { min-width: 0; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: filter .1s; }
}

/* --- tutorial and guide --- */
.commands { padding-left: 1.2rem; }
.commands li { margin-bottom: .45rem; }
.rules { padding-left: 1.2rem; }
.swatch { font-weight: 800; padding: 0 .35em; border: 2px solid var(--outline); color: #111; }
.swatch.own { background: #50dc5a; }
.swatch.foreign { background: #e63c3c; color: #fff; }
.swatch.free { background: #f5c83c; }
.name-admin { color: #ff5555; font-weight: 800; }
.name-mod { color: #55c8ff; font-weight: 800; }
.name-neuling { color: #aaaaaa; }
.tutorial-nav { display: none; }
.tutorial.js .tutorial-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 6px 2rem; }
.step-count { color: var(--muted); font-weight: 700; }
.progress { display: none; }
.tutorial.js .progress { display: block; height: 12px; margin: 0 6px 1.6rem; background: var(--field); border: 3px solid var(--outline); }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(#7bc043, #4e8a26); transition: width .25s; }
.tutorial-intro { margin-bottom: 1rem; }
button[disabled] { opacity: .45; cursor: default; }

/* --- Moderation: overview, player profile, console --- */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-head h1, .card-head h2 { margin-bottom: 0; }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); margin: 1rem 0; }
.tile { background: #1f1f25; border: 3px solid #3a3844; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.tile .value { font-size: 1.35rem; font-weight: 800; color: var(--gold); overflow-wrap: anywhere; }
.tile .label { font-size: .85rem; color: var(--muted); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin-bottom: 0; }
.ranking { margin: .4rem 0 0; padding-left: 1.4rem; }
.ranking li { margin: .25rem 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 1rem 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.plus { color: #7ee07e; }
.minus { color: #ff7a7a; }
.name-moderator { color: #55c8ff; font-weight: 800; }
.actions { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.actions form { background: #1f1f25; border: 3px solid #3a3844; padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.actions h3 { margin: 0; }
.actions input, .actions select { width: 100%; }
select { font: inherit; padding: .55rem .7rem; background: #101016; color: var(--text); background: var(--field); border: 3px solid #3a3844; }
form.search { display: flex; gap: .5rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
form.search input { flex: 1; min-width: 180px; }
.table a { color: inherit; }
.facts dd { min-width: 0; }
.facts code { word-break: break-all; white-space: normal; }
@media (max-width: 640px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { margin-top: .4rem; }
  /* Wide tables scroll inside their card instead of sticking out. */
  .table { display: block; overflow-x: auto; }
}

/* --- live console: a terminal with the server log and a prompt --- */
.terminal { background: #0c0c10; border: 3px solid #3a3844; box-shadow: inset 0 0 0 2px #000; margin: 1rem 0; }
.terminal-output {
  height: min(60vh, 520px); overflow-y: auto; padding: .7rem .9rem;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: .85rem; line-height: 1.45;
  color: #c9d1c9; white-space: pre-wrap; overflow-wrap: anywhere;
}
.terminal-output .line.warn { color: #f5c83c; }
.terminal-output .line.error { color: #ff7a7a; }
.terminal-output .line.command { color: #7ee07e; margin-top: .4rem; }
.terminal-output .line.answer { color: #ffffff; margin-bottom: .4rem; }
.terminal-input { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .45rem .9rem; border-top: 2px solid #2a2932; background: #111116; }
.terminal-input .prompt { color: #7ee07e; font-family: Consolas, "Courier New", monospace; font-weight: 800; }
.terminal-input input[type=text] {
  flex: 1; background: transparent; border: 0; padding: .35rem 0; color: #ffffff;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: .95rem;
}
.terminal-input input[type=text]:focus { outline: none; border: 0; }

