/* ==========================================================================
   RLGX CUP — 100% MONOCHROME THEME
   GX eSports Official Platform
   Zero emojis. Pure high-contrast architectural typography.
   ========================================================================== */

:root {
  --bg-black: #050505;
  --bg-surface: #0e0e0e;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #0a0a0a;

  --border-light: #2c2c2c;
  --border-subtle: #1c1c1c;
  --border-active: #ffffff;

  --text-white: #ffffff;
  --text-secondary: #999999;
  --text-muted: #555555;

  --font-arabic: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Syne', var(--font-arabic);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-black);
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.05) 0%, rgba(5, 5, 5, 0.92) 65%),
    linear-gradient(to bottom, rgba(5, 5, 5, 0.78) 0%, rgba(5, 5, 5, 0.9) 50%, rgba(5, 5, 5, 0.98) 100%),
    url('assets/bg_stadium_bw.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: grayscale(100%) contrast(125%) brightness(0.7);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

/* Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  line-height: 1;
}

.btn-primary {
  background-color: var(--text-white);
  color: var(--bg-black);
  border-color: var(--text-white);
}

.btn-primary:hover {
  background-color: #e5e5e5;
  border-color: #e5e5e5;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-white);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--bg-card);
  border-color: var(--text-white);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  color: var(--text-white);
  border-color: var(--border-light);
  background-color: var(--bg-card);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.btn-inside {
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 16px;
  font-size: 0.85rem;
}

/* Spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--bg-black);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.brand-cup-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
}

.brand-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-light);
}

.brand-org-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%) brightness(1.2);
}

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

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-white);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 85px 0 65px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  background: 
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(5, 5, 5, 0.65) 0%, rgba(5, 5, 5, 0.85) 60%, var(--bg-black) 100%),
    url('assets/bg_stadium_bw.jpg') no-repeat center top / cover;
  overflow: hidden;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge-tag {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-family: var(--font-heading);
  text-transform: uppercase;
}

.hero-cup-display {
  margin-bottom: 24px;
}

.hero-cup-img {
  width: 180px;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 18px;
  font-family: var(--font-arabic);
}

.hero-desc {
  max-width: 580px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Meta Strip */
.hero-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 820px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.meta-item {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--border-subtle);
}

.meta-item:last-child {
  border-left: none;
}

.meta-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
}

/* Sections Common */
.section {
  padding: 90px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 48px;
}

.section-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

/* Registration Section */
.register-card {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  background-color: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
}

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

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-white);
}

.required-mark {
  color: var(--text-muted);
  margin-right: 4px;
}

.input-action-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.input-action-group .form-input {
  flex: 1;
}

.input-action-group .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-active);
}

.tiktok-inline-feedback {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
}

.tiktok-inline-feedback.feedback-info {
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.tiktok-inline-feedback.feedback-success {
  color: var(--text-white);
  border-color: var(--text-white);
  font-weight: 600;
}

.tiktok-inline-feedback.feedback-error {
  color: var(--text-white);
  border-color: var(--border-light);
  background-color: #1a1a1a;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Auto-fetch Preview Box */
.profile-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.preview-avatar-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-color: #000;
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.preview-avatar-fallback {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-white);
}

.preview-details {
  flex-grow: 1;
}

.preview-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-white);
}

.preview-handle {
  font-size: 0.85rem;
  color: var(--text-muted);
  direction: ltr;
}

.preview-meta-row {
  margin-top: 2px;
}

.preview-status-pill {
  font-size: 0.72rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Ranks Grid */
.ranks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rank-chip {
  position: relative;
  cursor: pointer;
}

.rank-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rank-chip-label {
  display: block;
  padding: 12px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: center;
}

.rank-chip input[type="radio"]:checked + .rank-chip-label {
  background-color: var(--text-white);
  color: var(--bg-black);
  border-color: var(--text-white);
  font-weight: 700;
}

.rank-chip-label:hover {
  border-color: var(--border-light);
  color: var(--text-white);
}

/* Alerts */
.form-alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-input);
  color: var(--text-white);
}

/* Success Confirmation */
.submission-success {
  text-align: center;
  padding: 24px 12px;
}

.success-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--text-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-white);
}

.success-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 28px;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Teams Section */
.teams-section {
  position: relative;
  background: 
    linear-gradient(to bottom, var(--bg-black) 0%, rgba(10, 10, 10, 0.88) 35%, rgba(5, 5, 5, 0.96) 100%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.04) 0%, transparent 70%),
    url('assets/bg_arena_bw.jpg') no-repeat center bottom / cover;
}

.counter-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.teams-search-bar {
  margin-bottom: 32px;
}

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-active);
}

/* Teams Grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.team-card {
  background-color: rgba(18, 18, 18, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition-fast);
}

.team-card:hover {
  background-color: rgba(26, 26, 26, 0.96);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.team-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.team-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-black);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.team-logo-fallback {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

.team-info {
  overflow: hidden;
}

.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-tiktok-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  direction: ltr;
  transition: color var(--transition-fast);
}

.team-tiktok-link:hover {
  color: var(--text-white);
}

.team-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.rank-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.status-pill-accepted {
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--text-white);
  color: var(--bg-black);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Empty State */
.empty-teams-card {
  text-align: center;
  padding: 60px 24px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
}

.empty-icon-box {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Rules Grid */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.rule-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.rule-index {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.rule-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.rule-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* About Section */
.about-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.about-text-col {
  max-width: 580px;
}

.about-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.about-paragraph {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 14px;
}

.about-org-logo {
  max-width: 180px;
  height: auto;
  filter: grayscale(100%) brightness(1.2);
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  margin-top: auto;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  height: 38px;
  width: auto;
  filter: grayscale(100%);
}

.footer-cup-name {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-copy {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 50px 0 40px;
  }

  .main-nav {
    display: none;
  }

  .hero-meta-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-item:nth-child(2) {
    border-left: none;
  }

  .meta-item:nth-child(3),
  .meta-item:nth-child(4) {
    border-top: 1px solid var(--border-subtle);
  }

  .ranks-grid {
    grid-template-columns: 1fr;
  }

  .about-card {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
  }

  .about-org-logo {
    max-width: 120px;
  }

  .register-card {
    padding: 24px 18px;
  }
}
