/*
 * Majok mobile presentation — WeDrift UI tokens, 2026-11-03.
 * Deliberately visual-only. Desktop layout, scripting, IDs, form names,
 * hidden states, votes, countdown logic and API paths are unchanged.
 * Mirrors WeDrift-MVP/lib/config/theme/app_theme.dart (darkTheme).
 */
@media screen and (max-width: 767px) {
  :root {
    color-scheme: dark;
    --wd-bg: #101014;
    --wd-surface: #181820;
    --wd-raised: #22222c;
    --wd-input: #1d1d27;
    --wd-text: #f4f1f7;
    --wd-muted: #c8c2cf;
    --wd-line: #34303d;
    --wd-pink: #f42e78;
    --wd-purple: #b467f4;
    --wd-gradient: linear-gradient(105deg, var(--wd-pink), var(--wd-purple));
    --bg: var(--wd-bg);
    --bg1: var(--wd-bg);
    --bg2: var(--wd-raised);
    --panel: var(--wd-surface);
    --card: var(--wd-surface);
    --border: var(--wd-line);
    --line: var(--wd-line);
    --ink: var(--wd-text);
    --text: var(--wd-text);
    --muted: var(--wd-muted);
    --indigo: var(--wd-pink);
    --accent: var(--wd-pink);
    --ok: #8df0c2;
  }
  html { background: var(--wd-bg); }
  body {
    color: var(--wd-text);
    background: radial-gradient(ellipse 80% 40% at 50% -12%, rgba(180,103,244,.19), transparent 100%), var(--wd-bg) !important;
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
  }
  main { max-width: 100%; }
  main:not(.wrap):not(.card):not(.page) {
    width: min(100% - 24px, 760px);
    padding-top: 15px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
  .wrap { padding-inline: 14px; }
  .page { width: calc(100% - 28px); padding-top: 20px; padding-bottom: max(30px, env(safe-area-inset-bottom)); }
  h1, h2, h3, strong { color: var(--wd-text); }
  h1 { font-size: clamp(1.55rem, 6vw, 2rem); line-height: 1.35; letter-spacing: 0; }
  h2 { font-size: clamp(1.14rem, 4.7vw, 1.35rem); line-height: 1.45; }
  h3 { font-size: 1.05rem; line-height: 1.4; }
  p, small, li, .muted, .empty { color: var(--wd-muted); }
  p, li { line-height: 1.75; }
  a { text-underline-offset: 3px; }
  a:not(.card):not(.start):not(.btn):not(.mj-brand):not(.brand) { color: var(--wd-muted); }
  a:focus-visible, button:focus-visible, input:focus-visible,
  select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--wd-purple);
    outline-offset: 3px;
  }
  input, select, textarea {
    background: var(--wd-input) !important;
    color: var(--wd-text) !important;
    border: 1px solid var(--wd-line) !important;
    border-radius: 16px;
    min-height: 48px;
    font-size: 16px;
    max-width: 100%;
  }
  input::placeholder, textarea::placeholder { color: #a9a1b3; opacity: 1; }
  input:focus, select:focus, textarea:focus { border-color: var(--wd-purple) !important; }
  input[type="file"] { min-width: 0; }
  select { color-scheme: dark; }
  button, .btn, .start, .image-picker {
    font-family: inherit;
    min-height: 48px;
    border-radius: 16px;
    touch-action: manipulation;
    transition: filter .15s ease, transform .15s ease;
  }
  button:not(.secondary):not(.danger):not(.option):not(.team-switch):not(.image-picker),
  a.btn:not(.secondary), .start, .lang button.active, .lang-switch button.active,
  .section-nav .nav-active, #navRow .nav-active {
    background: var(--wd-gradient) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 7px 18px rgba(180,103,244,.18);
    -webkit-text-fill-color: #fff;
  }
  button.secondary, a.btn.secondary, .secondary,
  .image-picker, .lang-switch button:not(.active), .lang a:not(.active) {
    background: var(--wd-raised) !important;
    color: var(--wd-text) !important;
    border: 1px solid var(--wd-line) !important;
    box-shadow: none;
    -webkit-text-fill-color: currentColor;
  }
  button.danger { background: #743c4d !important; color: #fff !important; border: 1px solid #9b5162 !important; }
  button:disabled, .btn[aria-disabled="true"] { opacity: .52; box-shadow: none; }
  button:not(:disabled):active, .btn:active, .start:active { filter: brightness(.92); transform: scale(.99); }
  .panel, .card, .choice, .team-card, .podiumCard, .content-card {
    background: var(--wd-surface);
    color: var(--wd-text);
    border: 1px solid var(--wd-line);
    border-radius: 18px;
    box-shadow: 0 6px 22px rgba(0,0,0,.18);
  }
  .panel { padding: 17px; margin-block: 13px; }
  .card, .choice, .team-card { padding: 14px; }
  .notice, .timer, #countdownPanel, .stat, .team-preview,
  .secret, .secret-code, .tag, .pill, .email-box {
    background: var(--wd-raised) !important;
    color: var(--wd-text);
    border-color: var(--wd-line) !important;
  }
  .notice.error { border-color: #bc626e !important; color: #ffe3e8; }
  .notice.success { border-color: #55bca2 !important; color: #b5f9de; }
  .tag, .pill { border-radius: 999px; }
  .bar, .progress { background: var(--wd-input); }
  .fill, .progress span { background: var(--wd-gradient); }
  .result-num, .stat b, .podiumPercent, #countdownDigits { color: #ed9ccd; }
  .team-switch { color: #eaa0f8 !important; box-shadow: none; }
  .team-preview { border-radius: 16px; }
  .choice img, .preview { background: var(--wd-input); }
  .choice.selected { border: 2px solid var(--wd-pink); background: #2a1d31; }
  .choice button.final-result:disabled {
    opacity: 1;
    background: var(--wd-gradient) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
  }
  .option {
    background: var(--wd-raised);
    color: var(--wd-text);
    border: 1px solid var(--wd-line);
    border-radius: 16px;
    box-shadow: none;
  }
  /* Preserve the established green vote confirmation and muted other options. */
  #candidates .option.voteSelected { background: #194f45; border: 2px solid #8df0c2; box-shadow: inset 0 0 0 1px #237b63; opacity: 1; }
  #candidates .option.voteOther { opacity: .46; }
  #candidates .candidateIndex { background: #3b304b; }
  #chainTitle { background: var(--wd-raised); border-color: var(--wd-line); }
  #allResultsPanel { border-color: var(--wd-line); }
  .resultLine, .resultsList, .stat-list { max-width: 100%; }
  .resultsPodium { gap: 7px; }
  .podiumCard { padding: 12px 5px; }
  .podiumCard:first-child, .card.gold { border-color: #b467f4; background: #292034; }
  #navRow, .section-nav {
    gap: 7px;
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    border-radius: 19px;
    padding: 5px;
  }
  #navRow > button, .section-nav > button { border-radius: 14px; }
  .row { gap: 9px; }
  footer { color: var(--wd-muted); }
  footer .mj-footer-brand { padding-top: 4px; }
  .mj-brand { align-items: center; }
  .mj-brand img { background: #fff; border-radius: 14px; }
  /* Home: WeDrift-style dark cards, compact mobile navigation and gradient CTAs. */
  .top {
    background: rgba(24,24,32,.96);
    border-bottom: 1px solid var(--wd-line);
    padding-block: 12px;
  }
  .top-inner { gap: 10px; }
  .header-actions { gap: 9px; }
  .lang-switch { background: var(--wd-raised); border: 1px solid var(--wd-line); }
  .lang-switch button { border-radius: 999px; min-height: 36px; padding: 6px 12px; }
  .intro { padding: 32px 4px 19px; }
  .intro p { font-size: .95rem; }
  .cards { gap: 14px; padding-top: 9px; padding-bottom: 38px; }
  .cards > .card {
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
    background: var(--wd-surface);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .cards > .card .cover-icon { background: #28202f; color: #dd95e9; }
  .cards > .card .card-body { padding: 17px 18px 18px; }
  .cards > .card h2 { font-size: 1.27rem; }
  .cards > .card p { font-size: .92rem; color: var(--wd-muted); margin-bottom: 15px; }
  .cards > .card .start { min-height: 49px; border-radius: 999px; }
  .footer {
    background: var(--wd-surface);
    color: var(--wd-muted);
    border-top: 1px solid var(--wd-line);
  }
  .footer-links, .foot-links { color: var(--wd-muted); }
  .mj-footer-cloudflare .cf-secured { color: var(--wd-muted) !important; }
  /* Privacy & terms pages already have separate markup. */
  .lead { padding-top: 24px; padding-bottom: 13px; }
  .lead p, .panel p { color: var(--wd-muted); }
  .panel section { border-bottom-color: var(--wd-line); }
  .foot-brand small { color: var(--wd-muted); }
  .lang { background: var(--wd-raised); border-color: var(--wd-line); }
  .lang a.active { background: var(--wd-gradient); color: #fff !important; }
  /* Download/support: keep language and store redirects untouched. */
  body > main.card {
    background: var(--wd-surface);
    border-color: var(--wd-line);
    border-radius: 24px;
    width: min(100%, 460px);
    padding: 28px 20px;
  }
  body > main.card .logo { background: var(--wd-raised); border-color: var(--wd-line); }
  body > main.card .btns { gap: 10px; }
  body > main.card .btn { min-height: 52px; border-radius: 999px; }
  main.page .hero { padding: 36px 0 17px; }
  main.page .content-card, main.page .card { padding: 18px; }
  main.page .grid { grid-template-columns: 1fr; gap: 12px; }
  main.page .email-box { border-radius: 16px; }
  body > main:has(> .lang) {
    background: var(--wd-surface);
    border: 1px solid var(--wd-line);
    border-radius: 22px;
    padding: 30px 18px;
  }
  body > main:has(> .lang) .email {
    background: var(--wd-gradient);
    color: #fff;
    border-radius: 16px;
    min-height: 48px;
  }
  body > main:has(> .lang) .lang { background: transparent; }
  @media (max-width: 370px) {
    .mj-slogan { font-size: .60rem; }
    .mj-brand { gap: 6px; }
    .resultsPodium { gap: 5px; }
    .panel { padding: 13px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  button, .btn, .start, .image-picker, .card { transition: none !important; }
}
