/* DIMMS Lab: the activity apps (meeting schedule, Live Hub, archive) in the site's colours and type.
   Loaded after each app's own stylesheet; it changes colours, type and small details only. */

:root {
  --primary-blue: #13284a;
  --secondary-blue: #1d3c69;
  --accent-gold: #86600f;
  --accent-cyan: #0b6a74;
  --light-cyan: #3cc3cc;
  --role-member: #0b6a74;
  --bg-light: #f2f5f8;
  --bg-white: #ffffff;
  --text-primary: #0f1b2d;
  --text-secondary: #5b6779;
  --border-color: rgba(15, 27, 45, 0.14);
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.05), 0 2px 8px -4px rgba(15, 27, 45, 0.12);
  --shadow-md: 0 1px 2px rgba(15, 27, 45, 0.05), 0 12px 28px -18px rgba(15, 27, 45, 0.3);
  --shadow-lg: 0 1px 2px rgba(15, 27, 45, 0.05), 0 22px 44px -24px rgba(15, 27, 45, 0.4);
}

body, #app-root, #archive-app { font-family: var(--font-sans); }
body { background: var(--paper); }
input, select, textarea, button { font-family: var(--font-sans); }

.dl-ico { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.17em; flex: none; }
.format-icon .dl-icon { width: 30px; height: 30px; color: var(--gold); }
.format-tab .dl-icon { width: 16px; height: 16px; vertical-align: -0.2em; margin-right: 4px; }

.schedule-header { background: linear-gradient(135deg, #0a1630 0%, #13284a 60%, #1d3c69 100%); }
.format-time { color: var(--teal); background: rgba(11, 106, 116, 0.1); }
.badge-online { background: rgba(11, 106, 116, 0.12); color: var(--teal); }
.badge-inperson { background: rgba(134, 96, 15, 0.12); color: var(--gold); }
.next-meeting { background: rgba(216, 177, 90, 0.12); }
.zoom-link { color: var(--teal); background: rgba(11, 106, 116, 0.08); }
.enter-hub-btn { background: var(--night); color: var(--gold-soft); }
.enter-hub-btn:hover { background: var(--navy); color: var(--gold-soft); }
.btn-primary:hover { background: #08545c; }
.empty-icon .dl-icon { width: 44px; height: 44px; margin: 0 auto; color: var(--gold); }

.format-tab { display: inline-flex; align-items: center; gap: 8px; }
.format-tab .dl-icon { margin: 0; }
.table-badge, .meeting-type-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meeting-detail-label { display: inline-flex; align-items: center; gap: 6px; }
.slot-label { margin-right: 2px; }

/* Archive sign-in: line icon in place of the old emoji */
.login-icon { display: flex; justify-content: center; color: #1e3a5f; }
.login-icon .dl-icon { width: 44px; height: 44px; }
.archive-tab .dl-icon { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.user-status:empty { display: none; }
.format-title { text-wrap: balance; }
#archive-app .btn-primary:hover { transform: none; box-shadow: none; }

/* =====================================================
   Live Hub: trivia, leaderboard and waiting screens
   ===================================================== */
@property --t-frac { syntax: '<number>'; inherits: true; initial-value: 1; }

#app-root .content-section { border: 1px solid var(--rule); border-radius: 14px; }
#app-root .section-header { border-bottom: 1px solid var(--rule); }
#app-root .section-header h2,
#app-root .leaderboard-panel h3,
#app-root .qa-panel h3,
#app-root .host-panel h3,
#app-root .admin-panel h3 { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 500; color: var(--ink); }
#app-root .section-header h2 { font-size: 1.35rem; }
#app-root .section-header h2 .dl-icon,
#app-root .leaderboard-panel h3 .dl-icon,
#app-root .qa-panel h3 .dl-icon,
#app-root .host-panel h3 .dl-icon,
#app-root .admin-panel h3 .dl-icon { width: 22px; height: 22px; flex: none; color: var(--gold); }
#app-root .tab-btn { display: inline-flex; align-items: center; gap: 8px; }
#app-root .tab-btn .dl-icon { width: 18px; height: 18px; flex: none; }
#app-root .empty-state-large .empty-icon .dl-icon,
#app-root .empty-state-large .empty-icon svg { width: 44px; height: 44px; margin: 0 auto; color: var(--teal); }
#app-root .role-icon:empty { display: none; }

/* Countdown: a ring that empties as the time runs out */
#app-root .trivia-timer {
  --ring: var(--teal-soft);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 74px; height: 74px; min-width: 0; padding: 0; border-radius: 50%; color: #fff;
  background: conic-gradient(var(--ring) calc(var(--t-frac, 1) * 1turn), rgba(19, 40, 74, 0.12) 0);
  transition: --t-frac 1s linear;
}
#app-root .trivia-timer::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--night); }
#app-root .trivia-timer .timer-value,
#app-root .trivia-timer .timer-label { position: relative; color: #fff; }
#app-root .trivia-timer .timer-value { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 500; line-height: 1; }
#app-root .trivia-timer .timer-label { margin-top: 2px; font-size: 0.5rem; letter-spacing: 0.16em; opacity: 0.7; }
#app-root .trivia-timer.warning { --ring: var(--gold-soft); background-color: transparent; color: #fff; }
#app-root .trivia-timer.danger { --ring: var(--coral-soft); background-color: transparent; animation: lh-pulse 0.9s ease-in-out infinite; }

/* Question */
#app-root .question-number {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
#app-root .question-number::after {
  content: ""; flex: 1; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) calc(var(--q-progress, 0) * 100%), var(--paper-sunk) 0);
}
#app-root .question-text {
  margin-bottom: 22px; font-family: var(--font-serif); font-weight: 400; color: var(--ink);
  font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.95rem); line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty;
}
#trivia-question { animation: lh-rise 0.45s var(--ease-out); }

