@font-face {
  font-family: "Minecraft";
  src: url("/static/fonts/minecraftfont.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #090c12;
  --surface: #10151e;
  --surface-2: #151b26;
  --line: #232b39;
  --text: #f3f6fb;
  --muted: #8993a4;
  --green: #8bd450;
  --green-2: #b8f17e;
  --purple: #9d7cff;
  --amber: #f0b85c;
  --red: #ff6b73;
  --sidebar: 236px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(139, 212, 80, .45);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(139, 212, 80, .23), rgba(139, 212, 80, .04));
  color: var(--green-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: inset 0 0 18px rgba(139, 212, 80, .08);
}

/* Login */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: #090c12;
}
.login-shell {
  width: min(400px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.login-card {
  padding: 38px;
}
.login-card h1 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.login-card form { display: flex; margin-top: 30px; flex-direction: column; }
label { margin: 0 0 8px; color: #cbd1dc; font-size: 13px; font-weight: 700; }
input {
  width: 100%;
  border: 1px solid #2a3342;
  border-radius: 10px;
  outline: none;
  background: #0c1118;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(139, 212, 80, .11); }
.login-card input { height: 48px; margin-bottom: 20px; padding: 0 14px; }
.primary-button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #0b1107;
  cursor: pointer;
  font-weight: 850;
  transition: transform .15s, background .15s;
}
.primary-button:hover { background: var(--green-2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.form-error { min-height: 20px; margin: -6px 0 12px; color: var(--red); font-size: 13px; }

/* Application shell */
.app-page { min-height: 100vh; background: #0b0f16; }
.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  padding: 24px 18px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #0a0e14;
}
.sidebar-brand { display: flex; padding: 0 8px 26px; align-items: center; gap: 12px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 14px; }
.sidebar-brand span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.nav-list { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex;
  width: 100%;
  height: 43px;
  padding: 0 13px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #8f99aa;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}
.nav-item span { width: 20px; color: #687385; font-family: ui-monospace, monospace; font-size: 17px; }
.nav-item:hover { background: rgba(255, 255, 255, .03); color: #d8dde6; }
.nav-item.active {
  border-color: rgba(139, 212, 80, .17);
  background: rgba(139, 212, 80, .09);
  color: var(--green-2);
}
.nav-item.active span { color: var(--green); }
.sidebar-footer { margin-top: auto; }
.server-pill { display: flex; padding: 13px 10px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.server-pill strong, .server-pill span { display: block; }
.server-pill strong { font-size: 12px; }
.server-pill div span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.status-dot, .online-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(139, 212, 80, .8);
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 10px rgba(255, 107, 115, .5); }
.ghost-button {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.ghost-button:hover { border-color: #3a4557; color: var(--text); }
.ghost-button.compact { width: auto; height: 34px; padding: 0 13px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); padding: 0 36px 44px; }
.topbar {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.clock { color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }
.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(157, 124, 255, .35);
  border-radius: 10px;
  background: rgba(157, 124, 255, .12);
  color: #c8b9ff;
  font-size: 12px;
  font-weight: 900;
}
.view { display: none; padding-top: 27px; }
.view.active { display: block; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

.hero-panel {
  position: relative;
  display: flex;
  min-height: 220px;
  padding: 40px 44px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid #26311f;
  border-radius: 16px;
  background:
    radial-gradient(circle at 85% 50%, rgba(139, 212, 80, .14), transparent 26%),
    linear-gradient(105deg, #121a13, #0f151b 65%);
}
.hero-panel::after {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(139, 212, 80, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 212, 80, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  mask-image: linear-gradient(90deg, transparent 25%, black);
}
.hero-panel > div { position: relative; z-index: 1; }
.hero-panel h2 { margin: 13px 0 10px; font-size: 37px; line-height: 1.02; letter-spacing: -.05em; }
.hero-panel h2 em { color: var(--green-2); font-style: normal; }
.hero-panel p { margin: 0; color: var(--muted); }
.live-label {
  display: inline-flex;
  height: 26px;
  padding: 0 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(139, 212, 80, .22);
  border-radius: 99px;
  background: rgba(139, 212, 80, .07);
  color: var(--green-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.hero-cube { position: relative; width: 120px; height: 120px; margin-right: 8%; transform: rotate(30deg) skew(-5deg); }
.hero-cube span { position: absolute; border: 1px solid rgba(139, 212, 80, .25); background: rgba(139, 212, 80, .055); }
.hero-cube span:nth-child(1) { inset: 10px 10px 48px 48px; }
.hero-cube span:nth-child(2) { inset: 48px 48px 10px 10px; }
.hero-cube span:nth-child(3) { inset: 29px; border-color: rgba(157, 124, 255, .25); background: rgba(157, 124, 255, .07); }

.stat-grid { display: grid; margin-top: 16px; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card {
  display: flex;
  min-height: 96px;
  padding: 20px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.stat-card p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 19px; letter-spacing: -.03em; }
.stat-card strong.offline { color: var(--red); }
.stat-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 10px; font-size: 14px; }
.stat-icon.green { background: rgba(139, 212, 80, .1); color: var(--green); }
.stat-icon.purple { background: rgba(157, 124, 255, .1); color: var(--purple); }
.stat-icon.amber { background: rgba(240, 184, 92, .1); color: var(--amber); }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.overview-grid { display: grid; margin-top: 16px; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.player-panel, .quick-panel, .whitelist-panel, .add-player-panel { padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h3, .add-player-panel h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.text-button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 11px; font-weight: 750; }
.player-list { margin-top: 15px; }
.player-row, .whitelist-row {
  display: flex;
  min-height: 58px;
  padding: 9px 7px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(35, 43, 57, .75);
}
.player-avatar {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(157, 124, 255, .22);
  border-radius: 8px;
  background: rgba(157, 124, 255, .08);
  color: #b9a7fb;
  font-size: 10px;
  font-weight: 900;
}
.player-avatar.small { width: 31px; height: 31px; }
.player-row div, .whitelist-row div { min-width: 0; flex: 1; }
.player-row strong, .player-row small, .whitelist-row strong, .whitelist-row small { display: block; }
.player-row strong, .whitelist-row strong { font-size: 12px; }
.player-row small, .whitelist-row small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.player-row .online-dot { width: 6px; height: 6px; }
.empty-state { padding: 18px 0; color: var(--muted); font-size: 12px; }
.quick-action {
  display: flex;
  width: 100%;
  min-height: 62px;
  padding: 10px 5px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid rgba(35, 43, 57, .75);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.quick-action:first-of-type { margin-top: 15px; }
.quick-action > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #171e29; color: var(--green); font-family: ui-monospace, monospace; }
.quick-action div { flex: 1; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 11px; }
.quick-action small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.quick-action b { color: #5f6b7d; font-size: 12px; }
.quick-action:hover b { color: var(--green); transform: translateX(2px); }

/* Console */
.console-panel { overflow: hidden; }
.console-panel .panel-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.console-output {
  height: calc(100vh - 285px);
  min-height: 390px;
  padding: 18px 20px;
  overflow: auto;
  background: #080b10;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.65;
}
.console-line { color: #aab3c2; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-line.info { color: #b7c0cd; }
.console-line.warn { color: #e6bd70; }
.console-line.error { color: #ff7f87; }
.command-form { display: flex; height: 55px; padding: 8px 12px; align-items: center; gap: 9px; border-top: 1px solid var(--line); background: #0d121a; }
.command-form > span { color: var(--green); font-family: monospace; font-weight: 900; }
.command-form input { height: 37px; padding: 0 10px; flex: 1; border: 0; background: transparent; font-family: ui-monospace, monospace; font-size: 12px; }
.command-form input:focus { box-shadow: none; }
.command-form button { height: 34px; padding: 0 16px; border: 0; border-radius: 7px; background: var(--green); color: #0a1006; cursor: pointer; font-size: 11px; font-weight: 850; }
.form-message { min-height: 18px; margin: 8px 2px 0; color: var(--muted); font-size: 11px; }
.form-message.success { color: var(--green); }
.form-message.error { color: var(--red); }
.console-panel > .form-message { padding: 0 20px 8px; margin: 0; background: #0d121a; }

/* Map */
.map-view { padding-top: 18px; }
.map-panel { overflow: hidden; }
.map-panel .panel-heading { height: 66px; padding: 0 20px; }
.map-player-toolbar { display: flex; min-width: 0; align-items: center; gap: 10px; }
.map-player-list {
  display: flex;
  max-width: min(42vw, 500px);
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.map-player-list::-webkit-scrollbar { display: none; }
.map-player-chip {
  height: 27px;
  padding: 0 9px;
  flex: 0 0 auto;
  border: 1px solid #303a49;
  border-radius: 7px;
  background: #171e29;
  color: #cbd3df;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}
.map-player-chip:hover { border-color: var(--green); color: var(--green-2); }
.map-panel iframe { display: block; width: 100%; height: calc(100vh - 205px); min-height: 520px; border: 0; background: #070a0f; }

/* Inventories */
.inventory-panel { padding: 23px; }
.inventory-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.inventory-player-list { display: flex; max-width: 60%; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.inventory-player-list::-webkit-scrollbar { display: none; }
.inventory-player-button {
  height: 31px;
  padding: 0 11px;
  flex: 0 0 auto;
  border: 1px solid #303a49;
  border-radius: 8px;
  background: #151b25;
  color: #9da7b7;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}
.inventory-player-button:hover,
.inventory-player-button.active {
  border-color: rgba(139, 212, 80, .5);
  background: rgba(139, 212, 80, .09);
  color: var(--green-2);
}
.inventory-empty { padding: 80px 20px; color: var(--muted); font-size: 13px; text-align: center; }
.inventory-content { margin-top: 18px; }
.minecraft-inventory-toolbar {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
}
.minecraft-inventory-toolbar strong { font-family: "Minecraft", monospace; font-size: 14px; font-weight: 400; }
.minecraft-inventory-scroll { width: 100%; overflow-x: auto; padding: 8px 0 16px; }
.minecraft-inventory-window {
  --mc-slot: clamp(32px, 5vw, 54px);
  --mc-gap: clamp(3px, .5vw, 6px);
  width: max-content;
  margin: 0 auto;
  padding: calc(var(--mc-slot) * .42);
  border: 4px solid;
  border-color: #f8f8f8 #555 #555 #f8f8f8;
  outline: 3px solid #111;
  background: #c6c6c6;
  color: #3f3f3f;
  font-family: "Minecraft", "Courier New", ui-monospace, monospace;
  font-size: clamp(9px, 1.2vw, 13px);
  font-weight: 700;
  image-rendering: pixelated;
  box-shadow:
    inset 3px 3px 0 #fff,
    inset -3px -3px 0 #8b8b8b;
}
.minecraft-upper-inventory {
  display: grid;
  width: calc(var(--mc-slot) * 9);
  grid-template-columns: var(--mc-slot) calc(var(--mc-slot) * 3.4);
  gap: var(--mc-gap);
  justify-content: center;
}
.armor-grid { display: grid; align-content: start; gap: 0; }
.minecraft-player-preview {
  position: relative;
  height: calc(var(--mc-slot) * 4);
  border: 3px solid;
  border-color: #373737 #fff #fff #373737;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .08), transparent 45%),
    #151515;
  overflow: visible;
}
.minecraft-player-skin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 92%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
}
.minecraft-offhand {
  position: absolute;
  right: calc(var(--mc-slot) * -1 - var(--mc-gap));
  bottom: 0;
  width: var(--mc-slot);
  height: var(--mc-slot);
}
.minecraft-storage > span {
  display: block;
  height: calc(var(--mc-slot) * .38);
  line-height: calc(var(--mc-slot) * .38);
  text-shadow: 1px 1px #fff;
}
.minecraft-storage { margin-top: calc(var(--mc-slot) * .32); }
.inventory-grid {
  display: grid;
  width: calc(var(--mc-slot) * 9);
  grid-template-columns: repeat(9, var(--mc-slot));
  gap: 0;
}
.hotbar-divider { height: calc(var(--mc-slot) * .28); grid-column: 1 / -1; }
.item-slot {
  position: relative;
  display: flex;
  width: var(--mc-slot);
  height: var(--mc-slot);
  padding: calc(var(--mc-slot) * .09);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #8b8b8b;
  box-shadow: inset 3px 3px #373737, inset -3px -3px #fff;
}
.item-slot.empty { background: #8b8b8b; }
.armor-slot.empty::before, .offhand-slot.empty::before {
  color: #666;
  content: attr(data-label);
  font-size: calc(var(--mc-slot) * .16);
  opacity: .72;
  text-shadow: 1px 1px #aaa;
}
.item-icon {
  display: grid;
  width: 78%;
  height: 78%;
  place-items: center;
  color: #252525;
  font-size: calc(var(--mc-slot) * .2);
  font-weight: 900;
}
.item-texture {
  width: 82%;
  height: 82%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: none;
}
.item-slot b {
  position: absolute;
  right: 4px;
  bottom: 2px;
  z-index: 1;
  color: white;
  font-family: "Minecraft", "Courier New", monospace;
  font-size: calc(var(--mc-slot) * .3);
  line-height: 1;
  text-shadow: 2px 2px #3f3f3f;
}

/* Whitelist */
.whitelist-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; }
.add-player-panel { align-self: start; }
.add-player-panel > p.muted { font-size: 12px; line-height: 1.55; }
.add-player-panel form { margin-top: 25px; }
.input-row { display: flex; gap: 9px; }
.input-row input { height: 44px; padding: 0 12px; }
.input-row .primary-button { flex: 0 0 auto; }
.whitelist-list { margin-top: 13px; }
.count-badge, .allowed-badge { border-radius: 99px; font-size: 9px; font-weight: 800; }
.count-badge { padding: 5px 9px; background: rgba(139, 212, 80, .1); color: var(--green); }
.allowed-badge { padding: 5px 8px; background: rgba(139, 212, 80, .07); color: var(--green); }

@media (max-width: 900px) {
  :root { --sidebar: 76px; }
  .sidebar { padding-inline: 11px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand > div:last-child, .nav-item:not(.active) { }
  .sidebar-brand > div:last-child, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item span { width: auto; font-size: 18px; }
  .server-pill div, .ghost-button { display: none; }
  .server-pill { justify-content: center; }
  .workspace { padding-inline: 22px; }
  .overview-grid, .whitelist-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --sidebar: 0px; }
  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 66px;
    padding: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .nav-list { flex-direction: row; }
  .nav-item { display: flex; height: 48px; flex: 1; font-size: 0; }
  .workspace { padding: 0 14px 90px; }
  .topbar { min-height: 84px; }
  .clock { display: none; }
  .hero-panel { min-height: 200px; padding: 30px 25px; }
  .hero-panel h2 { font-size: 31px; }
  .hero-cube { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 78px; }
  .login-shell { width: 100%; }
  .login-card { padding: 34px 26px; }
  .input-row { flex-direction: column; }
  .map-player-list { max-width: 42vw; }
  .map-player-toolbar .live-label { display: none; }
  .map-panel iframe { height: calc(100vh - 190px); min-height: 400px; }
  .inventory-heading { align-items: flex-start; flex-direction: column; }
  .inventory-player-list { width: 100%; max-width: 100%; }
  .inventory-panel { padding: 16px 10px; }
  .minecraft-inventory-window { --mc-slot: 32px; }
  .minecraft-inventory-scroll { padding-inline: 4px; }
}
