/* View Transitions API (@view-transition navigation:auto) was tried here
   to smooth cross-page navigation, but was REVERTED 2026-07-29: when two
   pages differ in content height (e.g. a page before/after its async data
   loads), Chrome cross-fades between two differently-sized snapshots,
   which itself looks like a visible "stretch" — the opposite of what it
   was meant to fix. Removed rather than tuned further. */

/* ============================================================
   DanceSystem.NET — Design System
   Font   : Inter (Google Fonts, loaded via <link> in each page's <head>),
            falls back to Arial if the webfont hasn't loaded yet.
   Colors : body text is near-black (#111) throughout, WDSF-style — gray
            hierarchy tiers were retired site-wide, only the orange accent
            and light structural grays (borders/backgrounds) remain.
   Brand  : "Dance" light orange #E67E22 · "System.NET" dark gray #555
   Accent : light orange #E67E22 for active states & links (--red below —
            kept the variable name to avoid touching every reference site-wide;
            it's the site's one accent color, formerly a burnt red)
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; color-scheme: light; }

/* Always reserve the vertical scrollbar: without this, short pages (no
   scrollbar) and long pages (scrollbar) center the 900px layout at slightly
   different x-positions, so the nav visibly jumps ~8px when navigating. */
html { overflow-y: scroll; }

/* The column layout is what keeps the footer at the bottom of the window on
   a short page — My Entries with two rows, a thank-you screen, an empty
   state — instead of letting it ride up under the content with a band of
   grey below it. Nothing changes on a page taller than the window: the
   footer's margin-top:auto only takes up space that is actually spare. */
body {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: #111;
  background: #f2f2f2;
  color-scheme: light;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --red:          #E67E22;   /* light orange — primary accent, "Dance" */
  --red-light:    #fdf3ea;   /* light orange bg */
  --dark:         #555;      /* dark gray — "System.NET", strong text */
  --dark-light:   #f0f0f0;
  --border:       #e4e4e4;
  --border-mid:   #d4d4d4;
  --bg:           #fff;
  --bg-gray:      #f6f6f6;

  /* Text hierarchy — all near-black now (WDSF-style); the variables stay
     for structure/reuse, but no longer carry a gray scale. */
  --c-strong: #111;
  --c-body:   #111;
  --c-muted:  #111;
  --c-light:  #111;

  --nav-h:    52px;
  --radius:   2px;
  --inp-h:    27px;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

/* Brand */
.brand { display: flex; flex-direction: column; justify-content: center; line-height: 1; margin-right: auto; }
.brand-row { display: flex; align-items: baseline; }
.b247   { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; color: #E67E22; letter-spacing: 0; }
.bdance { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; color: #555;    letter-spacing: 0; }
.bsub   { font-family: 'Inter', Arial, sans-serif; font-size: 8px; font-weight: 600; color: #767676; letter-spacing: 4px; text-transform: uppercase; margin-top: 4px; }

/* Nav links — slim uppercase, letter-spaced: lighter weight than the brand
   mark, orange only on hover/active. */
.nav-links { display: flex; height: var(--nav-h); }
.nav-link {
  padding: 0 11px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #111;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s;
}
.nav-link:hover  { color: var(--red); }
.nav-link.active { color: var(--red); border-bottom-color: var(--red); }

/* Footer menu (homepage only) */
.footer-link { color: inherit; text-decoration: none; font-weight: 300; transition: color .15s; }
.footer-link:hover { color: var(--red); }

/* Logged-in nav: pick the right nav BEFORE first paint (no layout jump).
   A tiny inline script at the very top of <head> (before this stylesheet
   finishes loading, since external CSS is render-blocking) adds "hint-in"
   to <html> when the last page load was logged in. These rules override
   the default inline display:none/flex on the nav elements themselves, so
   the browser never paints the guest nav first and then resizes/reflows
   into the auth nav — eliminates the "co giãn nhập nhòe" menu jump. */
html.hint-in #nav-links-guest, html.hint-in #guest-wrap { display: none !important; }
html.hint-in #nav-links-auth,  html.hint-in #acct-wrap  { display: flex !important; }

/* Language switcher */
.lang { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.lang-sep { color: var(--border); }
.lang-opt { color: #999; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.lang-opt.on  { color: #111; font-weight: 600; }
.lang-opt:hover { color: #111; }
.lang-opt svg { display: inline-block; vertical-align: middle; }

/* ── Mobile navigation (hamburger) ────────────────────────────
   .nav-collapse wraps the two .nav-links lists (auth/guest) plus
   .nav-right-box. On desktop it's just a plain flex row (visually
   identical to the old flat layout). At mobile widths it collapses to
   display:none and only appears when .nav has .menu-open — the JS toggle
   (toggleMobileNav(), duplicated per page like the rest of the nav markup)
   just flips that one class. Login-state visibility (auth vs guest list)
   keeps working unchanged: applyAuthState() sets each list's own inline
   style.display, and an ancestor display:none still hides them regardless,
   so the two mechanisms don't fight each other. */
.nav-toggle { display: none; }
.nav-collapse { display: flex; align-items: center; }
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; padding: 10px 16px; }
  .nav { height: auto; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-left: auto; flex-shrink: 0;
    border: 1px solid var(--border-mid); border-radius: 4px;
    background: #fff; font-size: 16px; line-height: 1;
    color: #111; cursor: pointer;
  }
  .nav-collapse {
    display: none; width: 100%; flex-direction: column;
    align-items: stretch; margin-top: 10px;
    border-top: 1px solid var(--border); padding-top: 4px;
  }
  .nav.menu-open .nav-collapse { display: flex; }
  .nav-links { flex-direction: column; height: auto; }
  .nav-link {
    height: 44px; padding: 0 4px; width: 100%;
    border-bottom: 1px solid var(--bg-gray);
  }
  .nav-link.active { border-bottom-color: var(--red); }
  .nav-right-box {
    margin: 8px 0 4px; border: none; padding: 10px 0 0;
    border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px;
  }
}

/* ── Page Layout ────────────────────────────────────────────── */
.page-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px;
}

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

/* Two-column */
.layout-2col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 720px) {
  .layout-2col { grid-template-columns: 1fr; }
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { font-size: 12px; color: var(--c-light); margin-bottom: 14px; }
.breadcrumb a { color: var(--red); cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 4px; color: var(--border); }

/* ── Section label ──────────────────────────────────────────── */
.sec-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--c-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Forms & Inputs ─────────────────────────────────────────── */
.form-group { margin-bottom: 10px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-light);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.inp {
  width: 100%;
  height: var(--inp-h);
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
  color: #111 !important;
  background: #fff !important;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
  color-scheme: light;
}
.inp:focus { border-color: var(--dark); }
.inp::placeholder { color: #999 !important; font-size: 13px !important; }

select.inp { cursor: pointer; }
textarea.inp { height: auto; padding: 6px 8px; resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────────────────
   .btn-submit used to be styled here as a plain text link — no
   background, black text, turning orange on hover. Every page now paints
   it with the shared button block in its own <style>, which overrides
   the background, colour and padding but says nothing about hover
   colour. So the one line that survived was `:hover { color: red }`,
   which is why Register went orange while Sign In did not. Removed
   rather than patched: the text-link look it described is not used
   anywhere any more. */

.txt-link {
  font-size: 11px;
  color: var(--c-light);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.txt-link:hover { color: var(--c-muted); }

.txt-link-orange { font-size: 11px; font-weight: 700; color: var(--red); cursor: pointer; }
.txt-link-orange:hover { text-decoration: underline; }

/* ── Competition list ───────────────────────────────────────── */
.comp-item { padding: 10px 0; border-bottom: 1px solid var(--bg-gray); }
.comp-item:last-child { border-bottom: none; }
.comp-name-row { display: flex; align-items: center; gap: 8px; }
/* flex: 0 1 auto (not flex: 1) — the link should only be as wide as its
   own text, not stretch to fill the row, otherwise hovering/clicking the
   empty space to its right (before the LIVE badge) would act as a link
   too. The LIVE badge uses margin-left: auto below to still land on the
   far right of the row. */
.comp-name { font-size: 13px; font-weight: 600; color: #111; cursor: pointer; flex: 0 1 auto; min-width: 0; }
.comp-name:hover { color: var(--red); }
/* The badge sits right after the name, not out at the far edge — it says
   something ABOUT this competition, and a state marker floating a hand's
   width away from what it describes reads as unrelated. */
.comp-meta { font-size: 12px; color: #111; margin-top: 3px; }
.comp-meta b { color: #111; font-weight: 600; }
/* Only the dot blinks now. Pulsing the whole badge made the word itself
   hard to read at a glance, which is the one thing it exists to do. */
.live-badge {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  background: #ED1C24; color: #fff; font-size: 8.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
}
.live-badge-dot {
  width: 4px; height: 4px; border-radius: 50%; background: #fff; flex-shrink: 0;
  animation: live-blink 1.1s ease-in-out infinite;
}
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Entry Form page ────────────────────────────────────────── */
.comp-title { font-size: 11px; font-weight: 700; color: #111; line-height: 1.4; margin-bottom: 8px; }
.meta { font-size: 11px; color: var(--c-muted); line-height: 1.9; }
.meta b { color: var(--c-light); font-weight: 600; }

.entry-row { margin-top: 8px; font-size: 11px; color: var(--c-light); }
.entry-row a { color: var(--red); font-weight: 700; cursor: pointer; }
.entry-row a:hover { text-decoration: underline; }
.entry-row .sep { margin: 0 7px; color: var(--border); }

/* The old .qlinks / .ql / .ql-live block lived here. It has been removed:
   the links bar now styles itself inside entry.html, and the leftover
   `.ql .dot` rule was quietly winning on specificity (two classes beat
   one), which is why the sub-menu dots rendered small and grey instead
   of the bright green they were written to be. */

.poster {
  width: 100%;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--c-light);
  font-size: 11px;
}
.poster img { width: 100%; height: auto; border-radius: var(--radius); }

/* ── Auth tabs ──────────────────────────────────────────────── */
.auth-tab {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-light);
  cursor: pointer;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.auth-tab.on { color: var(--red); border-bottom-color: var(--red); }
.auth-footer { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }

/* ── Dashboard sidebar ──────────────────────────────────────── */
.dash-layout { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.dash-nav { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 11px;
  color: var(--c-body);
  cursor: pointer;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--bg-gray);
}
.dash-nav-item:last-child { border-bottom: none; }
.dash-nav-item:hover { color: var(--red); background: var(--bg-gray); }
.dash-nav-item.active { color: var(--red); border-left-color: var(--red); font-weight: 600; background: var(--red-light); }

/* ── Table ──────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.tbl th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--c-light); padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--bg-gray); color: #111; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-gray); }

/* ── Badge / pills ──────────────────────────────────────────── */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 2px; }
.pill-open    { background: var(--dark-light); color: var(--dark); }
.pill-closed  { background: var(--bg-gray); color: var(--c-muted); }
.pill-pending { background: var(--red-light); color: var(--red); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 280px;
  max-width: 420px;
  width: 90%;
}
.modal-title { font-size: 11px; font-weight: 700; margin-bottom: 14px; color: #111; }
.modal-close { float: right; font-size: 15px; color: var(--c-light); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--c-muted); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer-wrap {
  border-top: 1px solid var(--border);
  background: #fff;
  /* auto, not 0: this is the half of the sticky footer that pushes it down
     to the bottom of a short page (see the flex column on body). */
  margin-top: auto;
}
.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 11px;
  color: var(--c-light);
}

/* ── Utility ────────────────────────────────────────────────── */
.mt4  { margin-top: 4px; }   .mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }  .mt16 { margin-top: 16px; }
.mb4  { margin-bottom: 4px; } .mb8  { margin-bottom: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap4  { gap: 4px; }  .gap8  { gap: 8px; }  .gap12 { gap: 12px; }