/* Answer cards */
#app-root .answer-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#app-root .answer-options:has(> .answer-option) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) { #app-root .answer-options:has(> .answer-option) { grid-template-columns: minmax(0, 1fr); } }
#app-root .answer-option {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 14px 18px;
  background: #fff; border: 1.5px solid var(--rule-strong); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 27, 45, 0.04); color: var(--ink); font-size: 1.02rem; line-height: 1.35;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s, background-color 0.18s, opacity 0.25s;
}
#app-root .answer-option:hover:not(.selected):not(.disabled) {
  background: #fff; border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgba(11, 106, 116, 0.6);
}
#app-root .option-letter {
  width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #fff;
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500;
}
#app-root .option-text { flex: 1; }
#app-root .answer-option.disabled { cursor: default; opacity: 1; }
#app-root .answer-option.disabled:not(.correct):not(.incorrect) { opacity: 0.5; }
#app-root .answer-option.correct { border-color: #1f8a4c; background: #edf8f1; animation: lh-pop 0.45s var(--ease-out); }
#app-root .answer-option.correct .option-letter { background: #1f8a4c; }
#app-root .answer-option.correct::after { content: "\2713"; color: #1f8a4c; font-weight: 700; font-size: 1.2rem; }
#app-root .answer-option.incorrect { border-color: var(--coral); background: #fdf0ed; animation: lh-shake 0.4s; }
#app-root .answer-option.incorrect .option-letter { background: var(--coral); }
#app-root .answer-option.incorrect::after { content: "\2715"; color: var(--coral); font-weight: 700; font-size: 1.05rem; }

/* Feedback and the "why it matters" note */
#app-root .answer-feedback { margin-top: 16px; padding: 14px 18px; border-radius: 12px; font-size: 1.05rem; font-weight: 600; text-align: center; animation: lh-rise 0.35s var(--ease-out); }
#app-root .answer-feedback.correct { background: #edf8f1; color: #17693a; }
#app-root .answer-feedback.incorrect { background: #fdf0ed; color: #a8321d; }
#app-root .answer-fact { margin-top: 12px; padding: 16px 20px 18px; border-radius: 12px; background: var(--paper-sunk); animation: lh-rise 0.5s var(--ease-out) 0.15s both; }
#app-root .answer-fact[hidden] { display: none; }
#app-root .answer-fact__label { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
#app-root .answer-fact__text { margin: 0; font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.5; color: var(--ink-2); }

