:root {
  --black: #07090a;
  --charcoal: #101317;
  --metal: #171b20;
  --metal-light: #222832;
  --line: #39414d;
  --line-soft: rgba(255, 255, 255, 0.11);
  --paper: #e8edf2;
  --muted: #99a3ad;
  --blue: #3aa6ff;
  --blue-dim: #1b4d73;
  --orange: #f08a24;
  --orange-dim: #6f3f19;
  --green: #88d46b;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    repeating-linear-gradient(115deg, rgba(240, 138, 36, 0.05) 0 1px, transparent 1px 34px),
    linear-gradient(135deg, #0b0d0f 0%, #12171b 44%, #090b0d 100%);
  background-size: 96px 96px, 96px 96px, auto, auto;
  font-family: "Trebuchet MS", Verdana, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    linear-gradient(90deg, rgba(58, 166, 255, 0.08), transparent 22% 72%, rgba(240, 138, 36, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28% 70%, rgba(0, 0, 0, 0.45)),
    radial-gradient(circle at center, transparent 0 46%, rgba(0, 0, 0, 0.74) 100%);
}

body::after {
  opacity: 0.34;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 100%);
  background-size: auto, 7px 7px;
  mix-blend-mode: screen;
}

.loading-screen {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  grid-template-rows: minmax(120px, 0.4fr) minmax(250px, 1fr) minmax(180px, 0.66fr);
  gap: 14px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  padding: clamp(14px, 2.4vw, 32px);
}

.screen-texture,
.map-sketch {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.screen-texture {
  opacity: 0.42;
  background:
    linear-gradient(28deg, transparent 0 44%, rgba(58, 166, 255, 0.08) 44% 45%, transparent 45% 100%),
    linear-gradient(152deg, transparent 0 60%, rgba(240, 138, 36, 0.08) 60% 61%, transparent 61% 100%);
}

.map-sketch {
  right: 28px;
  bottom: 18px;
  left: auto;
  top: auto;
  width: min(42vw, 560px);
  height: min(38vh, 380px);
  opacity: 0.16;
  border: 2px solid rgba(255, 255, 255, 0.18);
  transform: rotate(-3deg);
}

.map-sketch::before,
.map-sketch::after {
  position: absolute;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.map-sketch::before {
  inset: 28px 70px 90px 34px;
}

.map-sketch::after {
  right: 42px;
  bottom: 36px;
  width: 34%;
  height: 28%;
}

h1,
h2,
p,
dl,
ul {
  margin-top: 0;
}

.server-header,
.progress-panel,
.info-panel,
.notes-panel,
.rules-panel {
  min-width: 0;
  border: 2px solid #2b333d;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    rgba(14, 17, 20, 0.94);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.server-header {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  overflow: hidden;
  border-left: 8px solid var(--orange);
}

.header-copy {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 30px);
}

.server-kicker {
  margin: 0 0 7px;
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.75rem, 1vw, 0.92rem);
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: clamp(2.5rem, 5.6vw, 5.7rem);
  line-height: 0.9;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.tagline {
  margin-bottom: 0;
  color: #c7d1db;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 700;
}

.header-stamp {
  display: flex;
  flex: 0 0 clamp(145px, 16vw, 230px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 2px solid #2b333d;
  background:
    repeating-linear-gradient(-45deg, rgba(58, 166, 255, 0.12) 0 8px, rgba(58, 166, 255, 0.03) 8px 16px),
    rgba(6, 9, 12, 0.88);
  color: var(--paper);
  text-transform: uppercase;
}

.header-stamp span {
  color: var(--blue);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.85;
}

.header-stamp strong {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
}

.progress-panel {
  --panel-pad: clamp(18px, 2.6vw, 34px);
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--panel-pad);
  border-left: 8px solid var(--blue);
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: calc(0px - var(--panel-pad)) calc(0px - var(--panel-pad)) 20px;
  padding: 8px 12px;
  border-bottom: 2px solid #2b333d;
  background: #0a0d10;
  color: #f7fbff;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.72rem, 0.95vw, 0.84rem);
  font-weight: 700;
  text-transform: uppercase;
}

.panel-bar span:last-child {
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-light {
  color: var(--green) !important;
}

.progress-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

#status-text {
  margin-bottom: 0;
  color: #ffffff;
  font-size: clamp(1.55rem, 3vw, 3.1rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

#percentage-text {
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(1.2rem, 2.8vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.progress-track {
  position: relative;
  height: clamp(26px, 4vw, 42px);
  overflow: hidden;
  border: 2px solid #55606b;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 16px),
    #070a0d;
}

.progress-track::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.68);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 16px),
    linear-gradient(90deg, #1c79b5, var(--blue) 58%, var(--orange));
  transition: width 0.35s linear;
}

.progress-fill.is-connecting {
  width: 34%;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 16px),
    linear-gradient(90deg, var(--blue-dim), var(--blue), var(--orange-dim));
  animation: connecting 1.1s steps(9) infinite;
}

.file-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 13px 0 0;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.82rem, 1.1vw, 0.98rem);
}

