:root {
  --ink: #f7f1e5;
  --muted: #a99c88;
  --muted-2: #756957;
  --bg: #17130f;
  --panel: rgba(36, 29, 22, .78);
  --panel-strong: #2a2118;
  --line: rgba(219, 194, 120, .16);
  --gold: #dbc278;
  --gold-light: #f2dda0;
  --green: #91b29a;
  --danger: #ca8178;
  --shadow: 0 18px 60px rgba(0, 0, 0, .32);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, sans-serif;
  background-image: radial-gradient(circle at 80% -10%, rgba(219,194,120,.18), transparent 35%), radial-gradient(circle at -15% 30%, rgba(130, 79, 44, .16), transparent 28%);
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
.app-shell { max-width: 680px; min-height: 100vh; margin: auto; padding-bottom: 98px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 4; background: rgba(23,19,15,.82); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.04); }
.brand-lockup { display: flex; align-items: center; gap: 9px; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
.brand-lockup em { display: block; color: var(--gold); font-family: 'Playfair Display', serif; font-size: 11px; letter-spacing: .2em; text-align: center; font-style: normal; margin-top: -2px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid var(--gold); display: grid; place-items: center; border-radius: 50%; color: var(--gold-light); font-family: 'Playfair Display', serif; font-size: 18px; }
.icon-button { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--gold-light); font-size: 24px; line-height: 1; }
.screen { padding: 26px 20px 24px; animation: appear .24s ease-out; }
.boot-screen { min-height: 52vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.boot-screen strong { color: var(--gold-light); font-size: 18px; }
.boot-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font: 700 28px 'Playfair Display', serif; }
.boot-error { color: #e7c9b8; }
.boot-error .primary-action { max-width: 260px; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--gold); letter-spacing: .18em; text-transform: uppercase; font-size: 10px; font-weight: 800; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 34px/1.02 'Playfair Display', serif; letter-spacing: -.02em; margin-top: 8px; }
h2 { font-size: 21px; margin-top: 7px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.hero { padding: 18px 2px 22px; }
.hero p { color: var(--muted); margin-top: 11px; font-size: 13px; line-height: 1.55; max-width: 480px; }
.hero-card { background: linear-gradient(135deg, rgba(100,76,42,.6), rgba(34,27,21,.88)); border: 1px solid rgba(219,194,120,.3); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-card:after { content: '✦'; position: absolute; right: 22px; top: 11px; font-size: 70px; color: rgba(242,221,160,.12); }
.hero-card .role { color: var(--gold-light); font-size: 12px; margin-top: 9px; }
.hero-card .venue { display: inline-flex; align-items: center; gap: 7px; margin-top: 19px; padding: 8px 11px; background: rgba(0,0,0,.18); border-radius: 99px; color: #e6d8bd; font-size: 11px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 12px 0; }
.section-head button { color: var(--gold); background: none; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feature { text-align: left; border-radius: 19px; background: var(--panel); border: 1px solid var(--line); padding: 16px; min-height: 132px; box-shadow: 0 10px 35px rgba(0,0,0,.12); transition: transform .18s, border-color .18s; }
.feature:active { transform: scale(.98); border-color: var(--gold); }
.feature .glyph { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: rgba(219,194,120,.12); color: var(--gold-light); font-size: 18px; margin-bottom: 18px; }
.feature strong { display: block; font-size: 14px; }
.feature span { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 5px; }
.list { display: grid; gap: 10px; }
.list-card { width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 15px; display: flex; align-items: center; gap: 12px; }
.list-card .round-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: rgba(219,194,120,.12); color: var(--gold); flex: 0 0 auto; }
.list-card .copy { flex: 1; min-width: 0; }
.list-card strong { display: block; font-size: 13px; }
.list-card small { color: var(--muted); display: block; margin-top: 3px; font-size: 11px; }
.list-card .chevron { color: var(--gold); font-size: 20px; }
.progress { height: 5px; border-radius: 9px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: inherit; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 99px; color: var(--gold-light); background: rgba(219,194,120,.13); font-size: 10px; font-weight: 700; }
.metric-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 17px 0 22px; }
.metric { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 15px; padding: 13px 10px; }
.metric b { display: block; color: var(--gold-light); font-size: 20px; }
.metric small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 11px; }
.subsection-head h2 { margin: 0; font-size: 17px; }
.subsection-head button { flex: 0 0 auto; color: var(--gold); background: none; font-size: 11px; }
.learning-tests-head { margin-top: 30px; }
.learning-group { margin-top: 20px; }
.learning-group .subsection-head { margin-top: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); background: none; padding: 0; margin-bottom: 18px; font-size: 12px; }
.primary-action { width: 100%; margin-top: 18px; padding: 14px 18px; border-radius: 14px; color: #2b2116; background: linear-gradient(135deg, var(--gold-light), var(--gold)); font-weight: 800; font-size: 13px; box-shadow: 0 10px 24px rgba(219,194,120,.2); }
.secondary-action, .danger-action { width: 100%; margin-top: 12px; padding: 12px 16px; border-radius: 13px; font-weight: 700; font-size: 12px; }
.secondary-action { color: var(--gold-light); background: rgba(219,194,120,.12); border: 1px solid var(--line); }
.danger-action { color: #f3c2b8; background: rgba(202,129,120,.12); border: 1px solid rgba(202,129,120,.3); }
.field-label { display: block; color: var(--muted); font-size: 11px; margin: 16px 0 6px; }
.field-input { width: 100%; margin-top: 10px; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--ink); outline: none; }
.field-input:focus { border-color: var(--gold); }
.button-row { display: flex; gap: 8px; }
.button-row .secondary-action { flex: 1; }
.quiz-options { display: grid; gap: 10px; margin-top: 18px; }
.quiz-option { padding: 14px; text-align: left; border-radius: 13px; background: rgba(219,194,120,.1); border: 1px solid var(--line); color: var(--ink); line-height: 1.4; }
.quiz-option:active { border-color: var(--gold); transform: scale(.99); }
.schedule-list { display: grid; gap: 0; margin-top: 10px; }
.schedule-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 12px; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row span { color: var(--gold-light); white-space: nowrap; }
.schedule-row small { color: var(--muted); text-align: right; }
.schedule-image { display: block; width: 100%; max-height: 65vh; object-fit: contain; margin-top: 12px; border-radius: 12px; background: #fff; }
.profile-photo-card { text-align: center; }
.profile-photo, .profile-photo-placeholder { display: block; width: 112px; height: 112px; margin: 0 auto 12px; border-radius: 50%; object-fit: cover; background: rgba(219,194,120,.12); border: 1px solid var(--line); }
.profile-photo-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 11px; padding: 16px; }
.ttk-photo { display: block; width: 100%; max-height: 320px; object-fit: contain; margin: 18px 0 4px; border-radius: 18px; background: rgba(255,255,255,.05); }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 18px; }
.detail-card { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.ingredients { display: grid; gap: 0; margin-top: 12px; }
.ingredient-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.07); color: var(--ink); font-size: 13px; }
.ingredient-row:last-child { border-bottom: 0; }
.ingredient-row b { color: var(--gold-light); font-weight: 700; white-space: nowrap; }
.detail-text { color: #dfd2b9; font-size: 13px; line-height: 1.65; margin-top: 12px; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: min(680px, 100%); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(28,22,17,.94); border-top: 1px solid rgba(219,194,120,.18); backdrop-filter: blur(20px); }
.nav-item { background: none; color: var(--muted-2); display: grid; justify-items: center; gap: 3px; font-size: 18px; padding: 3px; }
.nav-item small { font-size: 9px; }
.nav-item.active { color: var(--gold-light); }
.nav-center span { width: 44px; height: 44px; margin-top: -27px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--gold-light), var(--gold)); color: #241c13; font-weight: 800; font-size: 12px; box-shadow: 0 8px 20px rgba(219,194,120,.27); border: 4px solid #1c1611; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #eee1c4; color: #2b2116; padding: 10px 16px; border-radius: 99px; font-size: 12px; transition: all .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } .hero-card { padding: 28px; } }
.material-section { margin-top: 24px; }
.material-section .subsection-head small { color: var(--muted); font-size: 11px; }
.material-entry { border: 1px solid rgba(225, 202, 143, .18); border-radius: 18px; background: rgba(35, 28, 21, .72); margin: 9px 0; overflow: hidden; }
.material-entry summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; padding: 16px; color: var(--cream); font-weight: 650; }
.material-entry summary::-webkit-details-marker { display: none; }
.material-entry summary span { color: var(--gold); font-size: 20px; line-height: 14px; }
.material-entry[open] summary { border-bottom: 1px solid rgba(225, 202, 143, .14); }
.material-entry-body { padding: 14px 16px 17px; }
.material-image { display: block; width: 100%; max-height: 210px; object-fit: cover; border-radius: 13px; margin: 0 0 14px; }
.material-method { margin: 15px 0 0; padding-top: 13px; border-top: 1px solid rgba(225, 202, 143, .14); color: var(--muted); line-height: 1.55; font-size: 13px; }
.material-document { margin-top: 20px; }
.material-paragraph { padding: 12px 14px; border-bottom: 1px solid rgba(225, 202, 143, .12); color: var(--ink); line-height: 1.55; font-size: 14px; }
.material-paragraph.material-heading { color: var(--gold); font-weight: 750; font-size: 16px; background: rgba(225, 202, 143, .06); border-radius: 12px; margin-top: 9px; }
.material-note { margin-top: 14px; padding: 12px 13px; border-radius: 12px; background: rgba(225, 202, 143, .08); color: var(--muted); line-height: 1.5; font-size: 13px; }
.material-note b { color: var(--gold); display: block; margin-bottom: 5px; }
.material-note p { margin: 0; }
.material-cover { display: block; width: 100%; max-height: 180px; object-fit: contain; border-radius: 16px; margin-top: 20px; background: #211b16; }

/* Registration consent controls and documents stay inside the Mini App. */
.registration-consents { min-width: 0; margin: 22px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.registration-consents legend { padding: 0 8px 0 0; color: var(--gold-light); font-size: 12px; font-weight: 700; }
.consent-option { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; margin: 0 0 16px; align-items: start; }
.consent-option input[type="checkbox"] { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--gold); cursor: pointer; }
.consent-option input:disabled { opacity: .55; cursor: not-allowed; }
.consent-option label { display: block; color: var(--ink); font-size: 13px; line-height: 1.6; cursor: pointer; }
.legal-link { display: inline-block; padding: 5px 0; color: var(--gold-light); background: none; font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.legal-link:disabled { color: var(--muted); opacity: .65; cursor: not-allowed; }
.legal-link[hidden] { display: none; }
.consent-option input:focus-visible, .legal-link:focus-visible, .legal-close:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
.consent-notice { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.consent-notice-error { color: #efbca9; }
.primary-action:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.legal-dialog-open { overflow: hidden; }
.legal-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 40px); margin: auto; padding: 20px; border: 1px solid rgba(219,194,120,.35); border-radius: 20px; color: var(--ink); background: #211b15; box-shadow: 0 20px 90px rgba(0,0,0,.65); overflow-y: auto; overscroll-behavior: contain; }
.legal-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.legal-dialog[open] { position: fixed; inset: 0; z-index: 1000; }
.legal-dialog-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.legal-dialog-header h2 { margin: 2px 0 0; color: var(--gold-light); font-family: Manrope, sans-serif; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.legal-close { flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); background: rgba(219,194,120,.08); font-size: 16px; }
.legal-document-body { margin-top: 18px; color: var(--ink); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.legal-document-body h1 { font-size: 22px; line-height: 1.4; }
.legal-document-body h2, .legal-document-body h3 { margin: 22px 0 9px; font-family: Manrope, sans-serif; font-size: 16px; line-height: 1.5; color: var(--gold-light); }
.legal-document-body p { margin: 0 0 12px; }
.legal-document-body ul, .legal-document-body ol { padding-left: 20px; }
.legal-document-body a { color: var(--gold-light); }
.legal-close-bottom { margin-top: 20px; }
@supports not (height: 100dvh) { .legal-dialog { max-height: calc(100vh - 40px); } }

.achievement-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 22px; }
.achievement-chip { padding: 9px 12px; border: 1px solid rgba(225,202,143,.28); border-radius: 999px; color: var(--gold-light); background: rgba(225,202,143,.08); font-size: 12px; }
.achievement-chip.locked { color: var(--muted); border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.03); }
.notification-card.unread { border-color: rgba(225,202,143,.65); box-shadow: 0 0 0 1px rgba(225,202,143,.12); }
.checklist-card { margin-top: 16px; }
.checklist { display: grid; gap: 8px; margin-top: 10px; }
.check-row { display: flex; gap: 11px; align-items: flex-start; padding: 11px 10px; border-radius: 11px; background: rgba(255,255,255,.03); color: var(--ink); font-size: 13px; line-height: 1.45; cursor: pointer; }
.check-row.done { color: var(--muted); text-decoration: line-through; background: rgba(120,180,120,.09); }
.check-row input { flex: 0 0 auto; width: 19px; height: 19px; accent-color: var(--gold); }
.leaderboard { display: grid; gap: 8px; margin-top: 10px; }
.leader-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 10px; border-radius: 12px; background: rgba(255,255,255,.03); }
.leader-row.current { border: 1px solid rgba(225,202,143,.55); background: rgba(225,202,143,.10); }
.leader-rank { color: var(--gold-light); font-size: 17px; text-align: center; }
.leader-row .copy { min-width: 0; }
.leader-row .copy strong, .leader-row .copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-row .copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.leader-score { color: var(--gold-light); font-weight: 800; }
.ttk-search-card { margin-top: 18px; }

.award-banner {
  position: relative;
  overflow: hidden;
  margin: 18px 0 22px;
  padding: 22px 20px;
  border: 1px solid rgba(242,221,160,.58);
  border-radius: 22px;
  background: radial-gradient(circle at 82% 15%, rgba(242,221,160,.22), transparent 34%), linear-gradient(135deg, rgba(109,79,35,.84), rgba(40,27,17,.94));
  box-shadow: 0 14px 45px rgba(219,194,120,.16);
}
.award-banner.celebration { animation: award-pop .85s ease-out both, award-glow 2.8s ease-in-out .9s infinite; }
.award-banner:before, .award-banner:after { content: '✦'; position: absolute; color: rgba(242,221,160,.58); font-size: 22px; animation: award-sparkle 2.4s ease-in-out infinite; }
.award-banner:before { right: 62px; top: 19px; }
.award-banner:after { right: 25px; bottom: 18px; font-size: 14px; animation-delay: .6s; }
.award-spark { position: absolute; right: 19px; top: 28px; color: var(--gold-light); font-size: 48px; opacity: .4; transform: rotate(12deg); }
.award-banner h2 { color: var(--gold-light); margin-top: 8px; }
.award-winner { color: #fff5dc; font-size: 18px; font-weight: 800; line-height: 1.35; margin-top: 13px; }
.award-meta { color: #e5d4aa; font-size: 12px; margin-top: 9px; }
.award-current { color: var(--gold-light); font-size: 12px; line-height: 1.45; margin-top: 15px; }
.award-history { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(225,202,143,.16); }
.award-history h3 { color: var(--gold-light); margin-bottom: 8px; }
.award-history-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 11px; }
.award-history-row:last-child { border-bottom: 0; }
.award-history-row span { color: var(--muted); }
.award-history-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.award-history-row small { color: var(--gold-light); white-space: nowrap; }
@keyframes award-pop { from { opacity: 0; transform: scale(.94) translateY(8px); } 65% { transform: scale(1.02) translateY(-2px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes award-glow { 0%, 100% { box-shadow: 0 14px 45px rgba(219,194,120,.16); } 50% { box-shadow: 0 14px 60px rgba(219,194,120,.34); } }
@keyframes award-sparkle { 0%, 100% { opacity: .25; transform: scale(.8) rotate(0); } 50% { opacity: .95; transform: scale(1.18) rotate(18deg); } }