/* Typed answers: fill in the blank and word scramble */
#app-root .fillblank-sentence,
#app-root .scramble-prompt,
#app-root .wordsearch-prompt { margin-bottom: 10px; font-family: var(--font-serif); font-weight: 400; color: var(--ink); font-size: clamp(1.3rem, 1.05rem + 1vw, 1.8rem); line-height: 1.3; text-align: left; }
#app-root .blank-marker { min-width: 110px; margin: 0 6px; border-bottom: 3px solid var(--gold-soft); color: transparent; }
#app-root .scramble-hint { margin-bottom: 4px; font-style: normal; color: var(--teal); font-size: 0.98rem; }
#app-root .scrambled-letters { justify-content: flex-start; gap: 8px; margin: 18px 0 8px; }
#app-root .scramble-letter {
  width: 46px; height: 54px; border-radius: 10px; background: var(--night); color: #fff;
  font-family: var(--font-serif); font-size: 1.55rem; font-weight: 400; box-shadow: 0 8px 16px -10px rgba(10, 22, 48, 0.7);
  animation: lh-rise 0.4s var(--ease-out) both;
}
#app-root .text-input-answer { gap: 10px; }
#app-root .answer-text-input { height: 56px; padding: 0 18px; border: 1.5px solid var(--rule-strong); border-radius: 12px; background: #fff; font-family: var(--font-sans); font-size: 1.15rem; }
#app-root .answer-text-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(11, 106, 116, 0.14); }
#app-root .btn-submit-answer { height: 56px; padding: 0 28px; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; }
#app-root .btn-submit-answer:hover { background: var(--night); }
#app-root .text-answer-display { padding: 14px 18px; border-radius: 12px; font-size: 1.05rem; }
#app-root .text-answer-display.correct { background: #edf8f1; color: #17693a; border: 1.5px solid #1f8a4c; }
#app-root .text-answer-display.incorrect { background: #fdf0ed; color: #a8321d; border: 1.5px solid var(--coral); }

/* Word search: cells shrink to fit any screen */
#app-root .wordsearch-container { gap: 18px; }
#app-root .wordsearch-grid { width: 100%; max-width: 470px !important; gap: 3px; padding: 6px; background: var(--paper-sunk); border: 0; border-radius: 14px; }
#app-root .ws-cell { width: auto; height: auto; aspect-ratio: 1; border-radius: 6px; background: #fff; font-family: var(--font-mono); font-size: clamp(0.72rem, 2.7vw, 1.02rem); font-weight: 500; color: var(--ink); }
#app-root .ws-cell:hover { background: #e3f1f2; }
#app-root .ws-cell.ws-selected { background: var(--teal); color: #fff; }
#app-root .ws-cell.ws-found-cell { background: var(--gold-soft); color: var(--night); }
#app-root .wordsearch-wordlist h4 { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
#app-root .ws-word { padding: 6px 11px; border-radius: 999px; background: var(--paper-sunk); color: var(--ink-2); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em; }
#app-root .ws-word.ws-found { background: var(--gold-soft); color: var(--night); }
#app-root .wordsearch-score { font-family: var(--font-mono); font-weight: 500; color: var(--navy); }

/* Leaderboard */
#app-root .leaderboard-panel { margin-top: 22px; padding: 18px; border-radius: 14px; background: var(--paper-sunk); }
#app-root .leaderboard-item { padding: 10px 14px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(15, 27, 45, 0.05); }
#app-root .leaderboard-rank { width: 30px; height: 30px; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; }
#app-root .leaderboard-rank.gold { background: var(--gold-soft); color: var(--night); }
#app-root .leaderboard-rank.silver { background: #d5dbe3; color: var(--night); }
#app-root .leaderboard-rank.bronze { background: #dcae86; color: var(--night); }
#app-root .leaderboard-score { font-family: var(--font-mono); font-weight: 500; color: var(--navy); }

