/* Minecraftia чётко выглядит на размерах, кратных 12px, поэтому они заданы ступенями. */
@font-face { font-family: "Minecraftia"; src: url(fonts/Minecraftia-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --btn-shadow: #3f3f3f;
  --rule: #7a7a7a;
}

* { box-sizing: border-box; margin: 0; }
html { background: #1f1f1f; }
html.locked, html.locked body { overflow: hidden; height: 100%; }
body { font-family: "Minecraftia", ui-monospace, monospace; font-weight: 400; color: #fff; background: #1f1f1f; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

#track { height: 1100vh; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#scene.blur { filter: blur(7px) brightness(1.15); }
#scene { transition: filter .9s ease-out; }

#fader { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* ---------- загрузка ---------- */
#loader { position: fixed; inset: 0; pointer-events: none; transition: opacity .6s linear; }
#loader.hide { opacity: 0; }
#spin { position: absolute; left: 50%; top: 56.5%; width: 34px; height: 34px; margin-left: -17px; animation: spin 1.15s steps(12) infinite; }
#bar { position: absolute; left: 50%; top: 75%; width: min(69vw, 1100px); height: clamp(20px, 3.4vw, 38px); transform: translateX(-50%); border: clamp(3px, .45vw, 5px) solid #fff; padding: clamp(3px, .5vw, 6px); }
#bar i { display: block; height: 100%; width: 0; background: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- меню ---------- */
#ui, #end { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .28s linear; }
.ready.at-hero #ui, .ready.at-end #end { opacity: 1; }
.ready.at-hero #menu a, .ready.at-end #menu-end a { pointer-events: auto; }

#menu, #menu-end {
  position: absolute; left: 50%; top: 40%;
  width: min(30vw, 480px); min-width: 280px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px;
}
#ui::after, #end::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0, 0, 0, .42) 100%);
}

/* Спрайты кнопок из игры: 200x20, рамка 3 пикселя (nine_slice из .mcmeta).
   Масштаб 3 — как интерфейс игры: высота 60px и шрифт 24px; масштаб 2 — 40px и 16px. */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 60px;
  color: #fff; background: none;
  border-style: solid; border-width: 9px;
  border-image: url(ui/button.png) 3 fill / 9px repeat;
  image-rendering: pixelated;
  font: inherit; font-size: 24px; line-height: 1; padding-top: 6px; text-decoration: none; text-shadow: 3px 3px 0 var(--btn-shadow);
  cursor: pointer;
}
.btn > * { pointer-events: none; }
.btn:hover, .btn:focus-visible { border-image-source: url(ui/button_highlighted.png); outline: none; }
.btn:active { filter: brightness(.85); }
.btn:disabled { color: #a0a0a0; text-shadow: none; border-image-source: url(ui/button_disabled.png); cursor: default; }

#splash {
  position: absolute; left: 73%; top: 24%;
  color: #ffff33; font-size: 36px; line-height: 1; white-space: nowrap;
  text-shadow: 3px 3px 0 #3f3f00;
  transform: translate(-50%, -50%) rotate(-20deg);
  animation: splash .55s ease-in-out infinite alternate;
}
@keyframes splash { to { transform: translate(-50%, -50%) rotate(-20deg) scale(1.1); } }

/* ---------- прокрутка ---------- */
#hint { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); font-size: 24px; line-height: 1; text-shadow: 2px 2px 0 #000; text-align: center; opacity: 0; transition: opacity .3s; pointer-events: none; }
#hint b { display: block; width: 14px; height: 14px; margin: 8px auto 0; border-right: 4px solid #fff; border-bottom: 4px solid #fff; transform: rotate(45deg); animation: bob 1s steps(4) infinite alternate; }
@keyframes bob { to { translate: 0 6px; } }
.ready.at-hero #hint { opacity: 1; }

#title { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 72px; line-height: 1.2; text-align: center; text-shadow: 6px 6px 0 #000; opacity: 0; pointer-events: none; }
#title.show { animation: title 3s ease both; }
.at-hero #title, .at-end #title { display: none; }
@keyframes title { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }

#rail { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; opacity: 0; transition: opacity .4s; }
.ready #rail { opacity: 1; }
#rail button { width: 16px; height: 16px; padding: 0; border: 2px solid #000; background: rgba(255, 255, 255, .45); cursor: pointer; }
#rail button.on { background: #fff21e; }
#rail button:hover, #rail button:focus-visible { background: #fff; outline: 2px solid #fff; }


#toast { z-index: 3; position: fixed; left: 50%; top: 22px; transform: translate(-50%, -160%); padding: 18px 20px 10px; font-size: 24px; line-height: 1; white-space: nowrap; color: #fff; text-shadow: 2px 2px 0 #3e3e3e; background: #100010f0; border: 3px solid #28007a; transition: transform .25s steps(5), visibility .25s; pointer-events: none; visibility: hidden; }
#toast.on { transform: translate(-50%, 0); visibility: visible; }

