:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1115;
  --bg-2: #141a20;
  --surface: rgba(22, 29, 35, 0.9);
  --surface-solid: #161d23;
  --surface-2: rgba(31, 40, 47, 0.92);
  --ink: #eef3f4;
  --muted: #a8b5bc;
  --soft: #d8e1e3;
  --line: rgba(178, 199, 207, 0.18);
  --line-strong: rgba(209, 228, 234, 0.32);
  --teal: #54b6bd;
  --teal-2: #79d1d4;
  --gold: #d7af62;
  --rust: #c56f5c;
  --ok: #63d889;
  --ok-bg: rgba(99, 216, 137, 0.14);
  --bad: #ff8c82;
  --bad-bg: rgba(255, 140, 130, 0.14);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
  --glow: rgba(84, 182, 189, 0.26);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #e9e5dc;
  --bg-2: #f4f0e7;
  --surface: rgba(255, 252, 244, 0.92);
  --surface-solid: #fffaf0;
  --surface-2: rgba(244, 238, 226, 0.96);
  --ink: #182027;
  --muted: #5f6a72;
  --soft: #2b3940;
  --line: rgba(59, 76, 83, 0.18);
  --line-strong: rgba(59, 76, 83, 0.3);
  --teal: #2d838b;
  --teal-2: #246a72;
  --gold: #a7792c;
  --rust: #9d513f;
  --ok: #247245;
  --ok-bg: rgba(36, 114, 69, 0.12);
  --bad: #af3f39;
  --bad-bg: rgba(175, 63, 57, 0.12);
  --shadow: 0 14px 34px rgba(37, 33, 26, 0.14);
  --glow: rgba(45, 131, 139, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(18, 24, 30, 0.92), rgba(13, 17, 21, 0.98) 480px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(6, 10, 14, 0.42), var(--bg) 78%),
    url("/static/palandor-hero-bg.png") center top / cover no-repeat;
  opacity: 0.2;
}

