:root {
  --bg: #1f1b18;
  --wood: #5b3d22;
  --wood-dark: #2e1e10;
  --wood-light: #8a6039;
  --grass: #3f7a1f;
  --grass-light: #7fcf4a;
  --grass-dark: #1f4010;
  --gold: #ffd84a;
  --text: #f3e9d2;
  --sand: #e2c48a;
  --stone: #c6c6c6;
  --stone-dark: #555555;
  --stone-in: #8b8b8b;
  --ink: #1e1e1e;
  --dark: #2b2b30;
  --dark-edge: #55555c;
  --black: #0e0e10;
  --px: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 26px;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
a:hover { filter: brightness(1.15); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--px); font-weight: 400; line-height: 1.4; margin: 0; }
p { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.section { padding-top: 56px; }
.section:last-of-type { padding-bottom: 72px; }
.section__title { font-size: 20px; color: var(--text); margin-bottom: 28px; }
.muted { color: var(--sand); }
.inline-form { display: inline; margin: 0; }

/* ---------- nawigacja ---------- */
.nav { background: var(--wood-dark); border-bottom: 4px solid #000; }
.nav__inner {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand__logo {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--grass); border: 4px solid; border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light);
  font-family: var(--px); font-size: 18px; color: #fff;
}
.brand__name { font-family: var(--px); font-size: 14px; color: var(--gold); }
.nav__links { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-family: var(--px); font-size: 11px; }
.nav__links > a:not(.btn) { padding: 6px 0; border-bottom: 4px solid transparent; }
.nav__links > a.is-active { color: var(--grass-light); border-bottom-color: var(--grass-light); }

/* ---------- przyciski ---------- */
.btn {
  display: inline-block; cursor: pointer; font-family: var(--px); font-size: 12px; line-height: 1.3;
  padding: 14px 18px; border: 4px solid; text-align: center; color: #fff;
}
.btn--sm { font-size: 10px; padding: 10px 12px; }
.btn--green { background: var(--grass); border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light); }
.btn--stone { background: var(--stone); color: var(--ink); border-color: #fff var(--stone-dark) var(--stone-dark) #fff; }
.btn--amber { background: #9a6a00; border-color: #f0c04a #5a3c00 #5a3c00 #f0c04a; }
.btn--red { background: #a22a1f; border-color: #e87a6e #5a140d #5a140d #e87a6e; }
.btn:active { transform: translateY(2px); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- karty ---------- */
.card { padding: 24px; border: 4px solid; }
.card--wood { background: var(--wood); border-color: var(--wood-light) var(--wood-dark) var(--wood-dark) var(--wood-light); }
.card--stone { background: var(--stone); color: var(--ink); border-color: #fff var(--stone-dark) var(--stone-dark) #fff; }
.card--dark { background: var(--dark); border-color: var(--dark-edge) var(--black) var(--black) var(--dark-edge); }
.card__title { font-size: 15px; margin-bottom: 16px; }
.card--wood .card__title, .card--dark .card__title { color: var(--gold); }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.cols { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.cols > * { flex: 1 1 420px; min-width: 0; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 600px; overflow: hidden; background: #78b6ff; border-bottom: 4px solid #000; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__inner { position: relative; padding-top: 56px; padding-bottom: 80px; }
.hero__panel {
  max-width: 920px; padding: 32px; background: rgba(30, 20, 10, 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border: 4px solid; border-color: var(--wood-light) var(--wood-dark) var(--wood-dark) var(--wood-light);
}
.hero__title { margin-top: 22px; font-size: clamp(22px, 4.5vw, 40px); color: var(--gold); text-shadow: 4px 4px 0 #3b2a00; }
.hero__lead { margin-top: 18px; font-size: 30px; line-height: 1.2; }
.addr {
  margin-top: 26px; padding: 14px 18px; background: #1a1a1a; color: #6bff6b; font-size: 30px; word-break: break-all;
  border: 4px solid; border-color: #000 #4a4a4a #4a4a4a #000;
}
.hero .btn-row { margin-top: 22px; }

/* ---------- adresy serwerów ---------- */
.srvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 24px; align-items: start; }
.srv { margin-top: 22px; }
.srv .addr { margin-top: 10px; }
.srv__head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.srv__name { font-family: var(--px); font-size: 13px; color: var(--gold); }
.srv__copy { margin-top: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: #1a1a1a; border: 3px solid #000; font-family: var(--px); font-size: 11px;
}
.pill__dot { display: inline-block; width: 12px; height: 12px; }
.pill--on { color: #6bff6b; }
.pill--on .pill__dot { background: #6bff6b; }
.pill--off { color: #ff8a7a; }
.pill--off .pill__dot { background: #ff8a7a; }

/* ---------- statystyki ---------- */
.stat { text-align: center; padding: 22px 20px; }
.stat__value { font-family: var(--px); font-size: 24px; color: var(--gold); word-break: break-word; }
.stat__label { margin-top: 12px; font-size: 26px; }

/* ---------- tryby gry ---------- */
.mode { padding: 0; }
.mode__art { height: 120px; border-bottom: 4px solid var(--stone-dark); display: flex; align-items: center; justify-content: center; }
.mode__block { width: 64px; height: 64px; background: rgba(255, 255, 255, 0.28); border: 4px solid rgba(0, 0, 0, 0.45); }
.mode__body { padding: 22px 22px 26px; }
.mode__name { font-size: 15px; }
.mode__desc { margin-top: 14px; font-size: 26px; line-height: 1.15; }
.mode__tag { margin-top: 16px; font-family: var(--px); font-size: 10px; line-height: 1.5; color: var(--grass-dark); }

/* ---------- kroki ---------- */
.step { display: flex; gap: 18px; align-items: flex-start; }
.step__n {
  flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--grass); border: 4px solid; border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light);
  font-family: var(--px); font-size: 18px; color: #fff;
}
.step__title { font-family: var(--px); font-size: 12px; line-height: 1.5; color: var(--gold); }
.step__text { margin-top: 10px; font-size: 25px; line-height: 1.15; }

/* ---------- listy graczy ---------- */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 8px 12px; background: var(--stone-in); color: #111;
  border: 3px solid; border-color: var(--stone-dark) #dcdcdc #dcdcdc var(--stone-dark); font-size: 26px;
}
.row__skin { flex: none; width: 28px; height: 28px; border: 3px solid var(--ink); }
.row__name { flex: 1; min-width: 0; word-break: break-word; }
.row__meta { font-size: 22px; color: #1c1c1c; }
.empty { font-size: 25px; color: #222; }

/* ---------- aktualności ---------- */
.news-item { border-bottom: 3px solid var(--wood-dark); padding-bottom: 16px; }
.news-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-item__date { font-size: 22px; color: var(--sand); }
.news-item__title { margin-top: 4px; font-family: var(--px); font-size: 12px; line-height: 1.5; }
.news-item__text { margin-top: 8px; font-size: 25px; line-height: 1.15; }
.news-full { font-size: 28px; line-height: 1.3; }
.pager { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- zasady ---------- */
.rules { margin: 0; padding: 0; list-style: none; counter-reset: rule; display: flex; flex-direction: column; gap: 12px; }
.rules li { counter-increment: rule; display: flex; gap: 16px; align-items: flex-start; font-size: 28px; line-height: 1.2; }
.rules li::before {
  content: counter(rule); flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--grass); border: 4px solid; border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light);
  font-family: var(--px); font-size: 14px; color: #fff;
}

/* ---------- formularze ---------- */
.form { max-width: 560px; }
.form--wide { max-width: 760px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 8px; font-family: var(--px); font-size: 10px; line-height: 1.5; color: var(--sand); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url],
.field input[type=number], .field textarea, .field select {
  width: 100%; padding: 10px 12px; background: #1a1a1a; color: var(--text);
  border: 3px solid; border-color: #000 var(--dark-edge) var(--dark-edge) #000;
  font-family: 'VT323', monospace; font-size: 26px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field__hint { margin-top: 6px; font-size: 22px; color: var(--sand); }
.check { display: flex; gap: 12px; align-items: center; font-size: 26px; }
.check input { width: 24px; height: 24px; accent-color: var(--grass); }
.form-title { font-size: 16px; color: var(--gold); margin-bottom: 20px; }
.acc { margin: 0 0 14px; border: 3px solid #000; background: rgba(0,0,0,.25); }
.acc > summary { cursor: pointer; list-style: none; padding: 14px 16px; font-family: var(--px); font-size: 13px; color: var(--gold); display: flex; justify-content: space-between; align-items: center; gap: 12px; user-select: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: '+'; font-size: 18px; color: var(--grass-light, #7bd44a); }
.acc[open] > summary::after { content: '\2212'; }
.acc > summary:hover, .acc > summary:focus-visible { background: rgba(255,255,255,.06); outline: none; }
.acc__body { padding: 8px 16px 6px; border-top: 3px solid #000; }
.fieldset { margin: 0 0 26px; padding: 0; border: 0; }
.fieldset legend { padding: 0; margin-bottom: 14px; font-family: var(--px); font-size: 13px; color: var(--gold); }

/* ---------- komunikaty ---------- */
.flashes { padding-top: 24px; }
.alert { padding: 14px 18px; border: 4px solid; margin-bottom: 16px; font-size: 26px; }
.alert--ok { background: #1d3a10; border-color: var(--grass-light); color: #e4ffd0; }
.alert--err { background: #4a1410; border-color: #e87a6e; color: #ffe0da; }
.alert--info { background: #1d2b4a; border-color: #7aa6e8; color: #dbe8ff; }

/* ---------- tabele (admin) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 24px; }
.table th { text-align: left; padding: 10px 12px; font-family: var(--px); font-size: 9px; font-weight: 400; color: var(--sand); border-bottom: 3px solid var(--black); }
.table td { padding: 10px 12px; border-bottom: 3px solid var(--black); vertical-align: middle; }
.table .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 8px; font-family: var(--px); font-size: 9px; background: #1a1a1a; border: 2px solid #000; }
.badge--admin { color: var(--gold); }

.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0 28px; }
.subnav__item {
  padding: 10px 16px; font-family: var(--px); font-size: 11px; background: var(--dark); color: var(--text);
  border: 3px solid; border-color: var(--dark-edge) var(--black) var(--black) var(--dark-edge);
}
.subnav__item.is-active { background: var(--grass); border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light); color: #fff; }

.meter { height: 20px; background: #111; border: 3px solid #000; }
.meter__fill { height: 100%; background: var(--grass); border-right: 3px solid var(--grass-light); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 26px; }
.kv dt { color: var(--sand); }
.kv dd { margin: 0; word-break: break-word; }

.page-head { background: var(--dark); border-bottom: 4px solid #000; padding: 44px 0; }
.page-head h1 { font-size: 26px; color: var(--gold); text-shadow: 3px 3px 0 #3b2a00; }
.page-head p { margin-top: 14px; font-size: 28px; }

/* ---------- stopka ---------- */
.grass-strip { height: 24px; background: #5da130; border-top: 4px solid #000; }
.footer { background: #4a3018; border-bottom: 4px solid #000; }
.footer__inner { display: flex; gap: 32px; flex-wrap: wrap; justify-content: space-between; padding-top: 36px; padding-bottom: 36px; }
.footer__col { flex: 1 1 220px; font-size: 26px; line-height: 1.5; }
.footer__col a, .footer__col span { display: block; }
.footer__title { font-family: var(--px); font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.footer__label { font-family: var(--px); font-size: 11px; color: var(--sand); }
.footer__col p { font-size: 24px; line-height: 1.15; }

/* ---------- responsywność ---------- */
@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .hero__panel { padding: 20px; }
  .section { padding-top: 40px; }
  .nav__links { gap: 10px 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}

/* ---------- panel sterowania serwerem (admin) ---------- */
.dash { display: grid; grid-template-columns: clamp(300px, 22vw, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.dash__side { padding: 18px; position: sticky; top: 16px; }
.dash__label { font-family: var(--px); font-size: 10px; color: var(--sand); margin-bottom: 14px; }
.dash__nav, .dash__servers { display: flex; flex-direction: column; gap: 10px; }
.dash__servers { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 3px solid #000; }
.dash__link, .dash__srv {
  display: block; padding: 12px 14px; background: #3a3a42; color: var(--text); font-size: 26px;
  border: 3px solid; border-color: #6a6a74 #1a1a1e #1a1a1e #6a6a74;
}
.dash__srv { font-size: 22px; padding: 8px 12px; }
.dash__link:hover, .dash__srv:hover { background: #46464f; filter: none; }
.dash__link.is-active, .dash__srv.is-active { background: var(--grass); border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light); color: #fff; }
.dash__main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.dash__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash__title { font-size: 18px; color: var(--ink); }
.dash__addr { margin-top: 10px; font-size: 24px; color: #333; word-break: break-all; }
.dash__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.dash__stats .card { padding: 18px; }
.meter__row { display: flex; justify-content: space-between; gap: 10px; font-size: 24px; margin-bottom: 12px; }
.meter__row b { font-weight: 400; color: var(--gold); text-align: right; }
.meter { height: 24px; background: #0e0e0e; border: 3px solid #000; }
.meter i { display: block; height: 100%; background: var(--grass); border-right: 3px solid var(--grass-light); min-width: 0; }
.console { background: #101010; border-color: #55555c #000 #000 #55555c; }
.console__title { font-size: 11px; color: #ffb75a; margin-bottom: 16px; }
.console__log {
  max-height: 260px; overflow-y: auto; font-size: 24px; line-height: 1.35; color: #5dff6a;
  word-break: break-word;
}
.console__log div { padding: 2px 0; }
.console__empty { color: #9a9a9a; }
.console__form { display: flex; gap: 12px; margin-top: 16px; }
.console__form input { flex: 1; min-width: 0; padding: 12px 14px; font: inherit; font-size: 24px; background: #1c1c1c; color: var(--text); border: 3px solid; border-color: #000 #55555c #55555c #000; }
.console__hint { margin-top: 12px; font-size: 20px; color: #9a9a9a; }
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { position: static; }
  .dash__nav { flex-direction: row; flex-wrap: wrap; }
  .dash__stats { grid-template-columns: 1fr; }
}

/* czytelność tekstu na przezroczystym panelu w banerze */
.hero__panel .hero__lead, .hero__panel .srv__name, .hero__panel .meter__row { text-shadow: 2px 2px 0 rgba(0, 0, 0, .75); }

/* zegary CPU / RAM obok serwera */
.srv--res { display: flex; align-items: flex-start; gap: 14px; }
.srv__main { flex: 1 1 auto; min-width: 0; }
.srv__gauges { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; width: 92px; }
.gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gauge__ring {
  --c: var(--grass-light);
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(0, 0, 0, .55) 0);
  box-shadow: 0 0 0 3px #000;
}
.gauge--warn .gauge__ring { --c: #ffb23a; }
.gauge--bad .gauge__ring { --c: #ff5a4a; }
.gauge__ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: #1b1814; }
.gauge__val { position: relative; font-family: var(--px); font-size: 9px; color: var(--text); }
.gauge__cap { margin-top: 5px; line-height: 1; }
.gauge__cap b { display: block; font-weight: 400; font-family: var(--px); font-size: 8px; color: var(--gold); margin-bottom: 3px; }
.gauge__cap span { display: block; font-size: 16px; color: var(--sand); white-space: nowrap; }
.srv--res .addr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(18px, 2vw, 24px); }

/* ---------- edycja treści na stronie (administrator) ---------- */
.ed-only { display: none !important; }
body.edit-on .ed-only { display: inline-block !important; }
.ed-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; padding: 12px 16px; cursor: pointer;
  font-family: var(--px); font-size: 10px; color: #fff; background: #3a3a42;
  border: 3px solid; border-color: #6a6a74 #1a1a1e #1a1a1e #6a6a74; box-shadow: 0 4px 0 rgba(0, 0, 0, .5);
}
body.edit-on .ed-toggle { background: var(--grass); border-color: var(--grass-light) var(--grass-dark) var(--grass-dark) var(--grass-light); }
body.edit-on [data-edit] { outline: 2px dashed var(--gold); outline-offset: 3px; cursor: text; min-width: 24px; }
body.edit-on [data-edit]:hover { outline-color: #fff; background: rgba(255, 216, 74, .12); }
body.edit-on [data-edit$=":color"] { cursor: pointer; }
body.edit-on [data-edit].is-editing { outline: 3px solid var(--gold); background: rgba(0, 0, 0, .35); color: inherit; }
body.edit-on [data-edit][data-ml="1"] { white-space: pre-wrap; }
body.edit-on .mode__tag:empty { display: block; }
body.edit-on .mode__tag:empty::before { content: '(dodaj tag)'; opacity: .55; }
body.edit-on [data-edit]:empty::before { content: '(kliknij, aby edytować)'; opacity: .55; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 12px; }
.ed-bar__hint { font-size: 18px; color: var(--sand); }
.ed-del {
  position: absolute; top: 8px; right: 8px; z-index: 5; width: 34px; height: 34px; cursor: pointer;
  font: 22px/1 var(--px); color: #fff; background: #a52a22; border: 3px solid; border-color: #e0605a #5a1410 #5a1410 #e0605a;
}
.mode, .rules li, .news-item, .card { position: relative; }
.ed-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.uc { text-transform: uppercase; }
.news-full[data-edit], .step__text[data-edit], .mode__desc[data-edit] { white-space: pre-line; }

/* panel administracji: pełna szerokość okna */
body.is-admin .container { max-width: none; padding-left: clamp(16px, 2.5vw, 48px); padding-right: clamp(16px, 2.5vw, 48px); }
.dash__link, .dash__srv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .dash__link, .dash__srv { white-space: normal; } }

.seo-links { padding-top: 0; }
.seo-links__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 24px; }
.seo-links__list a { color: var(--sand); text-decoration: underline; }
.seo-links__list a:hover { color: var(--gold); }
.footer__copy { padding-top: 14px; padding-bottom: 22px; border-top: 3px solid rgba(0,0,0,.35); font-size: 20px; color: var(--sand); text-align: center; }

.set-panes { padding: 24px 28px; }
.set-pane[hidden] { display: none; }
.set-pane > .card__title { margin-bottom: 12px; }
.set-pane .acc__body { border-top: 0; padding: 0; }
.dash__link { display: block; text-decoration: none; }

/* bezpieczeństwo */
.sec-stat { padding: 14px; text-align: center; }
.sec-stat__n { font-family: var(--px); font-size: 22px; color: var(--gold); }
.sec-stat__l { font-size: 20px; margin-top: 6px; }
.sec-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.sec-filter input[type=text], .sec-filter select { width: auto; min-width: 180px; }
.sec-table td { font-size: 20px; }
tr.sec-bad td { background: rgba(176, 40, 30, .18); }
@media (max-width: 860px) { .dash__stats[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }