@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Work+Sans:wght@400;500;600;700&display=swap');

/*
 * The visual language remains the original H5's cyan / violet, layered sci-fi
 * treatment. This file only adapts the new information architecture to it.
 */
:root {
  --layout-cyan: #12d9f4;
  --layout-blue: #2c9dff;
  --layout-violet: #7c5cff;
  --layout-ink: #070c19;
  --layout-panel: rgba(18, 31, 53, .92);
  --layout-line: rgba(75, 193, 240, .58);
  --layout-text: #f3f7ff;
  --layout-muted: #91acd3;
}

html, body, #app, #view { max-width: 100%; overflow-x: hidden; }
#view { padding: 26px 22px calc(94px + env(safe-area-inset-bottom)); }

/* Keep the former header glow and simply fit the timer/status into it. */
#topbar { gap: 14px; box-sizing: border-box; }
#brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topStatus:not([hidden]) { display: flex !important; min-width: 0; flex: 0 1 auto; align-items: center; justify-content: flex-end; gap: 9px; margin: 0 !important; padding: 0 !important; background: transparent !important; border: 0 !important; }
#eventClock, #progressText { display: block !important; flex: 0 0 auto; margin: 0 !important; color: #9db4d7 !important; font-size: 14px !important; line-height: 1 !important; }
#progressTrack { display: block !important; flex: 0 1 clamp(52px, 18vw, 118px); min-width: 44px; width: clamp(52px, 18vw, 118px); height: 8px !important; margin: 0 !important; overflow: hidden; border: 0 !important; border-radius: 99px; background: #1b2840 !important; }
#progressBar { display: block !important; width: 0; height: 100% !important; margin: 0 !important; border-radius: inherit; background: linear-gradient(90deg, #0ddbf1, #36a8ff) !important; box-shadow: 0 0 10px rgba(16, 219, 244, .75); }

/* New three-tab navigation, using the legacy luminous button treatment. */
#tabbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#tabbar button { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; width: 100%; padding: 7px 3px !important; }
#tabbar button b { display: block; margin: 0; font-size: 19px; line-height: 1; font-family: inherit; }
#tabbar button span { display: block; max-width: 100%; overflow: visible; text-overflow: clip; white-space: nowrap; font-size: 13px !important; line-height: 1.1; }

.entry-page, .home-page, .leaderboard-page, .profile-page, .challenge-page {
  width: 100%; min-width: 0; box-sizing: border-box;
}

/* Home: order and content follow the revised layout; card finish remains 3D. */
.home-greeting { margin: 2px 0 22px; }
.home-greeting h1 { margin: 0 0 8px; color: var(--layout-text); font-size: clamp(29px, 8.5vw, 42px); line-height: 1.1; letter-spacing: -.035em; }
.home-greeting p { margin: 0; color: var(--layout-muted); font-size: 16px; line-height: 1.55; }
.home-section-title { margin: 26px 0 13px; color: var(--layout-text); font-size: 25px; line-height: 1.15; }

