:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #5f6670;
  --line: #e8edf1;
  --card: #ffffff;
  --soft: #f7faf8;
  --gold: #f7c436;
  --green: #0b7f4f;
  --red: #d21f2f;
  --black: #111111;
  --orange: #f08b22;
  --kente-blue: #1958a6;
  --shadow: 0 24px 64px rgba(17, 24, 39, 0.16);
  --kente-pattern:
    repeating-linear-gradient(90deg, #111111 0 8px, #f7c436 8px 16px, #d21f2f 16px 24px, #0b7f4f 24px 32px, #1958a6 32px 40px, #f08b22 40px 48px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.2) 0 6px, rgba(0,0,0,0.12) 6px 12px, transparent 12px 24px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(247, 196, 54, 0.3), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(11, 127, 79, 0.18), transparent 24%),
    linear-gradient(135deg, #f8fbf9 0%, #ffffff 48%, #f6fff9 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  background:
    repeating-linear-gradient(90deg, rgba(17, 17, 17, 0.05) 0 8px, transparent 8px 22px),
    repeating-linear-gradient(0deg, rgba(247, 196, 54, 0.12) 0 10px, transparent 10px 24px);
}

button,
input,
select {
  font: inherit;
}

.phone-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.app-screen {
  min-height: calc(100vh - 24px);
  overflow: hidden;
  background:
    linear-gradient(#ffffff, #fbfffd) padding-box,
    linear-gradient(135deg, var(--red), var(--gold), var(--green), var(--black)) border-box;
  border: 2px solid transparent;
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    var(--kente-pattern);
  color: var(--ink);
  text-align: center;
}

.brand-copy {
  min-width: 0;
  padding-left: 0;
  text-align: left;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.35rem;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, var(--red) 0 28%, var(--gold) 28% 58%, var(--green) 58% 82%, var(--black) 82% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}

h2 {
  margin-bottom: 7px;
  font-size: 1.35rem;
  line-height: 1.12;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 138px;
  height: 82px;
  flex: 0 0 138px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 20px;
  background: white;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.14);
}

.logo-slot {
  overflow: hidden;
}

.logo-slot img {
  width: 96%;
  height: 96%;
  object-fit: contain;
  border-radius: 16px;
}

.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 14px 16px;
  padding: 5px;
  border: 1px solid #e8edf1;
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #5f6670;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background:
    linear-gradient(135deg, var(--green), #0a6240);
  color: white;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.16);
}

.view {
  display: none;
  padding: 0 16px 26px;
}

.view.active {
  display: block;
}

#homeView {
  padding-top: 10px;
}

.hero-card,
.home-hero,
.admin-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(10, 98, 64, 0.9), rgba(9, 64, 47, 0.86)),
    var(--kente-pattern);
  background-blend-mode: normal, multiply;
  color: white;
  padding: 20px;
  box-shadow: 0 20px 42px rgba(17, 24, 39, 0.18);
}

.hero-card::before,
.home-hero::before,
.admin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.22), rgba(255,255,255,0.06)),
    linear-gradient(135deg, rgba(247, 196, 54, 0.16), transparent 45%, rgba(210, 31, 47, 0.16));
}

.hero-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: center;
}

.home-hero {
  margin: 8px 0 18px;
  padding: 16px 18px;
}

.home-hero h2 {
  max-width: 300px;
  position: relative;
  z-index: 1;
  font-size: 1.18rem;
  line-height: 1.18;
  margin-bottom: 12px;
}

.home-hero p {
  position: relative;
  z-index: 1;
}

.install-action {
  position: relative;
  z-index: 1;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  color: var(--green);
  padding: 0 14px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
}

.search-box {
  margin-bottom: 18px;
}

.contest-grid {
  display: grid;
  gap: 12px;
}

.contest-card {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid #e7edf1;
  border-radius: 22px;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(135deg, rgba(11, 127, 79, 0.55), rgba(247, 196, 54, 0.75), rgba(210, 31, 47, 0.4)) border-box;
  padding: 16px 16px 16px 18px;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.08);
}

.contest-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: var(--kente-pattern);
  background-size: 48px 48px;
}

.contest-card h3 {
  margin-bottom: 5px;
  font-size: 1.12rem;
}

.contest-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.contest-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.contest-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 15px;
  background: #f3faf5;
  padding: 11px 12px;
}

.contest-meta strong {
  font-size: 1.25rem;
}

.open-contest {
  min-height: 46px;
  box-shadow: none;
}

.back-button {
  min-height: 40px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 13px;
  background: #eef6ef;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.hero-card img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(247, 196, 54, 0.3);
}

.hero-card p,
.admin-card p,
.home-hero p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.hero-card .eyebrow,
.home-hero .eyebrow,
.admin-card .eyebrow {
  color: #fff2b2;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 22px;
}

.stat-row div,
.vote-panel,
.dashboard-card,
.record-card {
  border: 1px solid #e7edf1;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.stat-row div {
  padding: 13px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.stat-row span {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
}

small,
.section-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 12px;
}