.file-line span {
  padding: 3px 7px;
  color: #111;
  background: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
}

.file-line strong {
  min-width: 0;
  overflow: hidden;
  color: #dce5ed;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tip-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.22);
}

.tip-box span {
  color: var(--blue);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
  text-transform: uppercase;
}

.tip-box p {
  margin-bottom: 0;
  color: #f2f6fa;
  font-size: clamp(0.95rem, 1.25vw, 1.12rem);
  font-weight: 700;
}

.info-panel {
  --panel-pad: clamp(16px, 2vw, 24px);
  grid-column: 2;
  grid-row: 2;
  padding: var(--panel-pad);
}

.info-panel .panel-bar,
.notes-panel .panel-bar,
.rules-panel .panel-bar {
  margin: calc(0px - var(--panel-pad)) calc(0px - var(--panel-pad)) 14px;
}

.server-details {
  display: grid;
  gap: 0;
  margin-bottom: 0;
}

.server-details div {
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.server-details div:last-child {
  border-bottom: 0;
}

dt {
  margin-bottom: 4px;
  color: var(--orange);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin-left: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-panel,
.rules-panel {
  --panel-pad: clamp(16px, 2vw, 24px);
  grid-row: 3;
  padding: var(--panel-pad);
}

.notes-panel {
  grid-column: 1;
  border-left: 8px solid var(--orange);
}

.rules-panel {
  grid-column: 2;
  border-left: 8px solid #59636f;
}

.note-list,
.rule-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: #d1d9e0;
  font-size: clamp(0.92rem, 1.15vw, 1.05rem);
  line-height: 1.28;
}

.note-list li,
.rule-list li {
  position: relative;
  padding: 8px 10px 8px 28px;
  border-left: 3px solid rgba(58, 166, 255, 0.65);
  background: rgba(255, 255, 255, 0.045);
}

.note-list li::before,
.rule-list li::before {
  position: absolute;
  left: 10px;
  color: var(--orange);
  content: ">";
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}

.note-list li:nth-child(2n),
.rule-list li:nth-child(2n) {
  border-left-color: rgba(240, 138, 36, 0.72);
}

@keyframes connecting {
  0% {
    transform: translateX(-40%);
  }

  100% {
    transform: translateX(330%);
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .loading-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    min-height: 100vh;
    height: auto;
  }

  .server-header,
  .progress-panel,
  .info-panel,
  .notes-panel,
  .rules-panel {
    grid-column: 1;
  }

  .server-header {
    grid-row: 1;
  }

  .progress-panel {
    grid-row: 2;
  }

  .info-panel {
    grid-row: 3;
  }

  .notes-panel {
    grid-row: 4;
  }

  .rules-panel {
    grid-row: 5;
  }

  .server-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }

  .server-details div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  .loading-screen {
    gap: 10px;
    padding: 10px;
  }

  .server-header {
    flex-direction: column;
  }

  .header-stamp {
    flex: auto;
    min-height: 70px;
    border-top: 2px solid #2b333d;
    border-left: 0;
  }

  h1 {
    font-size: clamp(2.15rem, 13vw, 3.65rem);
  }

  .progress-copy {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #status-text {
    font-size: clamp(1.45rem, 9vw, 2.3rem);
  }

  .server-details {
    grid-template-columns: 1fr;
  }

  .panel-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .tip-box {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-height: 760px) and (min-width: 981px) {
  .loading-screen {
    grid-template-rows: minmax(110px, 0.34fr) minmax(230px, 0.9fr) minmax(165px, 0.56fr);
    padding: 14px;
  }

  .progress-panel {
    padding: 20px;
  }

  .progress-panel .panel-bar {
    margin: -20px -20px 16px;
  }

  .note-list,
  .rule-list {
    gap: 7px;
    font-size: 0.9rem;
  }

  .server-details div {
    padding: 8px 0;
  }
}

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