/* ============================================================
   HOK Community Platform — Shared Design System
   Import on every page: <link rel="stylesheet" href="../css/hok.css">
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  --bg:        #0e1118;
  --panel:     #161b26;
  --panel-2:   #1d2330;
  --panel-3:   #222839;
  --line:      #2a3343;
  --line-2:    #364152;
  --gold:      #d9a441;
  --gold-soft: #f0cd7e;
  --gold-dim:  #8a6520;
  --ink:       #e9edf4;
  --muted:     #8b95a7;
  --muted-2:   #5c6475;
  --red:       #e05252;
  --red-dim:   #3d1a1a;
  --orange:    #e07c3a;
  --orange-dim:#3d2510;
  --yellow:    #d9a441;
  --yellow-dim:#3d2d10;
  --green:     #4caf7d;
  --green-dim: #122b1e;
  --blue:      #4a9edd;
  --blue-dim:  #102540;
  --purple:    #9b6fd4;
  --purple-dim:#1e1030;

  --radius:    10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --transition:150ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-soft); }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ---------- Typography ---------- */
.font-display { font-family: Cinzel, serif; }
h1, h2, h3, h4 { line-height: 1.2; }
.text-gold     { color: var(--gold); }
.text-gold-soft{ color: var(--gold-soft); }
.text-muted    { color: var(--muted); }
.text-ink      { color: var(--ink); }
.text-red      { color: var(--red); }
.text-green    { color: var(--green); }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11.5px; }
.text-lg       { font-size: 17px; }
.text-xl       { font-size: 20px; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.uppercase     { text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Layout ---------- */
.wrap      { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wrap-sm   { max-width: 720px;  margin: 0 auto; padding: 0 20px; }
.wrap-lg   { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.gap-8  { gap: 32px; }
.grid   { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

/* ---------- Spacing ---------- */
.mt-1 { margin-top: 4px; }   .mb-1 { margin-bottom: 4px; }
.mt-2 { margin-top: 8px; }   .mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }  .mb-3 { margin-bottom: 12px; }
.mt-4 { margin-top: 16px; }  .mb-4 { margin-bottom: 16px; }
.mt-6 { margin-top: 24px; }  .mb-6 { margin-bottom: 24px; }
.mt-8 { margin-top: 32px; }  .mb-8 { margin-bottom: 32px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

/* ---------- Topbar / Nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,17,24,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: 60px;
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: Cinzel, serif; font-weight: 700;
  color: var(--gold-soft); font-size: 15px; white-space: nowrap;
}
.topbar-brand img { width: 28px; height: 28px; border-radius: 4px; }
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-nav a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.topbar-nav a:hover, .topbar-nav a.active {
  color: var(--ink); background: var(--panel-2);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 56vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 80px 20px 60px;
  background:
    radial-gradient(900px 400px at 50% -100px, rgba(217,164,65,.14), transparent),
    linear-gradient(180deg, #0e1118 0%, #121623 100%);
}
.hero-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .3em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 {
  font-family: Cinzel, serif; font-weight: 900;
  font-size: clamp(32px, 6vw, 64px); color: var(--gold-soft); line-height: 1.1;
}
.hero h1 span {
  display: block; color: var(--ink); font-size: .5em;
  font-weight: 700; letter-spacing: .1em; margin-top: 12px;
}
.hero-sub { max-width: 540px; color: var(--muted); margin-top: 20px; font-size: 15.5px; }
.hero-rule { width: 60px; height: 2px; background: var(--gold); margin: 28px auto 0; }

/* ---------- Section ---------- */
.section      { padding: 60px 0; }
.section-sm   { padding: 36px 0; }
.section-title {
  font-family: Cinzel, serif; color: var(--gold-soft);
  font-size: 22px; margin-bottom: 6px;
}
.section-lead { color: var(--muted); margin-bottom: 28px; max-width: 600px; font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--line-2); }
.card-accent { border-top: 3px solid var(--gold); }
.card-title {
  font-family: Cinzel, serif; font-size: 15px;
  color: var(--gold-soft); margin-bottom: 8px;
}
.card-sm { padding: 16px; border-radius: var(--radius); }

/* ---------- Tournament Card ---------- */
.tournament-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.tournament-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.tournament-card-banner {
  height: 130px; background: var(--panel-2);
  position: relative; overflow: hidden;
}
.tournament-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.tournament-card-banner .banner-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--panel-2), var(--panel-3));
  font-size: 32px;
}
.tournament-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tournament-card-logo {
  position: absolute; bottom: -18px; left: 18px;
  width: 52px; height: 52px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--panel);
  object-fit: contain; padding: 4px;
}
.tournament-card-name {
  font-family: Cinzel, serif; font-size: 15px;
  color: var(--gold-soft); font-weight: 700;
  margin-top: 18px;
}
.tournament-card-meta { color: var(--muted); font-size: 13px; }
.tournament-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; border: none;
  transition: all var(--transition); white-space: nowrap;
}
.btn-gold {
  background: var(--gold); color: #0e1118;
}
.btn-gold:hover { background: var(--gold-soft); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: rgba(217,164,65,.1); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.btn-danger {
  background: var(--red); color: #fff;
}
.btn-danger:hover { background: #c94444; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-draft          { background: var(--panel-3);  color: var(--muted); border: 1px solid var(--line); }
.badge-registration   { background: var(--blue-dim); color: var(--blue);  border: 1px solid rgba(74,158,221,.25); }
.badge-reg-closed     { background: var(--yellow-dim);color: var(--yellow);border: 1px solid rgba(217,164,65,.25); }
.badge-in-progress    { background: var(--green-dim); color: var(--green); border: 1px solid rgba(76,175,125,.25); }
.badge-completed      { background: var(--panel-3);  color: var(--muted); border: 1px solid var(--line); }
.badge-submitted      { background: var(--blue-dim); color: var(--blue);  border: 1px solid rgba(74,158,221,.2); }
.badge-under-review   { background: var(--yellow-dim);color: var(--yellow);border: 1px solid rgba(217,164,65,.2); }
.badge-needs-update   { background: var(--orange-dim);color: var(--orange);border: 1px solid rgba(224,124,58,.25); }
.badge-approved       { background: var(--green-dim); color: var(--green); border: 1px solid rgba(76,175,125,.2); }
.badge-rejected       { background: var(--red-dim);  color: var(--red);   border: 1px solid rgba(224,82,82,.2); }
.badge-upcoming       { background: var(--blue-dim); color: var(--blue);  border: 1px solid rgba(74,158,221,.2); }
.badge-complete       { background: var(--green-dim); color: var(--green); border: 1px solid rgba(76,175,125,.2); }
.badge-disputed       { background: var(--red-dim);  color: var(--red);   border: 1px solid rgba(224,82,82,.2); }
.badge-walkover       { background: var(--panel-3);  color: var(--muted); border: 1px solid var(--line); }
.badge-gold           { background: rgba(217,164,65,.15); color: var(--gold); border: 1px solid rgba(217,164,65,.3); }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-label .req { color: var(--red); margin-left: 3px; }
.form-input, .form-select, .form-textarea {
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink); padding: 9px 12px;
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--gold);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted-2); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint  { font-size: 12px; color: var(--muted); }
.form-error { font-size: 12px; color: var(--red); }
.form-input.error, .form-select.error, .form-textarea.error {
  border-color: var(--red);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
}
.form-section-title {
  font-family: Cinzel, serif; font-size: 14px;
  color: var(--gold-soft); margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Upload zones ---------- */
.upload-zone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--panel-2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold); background: rgba(217,164,65,.04);
}
.upload-zone-icon { font-size: 28px; margin-bottom: 8px; }
.upload-zone p   { font-size: 13px; color: var(--muted); }
.upload-zone p b { color: var(--gold); }
.upload-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.upload-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.upload-preview-name { flex: 1; font-size: 13px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: all var(--transition);
}
.tab-btn:hover  { color: var(--ink); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: var(--panel-2); color: var(--muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: Cinzel, serif; font-size: 16px; color: var(--gold-soft); }
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 20px; padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--ink); background: var(--panel-2); }

