/* Liminal 7: one screen, laid out like the Minecraft main menu. */
@font-face { font-family: "Monocraft"; src: url(fonts/Monocraft.ttf) format("truetype"); font-display: swap; }

:root {
  --g: 2px;                       /* one Minecraft GUI pixel (GUI scale 2) */
  --btn-w: min(calc(200 * var(--g)), calc(100vw - 32px));
  --btn-h: calc(20 * var(--g));
  --text: #e0e0e0;
  --shadow: #383838;
  --gs: 2px;                      /* small text (corners): one step below the GUI scale, never below 2 */
  --logo-k: 1.5;                  /* logo pixels per CSS px: native 230x48, drawn at whole steps */
}
@media (min-width: 900px) and (min-height: 700px) { :root { --g: 3px; --logo-k: 3; } }     /* GUI scale 3 */
@media (min-width: 1500px) and (min-height: 960px) { :root { --g: 4px; --gs: 3px; --logo-k: 4; } }    /* GUI scale 4 */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #000; }
body {
  color: var(--text); font: 400 calc(9 * var(--g))/calc(12 * var(--g)) "Monocraft", monospace;
  font-variant-ligatures: none; text-shadow: var(--g) var(--g) 0 var(--shadow);
  -webkit-font-smoothing: none; -webkit-tap-highlight-color: transparent;
}
a { color: #9fc5ff; }
:focus-visible { outline: none; }

/* ---------- background ---------- */
.pano { position: fixed; inset: 0; background: #000 center / cover no-repeat; }
.pano { overflow: hidden; }
/* a pre-rendered 360-degree strip of the mod's panorama (4096x1152, seamless), slid sideways = turning on the spot */
.strip { position: absolute; top: 0; left: 0; height: 100%; width: calc(100vh * 4096 / 1152 * 2); background: #000 repeat-x 0 0 / auto 100%;
  animation: pan 200s linear infinite; will-change: transform; backface-visibility: hidden; }
@keyframes pan { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.flick { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.flick.on { animation: fail .56s steps(1, end); }
@keyframes fail { 0% { opacity: 0 } 12% { opacity: .75 } 25% { opacity: 0 } 37% { opacity: .45 } 50% { opacity: .9 } 75% { opacity: .2 } 100% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .strip { animation: none; } .flick.on { animation: none; } }
.vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 35%, rgba(0,0,0,.6) 100%); }

/* ---------- the menu ---------- */
.menu-screen { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px 72px; }
.logo-wrap { position: relative; margin: 0 0 calc(12 * var(--g)); width: calc(230px * var(--logo-k)); max-width: calc(100vw - 32px); font-size: inherit; }
.logo { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.splash {
  position: absolute; right: 2%; bottom: 8%; color: #ffff00; text-shadow: var(--g) var(--g) 0 #3f3f00;
  white-space: nowrap; transform-origin: 50% 50%; transform: translate(30%, 0) rotate(-20deg);
  animation: splash .5s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes splash { from { transform: translate(30%, 0) rotate(-20deg) scale(1); } to { transform: translate(30%, 0) rotate(-20deg) scale(1.08); } }
@media (max-width: 600px) { .splash { right: 0; bottom: -22%; transform: rotate(-8deg); animation: none; } .logo-wrap { margin-bottom: calc(28 * var(--g)); } }

.buttons { display: grid; gap: calc(4 * var(--g)); width: var(--btn-w); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: calc(4 * var(--g)); }

/* Minecraft button: the game's own 200x20 nine-slice sprites (border 3), from the 26.3 client */
.mc {
  position: relative; display: flex; align-items: center; justify-content: center; height: var(--btn-h); width: 100%;
  padding: 0 calc(4 * var(--g)); font: inherit; color: #fff; text-decoration: none; text-shadow: inherit; cursor: pointer;
  background: none; border: calc(3 * var(--g)) solid transparent;
  border-image: url(img/mc/button.png) 3 fill / calc(3 * var(--g)) repeat;
  image-rendering: pixelated; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc:hover, .mc:focus-visible { border-image-source: url(img/mc/button_highlighted.png); }
.mc[disabled] { border-image-source: url(img/mc/button_disabled.png); color: #a0a0a0; cursor: default; }
.mc[aria-pressed="true"] { color: #ffffa0; }

/* corner text, like the version and copyright lines on the title screen */
.corner { position: fixed; bottom: 0; margin: 0; padding: calc(2 * var(--g)) calc(3 * var(--g)) max(calc(2 * var(--g)), env(safe-area-inset-bottom)); color: #fff; font-size: calc(9 * var(--gs)); line-height: calc(12 * var(--gs)); text-shadow: var(--gs) var(--gs) 0 var(--shadow); }
.corner-left { left: 0; }
.corner-right { right: 0; text-align: right; }
@media (max-width: 700px) { .corner-right { display: none; } }

.toast {
  position: fixed; left: 0; right: 0; width: max-content; margin-left: auto !important; margin-right: auto !important; top: calc(8 * var(--g)); transform: translateY(-300%); margin: 0; padding: calc(4 * var(--g)) calc(8 * var(--g));
  background: #212121; border: var(--g) solid #555; box-shadow: inset 0 0 0 var(--g) #000; color: #ffff55; transition: transform .25s ease; white-space: nowrap;
}
.toast.show { transform: none; }

/* ---------- sub-screens (darkened, title on top, Done at the bottom, like the game) ---------- */
.screen { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.screen[hidden] { display: none; }
.screen-in { width: min(calc(320 * var(--g)), 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--g)); }
.screen h2 { margin: 0; font-size: inherit; font-weight: 400; color: #fff; }
.panel { width: 100%; overflow-y: auto; padding: calc(6 * var(--g)) calc(8 * var(--g)); background: url(img/mc/menu_background.png) 0 0 / calc(16 * var(--g)) calc(16 * var(--g)); image-rendering: pixelated; border-top: var(--g) solid #000; border-bottom: var(--g) solid #000; box-shadow: 0 var(--g) 0 rgba(255,255,255,.15), 0 calc(-1 * var(--g)) 0 rgba(255,255,255,.15); }
.panel p, .panel ol { margin: 0 0 calc(5 * var(--g)); }
.panel ol { padding-left: 1.6em; }
.panel li { margin-bottom: calc(3 * var(--g)); }
.panel .hd { color: #ffff55; margin-bottom: calc(2 * var(--g)); }
.addr { color: #fff; }
.screen-in > .mc { width: var(--btn-w); flex: none; }

@media (prefers-reduced-motion: reduce) { .splash { animation: none; } .toast { transition: none; } }

/* ---------- code screen ---------- */
.gate-bg { background: #000 url(img/pano/lining/0.webp) center / cover no-repeat; filter: blur(2px) brightness(.8); transform: scale(1.03); }
.gate-form { display: grid; gap: calc(4 * var(--g)); width: var(--btn-w); text-align: center; }
.gate-form label { color: #a0a0a0; }
.mc-field {
  height: var(--btn-h); width: 100%; padding: 0 calc(4 * var(--g)); font: inherit; color: #e0e0e0; text-shadow: inherit; caret-color: #e0e0e0;
  background: none; border: var(--g) solid transparent; border-image: url(img/mc/text_field.png) 1 fill / var(--g) repeat; image-rendering: pixelated; outline: none;
}
.mc-field:focus { border-image-source: url(img/mc/text_field_highlighted.png); }
.gate-msg { margin: 0; min-height: 1.25em; color: #ff5555; }



/* ---------- server list entry (as in Multiplayer) ---------- */
.srv { display: grid; grid-template-columns: calc(32 * var(--g)) 1fr auto; gap: calc(3 * var(--g)); align-items: start; width: min(calc(305 * var(--g)), calc(100vw - 32px)); margin: 0 auto calc(8 * var(--g)); padding: calc(2 * var(--g)); background: rgba(0,0,0,.55); border: var(--g) solid #808080; text-align: left; }
.srv-icon { width: calc(32 * var(--g)); height: calc(32 * var(--g)); image-rendering: pixelated; }
.srv-text { display: flex; flex-direction: column; min-width: 0; }
.srv-name { color: #fff; }
.srv-motd { color: #aaa; overflow: hidden; text-overflow: ellipsis; }
.srv-opens { color: #ffff55; }
.srv-right { display: flex; align-items: center; gap: calc(2 * var(--g)); color: #aaa; white-space: nowrap; }
.srv-ping { width: calc(10 * var(--g)); height: calc(8 * var(--g)); image-rendering: pixelated; }


.swap { display: inline-block; margin-top: calc(1 * var(--gs)); color: #aaa; background: none; border: 0; padding: 0; font: inherit; text-shadow: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.swap:hover { color: #fff; }
