/* Portail Minecraft — night palette, amber torch. Dark by design: the page is
   looked at in the evening, and the server icon has to read as a lamp. */

:root {
  color-scheme: dark;

  --ground: oklch(0.185 0.042 275);
  --ground-lift: oklch(0.232 0.045 277);
  --panel: oklch(0.247 0.038 277);
  --line: oklch(0.345 0.035 277);
  --ink: oklch(0.945 0.012 88);
  --ink-soft: oklch(0.775 0.022 280);
  --ink-faint: oklch(0.635 0.025 280);
  --amber: oklch(0.83 0.148 74);
  --amber-ink: oklch(0.245 0.06 68);
  --alert-bg: oklch(0.31 0.062 30);
  --alert-line: oklch(0.46 0.095 32);
  --alert-ink: oklch(0.93 0.025 45);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--ground-lift), transparent 70%),
    var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Home ---------- */

.page-home {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem clamp(1rem, 5vw, 2.25rem);
}

.hello {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.quit {
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}

.quit:hover,
.quit:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.5rem, 6vw, 3rem) 1.25rem 2rem;
}

/* The whole icon is the copy button: a target a kid cannot miss. */
.beacon-wrap {
  position: relative;
  isolation: isolate;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.beacon-wrap.is-on::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.83 0.148 74 / 0.26), transparent 66%);
  animation: torch 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes torch {
  0%, 100% { opacity: 0.62; }
  45% { opacity: 0.86; }
  72% { opacity: 0.7; }
}

.beacon {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--ground-lift);
  transition: border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}

.beacon-wrap.is-on .beacon {
  border-color: oklch(0.83 0.148 74 / 0.45);
  box-shadow:
    inset 0 0 0 1px oklch(0.83 0.148 74 / 0.12),
    0 22px 60px -24px oklch(0.83 0.148 74 / 0.6);
}

.beacon-img {
  display: block;
  width: clamp(160px, 44vw, 232px);
  height: auto;
  aspect-ratio: 1;
  /* 64px source art: keep the pixels crisp instead of blurring them. */
  image-rendering: pixelated;
  border-radius: 8px;
  transition: filter 400ms var(--ease);
}

.beacon-wrap.is-off .beacon-img {
  filter: saturate(0.15) brightness(0.62);
}

.beacon-img--empty {
  background:
    repeating-conic-gradient(var(--line) 0% 25%, var(--panel) 0% 50%) 0 0 / 24px 24px;
}

.state {
  margin: clamp(1.4rem, 5vw, 2.1rem) 0 0;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--amber);
  transition: color 300ms var(--ease);
}

.state.is-off {
  color: var(--ink-faint);
}

.state-note {
  margin: 0.7rem 0 0;
  max-width: 34ch;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.address {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: clamp(1.8rem, 6vw, 2.6rem);
  min-height: 54px;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1rem, 4.4vw, 1.35rem);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 220ms var(--ease), background 220ms var(--ease),
    transform 220ms var(--ease);
}

.address:hover,
.address:focus-visible {
  border-color: oklch(0.83 0.148 74 / 0.6);
  background: var(--ground-lift);
}

.address:active {
  transform: scale(0.985);
}

.address.is-copied {
  border-color: var(--amber);
}

.address-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.address:hover .address-icon,
.address.is-copied .address-icon {
  stroke: var(--amber);
}

.address .icon-done,
.address.is-copied .icon-copy {
  display: none;
}

.address.is-copied .icon-done {
  display: block;
}

.address-hint {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.howto {
  margin-top: clamp(3rem, 11vw, 5rem);
  max-width: 58ch;
  text-align: left;
}

.howto-title {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  margin-bottom: clamp(1.6rem, 5vw, 2.2rem);
}

.step-text {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.step-num {
  display: inline-block;
  min-width: 1.7rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--amber);
}

/* Drawn walkthrough of the three screens, in the palette of the page. */
.step-shot {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground-lift);
}

.steps strong {
  color: var(--ink);
  font-weight: 600;
}

.pseudo-note {
  margin: 1.6rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.pseudo-note strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 500;
}

.footline {
  padding: 1.4rem 1.25rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.footline .dot {
  margin: 0 0.45rem;
}

/* ---------- Login ---------- */

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 1.5rem 1.25rem;
}

.login-panel {
  width: 100%;
  max-width: 23rem;
  padding: 1.8rem 1.6rem 2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 30px 70px -40px oklch(0.1 0.03 275 / 0.9);
}

.login-eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.login-title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.login-intro {
  margin: 0.6rem 0 1.6rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.login-form .field {
  min-height: 50px;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground-lift);
  color: var(--ink);
  font-size: 1.05rem;
}

.login-form .field:focus {
  border-color: var(--amber);
  background: var(--ground-lift);
  color: var(--ink);
  box-shadow: 0 0 0 3px oklch(0.83 0.148 74 / 0.2);
}

.remember {
  margin: 0.4rem 0 1.5rem;
}

.remember .form-check-input {
  background-color: var(--ground-lift);
  border-color: var(--line);
}

.remember .form-check-input:checked {
  background-color: var(--amber);
  border-color: var(--amber);
}

.remember .form-check-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px oklch(0.83 0.148 74 / 0.2);
}

.remember .form-check-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.btn-amber {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--amber);
  color: var(--amber-ink);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 200ms var(--ease), transform 200ms var(--ease);
}

.btn-amber:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-amber:active {
  transform: translateY(0);
}

.alert-line {
  margin: 0 0 1.2rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--alert-line);
  border-radius: 10px;
  background: var(--alert-bg);
  color: var(--alert-ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .beacon-wrap.is-on::before {
    opacity: 0.72;
  }
}