html[data-theme="light"] body::before {
  opacity: 0.1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 11px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 19, 0.76);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .topbar {
  background: rgba(248, 244, 235, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 230px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 800;
}

.brand img {
  width: 92px;
  height: 38px;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
}

nav,
.nav-form,
.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav {
  justify-content: flex-end;
}

nav a,
.nav-form button,
.theme-toggle {
  min-height: 36px;
  color: var(--soft);
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

nav a:hover,
.nav-form button:hover,
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] nav a:hover,
html[data-theme="light"] .nav-form button:hover,
html[data-theme="light"] .theme-toggle:hover {
  background: rgba(24, 32, 39, 0.06);
}

main {
  width: 100%;
  margin: 0;
  padding-bottom: 56px;
}

main > .status-strip,
main > .notice,
main > .grid,
main > .compact-panel,
.start-strip,
.download-portal,
main > .form-panel.single,
main > .account-shell,
main > .panel {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

main > .status-strip {
  margin-top: 24px;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(230px, 1.2fr) repeat(2, minmax(145px, 0.75fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-strip > div,
.status-error {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), rgba(16, 22, 27, 0.76));
  box-shadow: var(--shadow);
}

html[data-theme="light"] .status-strip > div,
html[data-theme="light"] .status-error {
  background: linear-gradient(180deg, var(--surface), rgba(244, 238, 226, 0.86));
}

.status-strip > div:not(.server-card) > span {
  display: block;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}

.status-strip small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.server-card {
  display: grid;
  align-content: center;
  gap: 5px;
}

.status-strip .server-line {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.15;
}

.status-strip .server-line strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.lamp {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: var(--bad);
  box-shadow: 0 0 14px rgba(255, 140, 130, 0.68);
}

.server-card.online .lamp {
  background: var(--ok);
  box-shadow: 0 0 16px rgba(99, 216, 137, 0.82);
}

.status-error {
  grid-column: 1 / -1;
  color: var(--bad);
  background: var(--bad-bg);
}

.notice {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice.success {
  color: var(--ok);
  border-color: rgba(99, 216, 137, 0.4);
}

.notice.error {
  color: var(--bad);
  border-color: rgba(255, 140, 130, 0.44);
}

.palandor-hero {
  min-height: clamp(470px, calc(100vh - 145px), 670px);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(7, 10, 14, 0.94) 0%, rgba(11, 17, 22, 0.86) 42%, rgba(13, 18, 23, 0.38) 78%),
    linear-gradient(180deg, rgba(11, 17, 22, 0.1), rgba(11, 17, 22, 0.9)),
    url("/static/palandor-hero-bg.png") center right / cover no-repeat;
}

html[data-theme="light"] .palandor-hero {
  background:
    linear-gradient(90deg, rgba(12, 18, 22, 0.9) 0%, rgba(18, 28, 34, 0.74) 46%, rgba(16, 24, 28, 0.24) 80%),
    linear-gradient(180deg, rgba(19, 27, 31, 0.1), rgba(12, 17, 21, 0.78)),
    url("/static/palandor-hero-bg.png") center right / cover no-repeat;
}

.palandor-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 150px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(300px, 390px);
  gap: 34px;
  align-items: center;
  padding: 46px 0 54px;
}

.hero-copy {
  max-width: 720px;
}

.hero-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  color: #f7fbfb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 82px;
  font-weight: 700;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.hero-copy h1 span {
  display: block;
  color: #9ed9da;
  text-shadow: 0 0 30px var(--glow);
}

.hero-subtitle {
  max-width: 610px;
  margin: 22px 0 28px;
  color: #d8e2e3;
  font-size: 18px;
  line-height: 1.56;
}

.hero-actions,
.download-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .button-link,
.download-actions .button-link,
.download-actions button {
  min-width: 188px;
}

.hero-primary {
  border: 1px solid rgba(125, 229, 232, 0.42);
  background: linear-gradient(180deg, #4fb2ba, #267983);
  box-shadow: 0 0 30px var(--glow), inset 0 0 18px rgba(255, 255, 255, 0.13);
}

.hero-secondary {
  color: #eef6f6;
  border-color: rgba(216, 228, 232, 0.28);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 18px rgba(84, 182, 189, 0.12);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-meta span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(216, 228, 232, 0.2);
  border-radius: 6px;
  color: #d8e2e3;
  background: rgba(10, 16, 20, 0.48);
  font-size: 13px;
  font-weight: 750;
}

.hero-side {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(216, 228, 232, 0.22);
  border-radius: 8px;
  background: rgba(10, 16, 20, 0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.side-label {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.hero-side .status-strip {
  grid-template-columns: 1fr 1fr;
  margin: 0;
}

.hero-side .server-card {
  grid-column: 1 / -1;
}

.hero-side .status-strip > div {
  min-height: 72px;
  background: rgba(18, 26, 32, 0.82);
  box-shadow: none;
}

.hero-side .status-strip > div:not(.server-card) > span {
  font-size: 25px;
}

.hero-side .status-strip small {
  font-size: 12px;
}

.side-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(215, 175, 98, 0.25);
  border-radius: 8px;
  background: rgba(215, 175, 98, 0.09);
}

.side-note strong {
  color: #f0d39a;
}

.side-note span {
  color: #cfd9da;
  line-height: 1.45;
}

.start-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: -34px;
  margin-bottom: 18px;
}

.start-strip article {
  min-height: 104px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), rgba(17, 24, 30, 0.88));
  box-shadow: var(--shadow);
}

html[data-theme="light"] .start-strip article {
  background: linear-gradient(180deg, var(--surface), rgba(245, 239, 226, 0.94));
}

.start-strip strong {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(84, 182, 189, 0.44);
  border-radius: 50%;
  color: var(--teal-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.start-strip span {
  font-weight: 850;
}

.start-strip small {
  align-self: start;
  color: var(--muted);
  line-height: 1.4;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 0.75fr) minmax(320px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.download-portal {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) repeat(3, minmax(190px, 0.65fr));
  gap: 14px;
  align-items: stretch;
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 12, 16, 0.88), rgba(18, 25, 31, 0.78)),
    url("/static/palandor-hero-bg.png") center right / cover no-repeat;
  box-shadow: var(--shadow);
}

.download-main {
  display: grid;
  align-content: center;
  min-height: 330px;
}

.download-main h1 {
  margin: 0;
  color: #f8fbfb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 56px;
  line-height: 1;
}

.download-main .muted {
  max-width: 560px;
  margin: 14px 0 24px;
  color: #d6e0e0;
  line-height: 1.55;
}

.download-card {
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 230px;
  padding: 18px;
  border: 1px solid rgba(216, 228, 232, 0.22);
  border-radius: 8px;
  background: rgba(13, 19, 24, 0.72);
  backdrop-filter: blur(8px);
}

.download-card span {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
}

.download-card strong {
  color: #f4f8f8;
  font-size: 18px;
}

.download-card p {
  margin: 0;
  color: #cdd8da;
  line-height: 1.45;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), rgba(16, 22, 27, 0.86));
  box-shadow: var(--shadow);
}