/* ---------- панель сервера: экран настроек из Java-версии ---------- */
.flying #rail { opacity: 0; pointer-events: none; }
#info {
  position: fixed; inset: 0; z-index: 2;
  display: grid; grid-template-rows: auto 1fr auto;
  color: #f0f0f0; font-size: 16px; line-height: 1.5; text-shadow: 2px 2px 0 #2e2e2e;
  background: rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
#info.on { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
#info h2 { padding: 22px 16px 12px; font-size: 24px; font-weight: 400; line-height: 1; text-align: center; border-bottom: 2px solid var(--rule); box-shadow: 0 2px 0 #000; }
#info h3 { margin-bottom: 6px; font-size: 16px; font-weight: 400; color: #ffff55; text-shadow: 2px 2px 0 #3f3f15; }
#info h4 { margin-top: 6px; font-size: 16px; font-weight: 400; color: #aaa; }
#info b { font-weight: 400; color: #55ffff; text-shadow: 2px 2px 0 #153f3f; }
#info ol, #info ul { padding-left: 28px; }
#info-body { display: flex; flex-direction: column; justify-content: safe center; gap: 20px; overflow-y: auto; min-height: 0; padding: 24px max(16px, calc(50% - 340px)); background: rgba(0, 0, 0, .22); scrollbar-color: #8a8a8a #111; }
.ip-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ip-row code { flex: 1 1 240px; padding: 8px 12px; font: inherit; line-height: 24px; color: #e0e0e0; background: #000; outline: 2px solid #a0a0a0; overflow-wrap: anywhere; }
.ip-row code.soon { color: #808080; text-shadow: none; }
.muted { color: #a0a0a0; }
.btn.small { flex: none; width: 200px; height: 40px; white-space: nowrap; font-size: 16px; padding-top: 4px; text-shadow: 2px 2px 0 var(--btn-shadow); border-width: 6px; border-image-width: 6px; }
#info-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px 16px; border-top: 2px solid var(--rule); box-shadow: inset 0 2px 0 #000; }
#info-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#info-back { width: min(400px, 100%); }
.btn.wide { width: min(400px, 100%); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.status { display: flex; align-items: center; gap: 10px; font-size: 24px; line-height: 1.2; }
.status i { flex: none; width: 16px; height: 16px; outline: 2px solid #000; background: #808080; }
.status.up { color: #55ff55; text-shadow: 2px 2px 0 #153f15; }
.status.up i { background: #55ff55; }
.status.down { color: #ff5555; text-shadow: 2px 2px 0 #3f1515; }
.status.down i { background: #ff5555; }
.status.unknown { color: #a0a0a0; font-size: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin-top: 10px; }
.facts dt { color: #a0a0a0; }
.facts dd { margin: 0; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 6px; margin-top: 10px; padding: 0 !important; list-style: none; color: #fff; }
.member { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 8px; background: rgba(0, 0, 0, .45); outline: 1px solid rgba(255, 255, 255, .14); }
.face { position: relative; flex: none; width: 24px; height: 24px; background: #3a3a42; }
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dot { position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; outline: 2px solid #000; background: #55ff55; }
.dot.idle { background: #ffaa00; }
.dot.dnd { background: #ff5555; }
.nick { min-width: 0; padding-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.more { margin-top: 6px; }
.voice { display: flex; flex-direction: column; gap: 6px; }
.room-name { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px 2px; color: #a0a0a0; background: rgba(0, 0, 0, .3); }
.room.active .room-name { color: #55ff55; text-shadow: 2px 2px 0 #153f15; }
.room-count { flex: none; }
.room .names { margin-top: 4px; }
.small-note { margin-top: 8px; font-size: 12px; }
.btn.small { width: auto; min-width: 150px; padding-left: 8px; padding-right: 8px; }
#sound { position: fixed; left: 12px; bottom: 12px; z-index: 1; min-width: 130px; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.ready:not(.flying) #sound.on { opacity: 1; visibility: visible; }
/* Быстрые переходы посреди спуска, где большого меню нет. */
#nav { position: fixed; left: 50%; top: 12px; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: max-content; max-width: calc(100vw - 16px); transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.ready:not(.flying):not(.at-hero):not(.at-end) #nav { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  #info { transition: none; }
}

#nogl { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 24px; background: #1f1f1f; }
#nogl[hidden] { display: none; }

@media (max-height: 640px), (max-width: 420px) {
  .btn { height: 40px; font-size: 16px; padding-top: 4px; text-shadow: 2px 2px 0 var(--btn-shadow); border-width: 6px; border-image-width: 6px; }
}
@media (max-width: 800px) {
  #menu, #menu-end { top: 34%; width: 78vw; min-width: 0; }
  #splash { left: 70%; top: 20%; font-size: 24px; text-shadow: 2px 2px 0 #3f3f00; }
  #title { font-size: 48px; text-shadow: 4px 4px 0 #000; width: 90vw; }
  #toast { font-size: 12px; }
  #hint { bottom: 40px; }
  #rail { right: 8px; }
  .btn.small { min-width: 0; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #splash, #spin, #hint b { animation: none; }
}
