/* ============================================================================
   AVH Studios — The Hitfinders (Contests)
   The monthly song contest: landing page, live transparency panel, entry grid,
   the entry modal and the Hall of Winners. Reads the shared :root tokens from
   brand.css so it shares one visual language with the rest of the app.
   ========================================================================== */

/* ---- Hero ----------------------------------------------------------------- */
.hf-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hf-hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background-image: url("brand/hitfinders-hero.jpg");
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.04);
}
.hf-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,8,10,0.72) 0%, rgba(7,8,10,0.55) 40%, rgba(7,8,10,0.94) 100%),
    radial-gradient(120% 90% at 12% 10%, rgba(255,107,53,0.30) 0%, rgba(7,8,10,0) 55%),
    radial-gradient(120% 90% at 92% 4%, rgba(53,194,255,0.28) 0%, rgba(7,8,10,0) 55%);
}
.hf-hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 84px 22px 66px;
}
.hf-kicker {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: #ffd9c4;
  background: rgba(255,107,53,0.16);
  border: 1px solid rgba(255,107,53,0.45);
  padding: 7px 14px; border-radius: 999px;
  margin-bottom: 20px;
}
.hf-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); }
.hf-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: .98; margin: 0 0 .18em; letter-spacing: -0.03em;
  text-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.hf-title .hf-the { display: block; font-size: .42em; letter-spacing: .34em; text-transform: uppercase; color: #ffd9c4; font-weight: 800; margin-bottom: .35em; }
.hf-sub {
  max-width: 640px; font-size: clamp(1.02rem, 2.2vw, 1.28rem);
  color: #e9edf3; text-shadow: 0 2px 18px rgba(0,0,0,.7); margin: 0 0 26px;
}
.hf-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hf-hero-note { color: #cdd3dc; font-size: .9rem; margin-top: 16px; }

/* ---- Countdown clock ------------------------------------------------------ */
.hf-countdown {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 9px;
  margin-top: 26px; padding: 16px 18px;
  background: rgba(15,17,21,0.72); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.hf-cd-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: #ffd9c4; display: flex; align-items: center; gap: .5em;
}
.hf-cd-clock { display: flex; gap: 10px; }
.hf-cd-cell {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; min-width: 66px; text-align: center;
}
.hf-cd-cell .n {
  display: block; font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: -0.02em;
}
.hf-cd-cell .l {
  display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--text-dim); margin-top: 3px;
}
.hf-cd-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: #ffc9c9; background: rgba(255,77,94,.14);
  border: 1px solid rgba(255,77,94,.5); border-radius: 999px; padding: 10px 18px;
}
.hf-cd-live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: hf-pulse 1.6s infinite; }
.hf-cd-sub { font-size: .82rem; color: var(--text-dim); }
.hf-cd-sub b { color: var(--text); font-weight: 700; }

/* ---- Live transparency strip --------------------------------------------- */
.hf-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; margin-top: 40px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.hf-strip-cell {
  background: rgba(15,17,21,0.82);
  padding: 20px 22px;
}
.hf-strip-cell .k {
  font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: .4em;
}
.hf-strip-cell .v { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; }
.hf-strip-cell .v.money { color: var(--accent-3); }
.hf-strip-cell .v.pool { color: var(--accent); }
.hf-strip-cell .sub { font-size: .78rem; color: var(--text-dim); margin-top: 4px; }
.hf-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(255,77,94,.7); animation: hf-pulse 1.8s infinite; }
@keyframes hf-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,94,.6);} 70% { box-shadow: 0 0 0 9px rgba(255,77,94,0);} 100% { box-shadow: 0 0 0 0 rgba(255,77,94,0);} }

/* ---- Layout --------------------------------------------------------------- */
.hf-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.hf-section { padding: 56px 0; }
.hf-section + .hf-section { border-top: 1px solid var(--border); }
.hf-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.hf-sec-head h2 { margin: 0; }
.hf-sec-head p { margin: 6px 0 0; color: var(--text-dim); }
.hf-eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }

/* ---- Status pill ---------------------------------------------------------- */
.hf-status {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim);
  background: var(--panel-2);
}
.hf-status.open { color: #bff5d8; border-color: rgba(53,255,158,.4); background: rgba(53,255,158,.12); }
.hf-status.judging { color: #ffe0b8; border-color: rgba(255,180,80,.4); background: rgba(255,180,80,.12); }
.hf-status.live { color: #ffc9c9; border-color: rgba(255,77,94,.5); background: rgba(255,77,94,.14); }
.hf-status.finalized, .hf-status.archived { color: #cfe6ff; border-color: rgba(53,194,255,.4); background: rgba(53,194,255,.12); }
.hf-status.upcoming, .hf-status.draft { color: var(--text-dim); }
.hf-status.cancelled { color: #ffb3bb; border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.1); }

/* ---- Cards ---------------------------------------------------------------- */
.hf-grid { display: grid; gap: 18px; }
.hf-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hf-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.hf-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow);
}
.hf-card h3 { margin: 0 0 .4em; }
.hf-card p { color: var(--text-dim); margin: 0; }
.hf-step .n {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(255,107,53,.22), rgba(53,194,255,.22));
  border: 1px solid var(--border); color: #fff;
}

/* ---- Transparency panel --------------------------------------------------- */
.hf-transparency { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.hf-meter {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.hf-meter .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hf-meter .pool-amt { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.hf-bar { height: 16px; border-radius: 999px; overflow: hidden; display: flex; margin: 18px 0 12px; border: 1px solid var(--border); }
.hf-bar .win { background: linear-gradient(92deg, var(--accent-3), #9dffce); }
.hf-bar .house { background: linear-gradient(92deg, #6b7280, #9aa0ac); }
.hf-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .86rem; color: var(--text-dim); }
.hf-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .5em; vertical-align: middle; }
.hf-legend b { color: var(--text); }
.hf-facts { display: grid; gap: 10px; }
.hf-fact { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.hf-fact .fk { color: var(--text-dim); font-size: .88rem; }
.hf-fact .fv { font-weight: 700; text-align: right; }
.hf-quorum { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: rgba(53,194,255,.08); border: 1px solid rgba(53,194,255,.28); color: #cfe6ff; font-size: .88rem; }

/* ---- Entries -------------------------------------------------------------- */
.hf-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.hf-entry {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .12s ease, border-color .12s ease;
}
.hf-entry:hover { transform: translateY(-3px); border-color: #3a4150; }
.hf-entry.winner { border-color: rgba(255,107,53,.6); box-shadow: 0 12px 40px rgba(255,107,53,.22); }
.hf-entry-cover { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg,#1b1f28,#12151b); overflow: hidden; }
.hf-entry-cover img { width: 100%; height: 100%; object-fit: cover; }
.hf-entry-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; opacity: .5; }
.hf-entry-play {
  position: absolute; left: 12px; bottom: 12px;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #ff8a4c); color: #1a0d05;
  font-size: 1.1rem; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.hf-entry-play.playing { background: linear-gradient(135deg, var(--accent-2), #7ad8ff); color: #05202b; }
.hf-entry-play:disabled { opacity: .4; cursor: not-allowed; }
.hf-rank {
  position: absolute; top: 10px; left: 10px; font-weight: 800; font-size: .8rem;
  background: rgba(7,8,10,.78); border: 1px solid var(--border); color: #fff;
  padding: 4px 10px; border-radius: 999px;
}
.hf-blind-tag { position: absolute; top: 10px; right: 10px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgba(7,8,10,.78); border: 1px solid var(--border); color: var(--text-dim); padding: 4px 9px; border-radius: 999px; }
.hf-entry-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hf-entry-title { font-weight: 800; font-size: 1.02rem; margin: 0; }
.hf-entry-artist { color: var(--text-dim); font-size: .86rem; display: flex; align-items: center; gap: .5em; }
.hf-entry-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.hf-chip { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); }
.hf-chip.verified { color: #bff5d8; border-color: rgba(53,255,158,.35); background: rgba(53,255,158,.1); }
.hf-chip.genre { color: #cfe6ff; border-color: rgba(53,194,255,.3); background: rgba(53,194,255,.08); }

/* ---- Hall of Winners ------------------------------------------------------ */
.hf-winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.hf-winner-card {
  position: relative; background: var(--panel); border: 1px solid rgba(255,107,53,.35);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.hf-winner-card .crown { position: absolute; top: 12px; right: 14px; font-size: 1.4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.hf-winner-cover { aspect-ratio: 16/9; background: linear-gradient(135deg,#241a12,#12151b); position: relative; }
.hf-winner-cover img { width: 100%; height: 100%; object-fit: cover; }
.hf-winner-body { padding: 18px; }
.hf-winner-body .period { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.hf-winner-body h3 { margin: 6px 0 2px; }
.hf-winner-prize { color: var(--accent-3); font-weight: 800; }

/* ---- Rules ---------------------------------------------------------------- */
.hf-rules { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.hf-rules-text { white-space: pre-wrap; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; line-height: 1.7; }
.hf-rubric { display: grid; gap: 12px; }
.hf-rubric-row { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.hf-rubric-row .rl { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.hf-rubric-row .rl .w { color: var(--accent-2); }
.hf-rubric-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.hf-rubric-bar span { display: block; height: 100%; background: linear-gradient(92deg, var(--accent), var(--accent-2)); }

/* ---- Empty / loading ------------------------------------------------------ */
.hf-empty { text-align: center; padding: 48px 20px; color: var(--text-dim); background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.hf-empty .big { font-size: 2.4rem; margin-bottom: 10px; }
.hf-skel { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%); background-size: 400% 100%; animation: hf-shimmer 1.4s infinite; border-radius: var(--radius-lg); height: 120px; }
@keyframes hf-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- Modal ---------------------------------------------------------------- */
.hf-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.hf-modal-backdrop { position: absolute; inset: 0; background: rgba(4,5,7,.72); backdrop-filter: blur(3px); }
.hf-modal-card {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 26px;
}
.hf-modal-x { position: absolute; top: 12px; right: 12px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.hf-modal h3 { margin: 0 0 .3em; }
.hf-field { margin: 16px 0; }
.hf-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.hf-field input[type=text], .hf-field textarea, .hf-field select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font: inherit;
}
.hf-field textarea { min-height: 84px; resize: vertical; }
.hf-song-pick { display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.hf-song-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; }
.hf-song-opt.sel { border-color: var(--accent); background: rgba(255,107,53,.1); }
.hf-song-opt .t { font-weight: 700; }
.hf-song-opt .g { color: var(--text-dim); font-size: .82rem; }
.hf-donate-note { background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.35); border-radius: var(--radius); padding: 14px; font-size: .9rem; color: #ffd9c4; }
.hf-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---- Toast ---------------------------------------------------------------- */
.hf-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #10131a; border: 1px solid var(--border); color: var(--text); padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s ease, transform .2s ease; z-index: 90; }
.hf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Footer --------------------------------------------------------------- */
.hf-footer { border-top: 1px solid var(--border); padding: 34px 0; color: var(--text-dim); font-size: .88rem; }
.hf-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hf-strip { grid-template-columns: repeat(2, 1fr); }
  .hf-transparency, .hf-rules { grid-template-columns: 1fr; }
  .hf-grid.cols-3, .hf-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hf-strip { grid-template-columns: 1fr; }
  .hf-grid.cols-3, .hf-grid.cols-4 { grid-template-columns: 1fr; }
  .hf-hero-inner { padding: 60px 18px 44px; }
  /* countdown clock: fit the 4 cells on one row at 390px */
  .hf-countdown { width: 100%; }
  .hf-cd-clock { gap: 7px; width: 100%; }
  .hf-cd-cell { min-width: 0; flex: 1; padding: 9px 5px; }
  .hf-cd-cell .n { font-size: 1.4rem; }
  /* tap targets >= 44px */
  .hf-song-opt { min-height: 44px; }
  .hf-receipt-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---- Phase 4: winner panel, settlement receipt, W-9 ----------------------- */
.hf-win-banner {
  display: flex; gap: 22px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(255,107,53,.14), rgba(53,255,158,.08));
  border: 1px solid rgba(255,107,53,.4); border-radius: var(--radius-lg);
  padding: 26px 28px; box-shadow: var(--shadow);
}
.hf-win-crown { font-size: 3rem; line-height: 1; filter: drop-shadow(0 6px 16px rgba(0,0,0,.6)); }
.hf-win-body { flex: 1; }
.hf-win-body h2 { margin: 4px 0 6px; }
.hf-win-body p { color: var(--text-dim); margin: 0 0 16px; }
.hf-win-facts { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 6px; }
.hf-win-facts .hf-fact { display: flex; flex-direction: column; gap: 2px; }
.hf-win-facts .fk { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.hf-win-facts .fv { font-size: 1.15rem; font-weight: 800; }
.hf-win-facts #hfWinPrize { color: var(--accent-3); }

.hf-receipt-link {
  margin-top: 14px; background: none; border: none; color: var(--accent-2);
  font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.hf-receipt-link:hover { text-decoration: underline; }

.hf-receipt { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.hf-receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.hf-receipt-head h4 { margin: 4px 0 0; }
.hf-receipt-id { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--text-dim); }
.hf-receipt-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.hf-receipt-row .rk { color: var(--text-dim); }
.hf-receipt-row .rv { font-weight: 700; text-align: right; }
.hf-receipt-row.win .rv { color: var(--accent-3); }
.hf-receipt-row.ok .rv { color: var(--accent-3); }
.hf-receipt-note { padding: 12px 20px; background: rgba(255,107,53,.1); color: #ffd9c4; font-size: .88rem; border-bottom: 1px solid var(--border); }
.hf-receipt-foot { padding: 14px 20px; color: var(--text-dim); font-size: .82rem; }

@media (max-width: 560px) {
  .hf-win-banner { flex-direction: column; gap: 12px; padding: 20px; }
}

/* ---- Accessibility: reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hf-live-dot, .hf-skel, .hf-toast { animation: none !important; }
  .hf-cd-live .dot { animation: none !important; }
  .hf-entry, .hf-song-opt, .hf-modal, .hf-modal-card, .hf-bar span { transition: none !important; }
}
