.competition-portal {
  background: #f8fafc;
  min-height: 100vh;
}

.portal-container {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 3rem;
  align-items: start;
}

/* Registration Panel */
.registration-panel {
  background: white;
  padding: 4rem;
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
}

.panel-header {
  margin-bottom: 2.5rem;
}

.badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.serif-title {
  font-family: "Playfair Display", serif;
  font-size: 2.8rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.serif-title span {
  color: #d4af37;
  font-style: italic;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.majestic-modal {
  max-width: 800px;
  margin: 2rem auto;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  color: white;
}

.modal-header .serif-title {
  color: white;
  font-size: 2rem;
  margin-bottom: 0;
}

.close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.close-modal:hover {
  background: #d4af37;
  color: #0f172a;
  transform: rotate(90deg);
}

.modal-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  flex-shrink: 0;
}

.rule-tab {
  padding: 1.25rem 2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rule-tab.active {
  color: #0f172a;
  border-bottom-color: #d4af37;
  background: white;
}

.modal-body {
  padding: 2.5rem;
  overflow-y: auto;
  flex-grow: 1;
  background: #ffffff;
}

/* Scrollbar Styling for Majestic Modal */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.rule-section {
  display: none;
}

.rule-section.active {
  display: block;
}

.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rules-list li {
  display: flex;
  gap: 1.25rem;
  line-height: 1.7;
  color: #334155;
  font-size: 1rem;
}

.rules-list li span {
  color: #d4af37;
  font-weight: 800;
  min-width: 1.5rem;
  font-size: 1.1rem;
}

#rule-hi .rules-list li {
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 500;
}

.special-note {
  margin-top: 2.5rem;
  padding: 2rem;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 12px;
  color: #92400e;
  font-size: 0.95rem;
  line-height: 1.7;
  box-shadow: inset 0 2px 4px rgba(251, 191, 36, 0.1);
}

.special-note strong {
  color: #b45309;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#rule-hi .special-note {
  line-height: 1.8;
}

/* Majestic Form */
.majestic-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.readonly-input {
  background: #f1f5f9 !important;
  font-weight: 600;
  color: #1e293b;
}

.form-footer {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fee-info {
  display: flex;
  flex-direction: column;
}

.fee-info span {
  font-size: 0.875rem;
  color: #64748b;
}

.fee-info strong {
  font-size: 1.5rem;
  color: #0f172a;
}

.btn-majestic {
  background: #0f172a;
  color: white;
  padding: 1.1rem 3rem;
  border-radius: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
}

.btn-majestic:hover {
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(15, 23, 42, 0.2);
}

/* Login Panel */
.panel-inner {
  background: #0f172a;
  color: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.panel-inner h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.panel-inner p {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

.minimal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.minimal-form label {
  color: #cbd5e1;
}

.minimal-form input,
.minimal-form select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-outline-gold {
  background: none;
  border: 2px solid #d4af37;
  color: #d4af37;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.btn-outline-gold:hover {
  background: #d4af37;
  color: #0f172a;
}

.announcement-card {
  background: #fefce8;
  border: 1px solid #fef08a;
  padding: 1.25rem;
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  color: #854d0e;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.announcement-card:hover {
  background: #fef9c3;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (max-width: 992px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .registration-panel {
    order: 1;
  }

  .login-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .registration-panel {
    padding: 2rem 1.5rem;
  }

  .serif-title {
    font-size: 2rem;
  }
}

/* Majestic Toast System */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  max-width: 450px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  animation: toastSlideIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  transition: all 0.3s;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast i {
  font-size: 1.25rem;
}

.toast.error i {
  color: #ef4444;
}
.toast.success i {
  color: #10b981;
}

.toast-content {
  flex: 1;
}

.toast-content .toast-title {
  font-weight: 700;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.125rem;
}

.toast-content .toast-message {
  font-size: 0.8125rem;
  color: #94a3b8;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.fade-out {
  transform: translateX(120%);
  opacity: 0;
}

@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 2rem;
    right: 1.5rem;
    left: 1.5rem;
  }
  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* ---------- Prize highlight chips (panel header) ---------- */
.prize-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.highlight-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.highlight-chip strong {
  font-weight: 800;
  color: #0f172a;
}
.highlight-chip.gold {
  background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
  border-color: #facc15;
  color: #78350f;
}
.highlight-chip.gold strong,
.highlight-chip.gold i {
  color: #b45309;
}
.highlight-chip.silver {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
  color: #334155;
}
.highlight-chip.silver strong,
.highlight-chip.silver i {
  color: #475569;
}
.highlight-chip.royal {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: #c4b5fd;
  color: #4c1d95;
}
.highlight-chip.royal i {
  color: #6d28d9;
}

/* ---------- Announcement cards (rules + prize) ---------- */
.announcement-card {
  align-items: flex-start;
  outline: none;
}
.announcement-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4);
}
.announcement-card > i {
  font-size: 1.4rem;
  color: #b45309;
  margin-top: 0.15rem;
}
.announcement-card .announcement-title {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.2;
}
.announcement-card .announcement-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
.announcement-card.prize-card {
  background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
  border-color: #facc15;
  margin-top: 0.85rem;
}
.announcement-card.prize-card > i {
  color: #b45309;
}
.announcement-card.prize-card:hover {
  background: linear-gradient(135deg, #fef08a 0%, #fde68a 100%);
}

/* ---------- Prize modal (mirrors rules modal styling) ---------- */
.prize-tab {
  padding: 1.25rem 2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prize-tab.active {
  color: #0f172a;
  border-bottom-color: #d4af37;
  background: white;
}

.prize-section {
  display: none;
}
.prize-section.active {
  display: block;
}

.prize-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.prize-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
.prize-hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d4af37;
  margin-bottom: 0.5rem;
}
.prize-hero-title {
  font-family: "Playfair Display", serif;
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.prize-hero-chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}
.hero-chip strong {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}
.hero-chip span {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.03em;
}
.hero-chip.gold {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(180, 83, 9, 0.18));
  border-color: rgba(250, 204, 21, 0.5);
}
.hero-chip.gold strong {
  color: #fde68a;
}
.hero-chip.silver {
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.18), rgba(148, 163, 184, 0.18));
  border-color: rgba(226, 232, 240, 0.5);
}
.hero-chip.silver strong {
  color: #e2e8f0;
}
.hero-chip.royal {
  background: linear-gradient(135deg, rgba(196, 181, 253, 0.18), rgba(109, 40, 217, 0.18));
  border-color: rgba(196, 181, 253, 0.5);
}
.hero-chip.royal i {
  font-size: 1.25rem;
  color: #ddd6fe;
}

