:root {
  /* Single palette aligned to rollhub.com */
  --background: #0f1115;
  --foreground: #ffffff;
  --container: #161a22;
  --border: #2a2f3a;

  --primary: #ff2da1; /* Brand pink */
  --primary-800: #b81f71;
  --primary-900: #8b1756;
  --cyan: #19e3ff;
  --green: #44b39d;
  --gray: #abacad;
  --red: #bf4a67;

  --subtle-bg: #12151c;
}

body {
  background-color: var(--background);
  color: var(--foreground);

  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 1.2rem;

  padding: 0 1.5rem 3rem;
  max-width: 100vw;
  overflow-x: hidden;
}

#root {
  display: flex;
  align-items: stretch;
  flex-direction: column;

  gap: 2rem;
}

@media (min-width: 1400px) {
  #root {
    max-width: 1400px;
    margin: 0 auto;
  }
}

@media (max-width: 1400px) {
  .input-group small br {
    display: none;
  }
}

header {
  display: flex;
  flex-direction: row;
  position: sticky;
  top: 0;
  z-index: 10;

  align-items: center;
  justify-content: space-between;

  margin: 1rem 0 2rem;
  background: var(--background);
}

header #logo {
  height: 64px;
}

header #github {
  position: absolute;
  top: 0;
  right: 0;
}

header #github img {
  width: 32px;
  height: 32px;
}

/* Compact header navigation */
.top-nav {
  display: flex;
  gap: 1rem;
}
.top-nav a, .top-nav a:visited {
  color: var(--foreground);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
}
.top-nav .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.top-nav .back-link svg { opacity: 0.9; }
.top-nav a:hover {
  border-color: var(--border);
  background: var(--subtle-bg);
}
.top-nav a.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}
.top-nav a.icon {
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
}
.top-nav a.icon img { width: 24px; height: 24px; }

/* Collapse nav text on small screens */
@media (max-width: 640px) {
  .top-nav a.home-link { display: none; }
}

/* Subtle neon divider under header similar to app navigation */
header::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* Hero section */
.hero {
  gap: 0.25rem;
}
.section-title {
  margin: 0;
  font-size: 1.6rem;
}
.muted {
  margin: 0;
  color: var(--gray);
}

.information-box {
  background-color: var(--container);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 1rem;
  padding: 1rem 0;
}

button {
  background-color: var(--container);
  font-size: 1.05rem;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
}

button:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

/* Link-style buttons for index cards */
.link-button {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
  background-color: transparent;
}
.link-button:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.button-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.button-primary:hover {
  filter: brightness(0.95);
}

/* Larger CTA button */
.cta-large {
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.65rem;
  background: linear-gradient(90deg, #ff2da1, #ff5bbd);
  border: none;
  box-shadow: 0 6px 18px rgba(255, 45, 161, 0.25);
}
.cta-large:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

small {
  font-size: 0.8rem;
  color: var(--gray);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group.full-width {
  width: 100%;
}

.input-group.inline {
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.input-group label {
  font-weight: semibold;
}

input {
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

table {
  border: 1px solid var(--border);
  table-layout: fixed;
  width: 100%;
}

table thead {
  background-color: var(--subtle-bg);
}

table th {
  padding: 0.5rem 1rem;
  text-align: left;
}

table tbody {
  background-color: var(--container);
}

table td {
  padding: 0.5rem 1rem;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table td.code {
  font-family: monospace;
}

table td.is-over-median {
  color: var(--green);
}

table td.is-at-median {
  color: var(--gray);
}

table td.is-under-median {
  color: var(--red);
}

/* Cards/Grid used on index */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--container);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.card h3 {
  margin: 0 0 0.5rem 0;
}

.card p {
  margin: 0 0 0.75rem 0;
  color: var(--gray);
}

.card a {
  color: var(--primary);
  text-decoration: none;
}
.card a:hover {
  text-decoration: underline;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 45, 161, 0.12);
}

/* Inputs */
input {
  background: var(--container);
  color: var(--foreground);
  border-color: var(--border);
}
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,45,161,0.15);
}

/* End header controls */

/* Telegram section */
.telegram {
  gap: 0.5rem;
}
.telegram-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.tg-icon {
  color: var(--cyan);
}
.telegram-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.icon-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 45, 161, 0.15);
}
.telegram-cta { margin-top: 0.25rem; }
.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.9);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.9); }
  70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* Footer */
footer {
  display: flex;
  justify-content: center;
  opacity: 1;
  margin-top: 1rem;
}
.footer-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--foreground);
  text-decoration: none;
  opacity: 0.9;
}
.footer-link:hover { color: var(--primary); }
.ok { color: #0a7f27; font-weight: 600; }
.bad { color: #b00020; font-weight: 600; }
.muted { color: #777; font-size: 12px; }
