:root {
  color-scheme: light dark;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #f7f7f7;
  color: #111;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, #f3f4f6 100%);
  color: inherit;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.required-indicator {
  color: #dc2626;
  margin-left: 0.25rem;
  font-weight: 700;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0 1.45rem 0 0.9rem;
  height: 48px;
  min-width: 58px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, #fdfefe, #eff4ff);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  backdrop-filter: blur(12px);
}

.menu-toggle::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(110deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.18);
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
  outline: none;
}

.menu-toggle:hover::after,
.menu-toggle:focus-visible::after,
.menu-toggle.is-active::after {
  opacity: 1;
}

.menu-toggle__label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: inherit;
}

.menu-toggle__icon {
  position: relative;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #c4b5fd);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.35);
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: inherit;
  box-shadow: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.menu-toggle__icon::before {
  transform: translateY(-6px);
}

.menu-toggle__icon::after {
  transform: translateY(6px);
}

.menu-toggle.is-active .menu-toggle__icon {
  background: transparent;
  box-shadow: none;
}

.menu-toggle.is-active .menu-toggle__icon::before {
  transform: rotate(45deg);
}

.menu-toggle.is-active .menu-toggle__icon::after {
  transform: rotate(-45deg);
}

.site-nav {
  position: absolute;
  right: 1.5rem;
  top: calc(100% - 0.25rem);
  min-width: 250px;
  padding: 1.25rem 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
  z-index: 25;
  opacity: 0;
  transform: translateY(0.75rem) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #0f172a;
  overflow: hidden;
  backdrop-filter: blur(16px);
  isolation: isolate;
}

.site-nav::after {
  content: "";
  position: absolute;
  inset: 10% 15% auto;
  height: 60%;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
  z-index: -1;
}

.site-nav.is-open {
  opacity: 1;
  transform: translateY(0.35rem) scale(1);
  pointer-events: auto;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.site-nav__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 0.9rem;
  border-radius: 16px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: border 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #0f172a;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.site-nav__link-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(15, 23, 42, 0.12);
}

.site-nav__link-icon svg {
  width: 22px;
  height: 22px;
  color: #1d4ed8;
}

.site-nav__link-icon--home {
  background: linear-gradient(135deg, #e0edff, #f0f7ff);
}

.site-nav__link-icon--rules {
  background: linear-gradient(135deg, #f4e8ff, #f8f1ff);
}

.site-nav__link-icon--dashboard {
  background: linear-gradient(135deg, #e4fbf5, #f1fff9);
}

.site-nav__link-text {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.site-nav__link-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  transition: background 0.3s ease, color 0.3s ease;
}

.site-nav__link svg {
  display: block;
}

.site-nav__link:hover .site-nav__link-arrow,
.site-nav__link:focus-visible .site-nav__link-arrow {
  background: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
}

.site-nav__account {
  margin-top: 1rem;
  padding: 1rem 1rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.9);
  display: grid;
  gap: 0.65rem;
}

.site-nav__account-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(71, 85, 105, 0.85);
}

.site-nav__account-display {
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.site-nav__account-empty {
  font-size: 0.95rem;
  color: rgba(71, 85, 105, 0.8);
}

.site-nav__logout {
  justify-self: start;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.site-nav__logout:hover,
.site-nav__logout:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.3);
  outline: none;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.12);
  z-index: 15;
  backdrop-filter: blur(4px);
}

.menu-overlay[hidden] {
  display: none !important;
}

body.menu-open {
  overflow: hidden;
}

.content {
  flex: 1 1 auto;
  padding: 4rem 1.5rem 3rem;
  display: block;
}

.content--align-start {
  padding-top: 2.5rem;
}

.content--compact {
  padding-top: 1.5rem !important;
}

.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.container--left {
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

.container--wide {
  max-width: 860px;
}

.container--full {
  max-width: none;
  width: 100%;
}

.auth-section {
  width: 100%;
  display: grid;
  gap: 1.25rem;
}

.auth-section[hidden] {
  display: none !important;
}

.card {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(6px);
}

.card + .card {
  margin-top: 0;
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0 0 1.5rem;
  color: rgba(17, 17, 17, 0.72);
  line-height: 1.55;
}

.card.hero-card {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
}

.card.hero-card p {
  color: rgba(255, 255, 255, 0.85);
}

.card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background-color: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  color: inherit;
  background-color: rgba(17, 17, 17, 0.06);
  transition: background-color 0.2s ease;
}

.link-button:hover {
  background-color: rgba(17, 17, 17, 0.1);
}

form.auth-form {
  display: grid;
  gap: 1rem;
  text-align: left;
  width: 100%;
}

.auth-form label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auth-form input {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  background-color: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  color: #111;
  caret-color: #1d4ed8;
}

.auth-form input::placeholder {
  color: rgba(17, 17, 17, 0.45);
}

.auth-form input:not(:placeholder-shown) {
  color: rgba(17, 17, 17, 0.92);
}

.auth-form .checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(17, 17, 17, 0.85);
  margin: 0.25rem 0 0.5rem;
}

.auth-form .checkbox input {
  width: auto;
  accent-color: #2563eb;
}

.rules {
  width: 100%;
  max-width: 860px;
  margin: 0;
  text-align: left;
  display: grid;
  gap: 1.5rem;
}

.rules__header {
  display: grid;
  gap: 0.5rem;
}

.rules__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

.rules__subtitle {
  margin: 0;
  color: rgba(17, 17, 17, 0.68);
}

.rules__content {
  display: grid;
  gap: 1.25rem;
  color: rgba(17, 17, 17, 0.85);
  line-height: 1.7;
}

.rules__content p {
  margin: 0 0 1rem;
  text-align: left;
}

.rules__content h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  text-align: left;
}

.rules__content ul,
.rules__content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.rules__content li {
  margin-bottom: 0.35rem;
  padding-left: 0.1rem;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #111;
  -webkit-box-shadow: 0 0 0 1000px rgba(231, 238, 255, 0.95) inset;
  box-shadow: 0 0 0 1000px rgba(231, 238, 255, 0.95) inset;
  caret-color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

.auth-form input:autofill,
.auth-form input:autofill:hover,
.auth-form input:autofill:focus,
.auth-form input:autofill:active {
  color: #111;
  box-shadow: 0 0 0 1000px rgba(231, 238, 255, 0.95) inset;
  caret-color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

.auth-form input:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  outline: none;
}

.auth-message {
  font-size: 0.95rem;
  text-align: center;
  margin-top: 0.5rem;
}

.auth-message.error {
  color: #dc2626;
}

.auth-message.success {
  color: #16a34a;
}

footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(17, 17, 17, 0.6);
}

@media (max-width: 520px) {
  .menu-toggle {
    min-width: 44px;
    padding-right: 1rem;
  }

  .menu-toggle__label {
    display: none;
  }
}

@media (min-width: 768px) {
  .content {
    padding: 6rem 2rem 4rem;
  }

  header h1 {
    font-size: 1.75rem;
  }

  .actions {
    flex-direction: row;
    justify-content: center;
  }
}

#rules-root {
  display: block;
  width: 100%;
  margin: 0;
}

#rules-root, #rules-root * {
  text-align: left !important;
}

#rules-root main,
#rules-root .content,
#rules-root .container {
  display: block;
  margin: 0;
  padding: 0;
  text-align: left;
}

#rules-root .rules {
  max-width: 860px;
  margin: 0;
}

#rules-root .rules__content ol,
#rules-root .rules__content ul {
  padding-left: 1.25rem;
  margin-left: 0;
}