html[data-theme="light"] .panel {
  background: linear-gradient(180deg, var(--surface), rgba(244, 238, 226, 0.9));
}

.form-panel,
.news-panel,
.account-mini,
.compact-panel {
  padding: 18px;
}

.form-panel.single {
  max-width: 620px;
  margin-top: 24px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 13, 17, 0.42);
  color: var(--ink);
  font: inherit;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea {
  background: rgba(255, 250, 240, 0.82);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(84, 182, 189, 0.38);
  border-color: var(--teal);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

button,
.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--teal-2);
}

button:disabled,
button:disabled:hover {
  opacity: 0.66;
  cursor: default;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid var(--line);
}

.button-link.secondary,
.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line);
}

html[data-theme="light"] .button-link.secondary,
html[data-theme="light"] .secondary-button {
  background: rgba(24, 32, 39, 0.06);
}

.button-link.secondary:hover,
.secondary-button:hover {
  background: rgba(84, 182, 189, 0.18);
}

.news-panel {
  min-height: 100%;
}

.news-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.news-item:last-child {
  border-bottom: 0;
}

.news-item time {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.news-item p,
.muted {
  color: var(--muted);
}

.account-mini p {
  margin: 10px 0 16px;
}

.compact-panel {
  margin-top: 16px;
}

.feedback-row {
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr);
  align-items: start;
}

.feedback-row textarea {
  grid-column: 1 / -1;
}

.feedback-row button {
  width: 180px;
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.account-header p {
  margin: 8px 0 0;
}

.account-badge {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
}

.account-badge.online {
  color: var(--ok);
  background: var(--ok-bg);
}

.account-badge.offline {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(220px, 1fr) minmax(160px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.2;
}

.stat-card small {
  color: var(--muted);
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

td {
  color: var(--ink);
}

@media (max-width: 1040px) {
  .hero-inner,
  .download-portal,
  .grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .palandor-hero {
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: 64px;
  }

  .hero-side {
    align-self: auto;
  }

  .download-main {
    min-height: 240px;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
    font-size: 16px;
  }

  .brand img {
    width: 86px;
    height: 36px;
  }

  nav {
    justify-content: flex-start;
  }

  main > .status-strip,
  main > .notice,
  main > .grid,
  main > .compact-panel,
  .start-strip,
  .download-portal,
  main > .form-panel.single,
  main > .account-shell,
  main > .panel,
  .hero-inner {
    width: min(100% - 20px, 640px);
  }

  .hero-inner {
    gap: 18px;
    padding: 24px 0 38px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-subtitle {
    margin: 16px 0 20px;
    font-size: 15px;
  }

  .hero-kicker {
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 2px;
  }

  .hero-meta {
    margin-top: 14px;
  }

  .hero-meta span {
    min-height: 28px;
    font-size: 12px;
  }

  .hero-side {
    padding: 12px;
  }

  .side-label,
  .side-note,
  .hero-side .status-strip > div:not(.server-card) {
    display: none;
  }

  .hero-side .status-strip > div {
    min-height: 62px;
    padding: 11px 12px;
  }

  .hero-side .status-strip .server-line strong {
    font-size: 19px;
  }

  .hero-actions .button-link,
  .download-actions .button-link,
  .download-actions button {
    width: 100%;
  }

  .hero-side .status-strip,
  .status-strip,
  .start-strip,
  .feedback-row {
    grid-template-columns: 1fr;
  }

  .hero-side .server-card {
    grid-column: auto;
  }

  .start-strip {
    margin-top: -18px;
  }

  .download-portal {
    padding: 18px;
  }

  .download-main h1 {
    font-size: 40px;
  }

  .account-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .feedback-row textarea,
  .feedback-row button {
    grid-column: auto;
    width: 100%;
  }
}
