:root {
  --color-black: #000000;
  --color-black-alt: #1a1a1a;
  --color-white: #ffffff;
  --color-red: #8B0000;
  --color-red-hover: #6B0000;
  --color-red-subtle: rgba(139, 0, 0, 0.1);
  --color-red-border: rgba(139, 0, 0, 0.3);
  --color-white-muted: rgba(255, 255, 255, 0.8);
  --color-white-dim: rgba(255, 255, 255, 0.7);
  --font-primary: Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  background: var(--color-black);
  color: var(--color-white);
}
h1 { font-size: 2.1rem; line-height: 1.2; }
h2 { font-size: 1.7rem; line-height: 1.2; }
h3 { font-size: 1.35rem; line-height: 1.2; }
h4 { font-size: 1.1rem; line-height: 1.2; }
a { color: var(--color-white); text-decoration: none; transition: 0.2s ease; }
a:hover, a:focus-visible { color: var(--color-red); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { transition: color .2s ease, background-color .2s ease, border-color .2s ease, outline .2s ease; }
:focus-visible { outline: 2px solid var(--color-white); outline-offset: 2px; }
.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;
}
.hidden { display: none !important; }
.container, main { max-width: 1200px; margin: 0 auto; padding: 20px; }
section + section { margin-top: 60px; }

.skip-link { background: var(--color-red); color: var(--color-white); padding: 10px 14px; display: inline-block; }
.skip-link:focus-visible { position: static !important; width: auto; height: auto; margin: 10px; clip: auto; }

/* ===== BRAND BAR ===== */
.site-header {
  background: var(--color-black);
  border-bottom: 2px solid var(--color-red);
  position: sticky;
  top: 0;
  z-index: 130;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}

.site-logo {
  width: 140px;
  border: 2px solid var(--color-red);
  display: block;
}

.site-name {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
}

.site-tagline {
  margin: 0;
  color: var(--color-white-muted);
}

/* ===== NAVIGATION BAR ===== */
.nav-bar {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--color-red-border);
  position: relative;
}

.hamburger-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--color-red-border);
  cursor: pointer;
  padding: 12px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Animate to X when open */
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.nav-links::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.nav-links li {
  flex-shrink: 0;
}

.nav-links a {
  display: block;
  padding: 14px 16px;
  font-weight: 700;
  white-space: nowrap;
}

/* Scroll fade indicator on right edge */
.nav-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--color-black));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.nav-bar.scrolled-end::after {
  opacity: 0;
}

/* ===== DRAWER OVERLAY ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== DRAWER PANEL (slides from right per industry standard) ===== */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--color-black-alt);
  border-left: 2px solid var(--color-red);
  z-index: 140;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 16px;
}
.nav-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-red-border);
}

.drawer-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-white);
}

.drawer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-links a {
  display: block;
  padding: 12px 8px;
  border-bottom: 1px solid var(--color-red-border);
}

.slide { display: none; }
.slide.active { display: block; }
.slideshow-container { border: 1px solid var(--color-red-border); background: var(--color-black-alt); }
.slide-content { padding: 28px; min-height: 380px; display: grid; place-items: center; text-align: center; }
.welcome-slide { background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.7)), url('images/Playing_cards_fanned.png') center/cover no-repeat; }
.tournament-slide { background: linear-gradient(135deg, #1a1a5c, #2563eb); }
.tournament-slide h2, .tournament-slide .stat-value { color: #fbbf24; }
.tournament-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; width: 100%; }
.stat-box { background: var(--color-black); border: 2px solid #fbbf24; padding: 14px; }
.stat-label { color: var(--color-white); }
.video-placeholder { border: 2px dashed var(--color-red); padding: 28px; width: 100%; max-width: 500px; }
.leaderboard-list { width: 100%; max-width: 640px; }
.leaderboard-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; padding: 10px; border-bottom: 1px solid var(--color-red-border); }
.slideshow-controls { display: flex; justify-content: center; gap: 12px; padding: 14px; }
.slide-btn, .btn, .primary-btn { background: var(--color-red); color: var(--color-white); border: 1px solid var(--color-red); font-weight: 700; padding: 12px 16px; cursor: pointer; }
.slide-btn:hover, .btn:hover, .primary-btn:hover,
.slide-btn:focus-visible, .btn:focus-visible, .primary-btn:focus-visible { background: var(--color-red-hover); outline: 2px solid var(--color-white); outline-offset: 2px; }
.about-section { background: var(--color-black-alt); border: 1px solid var(--color-red-border); padding: 24px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 540px; background: var(--color-white); color: var(--color-black); padding: 24px; border: 2px solid var(--color-red); }
.auth-card h1, .auth-card h2 { color: var(--color-red); }
.auth-card label { color: var(--color-black); font-weight: 700; display: block; margin-bottom: 6px; }
.auth-card input, .auth-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--color-red); background: var(--color-white); color: var(--color-black); }
.auth-card :focus-visible { outline: 2px solid var(--color-red); outline-offset: 2px; }
.form-group { margin-bottom: 15px; }
.form-banner { margin-top: 16px; }