.prize-block {
  margin-bottom: 1.75rem;
}
.prize-block-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.prize-block-title i {
  color: #d4af37;
}
.prize-block-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  margin: 0;
}
.prize-block-desc strong {
  color: #0f172a;
}
.prize-block-desc em {
  font-style: italic;
  color: #b45309;
  font-weight: 600;
}

.prize-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}
.prize-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.prize-table th,
.prize-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.prize-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.prize-table td.num,
.prize-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.prize-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}
.prize-table tbody tr.highlight {
  background: rgba(212, 175, 55, 0.08);
}
.prize-table tbody tr.highlight strong {
  color: #b45309;
}
.prize-table tfoot td {
  padding: 0.9rem 1rem;
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.prize-table tfoot td.num strong {
  color: #fde68a;
  font-size: 1.05rem;
}

.prize-footnote {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  color: #075985;
  font-size: 0.9rem;
  line-height: 1.7;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.prize-footnote i {
  color: #0284c7;
  font-size: 1.1rem;
  margin-top: 0.15rem;
}
.prize-footnote strong {
  color: #0c4a6e;
}

/* ---------- Form validation states + field hints ---------- */
.form-group {
  position: relative;
}
.field-hint {
  min-height: 1em;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: -0.15rem;
}
.form-group.is-valid input:not(.readonly-input),
.form-group.is-valid select {
  border-color: #10b981;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981' width='18' height='18'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
.form-group.is-invalid input:not(.readonly-input),
.form-group.is-invalid select {
  border-color: #ef4444;
  background-color: #fef2f2;
}
.form-group.is-invalid .field-hint {
  color: #b91c1c;
  font-weight: 600;
}

/* ---------- Progress track ---------- */
.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37 0%, #b45309 100%);
  transition: width 0.35s ease;
  border-radius: inherit;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}
.progress-meta .safe-note {
  color: #059669;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- Pay button disabled state ---------- */
.btn-majestic:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* ---------- Draft restore notice ---------- */
.draft-notice {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.35s ease;
}
.draft-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.draft-notice button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.draft-notice button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 640px) {
  .prize-hero {
    padding: 1.5rem;
  }
  .prize-hero-title {
    font-size: 1.6rem;
  }
  .prize-hero-chips {
    gap: 0.5rem;
  }
  .hero-chip {
    padding: 0.5rem 0.75rem;
  }
  .prize-table th,
  .prize-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
  .prize-highlights {
    gap: 0.4rem;
  }
  .highlight-chip {
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
  }
}
