/* MARVEL MUGITHI AWARDS 2026
   Theme taken from traditional Kikuyu attire:
   - rust ochre fabric      -> main colour
   - deep brown fabric folds -> dark tone
   - beadwork (red, white, black, yellow, green) -> thin beaded band, used sparingly
   - cowrie shells          -> cowrie trim along the header edge
   - sand walls             -> page background
   Flat colours only, no gradients. */
:root {
  --brand: #9A4419;        /* rust ochre (the fabric) */
  --brand-dark: #5C2812;   /* deep brown (fabric folds) */
  --brand-tint: #F6E6D9;   /* light ochre for highlights */
  --accent: #E3A72F;       /* bead yellow, for details on rust */
  --accent-tint: #FBF0D9;
  --cowrie: #F4EADB;       /* cowrie shell */
  --bead-red: #B5302A;
  --bead-black: #221B17;
  --bead-green: #2F7A4B;
  --bg: #F7F0E6;           /* sand */
  --surface: #FFFFFF;
  --line: #E8DCCB;
  --text: #2A1A10;
  --muted: #76675A;
  --green: #2F7A4B;
  --red: #B5302A;
  --radius: 10px;
  --beads: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10' viewBox='0 0 120 10'%3E%3Crect width='120' height='10' fill='%235C2812'/%3E%3Ccircle cx='5' cy='5' r='4.2' fill='%23B5302A'/%3E%3Ccircle cx='15' cy='5' r='4.2' fill='%23B5302A'/%3E%3Ccircle cx='25' cy='5' r='4.2' fill='%23F7F2EA'/%3E%3Ccircle cx='35' cy='5' r='4.2' fill='%23221B17'/%3E%3Ccircle cx='45' cy='5' r='4.2' fill='%23F7F2EA'/%3E%3Ccircle cx='55' cy='5' r='4.2' fill='%23B5302A'/%3E%3Ccircle cx='65' cy='5' r='4.2' fill='%23B5302A'/%3E%3Ccircle cx='75' cy='5' r='4.2' fill='%23F7F2EA'/%3E%3Ccircle cx='85' cy='5' r='4.2' fill='%23E3A72F'/%3E%3Ccircle cx='95' cy='5' r='4.2' fill='%232F7A4B'/%3E%3Ccircle cx='105' cy='5' r='4.2' fill='%23E3A72F'/%3E%3Ccircle cx='115' cy='5' r='4.2' fill='%23F7F2EA'/%3E%3C/svg%3E");
  --cowries: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cellipse cx='20' cy='10' rx='8.5' ry='6' fill='%23F4EADB'/%3E%3Cpath d='M13.6 10.2C17 9.1 23 9.1 26.4 10.2' stroke='%235C2812' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M16 8.4v1.1M18.5 8v1.2M21 8v1.2M23.5 8.3v1.1M16 11v1.1M18.5 11.2v1.2M21 11.2v1.2M23.5 11v1.1' stroke='%235C2812' stroke-width='.8' stroke-linecap='round'/%3E%3C/svg%3E");

  /* older names kept so every page uses the same palette */
  --gold: var(--brand);
  --gold-2: var(--brand);
  --ember: var(--brand);
  --card: var(--surface);
  --card-2: var(--surface);
  --bg-2: var(--surface);
  --shadow: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
h1, h2, h3, h4, .serif { font-family: inherit; font-weight: 800; letter-spacing: -.01em; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- header band ---------- */
.hero { background: var(--beads) repeat-x left bottom / auto 10px, var(--brand); color: #fff; padding: 36px 0 10px; text-align: center; }
/* cowrie trim along the bottom edge, like the hem of the attire */
.hero::after, .dash-hero::after { content: ''; display: block; height: 20px; margin: 26px 0 12px; background: var(--cowries) repeat-x center / 40px 20px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; color: var(--accent); }
.hero h1 { font-size: clamp(30px, 5.5vw, 52px); margin: 8px 0 6px; line-height: 1.08; color: #fff; }
.hero h1 span { color: var(--accent); }
.hero p { margin: 0 auto; max-width: 580px; opacity: .92; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.pill b { color: var(--text); }
.hero .pill { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.hero .pill b { color: var(--accent); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DBE6B; animation: blink 2s infinite; }
.live-dot.off { background: #E0584A; animation: none; }
.live-dot.soon { background: var(--accent); animation: none; }
@keyframes blink { 50% { opacity: .35; } }

.banner { margin: 14px auto 0; max-width: 640px; padding: 10px 14px; border-radius: 8px; font-size: 14px; text-align: center; }
.banner.warn { background: #FDECEA; border: 1px solid #F3C2BD; color: var(--red); }
.banner.info { background: var(--brand-tint); border: 1px solid #EBCDB6; color: var(--brand-dark); }
.hero .banner.info, .hero .banner.warn { background: var(--cowrie); border-color: var(--cowrie); color: var(--brand-dark); }

/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 5; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
}
.tab:hover { border-color: var(--brand); }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.search {
  flex: 1 1 200px; max-width: 280px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
.search:focus, .field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- category cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; padding: 20px 0 40px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cat header { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); border-top: 4px solid var(--brand); }
.cat .div { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cat h2 { margin: 4px 0 2px; font-size: 19px; line-height: 1.25; }
.cat .total { color: var(--muted); font-size: 13px; }
.cat ol { list-style: none; margin: 0; padding: 4px 0; }
.empty { padding: 18px; color: var(--muted); font-size: 14px; }

.nom { display: grid; grid-template-columns: 30px 42px 1fr auto; gap: 10px; align-items: center; padding: 10px 18px; }
.nom + .nom { border-top: 1px solid var(--line); }
.rank { font-weight: 800; color: var(--muted); text-align: center; font-size: 16px; }
.nom.r1 .rank { color: var(--brand); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--brand-tint);
  display: grid; place-items: center; font-weight: 800; color: var(--brand); font-size: 15px; border: 2px solid transparent;
}
.nom.r1 .avatar { border-color: var(--accent); background: var(--accent-tint); }
.who { min-width: 0; }
.who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: #EFE4D6; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.count { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; }
.count small { color: var(--muted); font-weight: 600; font-size: 11px; margin-left: 3px; }
.vote-btn { border: 0; border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 13px; background: var(--brand); color: #fff; }
.vote-btn:hover { background: var(--brand-dark); }
.vote-btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.bump { animation: bump 1.4s ease; }
@keyframes bump { 0% { background: var(--brand-tint); } 100% { background: transparent; } }

/* ---------- vote dialog ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.modal-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.modal-head .avatar { width: 54px; height: 54px; font-size: 19px; border-color: var(--brand); }
.modal-head h3 { margin: 0; font-size: 20px; }
.modal-head .sub { color: var(--muted); font-size: 13px; }
.close-x { margin-left: auto; align-self: flex-start; background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; padding: 4px; }
.modal-body { padding: 18px 22px 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 20px; font-weight: 700; }
.qty input { text-align: center; font-weight: 800; font-size: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; }
.chip.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 8px; background: var(--brand-tint); border: 1px solid #EBCDB6; margin-bottom: 16px; }
.total-line b { font-size: 22px; color: var(--brand); }
.primary { width: 100%; border: 0; border-radius: 8px; padding: 14px; font-weight: 800; font-size: 16px; background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); }
.primary:disabled { opacity: .6; cursor: progress; }
.secondary { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); color: var(--text); font-weight: 700; }
.err { color: var(--red); font-size: 14px; margin: -6px 0 12px; }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; }

.status-box { text-align: center; padding: 10px 0 4px; }
.status-box .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 30px; font-weight: 800; }
.status-box .icon.wait { border: 4px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; }
.status-box .icon.ok { background: #E6F4EC; color: var(--green); }
.status-box .icon.bad { background: #FDECEA; color: var(--red); }
.status-box h4 { margin: 0 0 6px; font-size: 19px; }
.status-box p { color: var(--muted); margin: 0 0 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- how to vote ---------- */
.how { border-top: 1px solid var(--line); padding: 28px 16px 50px; color: var(--muted); }
.how ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; padding: 0; list-style: none; counter-reset: s; }
.how li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-size: 14px; color: var(--text); }
.how li::before { content: counter(s); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--cowrie); font-weight: 800; font-size: 13px; margin-right: 8px; }
.how h3 { color: var(--text); margin: 0 0 10px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px);
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; transition: transform .3s ease; z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .nom { grid-template-columns: 24px 38px 1fr auto; padding: 10px 14px; gap: 8px; }
  .avatar { width: 38px; height: 38px; }
  .search { max-width: none; }
}

/* ---------- sliding category tiles ---------- */
.tiles { --per: 3; --gap: 16px; padding: 18px 0 40px; }
@media (max-width: 1000px) { .tiles { --per: 2; } }
@media (max-width: 680px)  { .tiles { --per: 1; } }
.car-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 36px; }
.car-status { color: var(--muted); font-size: 13px; font-weight: 700; }
.car-ctl { display: flex; gap: 6px; align-items: center; }
.car-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--brand); font-size: 22px; font-weight: 800; line-height: 1; padding: 0 0 3px;
}
.car-btn:hover { border-color: var(--brand); background: var(--brand); color: #fff; }
.car-mode { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.car-mode:hover { border-color: var(--brand); }
.car-view { overflow: hidden; }
.car-track { display: flex; gap: var(--gap); align-items: flex-start; will-change: transform; }
.car-track > * { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-width: 0; }
.tiles .car-grid { padding: 0; }

/* ---------- trophy artwork ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr 260px; gap: 28px; align-items: center; text-align: left; }
.hero-grid p { margin: 0; }
.hero-grid .pills { justify-content: flex-start; }
.hero-grid .banner { margin: 14px 0 0; }
.trophy { position: relative; display: grid; place-items: center; }
.trophy::before { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: var(--brand-dark); top: 4px; }
.trophy img { position: relative; height: 250px; width: auto; display: block; }

.dash-hero { background: var(--beads) repeat-x left bottom / auto 10px, var(--brand); color: #fff; padding: 26px 0 10px; }
.dash-hero::after { margin-top: 18px; }
.dash-hero .wrap { display: grid; grid-template-columns: 1fr 150px; gap: 20px; align-items: center; }
.dash-hero .me { justify-content: flex-start; padding: 0 0 6px; }
.dash-hero .me h1 { color: #fff; }
.dash-hero .me .eyebrow { color: var(--accent); }
.dash-hero .me .avatar { background: var(--cowrie); border-color: var(--accent); }
.dash-hero .pills { justify-content: flex-start; }
.dash-hero .pill { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.dash-hero .pill b { color: var(--accent); }
.dash-hero .updated { text-align: left; color: #F1E3CF; margin: 10px 0 0; }
.dash-hero .trophy::before { width: 130px; height: 130px; }
.dash-hero .trophy img { height: 150px; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .hero-grid .pills { justify-content: center; }
  .hero-grid .banner { margin: 14px auto 0; }
  .hero-grid .trophy { order: -1; }
  .hero-grid .trophy::before { width: 120px; height: 120px; }
  .hero-grid .trophy img { height: 140px; }
  .dash-hero .wrap { grid-template-columns: 1fr 84px; gap: 10px; }
  .dash-hero .me { flex-direction: row; text-align: left; gap: 12px; }
  .dash-hero .me .avatar { width: 52px; height: 52px; font-size: 18px; flex-shrink: 0; }
  .dash-hero .trophy::before { width: 76px; height: 76px; }
  .dash-hero .trophy img { height: 92px; }
}

/* ---------- footer ---------- */
.site-foot { background: var(--beads) repeat-x left top / auto 10px, var(--brand-dark); color: var(--cowrie); padding: 30px 0 26px; text-align: center; font-size: 13px; }
.site-foot b { display: block; font-size: 15px; letter-spacing: .06em; margin-bottom: 4px; color: #fff; }
.site-foot span { opacity: .85; }
