/**
 * TNT WiFi branding layer for LibreSpeed.
 * Original LibreSpeed interface design credits remain with the upstream project.
 */

@import url("colors.css");
@import url("fonts.css");
@import url("main.css");
@import url("server-selector.css");
@import url("button.css");
@import url("results.css");
@import url("dialog.css");

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  min-height: 100vh;
  width: 100%;
}

html {
  background-color: var(--background-backup-color);
  background-image:
    radial-gradient(circle at 20% 10%, rgb(180 0 0 / 22%), transparent 34rem),
    radial-gradient(circle at 85% 75%, rgb(255 30 30 / 12%), transparent 38rem),
    linear-gradient(145deg, #050505 0%, #151515 52%, #080808 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  font-size: 10px;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-overlay-color);
  color: var(--primary-text-color);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem 1rem;
}

header .brand-logo {
  width: min(24rem, 62vw);
  height: auto;
  filter: drop-shadow(0 0.8rem 1.4rem rgb(0 0 0 / 55%));
}

main {
  width: min(96rem, calc(100% - 3rem));
  margin-inline: auto;
}

main > h1 {
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.08rem;
  text-shadow: 0 0.3rem 1.4rem rgb(0 0 0 / 60%);
}

main > .tagline {
  color: var(--tagline-text-color);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04rem;
}

.server-selector {
  backdrop-filter: blur(10px);
  box-shadow: 0 1.2rem 3.5rem rgb(0 0 0 / 35%);
}

button#start-button {
  box-shadow: 0 1rem 3rem var(--button-shadow-color);
}

footer {
  margin: auto auto 0;
  padding: 4rem 2rem 3rem;
  text-align: center;
}

footer > p.source {
  color: var(--secondary-text-color);
  font-size: 1.4rem;
}

footer > p.source a {
  color: #ff4a4a;
  font-size: 1.4rem;
  font-weight: 700;
  text-underline-offset: 0.3rem;
  transition: color 0.2s ease, text-underline-offset 0.2s ease;
}

footer > p.source a:hover {
  color: #ffffff;
  text-underline-offset: 0.5rem;
}

.brand-note {
  margin-top: 0.8rem;
  color: #8f8f8f;
  font-size: 1.2rem;
}

@media screen and (max-width: 800px) {
  html {
    font-size: 8px;
  }

  header {
    padding: 3rem 2rem 0.5rem;
  }

  main {
    width: min(100% - 2rem, 96rem);
  }

  footer {
    padding: 3rem 2rem;
  }
}

/* Compact single-screen TNT WiFi layout */
body {
  min-height: 100vh;
}

header {
  padding: 1.2rem 2rem 0.2rem;
}

header .brand-logo {
  width: min(15rem, 38vw);
  max-height: 11rem;
  object-fit: contain;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92rem, calc(100% - 2rem));
}

main > h1 {
  font-size: clamp(2.4rem, 3.2vw, 4rem);
  line-height: 1.05;
  margin-top: 0.3rem;
}

main > .tagline {
  font-size: clamp(1.4rem, 1.6vw, 1.9rem);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.server-selector {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.server-selector .sponsor,
#sponsor {
  display: none !important;
}

#privacy-warning {
  margin: 0.5rem 0;
}

button#start-button {
  margin-top: 0.4rem;
  margin-bottom: 0.7rem;
}

.gauge-layout {
  margin-top: 0.5rem;
}

footer {
  margin-top: auto;
  padding: 1rem 2rem 1.2rem;
  line-height: 1.25;
}

footer > p.source,
footer > p.source a,
.brand-note {
  font-size: 1.1rem;
}

.brand-note {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

@media screen and (min-width: 801px) and (max-height: 900px) {
  html {
    font-size: 8.5px;
  }

  header .brand-logo {
    width: 13rem;
    max-height: 9rem;
  }

  header {
    padding-top: 0.8rem;
  }

  footer {
    padding-top: 0.5rem;
    padding-bottom: 0.7rem;
  }
}

@media screen and (max-width: 800px) {
  header {
    padding: 1.5rem 1rem 0.2rem;
  }

  header .brand-logo {
    width: min(14rem, 42vw);
  }

  main > .tagline {
    margin-bottom: 0.5rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }
}

/* TNT WiFi server dropdown: compact, readable, and above the test controls */
.server-selector {
  position: relative;
  z-index: 50;
}

.server-selector > ul.servers {
  z-index: 1000;
  top: calc(100% - 0.1rem);
  max-height: min(34rem, 48vh);
  overflow-y: auto;
  overflow-x: hidden;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 0 1.6rem 3.5rem rgb(0 0 0 / 70%);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.server-selector > ul.servers > li > a {
  padding: 0.85rem 2rem;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.08rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.server-selector > ul.servers > li:first-child > a {
  padding-top: 1.1rem;
}

.server-selector > ul.servers > li:last-child > a {
  padding-bottom: 1.1rem;
}

@media screen and (max-width: 800px) {
  .server-selector > ul.servers {
    max-height: min(30rem, 42vh);
  }

  .server-selector > ul.servers > li > a {
    padding: 0.9rem 1.6rem;
    font-size: 1.75rem;
    line-height: 1.18;
  }
}
