/* Nhất Niệm Tiêu Dao — Nền fantasy vàng/đỏ, style theo ảnh Hợp Hoan S130 */

:root {
  --bg-dark: rgba(15, 10, 5, 0.88);
  --bg-card: rgba(20, 12, 5, 0.85);
  --bg-card-solid: rgba(25, 15, 8, 0.92);
  --border: rgba(212, 175, 55, 0.45);
  --gold: #d4af37;
  --gold-light: #f5e6a8;
  --gold-soft: #e8c96a;
  --gold-dim: #b8860b;
  --red: #e00000;
  --red-soft: #c03030;
  --text: #fffef5;
  --text-muted: #e8e0c8;
  --font-serif: "Noto Serif SC", "Noto Serif", serif;
  --font-sans: "Be Vietnam Pro", system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 24px rgba(212, 175, 55, 0.35), 0 4px 20px rgba(0, 0, 0, 0.3);
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  color: var(--text);
  position: relative;
  background: #1a1208 url("bg-main.png") center center / 45% no-repeat fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.02) 0%,
    rgba(0, 0, 0, 0.06) 40%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

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

/* ----- Navigation ----- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 10, 5, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold-soft);
}

.nav-logo:hover {
  color: var(--gold-light);
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s, text-shadow 0.2s;
}

.nav-links a:hover {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(245, 230, 168, 0.5);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(15, 10, 5, 0.96);
    backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle {
    display: flex;
  }
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 3rem) 1.5rem 3rem;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.03) 0%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.12) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
}

.hero-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(245, 230, 168, 0.5), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--gold-soft);
  font-weight: 500;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.5), 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-desc {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  color: #1a1208;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 235, 180, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(245, 230, 168, 0.5), 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ----- Main sections ----- */
.main {
  flex: 1;
  padding: 4rem 0 3rem;
}

.section {
  margin-bottom: 4rem;
}

.section-head {
  margin-bottom: 2rem;
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--gold-soft);
  margin: 0 0 0.5rem;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Tiêu đề form đăng ký — nổi bật hơn trên nền */
.section-register .section-title {
  color: var(--gold-light);
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 700;
  text-shadow:
    0 0 20px rgba(245, 230, 168, 0.6),
    0 0 8px rgba(212, 175, 55, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

/* Tiêu đề danh sách đội — nổi bật hơn trên nền */
.section-teams .section-title {
  color: var(--gold-light);
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 700;
  text-shadow:
    0 0 20px rgba(245, 230, 168, 0.6),
    0 0 8px rgba(212, 175, 55, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

.section-desc {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.subsection-title {
  font-size: 1.2rem;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  font-weight: 600;
}

/* ----- Cards ----- */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow), 0 0 24px rgba(212, 175, 55, 0.08);
  backdrop-filter: blur(12px);
}

.card-form {
  max-width: 640px;
  margin: 0 auto;
}

/* ----- Forms ----- */
.form-register .form-row,
.form-match .form-row {
  margin-bottom: 1.25rem;
}

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

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

.form-group {
  padding: 1.25rem;
  background: rgba(30, 20, 10, 0.6);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.form-subtitle {
  font-size: 0.95rem;
  color: var(--gold-soft);
  margin: 0 0 1rem;
  font-weight: 600;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.required {
  color: var(--red);
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(25, 18, 8, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25), 0 0 12px rgba(212, 175, 55, 0.15);
}

.form-row input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.form-match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.form-row-score {
  margin-bottom: 0;
}

.form-row-score .score-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.form-row-score input {
  width: 4.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.score-sep {
  color: var(--gold-dim);
  font-weight: 700;
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  .form-match-row {
    grid-template-columns: 1fr;
  }
  .form-row-score .score-inputs {
    justify-content: flex-start;
  }
}

.form-actions {
  margin-top: 1.5rem;
}

.btn {
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  color: #1a1208;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35), 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 235, 180, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(245, 230, 168, 0.45), 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.form-message {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-message.success {
  color: #a8e6a0;
  text-shadow: 0 0 8px rgba(168, 230, 160, 0.3);
}

.form-message.error {
  color: #ff6b6b;
  text-shadow: 0 0 8px rgba(255, 100, 100, 0.3);
}

/* ----- Teams grid ----- */
.loading,
.empty-state {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  font-size: 1rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ----- Danh sách đội — cùng phong cách form đăng ký ----- */

.teams-list-card {
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

/* Header bảng: giống form labels — nền tối, chữ vàng */
.ranking-table thead {
  background: rgba(30, 20, 10, 0.7);
  border-bottom: 1px solid var(--border);
}

.ranking-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: left;
  vertical-align: middle;
  color: var(--gold-soft);
  font-size: 0.9rem;
}

/* Hàng dữ liệu: giống form input — nền tối, viền vàng, chữ sáng */
.ranking-table tbody tr {
  background: rgba(25, 18, 8, 0.6);
  border-bottom: 1px solid var(--border);
}

.ranking-table tbody tr:hover {
  background: rgba(35, 25, 12, 0.7);
}

.ranking-table td {
  padding: 0.75rem 1rem;
  color: var(--text);
  vertical-align: middle;
  border-right: 1px solid rgba(212, 175, 55, 0.15);
}

.ranking-table td:last-child {
  border-right: none;
}

.ranking-table .col-name {
  font-weight: 600;
  color: var(--text);
}

.ranking-table .col-player {
  color: var(--text-muted);
}

.player-contact {
  color: var(--text-muted);
  font-size: 0.88em;
  opacity: 0.9;
}

@media (max-width: 640px) {
  .ranking-table th,
  .ranking-table td {
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
  }
}

/* ----- Matches list ----- */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.match-item {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  transition: border-color 0.2s;
}

.match-item:hover {
  border-color: var(--gold-dim);
}

.match-team {
  font-weight: 600;
  color: var(--text);
}

.match-score {
  text-align: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 1.25rem;
  min-width: 4rem;
}

.match-meta {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

@media (max-width: 560px) {
  .match-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .match-score {
    order: -1;
  }
}

/* ----- Footer ----- */
.footer {
  padding: 2rem 0;
  border-top: 2px solid var(--border);
  text-align: center;
  margin-top: auto;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