.page-panel, .form-shell, .tab-panel, .modal-content { background: var(--color-black-alt); border: 1px solid var(--color-red-border); padding: 20px; }
label { font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px 12px; background: var(--color-black); color: var(--color-white); border: 1px solid var(--color-red); }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--color-red); }
fieldset { border: 1px solid var(--color-red-border); margin: 0 0 15px; }
legend { color: var(--color-white); font-weight: 700; }
.radio-option { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }

.game-type-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.game-type-btn i { margin-right: 8px; }
.disclaimer { border-left: 4px solid var(--color-red); background: var(--color-red-subtle); padding: 12px; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
[role='tab'] { background: var(--color-black); border: 1px solid var(--color-red); color: var(--color-white); padding: 10px 14px; }
[role='tab'][aria-selected='true'] { background: var(--color-red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 10px; }
.achievement { border: 1px solid var(--color-red-border); padding: 10px; display: flex; align-items: center; gap: 8px; }
.achievement.earned { border-color: var(--color-red); }
.achievement.unearned { opacity: .75; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar button { min-width: 44px; min-height: 44px; background: var(--color-black); border: 1px solid var(--color-red); color: var(--color-white); }
.activity-item { display: flex; gap: 10px; border-bottom: 1px solid var(--color-red-border); padding: 8px 0; }
.auto-save-status { color: var(--color-white-muted); }
.auto-save-status i { color: var(--color-red); }

.felt-green { background: #0b5d1e; }
.felt-ocean { background: #1a5276; }
.felt-wine { background: #722f37; }
.felt-night { background: #1a1a2e; }
.felt-plum { background: #6c3461; }
.felt-gold { background: #b8860b; }
.card-blue { color: #0066cc; }
.card-green { color: #008800; }

.site-footer { margin-top: 60px; border-top: 2px solid var(--color-red); background: var(--color-black); padding: 24px 20px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.footer-title, .footer-heading { color: var(--color-red); font-weight: 700; margin: 0 0 8px; }
.footer-section p { color: var(--color-white-muted); margin: 0 0 8px; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin: 6px 0; }
.social-icons { display: flex; flex-wrap: wrap; gap: 10px; }
.social-icons a { width: 44px; height: 44px; border: 1px solid var(--color-red-border); display: grid; place-items: center; }
.social-icons i { font-size: 1.2rem; }
.footer-bottom { max-width: 1200px; margin: 16px auto 0; border-top: 1px solid var(--color-red-border); padding-top: 14px; color: var(--color-white-dim); }

@media (max-width: 1024px) {
  .game-type-buttons, .tournament-stats { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .footer-container { grid-template-columns: 1fr; }
}

.about-subheading {
  color: var(--color-white-muted);
  font-size: 1.1rem;
  margin-top: 8px;
}

.about-section {
  margin-bottom: 40px;
}

.read-more-btn {
  background: transparent;
  color: var(--color-red);
  border: none;
  padding: 8px 0;
  font-weight: 700;
  cursor: pointer;
}

.read-more-btn:hover,
.read-more-btn:focus-visible {
  color: var(--color-red-hover);
  text-decoration: underline;
}

.how-to-play-video {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.section-subtitle {
  color: var(--color-white-muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.video-container {
  max-width: 800px;
  margin: 0 auto;
}

.tutorial-video {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--color-red);
  background: var(--color-black-alt);
}

.hand-rankings-section {
  max-width: 1200px;
  margin: 60px auto 0;
  padding: 0 20px;
}

.hand-rankings-chart {
  margin-top: 20px;
}

.hand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid var(--color-red-border);
  background: var(--color-black-alt);
  margin-bottom: 8px;
}

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

.hand-name {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: var(--color-white);
}

.hand-description {
  margin: 0;
  color: var(--color-white-muted);
  font-size: 0.95rem;
}

.hand-cards {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  align-items: center;
}

.card-img {
  width: 60px;
  height: auto;
  border-radius: 4px;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.35);
}

@media (max-width: 600px) {
  .hand-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hand-cards {
    margin-top: 10px;
  }

  .card-img {
    width: 48px;
  }
}

.practice-section {
  max-width: 800px;
  margin: 60px auto 0;
  padding: 30px;
  background: var(--color-black-alt);
  border: 2px solid var(--color-red);
  text-align: center;
}

.practice-section h2 {
  margin-top: 0;
}

.practice-section p {
  color: var(--color-white-muted);
  max-width: 600px;
  margin: 0 auto 20px;
}

.practice-btn {
  font-size: 1.1rem;
  padding: 14px 28px;
}

.practice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.practice-note {
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 12px;
}


/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 20px;
  background: var(--color-black);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-black-alt);
  border: 1px solid var(--color-red-border);
  border-radius: 14px;
  padding: 32px;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 20px;
}

.social-buttons {
  display: grid;
  gap: 12px;
}

.social-btn {
  min-height: 44px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
}

.social-btn--google {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #d9d9d9;
}

.social-btn--facebook {
  background: #1877f2;
  color: #ffffff;
}

.social-btn--apple {
  background: #111111;
  color: #ffffff;
  border-color: #5e5e5e;
}

.divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--color-red-border);
}

.divider span {
  position: relative;
  background: var(--color-black-alt);
  padding: 0 10px;
  color: var(--color-white-muted);
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.form-group input,
.form-group select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-red-border);
  background: var(--color-black);
  color: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.password-toggle:focus,
.social-btn:focus,
.auth-submit-btn:focus,
.inline-link:focus {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

.form-group .helper-text {
  margin: 6px 0 0;
  color: var(--color-white-muted);
  font-size: 0.92rem;
}

.form-group .error-text {
  margin: 6px 0 0;
  color: #ff6f6f;
  font-size: 0.92rem;
}

.input-error {
  border-color: #ff6f6f !important;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  min-width: 40px;
  border: none;
  background: transparent;
  color: var(--color-white-muted);
  border-radius: 7px;
  cursor: pointer;
}

.auth-options-row,
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-row {
  justify-content: flex-start;
}

.checkbox-row input[type='checkbox'] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.checkbox-group {
  margin-bottom: 16px;
  display: grid;
  gap: 6px;
}

.inline-link,
.auth-switch-text a {
  color: var(--color-white);
  text-decoration: underline;
}

.strength-meter {
  margin-top: 10px;
}

.strength-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #2b2b2b;
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 25%;
  background: #d93636;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.strength-bar span[data-level='2'] { width: 50%; background: #ff8a3d; }
.strength-bar span[data-level='3'] { width: 75%; background: #d8c83f; }
.strength-bar span[data-level='4'] { width: 100%; background: #2eaf61; }

.strength-label {
  margin: 8px 0 0;
  color: var(--color-white-muted);
}

.password-requirements {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 5px;
}

.requirement {
  display: flex;
  align-items: center;
  gap: 8px;
}

.requirement.met { color: #7ad89f; }
.requirement.unmet { color: var(--color-white-muted); }

.auth-submit-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-red);
  border-radius: 8px;
  background: var(--color-red);
  color: var(--color-white);
  font-weight: 700;
  cursor: pointer;
}

.auth-submit-btn:hover {
  background: var(--color-red-hover);
}

.auth-submit-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-success-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--color-red-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.auth-success-panel i {
  font-size: 2rem;
  color: #7ad89f;
}

.auth-success-subtext {
  color: var(--color-white-muted);
}

.two-factor-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-red-border);
}

.verified-banner {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(122, 216, 159, 0.5);
  border-radius: 8px;
  background: rgba(46, 175, 97, 0.2);
  color: #b7f4cc;
}

.logout-link {
  color: #ffb3b3;
}

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

.auth-message {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--color-red-border);
}

.auth-message--success { background: rgba(40, 120, 70, 0.22); }
.auth-message--error { background: rgba(170, 42, 42, 0.25); }
.auth-message--info { background: rgba(139, 0, 0, 0.2); }
.auth-return-link { margin: 10px 0 0; }
.auth-intro,
.auth-switch-text { color: var(--color-white-muted); }

.legal-page {
  padding-top: 24px;
}

.legal-updated {
  color: var(--color-white-muted);
  margin-top: -4px;
}

.legal-notice {
  border-left: 4px solid var(--color-red);
  background: var(--color-red-subtle);
  padding: 12px;
}

@media (max-width: 768px) {
  .auth-page {
    padding: 16px;
    align-items: flex-start;
  }

  .auth-card {
    max-width: 100%;
    padding: 24px;
    border-radius: 10px;
  }

  .auth-options-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
