/* ============================================================
   FightInfo 참가자 포털 - 메인 CSS
   ============================================================ */

:root {
  --primary:   #f59e0b;
  --primary-h: #d97706;
  --danger:    #ef4444;
  --success:   #10b981;
  --info:      #3b82f6;
  --dark:      #0f172a;
  --card:      #1e293b;
  --card2:     #243450;
  --bg-alt:    #131f35;
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --border:    #334155;
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

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

html { scroll-behavior:smooth; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color:inherit; text-decoration:none; }
img { max-width:100%; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--danger));
  color: #fff;
}
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(245,158,11,.4); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background:rgba(255,255,255,.07); }
.btn-lg { padding:14px 32px; font-size:1rem; border-radius:12px; }
.btn-sm { padding:7px 16px; font-size:.82rem; }
.btn-xs { padding:4px 10px; font-size:.75rem; border-radius:6px; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-success { background:var(--success); color:#fff; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}
.header .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-text {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--muted);
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,.07);
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245,158,11,.18) 0%, transparent 70%),
              radial-gradient(ellipse 60% 50% at 80% 100%, rgba(239,68,68,.12) 0%, transparent 70%);
}
.hero-content {
  position: relative;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,.15);
  color: var(--primary);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 36px;
  line-height: 1.8;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   STATS
   ============================================================ */
.stats-section {
  padding: 40px 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
}
.stat-label { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 64px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title { font-size: 1.6rem; font-weight: 800; }

/* ============================================================
   TOURNAMENT CARDS
   ============================================================ */
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.tournament-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all .3s;
  display: flex;
  flex-direction: column;
}
.tournament-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(245,158,11,.3);
}
.tournament-card-header {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px 0;
}
.tournament-poster {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin: 12px 0 0;
}
.tournament-poster-placeholder {
  height: 180px;
  background: linear-gradient(135deg, var(--card2), var(--dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--border);
  margin: 12px 0 0;
}
.tournament-card-body { padding: 16px; flex: 1; }
.tournament-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}
.tournament-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .8rem;
  color: var(--muted);
}
.tournament-card-footer {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

/* BADGES */
.sport-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.sport-kickboxing { background:rgba(245,158,11,.15); color:#f59e0b; }
.sport-boxing     { background:rgba(239,68,68,.15);  color:#ef4444; }
.sport-taekwondo  { background:rgba(59,130,246,.15); color:#3b82f6; }
.sport-hapkido    { background:rgba(16,185,129,.15); color:#10b981; }
.sport-mma        { background:rgba(139,92,246,.15); color:#8b5cf6; }
.sport-other      { background:rgba(148,163,184,.15);color:#94a3b8; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
}
.status-green  { background:rgba(16,185,129,.15);  color:#10b981; }
.status-orange { background:rgba(245,158,11,.15);  color:#f59e0b; }
.status-blue   { background:rgba(59,130,246,.15);  color:#3b82f6; }
.status-gray   { background:rgba(148,163,184,.15); color:#94a3b8; }
.status-red    { background:rgba(239,68,68,.15);   color:#ef4444; }

/* ============================================================
   HOW TO USE
   ============================================================ */
.howto-section {
  padding: 80px 0;
  background: var(--bg-alt);
}
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.howto-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  position: relative;
}
.howto-num {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: .75rem;
  font-weight: 800;
  color: var(--border);
}
.howto-icon { font-size: 2.5rem; margin-bottom: 14px; }
.howto-item h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.howto-item p  { font-size: .85rem; color: var(--muted); line-height: 1.6; }

/* ============================================================
   LIST TABLE
   ============================================================ */
.list-table {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.list-header, .list-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1.2fr 1.5fr 1fr .7fr;
  gap: 8px;
  padding: 12px 20px;
  align-items: center;
  font-size: .85rem;
}
.list-header {
  background: var(--dark);
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  border-bottom: 1px solid var(--border);
}
.list-row {
  border-bottom: 1px solid rgba(51,65,85,.5);
  transition: background .2s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(255,255,255,.03); }
.list-title { font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-top {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.footer-brand p { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-left: auto;
}
.footer-links > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links strong { font-size: .85rem; color: var(--text); margin-bottom: 4px; }
.footer-links a { font-size: .82rem; color: var(--muted); transition:color .2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: .8rem;
  color: var(--muted);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid var(--border);
  max-width: 500px;
  margin: 40px auto;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-control {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: .95rem;
  transition: border-color .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
}
.form-control select { cursor: pointer; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .875rem;
  margin-bottom: 20px;
}
.alert-error  { background:#7f1d1d; color:#fca5a5; border-left:3px solid var(--danger); }
.alert-success{ background:#052e16; color:#86efac; border-left:3px solid var(--success); }
.alert-info   { background:#1e3a5f; color:#93c5fd; border-left:3px solid var(--info); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.page-header h1 { font-size: 2rem; font-weight: 800; }
.page-header p  { color: var(--muted); margin-top: 8px; }
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--border); }

/* ============================================================
   TOURNAMENT DETAIL
   ============================================================ */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
.detail-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.detail-card-body { padding: 28px; }
.detail-card-body h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-item label { display:block; font-size:.75rem; color:var(--muted); margin-bottom:3px; }
.info-item span  { font-size:.9rem; font-weight:600; }

/* ============================================================
   BRACKET
   ============================================================ */
.bracket-container {
  overflow-x: auto;
  padding: 20px 0;
}
.bracket {
  display: flex;
  gap: 40px;
  min-width: max-content;
}
.bracket-round { display: flex; flex-direction: column; gap: 24px; }
.bracket-round-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.match-card {
  width: 220px;
  background: var(--card2);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.match-fighter {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.match-fighter:last-child { border-bottom: none; }
.match-fighter.winner {
  background: rgba(245,158,11,.12);
  color: var(--primary);
  font-weight: 700;
}
.match-fighter.loser { color: var(--muted); }
.match-num {
  font-size: .7rem;
  color: var(--muted);
  padding: 3px 10px;
  background: var(--dark);
  text-align: center;
}

/* ============================================================
   AUTH
   ============================================================ */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--muted);
}
.auth-footer a { color: var(--primary); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  width: fit-content;
}
.tab-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all .2s;
}
.tab-btn.active { background: var(--primary); color: #fff; }

/* ============================================================
   FILTERS
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  align-items: center;
}
.filter-bar select, .filter-bar input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text);
  font-size: .875rem;
}
.filter-bar select:focus, .filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 32px;
}
.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: all .2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: var(--card);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
    gap: 4px;
  }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tournament-grid { grid-template-columns: 1fr; }
  .howto-grid { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .list-header { display: none; }
  .list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .footer-links { flex-direction: column; }
  .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .howto-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 50px; }
  .section { padding: 40px 0; }
}