.main-tower {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%; box-sizing: border-box;
  margin: 0 0 22px; padding: 22px 20px 18px;
  border: 1px solid rgba(49, 214, 249, .76); border-radius: 22px;
  background:
    radial-gradient(circle at 76% 22%, rgba(248, 55, 75, .25), transparent 29%),
    radial-gradient(circle at 22% 0%, rgba(116, 81, 253, .34), transparent 48%),
    linear-gradient(135deg, #17224e 0%, #0d1836 56%, #071225 100%);
  box-shadow: inset 0 1px 0 rgba(136, 236, 255, .3), 0 15px 34px rgba(2, 7, 23, .56), 0 0 28px rgba(31, 211, 245, .1);
}
.main-tower::before { content: ''; position: absolute; inset: 13px 18px auto; height: 5px; border-radius: 99px; background: linear-gradient(90deg, #0bdff4, #48a7ff); box-shadow: 0 0 13px rgba(18, 217, 244, .9); }
.main-tower > * { position: relative; z-index: 1; }
.main-tower .eyebrow { margin-top: 19px; color: #98aed7; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.main-tower .tower-chip { margin-top: 19px; color: #ff8b96; font-size: 12px; font-weight: 850; letter-spacing: .13em; }
.main-tower-copy { position: relative; z-index: 2; max-width: 59%; }
.main-tower h2 { max-width: 63%; margin: 8px 0; color: var(--layout-text); font-size: clamp(25px, 7vw, 35px); line-height: 1.04; letter-spacing: -.025em; }
.main-tower p { max-width: 64%; margin: 0; color: var(--layout-muted); font-size: 15px; line-height: 1.45; }
.main-tower-art { position: absolute !important; z-index: 2 !important; top: 35px; right: 12px; width: min(39%, 146px); height: auto; max-height: 150px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(255, 42, 64, .36)); pointer-events: none; }
.main-tower .main-emblem { display: none !important; }
.main-tower button, .main-tower .main-actions { position: relative; z-index: 3; width: 59%; min-height: 54px; margin-top: 22px; border-radius: 15px; }
.main-tower .main-actions { display: flex; width: 100%; gap: 10px; }
.main-tower .main-actions button { width: 50%; margin: 0; }
.main-tower .locked-actions { max-width: 100%; }
.main-tower .power-up { white-space: nowrap; }
.main-tower .locked-actions #unlockMain[disabled] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #dbe9ff;
  opacity: 1;
}
.lock-glyph {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 15px;
  margin-top: 6px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(195, 217, 255, .22), rgba(79, 101, 139, .46));
  box-shadow: 0 0 9px rgba(190, 219, 255, .2), inset 0 1px rgba(255, 255, 255, .25);
}
.lock-glyph::before {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 10px;
  height: 9px;
  content: '';
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}
.lock-glyph::after {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 3px;
  height: 5px;
  content: '';
  border-radius: 4px;
  background: currentColor;
  box-shadow: 0 -2px 0 -1px currentColor;
  transform: translateX(-50%);
}

.tower-list { display: grid; gap: 13px; width: 100%; }
.tower-card {
  --tower-accent: var(--layout-blue);
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; column-gap: 13px;
  width: 100%; min-width: 0; box-sizing: border-box; padding: 15px 16px;
  border: 1px solid var(--layout-line); border-left: 7px solid var(--tower-accent); border-radius: 18px;
  background: linear-gradient(105deg, rgba(20, 42, 71, .98), rgba(11, 23, 44, .96));
  box-shadow: inset 0 1px 0 rgba(139, 229, 255, .12), 0 10px 22px rgba(2, 8, 24, .36), 0 0 17px color-mix(in srgb, var(--tower-accent) 15%, transparent);
  text-align: left;
}
.tower-card.orange { --tower-accent: #ffad1b; }
.tower-card.purple { --tower-accent: #8d70ff; }
.tower-card.blue { --tower-accent: #269cff; }
.tower-card > span:nth-child(2) { display: block; min-width: 0; }
.tower-card .tower-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--tower-accent) 80%, white); border-radius: 50%; color: var(--tower-accent); background: radial-gradient(circle, color-mix(in srgb, var(--tower-accent) 22%, transparent), rgba(11, 22, 42, .75)); box-shadow: inset 0 0 14px color-mix(in srgb, var(--tower-accent) 38%, transparent), 0 0 14px color-mix(in srgb, var(--tower-accent) 28%, transparent); font-size: 26px; }
.tower-card strong, .tower-card small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tower-card strong { color: var(--layout-text); font-size: clamp(17px, 5.3vw, 23px); line-height: 1.2; }
.tower-card small { margin-top: 5px; color: var(--layout-muted); font-size: 14px; line-height: 1.25; }
.tower-card > b { min-width: 44px; color: var(--tower-accent); font-size: 18px; text-align: right; white-space: nowrap; }

/* Preserve the original panel depth for all revised page groups. */
.question-shell, .video-shell, .personality-shell, .leaderboard-card, .profile-card, .resume-card, .entry-card, .modal-card {
  width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid rgba(76, 150, 208, .42); border-radius: 19px;
  background: linear-gradient(145deg, rgba(25, 43, 70, .96), rgba(12, 23, 43, .98));
  box-shadow: inset 0 1px 0 rgba(162, 222, 255, .12), 0 12px 26px rgba(2, 7, 22, .4);
}
.choice, .option-button { width: 100%; min-width: 0; box-sizing: border-box; overflow-wrap: anywhere; }
.choice.selected, .option-button.selected { border-color: var(--layout-cyan); box-shadow: 0 0 0 1px rgba(18, 217, 244, .25), 0 0 18px rgba(18, 217, 244, .12); }
.leaderboard-row.is-current { border-left-color: #ff4c5c; background: linear-gradient(90deg, rgba(255, 48, 67, .18), rgba(28, 35, 57, .86)); }

@media (max-width: 380px) {
  #view { padding-inline: 16px; }
  #topbar { padding-inline: 16px; gap: 8px; }
  #brand { font-size: 14px; }
  #eventClock { display: none; }
  .main-tower { padding-inline: 16px; }
  .main-tower-art { top: 41px; right: 9px; width: 37%; max-height: 130px; }
  .main-tower-copy { max-width: 62%; }
  .main-tower button { width: 62%; }
  .tower-card { grid-template-columns: 45px minmax(0, 1fr) auto; padding: 13px 11px; column-gap: 10px; }
  .tower-card .tower-icon { width: 42px; height: 42px; font-size: 21px; }
  .tower-card strong { font-size: 16px; }
  .tower-card small { font-size: 12px; }
  .tower-card > b { min-width: 36px; font-size: 16px; }
}

/* Challenge pages: legacy luminous cards, retained with the revised copy flow. */
.challenge-page {
  min-height: calc(100dvh - 170px);
  display: flex; flex-direction: column;
  color: var(--layout-text);
}
.challenge-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -2px 8px; padding: 0 2px 12px;
  border-bottom: 1px solid rgba(92, 160, 213, .36);
}
.challenge-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--layout-cyan); font-size: 17px; }
.challenge-head span { flex: 0 0 auto; color: var(--layout-muted); font-size: 13px; }
.challenge-head.orange strong, .tower-slogan.orange { color: #ffb020; }
.challenge-head.purple strong, .tower-slogan.purple { color: #a689ff; }
.challenge-head.blue strong, .tower-slogan.blue { color: #42b8ff; }
.tower-slogan { margin: 14px 0 26px; font-size: 15px; font-style: italic; line-height: 1.5; color: var(--layout-muted); }
.challenge-page h1 { margin: 0 0 10px; color: var(--layout-text); font-size: clamp(24px, 7vw, 31px); line-height: 1.16; letter-spacing: -.025em; }
.challenge-page .instruction { margin: 0 0 15px; color: var(--layout-muted); font-size: 14px; }
.answer-list { display: grid; gap: 10px; margin: 8px 0 20px; }
.answer-option {
  position: relative; display: block; min-height: 61px; padding: 16px 17px;
  border: 1px solid rgba(74, 126, 178, .58); border-radius: 13px;
  background: linear-gradient(110deg, rgba(29, 49, 81, .96), rgba(19, 33, 59, .98));
  box-shadow: inset 0 1px 0 rgba(177, 225, 255, .08), 0 6px 15px rgba(1, 6, 18, .25);
  color: #deebff; font: inherit; font-size: 15px; line-height: 1.45; text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.answer-option:hover { transform: translateY(-1px); border-color: rgba(51, 207, 248, .85); }
.intelligence-page .answer-option.selected, .intelligence-page .answer-option:focus-visible { border-color: #ffac13; background: linear-gradient(110deg, rgba(115, 66, 7, .55), rgba(37, 31, 27, .98)); box-shadow: 0 0 0 1px rgba(255, 163, 0, .28), 0 0 22px rgba(255, 151, 0, .14); }
.video-page .answer-option.selected, .video-page .answer-option:focus-visible { border-color: #9a82ff; box-shadow: 0 0 0 1px rgba(154, 130, 255, .3), 0 0 20px rgba(131, 89, 255, .16); }
.personality-page .answer-option.selected, .personality-page .answer-option:focus-visible { border-color: #32b9ff; box-shadow: 0 0 0 1px rgba(50, 185, 255, .3), 0 0 20px rgba(26, 166, 255, .15); }
.challenge-page .primary { width: 100%; min-height: 53px; margin-top: 8px; margin-bottom: 24px; flex: 0 0 auto; border: 0; border-radius: 13px; font: 800 16px/1 inherit; letter-spacing: .01em; }
.challenge-page .primary.orange { background: linear-gradient(100deg, #ff9d00, #ffbd22); color: #1c170c; box-shadow: 0 0 22px rgba(255, 153, 0, .28), inset 0 1px 0 rgba(255, 239, 184, .56); }
.challenge-page .primary.purple { background: linear-gradient(100deg, #7559e9, #9479ff); color: #fff; box-shadow: 0 0 22px rgba(134, 92, 255, .25), inset 0 1px 0 rgba(237, 230, 255, .38); }
.challenge-page .primary.blue { background: linear-gradient(100deg, #08c6dd, #299eff); color: #03121f; box-shadow: 0 0 22px rgba(26, 185, 255, .25), inset 0 1px 0 rgba(211, 253, 255, .6); }

.agent-record, .result-panel {
  padding: 18px; border: 1px solid rgba(72, 137, 209, .45); border-radius: 15px;
  background: linear-gradient(145deg, rgba(22, 41, 68, .92), rgba(11, 24, 42, .97));
  box-shadow: inset 0 1px 0 rgba(179, 226, 255, .08), 0 12px 23px rgba(1, 7, 19, .26);
}
.agent-record { margin-top: 15px; }
.agent-record span, .result-panel > span { display: block; margin-bottom: 9px; color: #78b6ff; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.agent-record p, .result-panel p { margin: 0; color: #c2d4ef; font-size: 15px; line-height: 1.55; }
.agent-record.revealed { border-color: rgba(91, 192, 106, .55); background: linear-gradient(145deg, rgba(18, 56, 31, .88), rgba(13, 35, 28, .98)); }
.agent-record.revealed span { color: #72d889; }
.story-copy { margin: 19px 0; color: #bdcbe4; font-size: 16px; line-height: 1.5; }
.story-copy.emphasis { font-weight: 800; font-style: italic; text-align: center; color: #ffdf9d; }
.result-panel { margin: auto 0; text-align: center; }
.result-panel h1 { margin: 6px 0 13px; }
.result-panel .result-unlock { margin-top: 18px; color: #65d5ff; font-weight: 700; }
.result-panel.wrong { border-color: rgba(255, 131, 62, .55); }
.result-panel.wrong > span { color: #ffb052; }
.result-panel .primary { margin-top: 24px; }

.video-intro { margin: 0 0 13px; color: #d4c8ff; font-weight: 750; }
.video-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; margin: 4px 0 22px; border: 1px solid rgba(149, 123, 255, .58); border-radius: 16px; background: linear-gradient(135deg, #18213c, #10192b); box-shadow: inset 0 0 26px rgba(110, 83, 255, .15), 0 10px 24px rgba(1, 6, 19, .4); }
.video-frame::after { content: '▶'; position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; color: #f4f0ff; font-size: 38px; text-shadow: 0 0 20px #876fff; pointer-events: none; }
.video-frame iframe { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; }
.video-fallback { position: relative; z-index: 1; display: grid; width: 100%; height: 100%; place-items: center; color: var(--layout-muted); }

/* Leaderboard: the new table data receives the same in-app panel treatment. */
.leaderboard-page { color: var(--layout-text); }
.leaderboard-title { position: relative; overflow: hidden; margin: 0 0 17px; padding: 19px 18px 17px; border: 1px solid rgba(46, 213, 246, .52); border-radius: 17px; background: radial-gradient(circle at 100% 0%, rgba(216, 61, 96, .25), transparent 35%), linear-gradient(135deg, rgba(35, 45, 98, .97), rgba(14, 28, 50, .98)); box-shadow: inset 0 1px 0 rgba(152, 237, 255, .18), 0 12px 26px rgba(1, 7, 20, .34); }
.leaderboard-title::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 4px; border-radius: 0 0 9px 9px; background: linear-gradient(90deg, #14dced, #378fff); box-shadow: 0 0 12px rgba(20, 220, 237, .75); }
.leaderboard-title > span { display: block; margin-top: 8px; color: #9ec3ff; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.leaderboard-title > b { position: absolute; right: 18px; top: 21px; color: #52edcf; font-size: 12px; }
.leaderboard-title h1 { margin: 8px 0 6px; font-size: 27px; line-height: 1.1; }
.leaderboard-title p { margin: 0; color: var(--layout-muted); font-size: 14px; }
.rank-list { overflow: hidden; border: 1px solid rgba(62, 127, 182, .5); border-radius: 16px; background: rgba(13, 27, 49, .87); box-shadow: inset 0 1px 0 rgba(171, 225, 255, .09), 0 12px 24px rgba(1, 6, 18, .35); }
.rank-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 66px; padding: 11px 14px; border-bottom: 1px solid rgba(81, 126, 171, .23); }
.rank-row:last-child { border-bottom: 0; }
.rank-row > b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #243956; color: #c8dcff; font-size: 13px; }
.rank-row:nth-child(1) > b { background: linear-gradient(135deg, #ffd978, #cf8e24); color: #2d1c00; box-shadow: 0 0 12px rgba(255, 190, 61, .37); }
.rank-row:nth-child(2) > b { background: linear-gradient(135deg, #dfeaff, #8294b6); color: #101a2c; }
.rank-row:nth-child(3) > b { background: linear-gradient(135deg, #ffc58f, #a4653e); color: #28170d; }
.rank-row > span { min-width: 0; }
.rank-row strong, .rank-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row strong { color: #edf5ff; font-size: 15px; }
.rank-row small { margin-top: 4px; color: var(--layout-muted); font-size: 12px; }
.rank-row time { color: #c5d9ff; font-size: 13px; white-space: nowrap; }
.rank-row.mine { position: relative; background: linear-gradient(90deg, rgba(192, 42, 54, .34), rgba(51, 24, 36, .46)); box-shadow: inset 3px 0 0 #ec3347; }
.rank-row.mine strong, .rank-row.mine time { color: #fff3f4; }

/* Profile: compact legacy panels; nothing functional is changed. */
.profile-page { color: var(--layout-text); }
.profile-page > h1 { margin: 0 0 20px; font-size: 28px; }
.profile-user { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 13px; margin-bottom: 14px; padding: 16px; border: 1px solid rgba(66, 191, 239, .6); border-radius: 17px; background: radial-gradient(circle at 98% 0%, rgba(117, 65, 231, .4), transparent 42%), linear-gradient(115deg, rgba(21, 47, 81, .98), rgba(13, 29, 54, .98)); box-shadow: inset 0 1px 0 rgba(147, 232, 255, .16), 0 10px 24px rgba(2, 7, 20, .36); }
.profile-user > b { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(92, 217, 253, .7); border-radius: 50%; background: linear-gradient(135deg, #1d608f, #6548c8); box-shadow: 0 0 17px rgba(61, 189, 255, .25); color: white; font-size: 17px; }
.profile-user > span { min-width: 0; }
.profile-user strong, .profile-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-user strong { color: #f3f7ff; font-size: 17px; }
.profile-user small { margin-top: 5px; color: var(--layout-muted); font-size: 13px; }
.profile-panel { margin: 12px 0; padding: 16px; border: 1px solid rgba(66, 122, 175, .48); border-radius: 15px; background: linear-gradient(145deg, rgba(24, 41, 69, .89), rgba(13, 26, 47, .95)); box-shadow: inset 0 1px 0 rgba(165, 221, 255, .08); }
.profile-panel > span { display: block; margin-bottom: 8px; color: #8ba9d1; font-size: 12px; }
.profile-panel strong { color: #f0f6ff; font-size: 15px; }
.profile-panel p { margin: 0; color: #b2c6e4; font-size: 14px; line-height: 1.5; }
.profile-page .secondary { width: 100%; min-height: 50px; margin: 12px 0; border: 1px solid rgba(84, 142, 201, .55); border-radius: 13px; background: linear-gradient(145deg, rgba(22, 38, 63, .95), rgba(11, 22, 40, .98)); color: #c6d8f7; font: 700 15px/1 inherit; }
.profile-page .secondary:hover { border-color: #43cef2; color: #fff; box-shadow: 0 0 17px rgba(33, 193, 247, .17); }
.profile-page .signout { margin-top: 16px; }
.profile-dashboard-entry { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; min-height: 68px; gap: 12px; margin: 12px 0; padding: 10px 14px; border: 1px solid rgba(95, 180, 249, .7); border-radius: 15px; background: radial-gradient(circle at 92% 18%, rgba(109, 82, 234, .36), transparent 42%), linear-gradient(135deg, rgba(21, 57, 96, .96), rgba(10, 25, 48, .99)); box-shadow: inset 0 1px 0 rgba(179, 237, 255, .17), 0 10px 23px rgba(0, 5, 19, .28); color: #f1f8ff; text-decoration: none; }
.profile-dashboard-entry:hover { border-color: #54e2ff; box-shadow: inset 0 1px 0 rgba(211, 250, 255, .25), 0 0 22px rgba(36, 203, 250, .2); }
.profile-dashboard-entry:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.profile-dashboard-entry > span:nth-child(2) { min-width: 0; }
.profile-dashboard-entry strong, .profile-dashboard-entry small { display: block; }
.profile-dashboard-entry strong { color: #f6fbff; font-size: 15px; line-height: 1.25; }
.profile-dashboard-entry small { margin-top: 4px; color: #acc4e6; font-size: 12px; line-height: 1.25; }
.profile-dashboard-entry > b { color: #70eaff; font-size: 21px; line-height: 1; }
.profile-dashboard-icon { position: relative; display: grid; place-items: center; width: 45px; height: 45px; overflow: hidden; border: 1px solid rgba(103, 220, 255, .75); border-radius: 13px; background: linear-gradient(135deg, rgba(28, 180, 225, .4), rgba(99, 59, 201, .64)); box-shadow: inset 0 1px rgba(255, 255, 255, .26), 0 0 16px rgba(42, 208, 255, .26); }
.profile-dashboard-icon::before { width: 16px; height: 21px; border: 2px solid #d9fbff; border-radius: 3px; content: ''; box-shadow: 0 0 8px #35d8ff; }
.profile-dashboard-icon::after { position: absolute; bottom: 10px; left: 17px; width: 3px; height: 3px; border-radius: 50%; background: #e9fcff; box-shadow: 6px -6px #e9fcff, 12px -1px #e9fcff, 6px 5px #e9fcff; content: ''; }
.profile-dashboard-icon i { position: absolute; width: 26px; height: 1px; background: rgba(201, 251, 255, .48); transform: rotate(-38deg); }
.profile-dashboard-icon i:nth-child(1) { top: 9px; left: -4px; }.profile-dashboard-icon i:nth-child(2) { top: 17px; right: -8px; }.profile-dashboard-icon i:nth-child(3) { bottom: 7px; left: -4px; }

/* Entry, system and modal surfaces also retain the established treatment. */
.entry-lead { margin: 4px 0 26px; }
.entry-lead > span { color: #32d7f2; font-size: 13px; font-weight: 800; letter-spacing: .05em; }
.entry-lead h1 { margin: 12px 0 7px; color: var(--layout-text); font-size: 34px; }
.entry-lead p { margin: 0; color: var(--layout-muted); font-size: 16px; line-height: 1.5; }
.manual-form, .resume-card, .state-card { padding: 18px; border: 1px solid rgba(63, 150, 212, .46); border-radius: 18px; background: linear-gradient(145deg, rgba(24, 43, 72, .96), rgba(10, 22, 41, .98)); box-shadow: inset 0 1px 0 rgba(164, 224, 255, .1), 0 13px 30px rgba(1, 7, 20, .4); }
.manual-form label, .modal-card label { display: grid; gap: 7px; margin: 13px 0; color: #9ab4d9; font-size: 13px; }
.manual-form input, .manual-form select, .modal-card input, .modal-card select { min-width: 0; box-sizing: border-box; width: 100%; min-height: 45px; padding: 0 13px; border: 1px solid rgba(83, 131, 181, .5); border-radius: 11px; background: #15243c; color: #eff6ff; font: inherit; }
.scan-primary, .entry-page .primary { width: 100%; min-height: 54px; border: 0; border-radius: 13px; background: linear-gradient(100deg, #ed1829, #f02432); color: white; font: 800 16px/1 inherit; box-shadow: 0 8px 20px rgba(224, 20, 43, .24); }
.camera-help { display: block; width: 100%; margin: 14px 0; border: 0; background: transparent; color: #8da9d3; font: 650 13px/1 inherit; }
.divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: #7794bd; font-size: 13px; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: rgba(90, 133, 179, .38); }
.resume-card h1 { margin: 8px 0; color: #f4f7ff; font-size: 29px; }
.resume-card p { color: #b5cae7; line-height: 1.5; }
.resume-card .primary, .resume-card .secondary { width: 100%; min-height: 50px; margin-top: 12px; border-radius: 13px; }
.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2, 7, 19, .75); backdrop-filter: blur(8px); }
.modal-card { position: relative; max-width: 440px; padding: 24px; }
.modal-card h2 { margin: 7px 0 8px; color: #f3f7ff; }
.modal-card p { margin: 0; color: #b4c7e3; line-height: 1.45; }
.modal-card .primary { width: 100%; min-height: 48px; margin-top: 12px; border: 0; border-radius: 12px; background: linear-gradient(100deg, #ed1b2b, #ee3d4a); color: white; font: 800 15px/1 inherit; }
.modal-close { position: absolute; top: 11px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 9px; background: rgba(117, 143, 179, .18); color: #d9e7fa; font-size: 23px; line-height: 1; }
.state-card { color: var(--layout-text); }
.state-card h1 { margin-top: 0; }
.state-card p { color: var(--layout-muted); }
.empty-copy { padding: 18px; color: var(--layout-muted); text-align: center; }

/* A narrow phone cannot fit the full event name and progress on one row. */
@media (max-width: 500px) {
  #topbar {
    display: grid !important; grid-template-columns: minmax(0, 1fr); align-content: center;
    min-height: 78px; padding: 12px 16px !important; gap: 8px;
  }
  #brand {
    width: 100%; max-width: none !important; overflow: visible; text-overflow: clip; white-space: nowrap;
    color: #10d9f1; font-size: clamp(14px, 4.45vw, 17px) !important; line-height: 1.1;
  }
  #topStatus:not([hidden]) { width: 100%; justify-content: flex-start; gap: 9px; }
  #progressTrack { flex: 1 1 auto; width: auto; max-width: none; }
  #tabbar { min-height: 68px; padding: 6px 10px calc(7px + env(safe-area-inset-bottom)) !important; }
  #tabbar button span { font-size: 12px !important; }
}

/* Tower names and slogans must remain readable on narrow phones. */
.tower-card {
  min-height: 90px;
  align-items: center;
}
.tower-card strong,
.tower-card small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tower-card strong {
  font-size: clamp(15px, 4.35vw, 18px);
  line-height: 1.18;
}
.tower-card small {
  margin-top: 4px;
  font-size: clamp(11px, 3.4vw, 13px);
  line-height: 1.28;
}
.tower-card > b { align-self: center; font-size: 17px; }

/* Compact the main-tower card so the full tower list stays within the first screen. */
@media (max-width: 500px) {
  #view { padding-top: 18px; }
  .home-greeting { margin-bottom: 14px; }
  .home-greeting h1 { margin-bottom: 5px; font-size: clamp(29px, 8vw, 35px); }
  .home-greeting p { font-size: 14px; line-height: 1.4; }
  .main-tower {
    min-height: 248px; height: 248px; margin-bottom: 14px; padding: 15px 17px;
    border-radius: 19px;
  }
  .main-tower::before { inset: 11px 16px auto; height: 4px; }
  .main-tower .tower-chip { margin-top: 15px; font-size: 12px; }
  .main-tower-copy { max-width: 56%; }
  .main-tower h2 { max-width: 100%; margin: 5px 0 6px; font-size: clamp(24px, 6.5vw, 28px); line-height: 1.03; }
  .main-tower p { max-width: 100%; overflow: visible; white-space: nowrap; font-size: 12px; line-height: 1.32; letter-spacing: -.055em; }
  .main-tower-art { top: 38px; right: 10px; width: 35%; max-height: 118px; }
  .main-tower button {
    position: absolute; left: 17px; bottom: 16px; width: 56%; min-height: 45px; margin: 0;
    border-radius: 13px; font-size: 15px;
  }
  .main-tower .main-actions.locked-actions {
    position: absolute; left: 17px; right: 17px; bottom: 16px; width: auto; min-height: 45px; margin: 0;
    gap: 8px;
  }
  .main-tower .main-actions.locked-actions button {
    position: static; flex: 1 1 0; width: auto; min-width: 0; min-height: 45px; margin: 0;
    padding-inline: 8px; font-size: 13px;
  }
  /* Keep the two unlocked interactions on one row. The generic mobile button
     rule above is absolute, so without this override both buttons would be
     placed at the same left/bottom coordinate. */
  .main-tower.awake {
    min-height: 248px;
    height: 248px;
  }
  .main-tower.awake .main-actions {
    position: absolute;
    left: 17px;
    right: 17px;
    bottom: 15px;
    z-index: 4;
    display: flex;
    gap: 8px;
    width: auto;
    min-height: 45px;
    margin: 0;
  }
  .main-tower.awake .main-actions button {
    position: static;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 45px;
    margin: 0;
    padding: 8px;
    font-size: 13px;
    line-height: 1.15;
  }
  .home-page .section-title { margin: 15px 0 9px; font-size: 22px; }
  .tower-list { gap: 10px; }
}

/* WCAG 2.1 AA, typography, and interaction baseline. */
#app, #app button, #app input, #app select, #app textarea {
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app h1, #app h2, #app h3, #brand, .tower-card strong, .profile-user strong, .rank-row strong {
  font-family: 'Montserrat', 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app :where(p, small, label, span, time, button, input, select, textarea, strong, b) {
  font-size: max(12px, 1em);
}
#app :where(button, input, select, textarea) { min-height: 44px; }
#app button { touch-action: manipulation; }
#app :where(button, input, select, textarea):focus-visible {
  outline: 3px solid #ff5a61 !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(255, 90, 97, .22) !important;
}
@media (hover: hover) {
  #app button:not(:disabled):hover { filter: brightness(1.06); }
}
#app button:not(:disabled):active { transform: translateY(1px); }
#app button:disabled, #app button[aria-busy='true'] {
  background: #4b566d !important;
  border-color: #64738f !important;
  color: #ffffff !important;
  opacity: 1;
  cursor: not-allowed;
}
#app button[aria-busy='true'] { pointer-events: none; }

/* Primary actions keep the approved red surface with white text. */
#app .primary, #app .scan-primary {
  background: #d71920 !important;
  color: #ffffff !important;
  border: 1px solid #d71920 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 18px rgba(215, 25, 32, .22) !important;
}
@media (hover: hover) {
  #app .primary:not(:disabled):hover, #app .scan-primary:not(:disabled):hover { background: #af141a !important; border-color: #af141a !important; }
}
#app .secondary, #app .camera-help {
  background: transparent !important;
  border: 1px solid #77839a !important;
  color: #dfe9fa !important;
}

/* Muted text uses the documented minimum contrast token on dark surfaces. */
#app .instruction, #app .home-greeting p, #app .tower-card small, #app .main-tower p,
#app .profile-panel > span, #app .profile-panel p, #app .rank-row small, #app .leaderboard-title p,
#app .entry-lead p, #app .resume-card p, #app .modal-card p, #app .camera-help, #app .divider {
  color: #9bb1d2 !important;
}
#app .main-tower .tower-chip { color: #ff5a61; }
#app .leaderboard-title > span, #app .agent-record span, #app .result-panel > span { letter-spacing: .05em; }

/* Explicit spacing after labels when controls are no longer nested inside them. */
.manual-form > label + :is(input, select), .modal-card > label + :is(input, select) { margin-bottom: 11px; }

/* Home reward entry: it is only rendered after at least one reward threshold is reached. */
.reward-orbit-button {
  position: fixed;
  z-index: 29;
  right: calc(50% - min(215px, 50vw) + 17px);
  bottom: calc(89px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid rgba(104, 239, 255, .88);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(110, 242, 255, .6), rgba(29, 100, 186, .88) 42%, rgba(34, 28, 101, .96) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -10px 16px rgba(5, 14, 47, .42), 0 0 0 4px rgba(18, 211, 244, .1), 0 9px 24px rgba(0, 6, 27, .7), 0 0 24px rgba(16, 216, 242, .44);
  color: #fff;
  isolation: isolate;
  transition: transform .2s ease, filter .2s ease;
  animation: reward-float 2.5s ease-in-out infinite;
}
.reward-orbit-button::before {
  position: absolute;
  z-index: -2;
  inset: -8px;
  content: '';
  border: 1px solid rgba(111, 231, 255, .36);
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(14, 217, 244, .22);
  animation: reward-aura 2.5s ease-in-out infinite;
}
.reward-orbit-button::after {
  position: absolute;
  z-index: -1;
  inset: 8px;
  content: '';
  border: 1px solid rgba(239, 247, 255, .29);
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, .19), transparent 42%);
}
.reward-orbit-button:hover { filter: brightness(1.12); }
.reward-orbit-button:active { transform: translateY(1px) scale(.97); }
.reward-orbit-ring {
  position: absolute;
  inset: -5px;
  border: 1px dashed rgba(147, 249, 255, .9);
  border-radius: 50%;
  animation: reward-orbit 5s linear infinite;
}
.reward-orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffea85;
  box-shadow: 0 0 10px #ffe263;
}
.reward-orbit-dot-a { top: 0; right: 11px; animation: reward-dot-a 2.8s ease-in-out infinite; }
.reward-orbit-dot-b { bottom: 6px; left: 1px; background: #ff6d82; box-shadow: 0 0 10px #ff4c63; animation: reward-dot-b 2.8s ease-in-out infinite; }
.reward-gift {
  position: relative;
  display: block;
  width: 28px;
  height: 22px;
  margin-top: -5px;
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 4px 4px 7px 7px;
  background: linear-gradient(135deg, #fc5566, #df1d3d 50%, #9d143b);
  box-shadow: inset 0 1px rgba(255, 255, 255, .65), 0 0 11px rgba(255, 69, 93, .72);
}
.reward-gift::before {
  position: absolute;
  top: -6px;
  left: -2px;
  width: 30px;
  height: 6px;
  content: '';
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 3px;
  background: linear-gradient(90deg, #ffad39, #ffe97a, #ffad39);
  box-shadow: 0 0 8px rgba(255, 220, 93, .62);
}
.reward-gift::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  content: '';
  background: linear-gradient(#fff7a6, #ffc639);
  transform: translateX(-50%);
}
.reward-gift i::before, .reward-gift i::after {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 8px;
  content: '';
  border: 2px solid #fff4a8;
  border-radius: 10px 10px 2px 10px;
  box-shadow: 0 0 7px rgba(255, 229, 104, .7);
}
.reward-gift i::before { left: 4px; transform: rotate(-26deg); }
.reward-gift i::after { right: 4px; transform: scaleX(-1) rotate(-26deg); }
.reward-orbit-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  color: #eefdff;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  text-shadow: 0 1px 3px #06122b;
  transform: translateX(-50%);
}
.reward-orbit-count {
  position: absolute;
  top: -6px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 1px solid rgba(255, 249, 184, .85);
  border-radius: 99px;
  background: #d71920;
  box-shadow: 0 0 13px rgba(255, 54, 72, .75);
  color: white;
  font-size: 12px !important;
  font-weight: 850;
  line-height: 1;
}
@keyframes reward-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes reward-aura { 0%, 100% { opacity: .35; transform: scale(.96); } 50% { opacity: .95; transform: scale(1.08); } }
@keyframes reward-orbit { to { transform: rotate(360deg); } }
@keyframes reward-dot-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, 5px); } }
@keyframes reward-dot-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(7px, -6px); } }

/* Reward dialog retains the H5's layered sci-fi treatment rather than a flat list. */
.reward-modal { z-index: 100; padding: 16px; }
.reward-dialog {
  width: min(100%, 410px);
  max-height: min(720px, calc(100dvh - 32px));
  padding: 23px 17px 18px;
  overflow: auto;
  border-color: rgba(68, 216, 243, .64);
  background: radial-gradient(circle at 92% 0%, rgba(120, 75, 232, .28), transparent 34%), linear-gradient(145deg, rgba(26, 44, 77, .98), rgba(8, 18, 35, .99));
  box-shadow: inset 0 1px 0 rgba(176, 240, 255, .18), 0 22px 55px rgba(0, 0, 0, .56), 0 0 34px rgba(17, 193, 244, .13);
}
.reward-dialog .eyebrow { display: block; margin-right: 42px; color: #65d9ff; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.reward-dialog h2 { margin: 7px 0 16px; font-size: 25px; }
.reward-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.reward-progress > span { padding: 12px; border: 1px solid rgba(90, 148, 209, .42); border-radius: 13px; background: linear-gradient(145deg, rgba(32, 58, 95, .88), rgba(14, 31, 55, .92)); box-shadow: inset 0 1px rgba(188, 237, 255, .1); }
.reward-progress b, .reward-progress small { display: block; }
.reward-progress b { color: #f1f8ff; font-size: 20px; line-height: 1.1; }
.reward-progress small { margin-top: 5px; color: #9bb6d9; font-size: 12px; line-height: 1.25; }
.reward-list { display: grid; gap: 10px; }
.reward-item { position: relative; overflow: hidden; padding: 14px; border: 1px solid rgba(72, 136, 196, .48); border-radius: 15px; background: linear-gradient(130deg, rgba(21, 45, 77, .96), rgba(11, 25, 45, .98)); box-shadow: inset 0 1px rgba(171, 230, 255, .09), 0 7px 17px rgba(0, 4, 19, .23); }
.reward-item::after { position: absolute; top: 0; right: 0; width: 90px; height: 90px; content: ''; background: radial-gradient(circle at 100% 0, rgba(68, 215, 246, .15), transparent 68%); pointer-events: none; }
.reward-item.reward-claimable { border-color: rgba(255, 192, 77, .66); background: linear-gradient(130deg, rgba(74, 50, 24, .86), rgba(17, 30, 49, .99)); }
.reward-item.reward-issued { border-color: rgba(57, 212, 167, .62); }
.reward-item.reward-redeemed { opacity: .86; border-color: rgba(125, 158, 190, .48); }
.reward-item.reward-locked { opacity: .68; }
.reward-item-head { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.reward-item-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(125, 233, 255, .66); border-radius: 10px; background: linear-gradient(145deg, rgba(18, 205, 231, .28), rgba(105, 67, 212, .54)); color: #effeff; font-size: 18px !important; text-shadow: 0 0 9px #31dcff; }
.reward-item-head b, .reward-item-head small { display: block; min-width: 0; }
.reward-item-head b { overflow: hidden; color: #f2f7ff; font-size: 15px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.reward-item-head small { margin-top: 3px; color: #a8bfdd; font-size: 12px; line-height: 1.2; }
.reward-item-head em { padding: 5px 7px; border: 1px solid rgba(114, 163, 210, .38); border-radius: 99px; background: rgba(4, 14, 30, .45); color: #bfd0e9; font-size: 12px; font-style: normal; font-weight: 800; white-space: nowrap; }
.reward-claimable .reward-item-head em { border-color: rgba(255, 204, 106, .5); color: #ffd46b; }
.reward-issued .reward-item-head em { border-color: rgba(75, 228, 177, .45); color: #70edbb; }
.reward-redeemed .reward-item-head em { color: #b8c5d4; }
.reward-item > p { margin: 11px 0 0; color: #b7c9e3; font-size: 13px; line-height: 1.45; }
.reward-claim { width: 100%; min-height: 45px; margin-top: 13px; border: 1px solid #e8343f; border-radius: 11px; background: linear-gradient(105deg, #d71920, #f0444c); box-shadow: inset 0 1px rgba(255, 255, 255, .24), 0 8px 15px rgba(215, 25, 32, .18); color: white; font: 800 14px/1 inherit; }
.reward-code { margin-top: 12px; padding: 12px; border: 1px dashed rgba(88, 232, 188, .66); border-radius: 11px; background: rgba(10, 46, 43, .62); }
.reward-code span, .reward-code strong, .reward-code small { display: block; }
.reward-code-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.reward-code span { color: #98d8c6; font-size: 12px; font-weight: 700; }
.reward-code strong { margin: 0; overflow-wrap: anywhere; color: #effff8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .08em; white-space: nowrap; }
.reward-barcode { display: grid; min-height: 80px; margin: 10px 0 9px; padding: 8px 9px; place-items: center; overflow: hidden; border: 1px solid rgba(187, 251, 239, .8); border-radius: 8px; background: #f9fffc; box-shadow: inset 0 0 0 2px rgba(18, 50, 60, .08), 0 0 15px rgba(79, 239, 191, .15); }
.reward-barcode .bc-svg { display: block; width: 100%; max-width: 100%; height: 64px; }
.reward-code small, .reward-redeemed, .reward-locked { color: #a6c3d2; font-size: 12px; line-height: 1.35; }
.reward-redeemed, .reward-locked { margin-top: 12px; padding: 9px 10px; border-radius: 9px; background: rgba(7, 16, 31, .45); }
.reward-redeemed { color: #8fe4be; }
@media (prefers-reduced-motion: reduce) {
  .reward-orbit-button, .reward-orbit-button::before, .reward-orbit-ring, .reward-orbit-dot { animation: none !important; }
}

/* Brand refresh: retain the 3D sci-fi surfaces, now in TrendAI red and orange. */
:root {
  --layout-cyan: #ff2d35;
  --layout-blue: #ff7112;
  --layout-violet: #b70824;
  --layout-ink: #100206;
  --layout-panel: rgba(42, 7, 13, .94);
  --layout-line: rgba(255, 75, 65, .68);
  --layout-muted: #d7a5ab;
}
body {
  background-image:
    radial-gradient(circle at 94% 8%, rgba(255, 91, 24, .23), transparent 25rem),
    radial-gradient(circle at 5% 46%, rgba(178, 4, 29, .24), transparent 26rem),
    linear-gradient(145deg, #100206, #050206 68%);
}
#app { background: linear-gradient(154deg, #19050a, #070205 54%, #130207); }
#topbar {
  display: grid !important;
  grid-template-areas: 'event logo' 'status status';
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  min-height: 92px;
  padding: 12px 20px !important;
  gap: 8px 12px;
  border-bottom-color: rgba(255, 92, 82, .36);
  background: linear-gradient(105deg, rgba(25, 3, 8, .97), rgba(50, 5, 12, .93));
  box-shadow: inset 0 -1px rgba(255, 161, 144, .08), 0 8px 28px rgba(0, 0, 0, .32);
}
#brand {
  grid-area: event;
  color: #fff4f4 !important;
  font-size: clamp(14px, 4vw, 17px) !important;
  text-shadow: 0 0 16px rgba(255, 69, 62, .28) !important;
}
#trendaiLogo {
  grid-area: logo;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 133, 114, .68);
  border-radius: 9px 13px 9px 13px;
  background: linear-gradient(135deg, rgba(255, 60, 47, .94), rgba(181, 7, 30, .97) 58%, rgba(92, 3, 18, .96));
  box-shadow: inset 0 1px rgba(255, 235, 225, .42), 0 0 18px rgba(255, 47, 40, .25);
  color: #fff;
  font-family: 'Montserrat', 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1;
}
.trendai-logo-word sup { margin-left: 1px; font-size: 6px; vertical-align: top; }
#topStatus:not([hidden]) { grid-area: status; width: 100%; justify-content: flex-start; }
#eventClock, #progressText { color: #f3b2ae !important; }
#progressTrack { background: #3a121a !important; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6) !important; }
#progressBar { background: linear-gradient(90deg, #ef0a20, #ff6b13) !important; box-shadow: 0 0 13px rgba(255, 52, 39, .88) !important; }

#tabbar { border-top-color: rgba(255, 93, 74, .3); background: rgba(22, 3, 8, .95); }
#tabbar button.active {
  color: #fff4f1;
  border-color: rgba(255, 85, 66, .7);
  background: linear-gradient(135deg, rgba(219, 17, 35, .34), rgba(255, 105, 19, .25));
  box-shadow: 0 0 19px rgba(239, 23, 36, .18), inset 0 0 16px rgba(255, 115, 33, .1);
}

.main-tower {
  border-color: rgba(255, 74, 62, .88);
  background:
    radial-gradient(circle at 77% 20%, rgba(255, 121, 22, .36), transparent 28%),
    radial-gradient(circle at 22% 0%, rgba(219, 17, 35, .54), transparent 49%),
    linear-gradient(135deg, #4a0b15 0%, #23050c 56%, #100205 100%);
  box-shadow: inset 0 1px 0 rgba(255, 207, 191, .31), 0 15px 34px rgba(2, 0, 2, .62), 0 0 28px rgba(235, 19, 37, .18);
}
.main-tower::before { background: linear-gradient(90deg, #ff1828, #ff7b16); box-shadow: 0 0 15px rgba(255, 48, 36, .94); }
.main-tower .tower-chip { color: #ff9c8d !important; }
.main-tower-art { filter: drop-shadow(0 9px 17px rgba(255, 41, 32, .56)) !important; }
.main-tower .main-actions .power-up { border-color: rgba(255, 136, 95, .72); background: linear-gradient(145deg, rgba(106, 8, 22, .92), rgba(42, 4, 11, .96)); color: #ffd8cf; }

.tower-card { border-color: rgba(255, 76, 61, .58) !important; background: linear-gradient(135deg, rgba(69, 9, 17, .96), rgba(23, 4, 9, .98)) !important; box-shadow: inset 0 1px rgba(255, 205, 193, .12), 0 9px 21px rgba(0, 0, 0, .24) !important; }
.tower-card.orange { --tower-accent: #ff7a18; }
.tower-card.purple { --tower-accent: #ff3c47; }
.tower-card.blue { --tower-accent: #df1129; }
.tower-card small { color: #d7a5ab !important; }

.question-shell, .video-shell, .personality-shell, .leaderboard-card, .profile-card, .resume-card, .entry-card, .modal-card, .profile-panel {
  border-color: rgba(255, 78, 64, .46) !important;
  background: linear-gradient(145deg, rgba(52, 8, 15, .96), rgba(13, 2, 6, .99)) !important;
  box-shadow: inset 0 1px rgba(255, 211, 199, .1), 0 12px 27px rgba(0, 0, 0, .29) !important;
}
.answer-option, .manual-form input, .manual-form select, .modal-card input, .modal-card select {
  border-color: rgba(255, 106, 90, .42) !important;
  background: linear-gradient(145deg, #3a0b14, #21050b) !important;
}
.answer-option:hover { border-color: rgba(255, 105, 75, .92) !important; }
.personality-page .answer-option.selected, .personality-page .answer-option:focus-visible,
.video-page .answer-option.selected, .video-page .answer-option:focus-visible {
  border-color: #ff5a46 !important;
  box-shadow: 0 0 0 1px rgba(255, 90, 70, .33), 0 0 20px rgba(235, 28, 44, .2) !important;
}
.video-frame { border-color: rgba(255, 88, 74, .56); background: linear-gradient(135deg, #48101a, #160409); box-shadow: inset 0 0 26px rgba(235, 28, 44, .16), 0 10px 24px rgba(1, 0, 2, .5); }
.leaderboard-title, .leaderboard-hero { border-color: rgba(255, 74, 61, .7) !important; background: radial-gradient(circle at 86% 25%, rgba(255, 101, 25, .26), transparent 11rem), linear-gradient(125deg, #530b17, #160307) !important; }
.leaderboard-title::before { background: linear-gradient(90deg, #ff1628, #ff7b19) !important; box-shadow: 0 0 13px rgba(255, 41, 36, .82) !important; }
.profile-user, .profile-dashboard-entry { border-color: rgba(255, 74, 61, .64) !important; background: radial-gradient(circle at 96% 0%, rgba(255, 98, 22, .32), transparent 42%), linear-gradient(115deg, rgba(79, 10, 20, .98), rgba(25, 4, 10, .99)) !important; }
.profile-user > b, .profile-dashboard-icon { border-color: rgba(255, 156, 137, .7) !important; background: linear-gradient(135deg, #d9192b, #ff7618) !important; box-shadow: 0 0 17px rgba(246, 37, 41, .32) !important; }
.profile-dashboard-entry > b { color: #ff806d !important; }

.reward-orbit-button { border-color: rgba(255, 166, 130, .9); background: radial-gradient(circle at 32% 26%, rgba(255, 195, 121, .7), rgba(239, 19, 37, .94) 42%, rgba(86, 4, 18, .98) 72%); box-shadow: inset 0 1px rgba(255, 255, 255, .45), inset 0 -10px 16px rgba(41, 1, 8, .48), 0 0 0 4px rgba(239, 23, 36, .13), 0 9px 24px rgba(0, 0, 0, .72), 0 0 25px rgba(255, 48, 38, .56); }
.reward-orbit-button::before { border-color: rgba(255, 139, 112, .52); box-shadow: 0 0 19px rgba(255, 44, 35, .36); }
.reward-orbit-ring { border-color: rgba(255, 174, 127, .9); }
.reward-dialog { border-color: rgba(255, 83, 67, .7); background: radial-gradient(circle at 92% 0%, rgba(255, 105, 21, .32), transparent 34%), linear-gradient(145deg, rgba(59, 8, 17, .99), rgba(12, 2, 6, .99)); box-shadow: inset 0 1px rgba(255, 213, 201, .18), 0 22px 55px rgba(0, 0, 0, .6), 0 0 34px rgba(241, 26, 40, .18); }

@media (max-width: 500px) {
  #topbar { min-height: 86px; padding: 10px 16px !important; }
  #brand { font-size: clamp(13px, 4vw, 16px) !important; }
  #trendaiLogo { min-height: 28px; padding: 5px 8px; font-size: 11px; }
}

/* Red button system: a solid primary action and a crisp outlined secondary action. */
#app :is(.primary, .scan-primary, .reward-claim, button.btn:not(.ghost)) {
  min-height: 50px;
  border: 1px solid #ff5a55 !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, #f21b25 0%, #df0b19 58%, #bd0713 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 235, 225, .34), inset 0 -2px 0 rgba(112, 0, 9, .42), 0 9px 20px rgba(218, 9, 24, .28) !important;
  color: #fff !important;
  font-weight: 850 !important;
  letter-spacing: .01em;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
#app :is(.primary, .scan-primary, .reward-claim, button.btn:not(.ghost)):not(:disabled):hover {
  background: linear-gradient(135deg, #ff3038 0%, #e30d1a 58%, #c30815 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 244, 240, .42), inset 0 -2px 0 rgba(112, 0, 9, .4), 0 11px 24px rgba(242, 27, 37, .42) !important;
  filter: none !important;
  transform: translateY(-1px);
}
#app :is(.secondary, .camera-help, button.btn.ghost, .main-tower .main-actions .power-up) {
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, .82) !important;
  border-radius: 13px !important;
  background: linear-gradient(145deg, rgba(7, 2, 4, .88), rgba(26, 4, 9, .92)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 7px 16px rgba(0, 0, 0, .25) !important;
  color: #fff !important;
  font-weight: 750 !important;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
#app :is(.secondary, .camera-help, button.btn.ghost, .main-tower .main-actions .power-up):not(:disabled):hover {
  border-color: #ff5f59 !important;
  background: linear-gradient(145deg, rgba(72, 8, 17, .94), rgba(28, 3, 9, .96)) !important;
  box-shadow: inset 0 1px rgba(255, 215, 205, .18), 0 0 19px rgba(242, 27, 37, .18) !important;
  transform: translateY(-1px);
}
#app :is(.primary, .secondary, .scan-primary, .camera-help, .reward-claim, button.btn):not(:disabled):active { transform: translateY(1px); }

/* Official TrendAI mark: keep it anchored at the upper-left without consuming status space. */
#topbar {
  grid-template-areas: 'event' 'status' !important;
  grid-template-columns: minmax(0, 1fr) !important;
}
#brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  color: transparent !important;
  text-shadow: none !important;
}
#brand img {
  display: block;
  width: min(199px, 58vw);
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}
@media (max-width: 500px) {
  #brand { min-height: 32px; }
  #brand img { width: min(168px, 55vw); max-height: 34px; }
}
#app .main-tower .main-actions.locked-actions #unlockMain[disabled] {
  border-color: #ad2630 !important;
  background: linear-gradient(145deg, #76141d, #35070e) !important;
  box-shadow: inset 0 1px rgba(255, 217, 211, .16), inset 0 -2px rgba(70, 0, 8, .55), 0 7px 17px rgba(90, 4, 13, .25) !important;
  color: #ffe1df !important;
  opacity: 1 !important;
}

/* Complete the red visual system on data panels that retain their original blue surface. */
#app .rank-list {
  border-color: rgba(224, 48, 55, .68) !important;
  background: radial-gradient(circle at 100% 0%, rgba(255, 98, 20, .16), transparent 38%), linear-gradient(145deg, #26050b, #100205 72%) !important;
  box-shadow: inset 0 1px rgba(255, 214, 205, .11), 0 12px 25px rgba(0, 0, 0, .35) !important;
}
#app .rank-row {
  border-bottom-color: rgba(195, 48, 55, .26) !important;
  background: linear-gradient(90deg, rgba(104, 12, 23, .3), rgba(30, 3, 8, .12)) !important;
}
#app .rank-row > b {
  border: 1px solid rgba(255, 142, 118, .28);
  background: linear-gradient(145deg, #4b0b15, #24040a);
  color: #ffd3d0;
}
#app .rank-row strong { color: #fff5f3; }
#app .rank-row small { color: #dda9ad !important; }
#app .rank-row time { color: #ffd1cc; }
#app .rank-row.mine {
  background: linear-gradient(90deg, rgba(232, 33, 47, .44), rgba(85, 10, 21, .48)) !important;
  box-shadow: inset 3px 0 0 #ff5a55, inset 0 1px rgba(255, 213, 205, .09) !important;
}
#app .profile-page .signout {
  border-color: rgba(255, 255, 255, .88) !important;
  background: linear-gradient(145deg, rgba(9, 2, 4, .95), rgba(32, 4, 10, .95)) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .13), 0 7px 16px rgba(0, 0, 0, .25) !important;
}

/* Typography stays neutral on the red palette; red and orange are reserved for UI accents. */
#app * { color: #fff !important; }
#app :where(h1, h2, h3, h4, p, span, small, strong, b, label, time, legend, li) {
  color: #fff !important;
}
#app :is(input, select, textarea) {
  color: #fff !important;
}
#app :is(input, textarea)::placeholder {
  color: rgba(255, 255, 255, .72) !important;
  opacity: 1;
}
#app .rank-row.mine,
#app .rank-row.mine :is(strong, small, time),
#app .tower-card small,
#app .home-greeting p,
#app .main-tower p,
#app .profile-panel p,
#app .profile-panel > span,
#app .leaderboard-title p {
  color: #fff !important;
}

/* Challenge and reward surfaces follow the active red-and-black event shell. */
#app .challenge-head {
  padding: 12px 13px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 89, 78, .42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 116, 24, .17), transparent 42%),
    linear-gradient(135deg, rgba(84, 10, 21, .78), rgba(25, 3, 9, .96));
  box-shadow: inset 0 1px rgba(255, 217, 207, .11), 0 8px 19px rgba(0, 0, 0, .24);
}
#app .challenge-head strong,
#app .challenge-head span,
#app .tower-slogan,
#app .challenge-page .instruction,
#app .video-intro,
#app .story-copy,
#app .story-copy.emphasis {
  color: #fff !important;
}
#app .tower-slogan {
  margin: 0 0 22px;
  padding-left: 13px;
  border-left: 3px solid #ed2631;
  font-style: normal;
  text-shadow: 0 0 16px rgba(246, 36, 47, .16);
}
#app .challenge-page .answer-list {
  gap: 12px;
  margin-bottom: 22px;
}
#app .challenge-page .answer-option {
  min-height: 64px;
  border-color: rgba(255, 113, 94, .48) !important;
  border-radius: 15px;
  background:
    linear-gradient(105deg, rgba(118, 14, 29, .25), transparent 54%),
    linear-gradient(145deg, #3c0a14, #1b0409) !important;
  box-shadow: inset 0 1px rgba(255, 219, 211, .12), inset 0 -1px rgba(0, 0, 0, .32), 0 8px 17px rgba(0, 0, 0, .26) !important;
  color: #fff !important;
}
#app .challenge-page .answer-option:hover {
  border-color: rgba(255, 143, 100, .95) !important;
  box-shadow: inset 0 1px rgba(255, 234, 229, .19), 0 0 0 1px rgba(242, 36, 47, .22), 0 10px 20px rgba(0, 0, 0, .3), 0 0 18px rgba(242, 36, 47, .16) !important;
}
#app :is(.intelligence-page, .video-page, .personality-page) .answer-option.selected,
#app :is(.intelligence-page, .video-page, .personality-page) .answer-option:focus-visible {
  border-color: #ff6957 !important;
  background:
    linear-gradient(105deg, rgba(242, 33, 44, .42), rgba(255, 112, 19, .15)),
    linear-gradient(145deg, #570c16, #26050b) !important;
  box-shadow: inset 0 1px rgba(255, 236, 231, .22), 0 0 0 1px rgba(255, 94, 75, .34), 0 0 24px rgba(242, 27, 37, .26) !important;
}
#app .challenge-page .primary {
  min-height: 55px;
  margin-top: 10px;
  margin-bottom: 24px;
}
#app .agent-record,
#app .result-panel {
  border-color: rgba(255, 89, 78, .54);
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 111, 22, .18), transparent 42%),
    linear-gradient(145deg, rgba(71, 10, 20, .96), rgba(19, 3, 8, .99));
  box-shadow: inset 0 1px rgba(255, 221, 213, .13), 0 14px 27px rgba(0, 0, 0, .34), 0 0 22px rgba(239, 25, 39, .09);
}
#app .agent-record.revealed {
  border-color: rgba(255, 131, 88, .75);
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 127, 20, .21), transparent 40%),
    linear-gradient(145deg, rgba(99, 15, 20, .94), rgba(31, 4, 8, .99));
}
#app .agent-record span,
#app .agent-record.revealed span,
#app .result-panel > span,
#app .result-panel.wrong > span,
#app .result-panel .result-unlock {
  color: #fff !important;
}
#app .agent-record p,
#app .result-panel p { color: #fff !important; }
#app .video-frame {
  border-color: rgba(255, 97, 79, .72);
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 50%, rgba(238, 29, 42, .18), transparent 48%),
    linear-gradient(145deg, #4c0b15, #160308);
  box-shadow: inset 0 0 30px rgba(242, 32, 45, .2), 0 11px 25px rgba(0, 0, 0, .48), 0 0 18px rgba(239, 26, 40, .12);
}
#app .video-frame::after {
  color: #fff;
  text-shadow: 0 0 20px #f22a36;
}

.reward-modal {
  background: rgba(14, 1, 5, .84) !important;
  backdrop-filter: blur(8px);
}
.reward-dialog {
  border-color: rgba(255, 92, 75, .82) !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 113, 23, .34), transparent 35%),
    radial-gradient(circle at 4% 82%, rgba(214, 11, 34, .25), transparent 35%),
    linear-gradient(145deg, #4a0b16, #140206 68%) !important;
  box-shadow: inset 0 1px rgba(255, 225, 217, .2), 0 24px 60px rgba(0, 0, 0, .7), 0 0 35px rgba(241, 26, 40, .25) !important;
}
.reward-dialog :is(.eyebrow, h2, p, span, small, b, strong, em) { color: #fff !important; }
.reward-dialog .eyebrow { color: #fff !important; }
.reward-dialog .modal-close {
  border: 1px solid rgba(255, 135, 120, .42);
  background: linear-gradient(145deg, rgba(123, 15, 31, .9), rgba(43, 5, 12, .95));
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 226, 220, .14);
}
.reward-progress > span {
  border-color: rgba(255, 113, 94, .5);
  background: linear-gradient(145deg, rgba(96, 13, 26, .76), rgba(31, 4, 10, .96));
  box-shadow: inset 0 1px rgba(255, 225, 217, .11), 0 7px 16px rgba(0, 0, 0, .2);
}
.reward-item {
  border-color: rgba(255, 99, 79, .5);
  background:
    linear-gradient(110deg, rgba(206, 18, 38, .12), transparent 54%),
    linear-gradient(145deg, rgba(77, 10, 21, .97), rgba(24, 3, 8, .99));
  box-shadow: inset 0 1px rgba(255, 221, 213, .11), 0 8px 18px rgba(0, 0, 0, .27);
}
.reward-item::after { background: radial-gradient(circle at 100% 0, rgba(255, 105, 24, .24), transparent 68%); }
.reward-item.reward-claimable,
.reward-item.reward-issued {
  border-color: rgba(255, 118, 73, .78);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 128, 22, .25), transparent 39%),
    linear-gradient(145deg, rgba(113, 14, 24, .98), rgba(35, 4, 9, .99));
}
.reward-item.reward-redeemed { border-color: rgba(255, 205, 195, .38); }
.reward-item.reward-locked { border-color: rgba(255, 155, 142, .24); background: linear-gradient(145deg, rgba(52, 8, 15, .92), rgba(20, 3, 8, .98)); }
.reward-item-mark {
  border-color: rgba(255, 164, 125, .78);
  background: linear-gradient(145deg, #e2192b, #ff6b17);
  color: #fff !important;
  text-shadow: 0 0 10px rgba(255, 245, 233, .82);
  box-shadow: inset 0 1px rgba(255, 239, 221, .42), 0 0 15px rgba(244, 32, 42, .29);
}
.reward-item-head em {
  border-color: rgba(255, 151, 123, .48);
  background: rgba(42, 4, 10, .68);
  color: #fff !important;
}
.reward-code {
  border-color: rgba(255, 139, 107, .82);
  background: linear-gradient(145deg, rgba(104, 12, 25, .74), rgba(35, 4, 10, .9));
  box-shadow: inset 0 1px rgba(255, 224, 216, .1);
}
.reward-barcode {
  border-color: rgba(255, 219, 210, .86);
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(88, 7, 17, .11), 0 0 15px rgba(244, 37, 45, .18);
}
.reward-dialog .reward-claim {
  min-height: 50px;
  border: 1px solid #ff5a55;
  border-radius: 13px;
  background: linear-gradient(135deg, #f21b25 0%, #df0b19 58%, #bd0713 100%);
  box-shadow: inset 0 1px rgba(255, 235, 225, .34), inset 0 -2px rgba(112, 0, 9, .42), 0 9px 20px rgba(218, 9, 24, .28);
  color: #fff !important;
  font-weight: 850;
}
.reward-dialog .reward-claim:not(:disabled):hover {
  background: linear-gradient(135deg, #ff3038 0%, #e30d1a 58%, #c30815 100%);
  box-shadow: inset 0 1px rgba(255, 244, 240, .42), inset 0 -2px rgba(112, 0, 9, .4), 0 11px 24px rgba(242, 27, 37, .42);
  transform: translateY(-1px);
}

/* Leaderboard: layered command-console treatment with clear podium and current-user states. */
#app .leaderboard-page {
  position: relative;
  padding-bottom: 10px;
}
#app .leaderboard-title {
  isolation: isolate;
  min-height: 158px;
  padding: 25px 21px 21px;
  border-color: rgba(255, 86, 72, .86) !important;
  background:
    radial-gradient(circle at 91% 20%, rgba(255, 125, 22, .37), transparent 18%),
    radial-gradient(circle at 76% 80%, rgba(223, 12, 37, .32), transparent 34%),
    linear-gradient(125deg, #560a16, #21040a 62%, #120205) !important;
  box-shadow: inset 0 1px rgba(255, 229, 220, .22), inset 0 -18px 32px rgba(20, 1, 5, .42), 0 16px 32px rgba(0, 0, 0, .42), 0 0 28px rgba(239, 26, 40, .16) !important;
}
#app .leaderboard-title::before {
  left: 20px;
  right: 20px;
  height: 5px;
  background: linear-gradient(90deg, #ed1d2d, #ff7415, #ed1d2d) !important;
  box-shadow: 0 0 16px rgba(255, 63, 41, .86) !important;
}
#app .leaderboard-title > span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 7px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#app .leaderboard-title > span::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff5b52;
  box-shadow: 0 0 11px rgba(255, 81, 69, .92);
  content: '';
}
#app .leaderboard-title > b {
  z-index: 2;
  top: 26px;
  right: 21px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 138, 118, .56);
  border-radius: 999px;
  background: rgba(74, 7, 17, .55);
  box-shadow: inset 0 1px rgba(255, 224, 216, .14), 0 0 16px rgba(239, 25, 39, .16);
}
#app .leaderboard-title h1 {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  font-size: clamp(31px, 9vw, 39px);
  letter-spacing: -.04em;
  text-shadow: 0 6px 17px rgba(0, 0, 0, .48);
}
#app .leaderboard-title p {
  position: relative;
  z-index: 1;
  max-width: 250px;
  font-size: 14px;
  line-height: 1.45;
}
.leaderboard-orbit {
  position: absolute;
  z-index: -1;
  right: -21px;
  bottom: -47px;
  width: 175px;
  height: 175px;
  border: 1px solid rgba(255, 154, 109, .24);
  border-radius: 50%;
  box-shadow: 0 0 0 19px rgba(247, 32, 44, .035), 0 0 0 38px rgba(255, 113, 20, .025);
  transform: rotate(-23deg);
}
.leaderboard-orbit::before,
.leaderboard-orbit::after {
  position: absolute;
  border: 1px solid rgba(255, 153, 112, .25);
  border-radius: 50%;
  content: '';
}
.leaderboard-orbit::before { inset: 24px; }
.leaderboard-orbit::after { inset: 47px; border-color: rgba(255, 191, 120, .32); }
#app .leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 13px 0;
}
#app .leaderboard-summary > span {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: 'icon number' 'icon label';
  align-items: center;
  column-gap: 9px;
  min-height: 70px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 105, 86, .43);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(82, 10, 20, .9), rgba(26, 3, 8, .97));
  box-shadow: inset 0 1px rgba(255, 226, 217, .1), 0 8px 16px rgba(0, 0, 0, .24);
}
#app .leaderboard-summary > span::after {
  position: absolute;
  top: -27px;
  right: -22px;
  width: 73px;
  height: 73px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 111, 20, .2), transparent 68%);
  content: '';
  pointer-events: none;
}
#app .leaderboard-summary i {
  grid-area: icon;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 158, 126, .5);
  border-radius: 10px;
  background: linear-gradient(135deg, #e7192b, #ff7316);
  color: #fff !important;
  font-size: 14px;
  font-style: normal;
  box-shadow: inset 0 1px rgba(255, 238, 225, .4), 0 0 14px rgba(245, 36, 42, .22);
}
#app .leaderboard-summary b { grid-area: number; font-size: 20px; line-height: 1; }
#app .leaderboard-summary small { grid-area: label; margin-top: 4px; font-size: 11px; line-height: 1.2; }
#app .rank-list {
  padding: 7px;
  overflow: visible;
  border-color: rgba(255, 81, 68, .64) !important;
  border-radius: 19px;
  background:
    linear-gradient(145deg, rgba(69, 8, 18, .94), rgba(14, 2, 6, .98)) !important;
  box-shadow: inset 0 1px rgba(255, 223, 215, .13), 0 14px 27px rgba(0, 0, 0, .38), 0 0 22px rgba(234, 26, 39, .09) !important;
}
#app .rank-list-head {
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px 9px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
#app .rank-list-head span:last-child { text-align: right; }
#app .rank-row {
  position: relative;
  grid-template-columns: 47px minmax(0, 1fr) auto;
  min-height: 78px;
  margin: 0 0 7px;
  padding: 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 106, 88, .31) !important;
  border-radius: 14px;
  background:
    linear-gradient(105deg, rgba(203, 17, 37, .12), transparent 57%),
    linear-gradient(145deg, rgba(65, 8, 17, .96), rgba(24, 3, 8, .98)) !important;
  box-shadow: inset 0 1px rgba(255, 227, 219, .1), 0 8px 16px rgba(0, 0, 0, .21) !important;
}
#app .rank-row:last-child { margin-bottom: 0; }
#app .rank-row::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(#ff7418, #e8192c);
  box-shadow: 0 0 12px rgba(255, 79, 54, .58);
  content: '';
}
#app .rank-row > b {
  width: 34px;
  height: 34px;
  border-color: rgba(255, 151, 124, .5);
  border-radius: 11px;
  background: linear-gradient(145deg, #6e101d, #2c040b);
  color: #fff !important;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255, 230, 223, .16), 0 4px 10px rgba(0, 0, 0, .23);
}
#app .rank-row strong { font-size: 16px; letter-spacing: -.01em; }
#app .rank-row small { margin-top: 5px; font-size: 12px; }
#app .rank-row time {
  padding: 7px 9px;
  border: 1px solid rgba(255, 148, 121, .29);
  border-radius: 9px;
  background: rgba(30, 3, 8, .56);
  font-size: 12px;
  font-weight: 800;
}
#app .rank-row.podium {
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 159, 34, .22), transparent 35%),
    linear-gradient(110deg, rgba(168, 37, 14, .36), rgba(52, 6, 12, .96) 62%) !important;
}
#app .rank-row.rank-1 { border-color: rgba(255, 183, 65, .77) !important; box-shadow: inset 0 1px rgba(255, 244, 211, .24), 0 8px 18px rgba(0, 0, 0, .24), 0 0 20px rgba(255, 153, 29, .18) !important; }
#app .rank-row.rank-1 > b { border-color: rgba(255, 235, 158, .88); background: linear-gradient(145deg, #ffd661, #e0831d); color: #2a1400 !important; box-shadow: inset 0 1px rgba(255, 252, 232, .73), 0 0 16px rgba(255, 178, 42, .48); }
#app .rank-row.rank-2 > b { border-color: rgba(236, 238, 255, .7); background: linear-gradient(145deg, #dce2ee, #7d8493); color: #201d23 !important; }
#app .rank-row.rank-3 > b { border-color: rgba(255, 202, 154, .68); background: linear-gradient(145deg, #ffbf82, #a75d32); color: #2c1209 !important; }
#app .rank-row.mine {
  border-color: rgba(255, 106, 89, .92) !important;
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 121, 19, .31), transparent 39%),
    linear-gradient(105deg, rgba(232, 30, 46, .62), rgba(72, 7, 17, .98)) !important;
  box-shadow: inset 0 1px rgba(255, 235, 229, .2), inset 4px 0 #ff8061, 0 9px 20px rgba(0, 0, 0, .28), 0 0 21px rgba(242, 28, 42, .18) !important;
}
#app .rank-row.mine::after { width: 4px; background: #fff0ec; box-shadow: 0 0 12px rgba(255, 241, 234, .65); }
#app .rank-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
#app .rank-name-line strong { min-width: 0; }
#app .my-rank-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(255, 220, 155, .72);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 176, 53, .34), rgba(196, 33, 47, .44));
  color: #fff5d4 !important;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
#app .rank-timing-note {
  display: grid;
  gap: 5px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 156, 85, .62);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(135, 50, 6, .63), rgba(55, 9, 11, .82));
  box-shadow: inset 0 1px rgba(255, 230, 179, .15), 0 8px 18px rgba(0, 0, 0, .24);
}
#app .rank-timing-note b { color: #fff2d5; font-size: 13px; }
#app .rank-timing-note span { color: #ffd0a8; font-size: 12px; line-height: 1.45; }
#app .rank-row:focus-within { outline: 2px solid #fff; outline-offset: 3px; }
#app .empty-copy {
  margin: 0;
  padding: 36px 20px;
  text-align: center;
  color: #fff !important;
}
@media (max-width: 380px) {
  #app .leaderboard-title { min-height: 148px; padding: 23px 17px 19px; }
  #app .leaderboard-title h1 { font-size: 30px; }
  #app .rank-row, #app .rank-list-head { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; }
  #app .rank-row { padding: 11px 9px; }
  #app .rank-row > b { width: 31px; height: 31px; }
  #app .rank-row strong { font-size: 15px; }
  #app .my-rank-badge { padding: 3px 5px; font-size: 8px; }
  #app .rank-row time { padding: 6px; font-size: 11px; }
}

/* In-question AR uses the camera/Three.js scene as the visual layer. */
#app .challenge-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: initial;
  gap: 9px;
}
#app .challenge-head .challenge-back,
#app .challenge-back.standalone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 64px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 178, 166, .68);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(92, 11, 23, .9), rgba(37, 3, 11, .9));
  color: #fff !important;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px rgba(255,255,255,.14), 0 5px 14px rgba(0,0,0,.22);
}
#app .challenge-head .challenge-back i,
#app .challenge-back.standalone i { font-size: 18px; font-style: normal; line-height: 1; }
#app .challenge-head .challenge-back span,
#app .challenge-back.standalone span { color: #fff !important; font-size: 13px; }
#app .challenge-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app .challenge-head .challenge-count { min-width: max-content; }
#app .challenge-back.standalone { margin: 0 0 16px; }
#app .challenge-head .challenge-back:focus-visible,
#app .challenge-back.standalone:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
body.ar-question-active #app .challenge-page {
  background: linear-gradient(150deg, rgba(12, 2, 8, .43), rgba(24, 2, 8, .59));
  backdrop-filter: blur(1.5px);
}
body.ar-question-active #app .challenge-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(8,0,3,.30));
}
@media (max-width: 380px) {
  #app .challenge-head { gap: 6px; padding: 9px 8px; }
  #app .challenge-head .challenge-back { min-width: 52px; padding: 7px 6px; }
  #app .challenge-head .challenge-back span { display: none; }
}

/* Progress and completion feedback. Keep the event status visible while the
   page scrolls, then make completion states obvious without changing layout. */
html, body { overflow-x: hidden; }
#app { overflow: visible; }
#view { overflow: visible !important; }
#topbar {
  position: sticky !important;
  top: 0;
  z-index: 120;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .36);
}
#app .tower-card.is-pending {
  border-color: rgba(255, 151, 0, .88) !important;
  border-left-color: #ff9500 !important;
  background:
    radial-gradient(circle at 88% 2%, rgba(255, 156, 34, .23), transparent 37%),
    linear-gradient(135deg, rgba(91, 42, 5, .95), rgba(38, 7, 6, .98)) !important;
  box-shadow: inset 0 1px rgba(255, 233, 193, .16), 0 10px 20px rgba(0, 0, 0, .28), 0 0 20px rgba(255, 145, 0, .15) !important;
}
#app .tower-card.is-pending > b {
  color: #ffb33c !important;
  text-shadow: 0 0 11px rgba(255, 151, 0, .42);
}
#app .tower-card.is-pending .tower-icon {
  border-color: rgba(255, 178, 60, .9) !important;
  box-shadow: 0 0 18px rgba(255, 151, 0, .32), inset 0 1px rgba(255, 240, 211, .23) !important;
}
#app .tower-card.is-complete {
  border-color: rgba(255, 64, 73, .92) !important;
  border-left-color: #ff3342 !important;
  background:
    radial-gradient(circle at 88% 2%, rgba(255, 72, 51, .25), transparent 37%),
    linear-gradient(135deg, rgba(113, 12, 23, .96), rgba(40, 3, 9, .99)) !important;
  box-shadow: inset 0 1px rgba(255, 232, 227, .17), 0 10px 21px rgba(0, 0, 0, .3), 0 0 23px rgba(242, 33, 46, .23) !important;
}
#app .tower-card.is-complete > b {
  color: #ff6970 !important;
  text-shadow: 0 0 11px rgba(255, 64, 73, .5);
}
#app .tower-card.is-complete .tower-icon {
  border-color: rgba(255, 102, 108, .9) !important;
  box-shadow: 0 0 20px rgba(242, 41, 54, .4), inset 0 1px rgba(255, 240, 238, .22) !important;
}
#app .main-tower:has(#unlockMain[disabled]),
#app .main-tower.is-pending {
  border-color: rgba(255, 157, 23, .85) !important;
  background:
    radial-gradient(circle at 78% 15%, rgba(255, 173, 42, .26), transparent 30%),
    linear-gradient(135deg, rgba(102, 44, 4, .96), rgba(39, 5, 7, .99)) !important;
}
#app .main-tower:has(#unlockMain[disabled])::before,
#app .main-tower.is-pending::before {
  background: linear-gradient(90deg, #ff9d00, #ffcc55) !important;
  box-shadow: 0 0 15px rgba(255, 157, 0, .72) !important;
}
#app .main-tower:has(#unlockMain:not([disabled])),
#app .main-tower.ready {
  border-color: rgba(255, 68, 60, .98) !important;
  background:
    radial-gradient(circle at 78% 15%, rgba(255, 126, 25, .29), transparent 31%),
    radial-gradient(circle at 15% 0%, rgba(238, 37, 54, .32), transparent 40%),
    linear-gradient(135deg, rgba(116, 11, 20, .98), rgba(42, 3, 8, .99)) !important;
  box-shadow: inset 0 1px rgba(255, 235, 228, .22), 0 16px 34px rgba(0, 0, 0, .38), 0 0 31px rgba(245, 37, 44, .38) !important;
  animation: main-tower-ready-pulse 1.9s ease-in-out infinite;
}
#app .main-tower:has(#unlockMain:not([disabled]))::before,
#app .main-tower.ready::before {
  background: linear-gradient(90deg, #ff283b, #ff7419) !important;
  box-shadow: 0 0 18px rgba(255, 57, 45, .9) !important;
}
#app .main-tower:has(#unlockMain:not([disabled])) .tower-chip::after,
#app .main-tower.ready .tower-chip::after {
  content: ' · Ready to unlock';
  color: #fff1e9;
}
#app .main-tower.awake {
  border-color: rgba(255, 78, 68, .96) !important;
  box-shadow: inset 0 1px rgba(255, 235, 228, .2), 0 14px 32px rgba(0, 0, 0, .37), 0 0 27px rgba(245, 37, 44, .31) !important;
}
@keyframes main-tower-ready-pulse {
  50% { box-shadow: inset 0 1px rgba(255, 235, 228, .25), 0 16px 34px rgba(0, 0, 0, .38), 0 0 43px rgba(255, 37, 44, .55) !important; }
}
@media (prefers-reduced-motion: reduce) {
  #app .main-tower:has(#unlockMain:not([disabled])),
  #app .main-tower.ready { animation: none; }
}

/* Compact completed-state controls and the simplified main tower module. */
#app .main-tower.main-tower-simple {
  min-height: 0;
  height: auto;
  padding: 28px 20px 20px;
}
#app .main-tower.main-tower-simple .main-tower-copy {
  max-width: none;
}
#app .main-tower.main-tower-simple h2 {
  max-width: none;
  margin: 4px 0 18px;
  font-size: clamp(23px, 6.5vw, 30px);
  line-height: 1.12;
}
#app .main-tower.main-tower-simple .main-actions,
#app .main-tower.main-tower-simple .main-actions.locked-actions,
#app .main-tower.main-tower-simple.awake .main-actions {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-height: 48px;
  margin: 0;
  gap: 10px;
}
#app .main-tower.main-tower-simple .main-actions button,
#app .main-tower.main-tower-simple .main-actions.locked-actions button,
#app .main-tower.main-tower-simple.awake .main-actions button {
  position: static;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.18;
}
#app .completed-tower-card {
  cursor: default;
  row-gap: 12px;
}
#app .completed-tower-card .tower-card-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  width: 100%;
}
#app .completed-tower-card .tower-card-actions button {
  min-width: 0;
  min-height: 46px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 126, 93, .72);
  border-radius: 12px;
  background: rgba(68, 7, 14, .86);
  color: #fff2ed;
  font: 800 12px/1.2 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app .completed-tower-card .tower-card-actions button:last-child {
  background: linear-gradient(110deg, #d71920, #ff7617);
  box-shadow: 0 7px 18px rgba(215, 25, 32, .28);
}
#toast.is-center {
  z-index: 220;
  top: 50%;
  bottom: auto;
  width: min(330px, calc(100% - 42px));
  max-width: none;
  padding: 18px 20px;
  border-color: rgba(255, 139, 102, .82);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(91, 10, 21, .98), rgba(30, 4, 11, .98));
  box-shadow: 0 20px 55px rgba(0, 0, 0, .5), 0 0 28px rgba(215, 25, 32, .28);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  transform: translate(-50%, -50%) scale(.96);
}
#toast.is-center.show {
  transform: translate(-50%, -50%) scale(1);
}
.modal.ar-flag-modal {
  z-index: 230;
}
