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

/* === Темы === */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: #aaa;
  --muted2: #888;
  --muted3: #666;
  --card-bg: #0a0a0a;
  --card-border: #1a1a1a;
  --input-bg: #111;
  --input-border: #222;
  --btn-bg: #fff;
  --btn-fg: #000;
  --link: #fff;
  --error-bg: #2a0a0a;
  --error-fg: #ff6b6b;
  --success-bg: #0a2a0a;
  --success-fg: #6bff6b;
  --notice-bg: #1a1a1a;
}

html.theme-light, body.theme-light {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #555;
  --muted2: #777;
  --muted3: #999;
  --card-bg: #fff;
  --card-border: #e5e5e5;
  --input-bg: #fff;
  --input-border: #d4d4d4;
  --btn-bg: #1a1a1a;
  --btn-fg: #fff;
  --link: #1a1a1a;
  --error-bg: #fef2f2;
  --error-fg: #dc2626;
  --success-bg: #f0fdf4;
  --success-fg: #16a34a;
  --notice-bg: #f5f5f5;
}

html { background: #000; }
html.theme-light { background: #fafafa; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

nav, .card, .feature, .tg-link, input, .btn, .tab,
.profile-row, footer, label, .error, .success, .notice,
.theme-dropdown, h1, h2, p, a {
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--card-border);
}

nav .logo {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.5px;
}

nav .links {
  display: flex;
  gap: 28px;
  align-items: center;
}

nav a {
  color: var(--muted2);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

nav a:hover, nav a.active { color: var(--fg); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
}

h1 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 16px;
  margin-top: 40px;
}

p {
  color: var(--muted);
  margin-bottom: 16px;
}

.hero { margin-bottom: 56px; }

.hero .sub {
  font-size: 18px;
  color: var(--muted2);
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover, .btn:active { opacity: 0.85; }

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--card-border);
}

.btn.ghost:hover { border-color: var(--muted3); opacity: 1; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
}

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted2);
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 16px;
  font-family: inherit;
}

input:focus { outline: none; border-color: var(--muted2); }

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--card-border);
}

.tab {
  padding: 12px 0;
  cursor: pointer;
  color: var(--muted3);
  font-size: 14px;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  -webkit-tap-highlight-color: transparent;
}

.tab.active { color: var(--fg); border-bottom-color: var(--fg); }

.error {
  background: var(--error-bg);
  color: var(--error-fg);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.success {
  background: var(--success-bg);
  color: var(--success-fg);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.notice {
  background: var(--notice-bg);
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 16px;
}

.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: var(--muted2); font-size: 14px; flex-shrink: 0; }
.profile-row .value { font-size: 14px; text-align: right; word-break: break-all; }

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.feature {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.feature h3 { font-size: 15px; margin-bottom: 8px; }
.feature p { font-size: 13px; color: var(--muted2); margin: 0; }

.tg-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.tg-link {
  display: block;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s;
}

.tg-link:hover { border-color: var(--muted3); }

.tg-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.tg-desc { font-size: 12px; color: var(--muted2); }

.profile-block {
  display: flex;
  gap: 32px;
  align-items: center;
}

.profile-block img,
.profile-block canvas {
  width: 128px;
  height: 128px;
  background: var(--input-bg);
  border-radius: 8px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.profile-block .info { flex: 1; min-width: 0; }

footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted3);
  font-size: 13px;
  border-top: 1px solid var(--card-border);
}

.theme-switch {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.theme-switch > .theme-btn {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  font-family: inherit;
  transition: color 0.3s;
}

.theme-switch > .theme-btn:hover { color: var(--fg); }

.theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background 0.3s, border-color 0.3s;
  pointer-events: none;
}

.theme-switch:hover .theme-dropdown,
.theme-switch:focus-within .theme-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, color 0.3s;
}

.theme-dropdown button:hover { background: var(--input-bg); }

@media (max-width: 640px) {
  nav { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  nav .links { gap: 16px; font-size: 13px; flex-wrap: wrap; }
  main { padding: 32px 20px; }
  h1 { font-size: 32px; letter-spacing: -1px; }
  h2 { font-size: 19px; margin-top: 32px; }
  .hero { margin-bottom: 40px; }
  .hero .sub { font-size: 16px; }
  .card { padding: 20px; }
  .btn { width: 100%; text-align: center; padding: 14px 24px; }
  .feature-list { grid-template-columns: 1fr; }
  .profile-block { flex-direction: column; text-align: center; gap: 20px; }
  .profile-block img,
  .profile-block canvas { width: 96px; height: 96px; }
  .profile-row { font-size: 13px; }
  .profile-row .value { font-size: 13px; }
  .theme-dropdown { right: auto; left: 0; }
}
.links { display: flex; align-items: center; }
.theme-switch { display: flex; align-items: center; padding-bottom: 0; }
.theme-switch > .theme-btn { padding: 4px 8px; line-height: 1; }

.server-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 24px;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.server-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--fg);
}
.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted3);
  flex-shrink: 0;
}
.online-dot.on { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.online-dot.off { background: #ff6b6b; }
.ip-row { display: flex; flex-direction: column; gap: 8px; }
.ip-label { font-size: 12px; color: var(--muted2); }
.ip-field {
  display: flex;
  align-items: stretch;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
}
.ip-field code {
  flex: 1;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 16px;
  color: var(--fg);
  display: flex;
  align-items: center;
}
.ip-copy-btn {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-size: 18px;
  transition: opacity 0.15s;
}
.ip-copy-btn:hover { opacity: 0.85; }

.ip-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
}
.ip-copy-btn svg { display: block; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(80px);
  background: var(--fg);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease, visibility 0.35s;
  z-index: 1000;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { transform: scale(1.15); }

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted2);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
.nav-user:hover { color: var(--fg); }
.nav-user img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  image-rendering: pixelated;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  object-fit: cover;
}

.nav-skin {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  image-rendering: pixelated;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  display: block;
}