/* ---------- Toasts ---------- */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 13.5px; color: var(--ink);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  pointer-events: all;
  animation: toast-in .2s ease;
  max-width: 340px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes toast-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 56px 20px; color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 14px; opacity: .5; }
.empty-state h3   { font-size: 15px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.empty-state p    { font-size: 13px; }

/* ---------- Loading / Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Divider ---------- */
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.divider-text {
  display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ---------- Auth overlay ---------- */
.auth-required {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 40vh; gap: 16px; text-align: center;
}
.auth-required h3 { font-family: Cinzel, serif; color: var(--gold-soft); }
.auth-required p  { color: var(--muted); font-size: 14px; }

/* ---------- Step progress ---------- */
.steps { display: flex; align-items: center; margin-bottom: 32px; overflow-x: auto; }
.step-item { flex: 1; min-width: 80px; display: flex; flex-direction: column; align-items: center; position: relative; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute;
  top: 16px; left: calc(50% + 20px);
  width: calc(100% - 40px); height: 1.5px;
  background: var(--line);
}
.step-item.done:not(:last-child)::after  { background: var(--gold); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-family: Cinzel, serif; font-size: 13px; font-weight: 700; color: var(--muted);
  z-index: 1; margin-bottom: 8px;
}
.step-item.active .step-circle { border-color: var(--gold); color: var(--gold); background: rgba(217,164,65,.1); }
.step-item.done   .step-circle { border-color: var(--gold); background: var(--gold); color: #0e1118; }
.step-label { font-size: 11.5px; color: var(--muted); text-align: center; }
.step-item.active .step-label { color: var(--gold); font-weight: 600; }
.step-item.done   .step-label { color: var(--muted); }

/* ---------- Notification bell ---------- */
.notif-bell { position: relative; }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--bg);
}
.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 320px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); z-index: 200;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 13px;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: rgba(74,158,221,.06); }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.notif-item-body  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: var(--muted-2); margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .wrap, .wrap-sm, .wrap-lg { padding: 0 14px; }
  .section { padding: 40px 0; }
  .hero    { padding: 60px 14px 44px; min-height: auto; }
  .topbar-nav { display: none; }
  .modal  { max-width: 100%; }
  .tabs   { gap: 0; }
  .tab-btn { padding: 10px 12px; font-size: 13px; }
}
@media (max-width: 480px) {
  .btn-lg { padding: 10px 20px; font-size: 14px; }
  h1 { font-size: clamp(26px, 8vw, 42px) !important; }
}

/* ---------- Utility ---------- */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.opacity-50 { opacity: .5; }
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.relative{ position: relative; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 999px; }
.overflow-hidden { overflow: hidden; }
