@font-face { font-family: "Monocraft"; src: url("/fonts/monocraft.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Monocraft"; src: url("/fonts/monocraft-bold.ttf"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-400.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-600.ttf"); font-weight: 600; font-display: swap; }

:root {
  --text: #f0f0f0;
  --muted: #b4b4b4;
  --dim: #8a8a8a;
  --panel: rgba(0, 0, 0, .55);
  --line: #3a3a3a;
  --green: #55ff55;
  --green-dark: #2f8a2f;
  --mc-gray: #6f6f6f;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #1a1410 url("/dirt.png") repeat;
  background-size: 64px 64px;
  image-rendering: pixelated;
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

img { image-rendering: pixelated; }

h1, h2, .row-name, .mc-button, .opened, dt, code {
  font-family: "Monocraft", ui-monospace, monospace;
  text-shadow: 2px 2px 0 #2a2a2a;
}

.page { width: min(1100px, 100% - 32px); margin: 0 auto; padding: 72px 0 40px; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 96px;
}
.opened { margin: 0 0 14px; color: var(--green); font-size: 14px; }
.countdown { display: flex; gap: 10px; margin: 0 0 22px; }
.countdown div { min-width: 64px; padding: 8px 10px 6px; border: 2px solid #111; background: rgba(0, 0, 0, .6); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .12); text-align: center; }
.countdown b { display: block; font-family: "Monocraft", monospace; font-size: 26px; line-height: 1.1; color: var(--green); text-shadow: 2px 2px 0 #1d3d1d; }
.countdown span { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0 0 18px; font-size: clamp(26px, 3.2vw, 38px); hyphens: none; font-weight: 700; line-height: 1.15; }
.sub { max-width: 46ch; margin: 0 0 30px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.text-link { color: var(--muted); text-underline-offset: 4px; }
.text-link:hover { color: var(--text); }

.server-row {
  display: flex;
  gap: 14px;
  padding: 8px;
  border: 3px solid #c6c6c6;
  background: rgba(0, 0, 0, .7);
  font-family: "Monocraft", ui-monospace, monospace;
  font-size: 19px;
  line-height: 1.4;
}
.server-row img { width: 84px; height: 84px; flex: none; }
.row-text { min-width: 0; flex: 1; }
.row-top { display: flex; justify-content: space-between; gap: 12px; }
.row-name { color: #fff; }
.row-count { display: flex; align-items: center; gap: 8px; color: var(--dim); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.bars i { width: 4px; background: #555; }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 11px; }
.bars i:nth-child(4) { height: 14px; }
.bars i:nth-child(5) { height: 18px; }
.bars.up i { background: var(--green); }
.motd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motd b { font-weight: 700; }
.c2 { color: #00aa00; }
.c7 { color: #aaaaaa; }
.c8 { color: #555555; }

.mc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 22px;
  border: 2px solid #111;
  background: var(--mc-gray);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .28), inset -2px -3px 0 rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.mc-button:hover { background: #7f8fbf; outline: 2px solid #fff; outline-offset: -4px; }
.mc-button.primary { background: var(--green-dark); }
.mc-button.primary:hover { background: #3aa53a; }
.mc-button:active { transform: translateY(1px); }
.mc-button:disabled { opacity: .6; cursor: default; }

h2 { margin: 0 0 22px; font-size: 24px; font-weight: 700; }

.about { margin-bottom: 96px; }
.about dl { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 56px; margin: 0; }
.about dt { margin-bottom: 6px; color: var(--green); font-size: 16px; }
.about dd { margin: 0; max-width: 48ch; color: var(--muted); }

.apply-wrap {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 72px;
  scroll-margin-top: 24px;
}
.rules ul { margin: 0; padding: 0; list-style: none; }
.rules li { position: relative; margin-bottom: 14px; padding-left: 24px; color: var(--muted); }
.rules li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; background: var(--green); }
.rules-note { margin-top: 28px; color: var(--dim); font-size: 14px; }

.panel { padding: 28px; border: 2px solid var(--line); background: var(--panel); }
.apply { display: grid; gap: 20px; }
.apply h2 { margin-bottom: 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.hint { margin: -2px 0 2px; color: var(--muted); font-size: 14px; }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #a0a0a0;
  border-radius: 0;
  background: #000;
  color: #fff;
  font: inherit;
  outline: 0;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #fff; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.check input { width: 18px; height: 18px; accent-color: var(--green-dark); }
.apply .mc-button { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-note { min-height: 22px; margin: 0; color: var(--muted); font-size: 15px; }
.form-note.good { color: var(--green); }
.form-note.bad { color: var(--red); }

.join { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 56px; scroll-margin-top: 24px; }
.join-box p { margin: 0 0 18px; color: var(--muted); }
.address-row, .inline { display: flex; gap: 10px; }
.address-row code { flex: 1; display: flex; align-items: center; padding: 8px 12px; border: 2px solid #a0a0a0; background: #000; font-size: 17px; overflow-wrap: anywhere; }
.status .form-note { margin-top: 12px; }

.tickets { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; align-items: start; margin-bottom: 56px; scroll-margin-top: 24px; }
.ticket { display: grid; gap: 18px; }
.ticket h2 { margin-bottom: 0; }
.lead { margin: -6px 0 0; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #a0a0a0;
  border-radius: 0;
  background: #000;
  color: #fff;
  font: inherit;
  outline: 0;
}
select:focus { border-color: #fff; }
input::placeholder { color: #8a8a8a; }
.ticket .mc-button { justify-self: start; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); }
.chat { display: flex; flex-direction: column; gap: 14px; width: min(720px, 100%); max-height: calc(100dvh - 32px); background: #141210; }
.chat-tools { display: flex; align-items: center; gap: 8px; }
.mc-button.small { min-height: 32px; padding: 4px 10px; font-size: 12px; }
body.locked { overflow: hidden; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.chat-head h2 { margin: 0 0 4px; }
.chat-meta { margin: 0; color: var(--muted); font-size: 14px; }
.chip { padding: 4px 10px; border: 2px solid #111; background: var(--green-dark); color: #fff; font-family: "Monocraft", monospace; font-size: 12px; white-space: nowrap; }
.chip.resolved { background: var(--mc-gray); }
.chat-log { display: flex; flex-direction: column; gap: 10px; height: 420px; min-height: 160px; padding: 14px; overflow-y: auto; border: 2px solid #a0a0a0; background: rgba(0, 0, 0, .65); }
.msg { max-width: 78%; padding: 9px 12px; border: 2px solid #111; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; margin-bottom: 3px; color: rgba(255, 255, 255, .6); font-family: "Monocraft", monospace; font-size: 11px; }
.msg.player { align-self: flex-end; background: #2c5d2c; }
.msg.staff { align-self: flex-start; background: #3b3b3b; }
.msg.staff small { color: var(--green); }
.chat-system { align-self: center; color: var(--dim); font-size: 13px; }
.chat-send { display: flex; gap: 10px; }
.chat-send input { flex: 1; min-width: 0; }

.my-tickets ul { margin: 0 0 16px; padding: 0; list-style: none; }
.my-tickets li + li { margin-top: 8px; }
.my-tickets button.ticket-link {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 2px solid var(--line); background: rgba(0, 0, 0, .4); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.my-tickets button.ticket-link:hover, .my-tickets button.ticket-link.active { border-color: #fff; }
.my-tickets .tid { font-family: "Monocraft", monospace; font-size: 14px; }
.my-tickets .ttype { display: block; color: var(--muted); font-size: 13px; }
.my-tickets .empty { color: var(--muted); font-size: 14px; }

.app-card, .mini-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.mini-card { margin-top: 16px; padding: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, .4); }
.app-card img, .mini-card img { width: 72px; height: 72px; image-rendering: pixelated; border: 2px solid #111; }
.mini-card img { width: 48px; height: 48px; }
.state { margin: 0 0 4px; font-family: "Monocraft", monospace; font-size: 22px; font-weight: 700; text-shadow: 2px 2px 0 #2a2a2a; }
.mini-card .state { font-size: 17px; }
.state.waiting { color: #ffd84d; }
.state.approved { color: var(--green); }
.state.declined { color: var(--red); }
.state-text { margin: 0; color: var(--muted); }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.card-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card-actions code { padding: 8px 12px; border: 2px solid #a0a0a0; background: #000; font-size: 16px; }
.link-box { width: 100%; padding: 14px; border: 2px dashed #5865f2; background: rgba(88, 101, 242, .12); }
.link-title { margin: 0 0 4px; font-family: "Monocraft", monospace; font-weight: 700; color: #aab4ff; }
.link-row { display: flex; gap: 10px; align-items: center; margin: 8px 0 6px; flex-wrap: wrap; }
.link-row code { padding: 6px 10px; border: 2px solid #a0a0a0; background: #000; font-size: 16px; }
.link-box .hint { margin: 0; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .dots::after { animation: none; content: "..."; } }

footer { color: var(--dim); font-size: 13px; }

@media (max-width: 860px) {
  .page { padding-top: 40px; }
  .hero, .apply-wrap, .join, .tickets { grid-template-columns: 1fr; gap: 36px; }
  .hero, .about { margin-bottom: 64px; }
  .about dl { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 480px) {
  .panel { padding: 20px; }
  .server-row { font-size: 14px; gap: 10px; }
  .server-row img { width: 56px; height: 56px; }
  .address-row, .inline { flex-direction: column; }
  .two { grid-template-columns: 1fr; }
  .chat-head { flex-direction: column; }
  .chat-log { height: auto; flex: 1; }
}
