/* Critter Space SMP homepage: a web take on our FancyMenu title screen.
   Art is ours (pack/config/fancymenu/assets/critterspace). No Mojang assets. */
:root {
  --indigo: #1d1640;
  --peri: #8c8ff0;
  --pink: #f59ad0;
  --splash: #fff4aa;
  --text: #f6f2ff;
  --pixel: 4px;
  font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color: var(--text);
  background: #17123a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background: #17123a url("assets/sky.apng") center / cover no-repeat fixed;
  image-rendering: pixelated;
}
@media (prefers-reduced-motion: reduce) {
  body { background-image: url("assets/sky_still.png"); }
  .splash { animation: none !important; }
}
a { color: var(--splash); }
:focus-visible { outline: 3px solid var(--splash); outline-offset: 3px; }

/* Title screen */
.title {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1rem 4.5rem;
  gap: clamp(1.5rem, 5vh, 3rem);
  position: relative;
}

/* Decorations from deco.js (like the FancyMenu overlays); absent without JavaScript */
.deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.deco canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.deco.back { z-index: 0; }
.deco.front { z-index: 2; }
.btn .moss { position: absolute; pointer-events: none; image-rendering: pixelated; }
.logo-wrap { position: relative; z-index: 1; margin: 0; font-size: 1rem; width: min(640px, 92vw); }
.logo { display: block; width: 100%; height: auto; image-rendering: auto;
  filter: drop-shadow(0 6px 0 rgba(10, 6, 30, .35)); }
.splash {
  position: absolute; right: -2%; bottom: 4%;
  max-width: 15em;
  color: var(--splash);
  font-size: clamp(.8rem, 2.2vw, 1.15rem); font-weight: 700; line-height: 1.15; text-align: center;
  text-shadow: 2px 2px 0 #3f3c2a;
  transform-origin: center;
  transform: translate(35%, 0) rotate(-20deg);
  animation: pulse .5s ease-in-out infinite alternate;
  cursor: pointer; user-select: none;
}
@keyframes pulse {
  from { transform: translate(35%, 0) rotate(-20deg) scale(1); }
  to   { transform: translate(35%, 0) rotate(-20deg) scale(1.08); }
}

/* Buttons: our own 20x20 nine-slice button.png, scaled up pixel-sharp */
.menu { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; width: min(400px, 88vw); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 8px 16px;
  color: #fff; text-decoration: none; font: inherit; font-size: 1.05rem; font-weight: 700;
  text-shadow: 2px 2px 0 rgba(29, 22, 64, .75);
  position: relative;
  /* Colour only under the middle: the texture's corner pixels are transparent */
  background: var(--peri) padding-box;
  border: 20px solid transparent;
  border-image: url("assets/button.png") 5 fill / 20px / 0 stretch;
  image-rendering: pixelated;
  padding: 0 4px;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible {
  border-image-source: url("assets/button_hover.png");
  color: var(--splash);
}
.btn:focus-visible { outline-offset: 2px; }
.btn[aria-disabled="true"] { opacity: .7; cursor: default; }
.btn.small { min-height: 40px; font-size: .95rem; padding: 0 10px; border-width: 15px; border-image-width: 15px; }
.btn.wide { width: min(320px, 100%); }
.btn.done { margin: 1.5rem auto 0; width: min(260px, 100%); }

/* Sub-screens, like a darkened options screen */
.screen { display: none; }
.screen:target {
  display: block;
  position: fixed; inset: 0; z-index: 5;
  overflow-y: auto;
  background: rgba(16, 10, 40, .72);
  padding: 2rem 1rem 4rem;
}
.screen:target ~ .corners { z-index: 6; }
.panel {
  max-width: 42rem; margin: 0 auto;
  background: rgba(29, 22, 64, .88);
  border: var(--pixel) solid #0e0a26;
  box-shadow: inset 0 0 0 var(--pixel) #3b3378;
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
  line-height: 1.55;
}
.panel h2 { margin: 0 0 .5rem; text-align: center; color: var(--splash); text-shadow: 2px 2px 0 #3f3c2a; }
.panel h3 { color: #cfd0ff; margin-top: 1.5rem; }
.sub { opacity: .8; text-align: center; margin-top: 0; }
.steps li { margin: .6rem 0; }
code { background: rgba(0, 0, 0, .35); padding: .1em .35em; }
.url { display: block; margin: .4rem 0; padding: .6em .7em; word-break: break-all; user-select: all;
  border: 2px solid #0e0a26; background: #0e0a26; color: #fff; }
.addr { display: flex; gap: 10px; align-items: center; }
.addr .url { flex: 1; font-size: 1.2rem; text-align: center; margin: 0; }
.steps .addr { margin: .4rem 0; }
.steps .addr .url { font-size: .9rem; text-align: left; }
.steps .status { display: block; }
a.url { user-select: text; text-decoration: underline; text-underline-offset: 3px; }
.status { min-height: 1.4em; color: var(--splash); margin: .3rem 0; }

/* Corner text, as on the title screen */
.corners {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 6px 8px; font-size: .8rem;
  text-shadow: 1px 1px 0 #000; pointer-events: none;
  z-index: 3;
}
.corners .right { text-align: right; }

@media (max-width: 560px) {
  .splash { right: 0; bottom: -8%; transform: translate(10%, 0) rotate(-20deg); }
  @keyframes pulse {
    from { transform: translate(10%, 0) rotate(-20deg) scale(1); }
    to   { transform: translate(10%, 0) rotate(-20deg) scale(1.08); }
  }
  .corners { flex-direction: column; gap: 0; font-size: .7rem; }
  .corners .right { text-align: left; }
  .title { padding-bottom: 5rem; }
}