.contestant-list,
.dashboard-list,
.records-list {
  display: grid;
  gap: 10px;
}

.record-tools {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid #e7edf1;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.record-tools label {
  margin-bottom: 0;
}

.record-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.record-summary div {
  min-width: 0;
  border: 1px solid #e7edf1;
  border-radius: 16px;
  background: #f8fafc;
  padding: 10px 8px;
}

.record-summary strong,
.record-summary span {
  display: block;
}

.record-summary strong {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.record-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.contestant-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 11px;
  border: 1px solid #e7edf1;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.contestant-card.active {
  border-color: rgba(247, 196, 54, 0.95);
  box-shadow: 0 0 0 4px rgba(247, 196, 54, 0.18), 0 18px 34px rgba(17, 24, 39, 0.1);
}

.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: white;
  font-weight: 950;
}

.contestant-card strong,
.dashboard-card strong {
  display: block;
  margin-bottom: 4px;
}

.contestant-card span,
.dashboard-card span,
.record-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.vote-count {
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff0a8;
  color: #111111;
  border: 1px solid rgba(247, 196, 54, 0.75);
  text-align: center;
  font-weight: 950;
  box-shadow: inset 0 -2px 0 rgba(247, 196, 54, 0.28);
}

.vote-panel {
  margin-top: 18px;
  padding: 16px;
}

.selected-line,
.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.selected-line span,
.checkout-row span,
label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.hidden-field {
  display: none;
}

.secure-card-panel {
  display: grid;
  gap: 5px;
  margin: 0 0 14px;
  border: 1px solid rgba(11, 127, 79, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(11, 127, 79, 0.08), rgba(247, 196, 54, 0.14));
  padding: 13px 14px;
}

.secure-card-panel.hidden-field {
  display: none;
}

.secure-card-panel strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.secure-card-panel span,
.secure-card-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dfe7ec;
  border-radius: 15px;
  background: #fffdf7;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(247, 196, 54, 0.22);
}

.contest-picker {
  margin: 14px 0 16px;
}

.stepper {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
}

.stepper button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #f1f6f2;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
}

.checkout-row {
  padding-top: 4px;
}

.checkout-row strong {
  font-size: 1.3rem;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 17px;
  background:
    linear-gradient(135deg, var(--green), #0a6f49);
  color: white;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.18);
  position: relative;
  overflow: hidden;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-action::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--kente-pattern);
  background-size: 48px 48px;
}

.secondary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--green), #075f3a);
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(16, 24, 40, 0.16);
}

.payment-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  background: rgba(17, 17, 17, 0.58);
  padding: 18px;
}

.checkout-modal.hidden-field {
  display: none;
}

.checkout-modal-panel {
  width: min(100%, 428px);
  border-radius: 26px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

.checkout-modal-panel h2 {
  margin-bottom: 8px;
}

.checkout-modal-panel p {
  color: var(--muted);
  font-weight: 750;
}

.provider-window {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
  border: 1px solid #e7edf1;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #f8fafc, #ffffff);
  padding: 14px;
}

.provider-window span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #111111;
  color: #ffffff;
  font-weight: 950;
}

.provider-window strong {
  grid-column: 1 / -1;
  display: block;
  border-radius: 14px;
  background: #fff0a8;
  padding: 12px;
  text-align: center;
  font-size: 1.35rem;
}

.provider-note {
  font-size: 0.82rem;
}

.text-action {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.offline-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 30;
  width: min(calc(100% - 28px), 420px);
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 18px;
  background: #111111;
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.offline-banner.hidden-field {
  display: none;
}

.offline-banner strong {
  font-size: 0.9rem;
}

.offline-banner span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 750;
}

.inline-action {
  width: auto;
  min-height: 34px;
  margin-top: 12px;
  padding: 0;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-card {
  padding: 14px;
}

.compact-panel {
  margin: 0 0 18px;
}

.form-title {
  margin-bottom: 14px;
}

.admin-section {
  margin: 18px 0 20px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: #eef2f7;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
}

.admin-card {
  margin-bottom: 20px;
}

.admin-card h2 {
  font-size: 2rem;
}

.record-card {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.access-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

code {
  min-width: 0;
  overflow-wrap: anywhere;
  border-radius: 12px;
  background: #fff1c8;
  padding: 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.mini-action {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #111111;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.empty-state {
  padding: 20px;
  border: 1px dashed #d7b35a;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.compact-empty {
  padding: 12px;
  font-size: 0.8rem;
}

@media (max-width: 380px) {
  .phone-shell {
    padding: 0;
  }

  .app-screen {
    min-height: 100vh;
    border-radius: 0;
  }

  .hero-card {
    grid-template-columns: 72px 1fr;
  }

  .hero-card img {
    width: 72px;
    height: 72px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 116px;
  }

  .brand-mark {
    width: 116px;
    height: 74px;
  }

  h1 {
    font-size: 2rem;
  }
}