/* Before the game: what is coming up */
#app-root .upcoming-trivia { padding: clamp(28px, 6vw, 60px) clamp(12px, 5vw, 48px); text-align: center; }
#app-root .upcoming-trivia[hidden], #app-root #no-content-default[hidden] { display: none; }
#app-root .upcoming-trivia__mark { display: block; width: 76px; height: 76px; margin: 0 auto 18px; animation: lh-float 6s ease-in-out infinite; }
#app-root .upcoming-trivia__kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
#app-root .upcoming-trivia__title { max-width: 16ch; margin: 0 auto 16px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.4rem); line-height: 1.04; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
#app-root .upcoming-trivia__subtitle { max-width: 46ch; margin: 0 auto 24px; color: var(--ink-2); font-size: 1.05rem; line-height: 1.55; }
#app-root .upcoming-trivia__wait { margin: 0; color: var(--ink-3); font-size: 0.9rem; }

/* After the game: podium and confetti */
#app-root .trivia-ended { position: relative; overflow: hidden; padding: 30px 12px 8px; }
#app-root .trivia-ended__kicker { margin: 0 0 8px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
#app-root .trivia-ended h3 { margin: 0 0 28px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem); color: var(--ink); }
#app-root .trivia-podium { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 2vw, 18px); }
#app-root .podium-step { display: flex; flex-direction: column; align-items: center; width: clamp(92px, 26vw, 170px); animation: lh-rise 0.7s var(--ease-out) both; }
#app-root .podium-step--third { animation-delay: 0.15s; }
#app-root .podium-step--second { animation-delay: 0.35s; }
#app-root .podium-step--first { animation-delay: 0.6s; }
#app-root .podium-name { margin-bottom: 4px; font-family: var(--font-serif); font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem); line-height: 1.2; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
#app-root .podium-score { margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-3); }
#app-root .podium-block { display: grid; place-items: center; width: 100%; border-radius: 12px 12px 0 0; }
#app-root .podium-rank { font-family: var(--font-serif); font-size: 2.2rem; color: var(--night); }
#app-root .podium-step--first .podium-block { height: 150px; background: linear-gradient(180deg, #ecd08d, var(--gold-soft)); }
#app-root .podium-step--second .podium-block { height: 108px; background: linear-gradient(180deg, #edf1f5, #c9d2dd); }
#app-root .podium-step--third .podium-block { height: 80px; background: linear-gradient(180deg, #efcfb3, #d39d72); }
#app-root .trivia-ended__note { margin: 22px 0 0; color: var(--ink-3); }
#app-root .podium-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#app-root .podium-confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: lh-confetti 3s cubic-bezier(0.2, 0.6, 0.4, 1) forwards; }

/* The host's preview of the current question */
#host-question-preview .host-fact,
#admin-question-preview .host-fact { grid-column: 1 / -1; margin-top: 0.4rem; padding: 0.6rem 0.75rem; border-radius: 8px; background: #fff; color: var(--ink-2); line-height: 1.45; }
#host-question-preview .host-fact strong,
#admin-question-preview .host-fact strong { color: var(--gold); }

/* No countdown once the game is over */
#trivia-section:has(#trivia-ended[style*="block"]) .trivia-timer { visibility: hidden; }

/* Phones: timer beside the title, scramble tiles in two rows, full-height answer box */
@media (max-width: 480px) {
  #app-root #trivia-section .section-header { flex-direction: row; align-items: center; }
  #app-root .trivia-timer { width: 62px; height: 62px; }
  #app-root .trivia-timer .timer-value { font-size: 1.2rem; }
  #app-root .scrambled-letters { gap: 6px; }
  #app-root .scramble-letter { width: 38px; height: 46px; font-size: 1.3rem; }
  #app-root .answer-text-input { flex: none; width: 100%; }
}

@keyframes lh-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lh-pop { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes lh-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes lh-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes lh-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes lh-confetti {
  0% { opacity: 0; transform: translateY(0) rotate(var(--r, 0deg)); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translateY(460px) rotate(calc(var(--r, 0deg) + 540deg)); }
}
@media (prefers-reduced-motion: reduce) {
  #app-root .podium-confetti { display: none; }
  #trivia-question, #app-root .answer-option, #app-root .answer-feedback, #app-root .answer-fact, #app-root .scramble-letter,
  #app-root .podium-step, #app-root .upcoming-trivia__mark, #app-root .trivia-timer { animation: none !important; transition: none !important; }
}
