:root {
  color-scheme: light;
  --ink: #24223a;
  --muted: #77758c;
  --line: #eceaf3;
  --paper: #ffffff;
  --bg: #f7f6fb;
  --purple: #7062c8;
  --purple-dark: #51459f;
  --purple-soft: #f0edff;
  --mint: #dff5ed;
  --peach: #fff0e6;
  --shadow: 0 14px 40px rgba(45, 38, 89, .07);
  font-family: "DM Sans", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(112, 98, 200, .25); outline-offset: 2px; }
#app { min-height: 100vh; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); gap: 12px; }
.logo-mark { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #8275dc, #5a4caf); color: white; font-family: "Manrope", sans-serif; font-size: 19px; font-weight: 800; box-shadow: 0 8px 18px rgba(93, 77, 179, .25); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-copy strong { font-family: "Manrope", sans-serif; font-size: 15px; letter-spacing: -.3px; }
.brand-copy span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.app-shell { min-height: 100vh; }
.sidebar { width: 252px; position: fixed; inset: 0 auto 0 0; z-index: 10; padding: 28px 18px 18px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 8px 34px; }
.nav-caption { color: #a5a2b5; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; padding: 0 12px 12px; }
.main-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-link { border: 0; display: flex; align-items: center; gap: 13px; min-height: 45px; border-radius: 12px; background: transparent; padding: 0 13px; color: #6e6b83; font-size: 13px; font-weight: 600; text-align: left; transition: .18s ease; }
.nav-link:hover { background: #f7f5ff; color: var(--purple-dark); }
.nav-link.active { color: var(--purple-dark); background: var(--purple-soft); font-weight: 800; }
.nav-symbol { width: 20px; text-align: center; font-size: 19px; line-height: 1; }
.admin-caption { margin-top: 30px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-tip { background: #f5f2ff; border-radius: 15px; padding: 16px; margin: 0 2px 18px; }
.tip-spark { color: var(--purple); font-size: 18px; }
.sidebar-tip strong { display: block; margin: 7px 0 4px; font-size: 12px; }
.sidebar-tip p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.profile-mini { border-top: 1px solid var(--line); padding: 16px 4px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; font-weight: 800; font-size: 13px; background: linear-gradient(145deg, #9285e9, #5f52af); }
.profile-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.profile-copy strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.profile-copy span { color: var(--muted); font-size: 10px; }
.logout-button { border: 0; background: transparent; color: #9692aa; border-radius: 8px; width: 30px; height: 30px; font-size: 17px; }
.logout-button:hover { background: #f5f3fa; color: var(--purple-dark); }
.main-area { margin-left: 252px; min-height: 100vh; padding: 0 42px 22px; max-width: 1700px; }
.topbar { padding: 36px 0 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ebe9f1; }
.topbar-kicker, .eyebrow { display: block; font-size: 9px; letter-spacing: 1.65px; font-weight: 800; color: #9995ad; }
.topbar h1 { font: 800 26px/1.25 "Manrope", sans-serif; letter-spacing: -.8px; margin: 8px 0 5px; }
.topbar p { color: var(--muted); font-size: 12px; margin: 0; }
.topbar-score { min-width: 116px; text-align: right; }
.topbar-score span { display: block; color: #9d99ae; font-size: 9px; font-weight: 800; letter-spacing: 1.1px; }
.topbar-score strong { display: block; font: 800 24px "Manrope", sans-serif; margin-top: 4px; color: var(--purple-dark); }
.topbar-score small { font: 600 11px "DM Sans", sans-serif; color: var(--muted); }
.page-content { max-width: 1280px; margin: 26px auto 42px; }
.page-footer { color: #a09daf; text-align: center; font-size: 10px; padding: 10px 0 18px; }
.page-footer span { padding: 0 7px; color: #c0bdd0; }
.welcome-banner { min-height: 275px; position: relative; overflow: hidden; background: linear-gradient(110deg, #6558b8 0%, #796bc9 58%, #9387df 100%); border-radius: 22px; color: #fff; padding: 36px 42px; display: flex; align-items: center; box-shadow: 0 16px 32px rgba(91, 77, 167, .15); }
.welcome-text { position: relative; z-index: 2; max-width: 480px; }
.light-eyebrow { color: rgba(255,255,255,.64); }
.welcome-text h2, .admin-welcome h2, .detail-hero h2, .ranking-hero h2 { font: 800 31px/1.23 "Manrope", sans-serif; letter-spacing: -1px; margin: 12px 0 10px; }
.welcome-text p, .admin-welcome p, .ranking-hero p { max-width: 420px; font-size: 12px; line-height: 1.7; color: rgba(255,255,255,.78); margin: 0 0 22px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-size: 11px; font-weight: 800; transition: .18s ease; display: inline-flex; gap: 12px; align-items: center; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--purple); box-shadow: 0 6px 14px rgba(103, 88, 188, .18); }
.btn-primary:hover { background: var(--purple-dark); transform: translateY(-1px); }
.btn-light { background: #fff; color: var(--purple-dark); }
.btn-light:hover { background: #f3f0ff; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--purple-dark); border-color: #ded9f4; }
.btn-outline:hover { background: #f7f5ff; border-color: #bcb3e7; }
.btn-wide { width: 100%; }
.btn-large { padding: 14px 21px; }
.btn-small { padding: 8px 11px; font-size: 10px; }
.welcome-graphic { position: absolute; right: 8%; top: 0; width: 320px; height: 100%; opacity: .98; }
.graphic-circle { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); }
.circle-a { width: 250px; height: 250px; right: 0; top: 10px; background: rgba(255,255,255,.07); }
.circle-b { width: 180px; height: 180px; right: 36px; top: 45px; background: rgba(255,255,255,.07); }
.graphic-paper { position: absolute; top: 48px; right: 81px; width: 130px; height: 178px; border-radius: 12px; transform: rotate(8deg); background: #fffdfb; color: #6d5fc1; box-shadow: 0 14px 25px rgba(42,35,93,.2); padding: 20px 17px; }
.graphic-paper span { font: 800 29px "Manrope", sans-serif; letter-spacing: -3px; }
.graphic-paper i { position: absolute; top: 17px; right: 16px; font-size: 24px; font-style: normal; }
.graphic-paper small { display: block; color: #89849f; line-height: 1.55; margin-top: 21px; font-size: 11px; }
.graphic-star { position: absolute; color: #ffe8a9; font-size: 25px; }
.star-a { top: 46px; right: 242px; }
.star-b { bottom: 36px; right: 49px; font-size: 36px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 18px 0 24px; }
.stat-card { border: 1px solid var(--line); background: #fff; border-radius: 15px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 5px 16px rgba(38,33,78,.025); }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; font-size: 18px; }
.stat-icon.purple { color: #7869cc; background: #f0edff; }
.stat-icon.peach { color: #d18e65; background: var(--peach); }
.stat-icon.mint { color: #399579; background: var(--mint); }
.stat-card span { display: block; color: #9b97ac; font-size: 8px; letter-spacing: 1px; font-weight: 800; }
.stat-card strong { display: block; font: 800 22px "Manrope", sans-serif; margin-top: 5px; }
.stat-card strong small { font: 600 10px "DM Sans", sans-serif; color: #aaa6b6; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr); gap: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 5px 18px rgba(38,33,78,.025); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-heading h2 { margin: 5px 0 0; font: 800 17px "Manrope", sans-serif; letter-spacing: -.35px; }
.link-button, .text-button { border: 0; background: transparent; color: var(--purple); font-weight: 800; font-size: 10px; padding: 7px; }
.link-button:hover, .text-button:hover { color: var(--purple-dark); text-decoration: underline; }
.preview-list { display: flex; flex-direction: column; }
.preview-rule { width: 100%; border: 0; border-top: 1px solid #f0eef5; background: transparent; padding: 13px 4px; display: flex; gap: 13px; align-items: center; text-align: left; }
.preview-rule:first-child { border-top: 0; }
.rule-index { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--purple); background: var(--purple-soft); font: 800 10px "Manrope", sans-serif; }
.preview-rule span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.preview-rule strong { font-size: 11px; }
.preview-rule small { color: #a09caf; font-size: 9px; }
.preview-rule b { font-size: 16px; color: #aaa5c0; }
.preview-rule:hover strong { color: var(--purple-dark); }
.panel-medal { width: 33px; height: 33px; display: grid; place-items: center; background: #fff7e7; color: #d9a04f; border-radius: 10px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 12px 1px; border-bottom: 1px solid #f1eff5; }
.rank-number { color: #a49fb5; width: 19px; font: 800 10px "Manrope", sans-serif; }
.rank-name { flex: 1; font-size: 11px; font-weight: 700; }
.rank-name b { color: var(--purple); font-size: 9px; }
.rank-row strong { color: var(--purple-dark); font-size: 10px; }
.ranking-link { margin-top: 12px; padding-left: 0; }
.muted { color: var(--muted); font-size: 11px; line-height: 1.7; }
.small { font-size: 10px; }
.empty-state { padding: 48px 20px; text-align: center; background: #fff; border: 1px dashed #ddd8ed; border-radius: 17px; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: 22px; }
.empty-state h3 { margin: 0 0 6px; font: 800 16px "Manrope", sans-serif; }
.empty-state p { max-width: 390px; margin: 0 auto 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.rules-grid, .exercise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rule-card, .exercise-card { padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 16px; transition: .18s ease; min-width: 0; }
.rule-card:hover, .exercise-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dcd7f1; }
.rule-card-top { display: flex; align-items: center; justify-content: space-between; }
.rule-tag, .count-pill { color: var(--purple); background: var(--purple-soft); border-radius: 20px; padding: 6px 9px; font-size: 9px; font-weight: 800; }
.rule-card h2 { font: 800 15px/1.4 "Manrope", sans-serif; margin: 17px 0 9px; }
.rule-card p { color: var(--muted); font-size: 10px; line-height: 1.7; min-height: 52px; margin: 0 0 18px; }
.card-arrow { border: 0; border-top: 1px solid #f0eef5; background: transparent; width: 100%; padding: 14px 0 0; display: flex; justify-content: space-between; align-items: center; color: var(--purple); font-weight: 800; font-size: 10px; text-align: left; }
.card-arrow span { font-size: 16px; }
.back-link { border: 0; background: transparent; color: var(--purple); font-size: 11px; font-weight: 800; padding: 0; margin-bottom: 18px; }
.detail-hero, .ranking-hero { background: linear-gradient(110deg, #6558b8, #8980d7); padding: 30px 34px; border-radius: 18px; color: white; margin-bottom: 18px; }
.detail-hero h2 { margin-bottom: 6px; }
.detail-hero p { color: rgba(255,255,255,.77); margin: 0; font-size: 11px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(230px, .65fr); gap: 17px; align-items: start; }
.detail-panel { padding: 25px; }
.rule-section { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 19px 0; border-top: 1px solid #f0eef5; }
.rule-section:first-of-type { border-top: 0; }
.section-number { color: #b4aecf; font: 800 12px "Manrope", sans-serif; padding-top: 3px; }
.section-body h3 { font: 800 14px "Manrope", sans-serif; margin: 0 0 9px; }
.section-body > p { color: #68657b; font-size: 11px; line-height: 1.8; margin: 0; }
.exception-box { margin-top: 13px; padding: 13px 15px; border-radius: 11px; background: #fff7ed; border-left: 3px solid #e8b47f; }
.exception-box strong { color: #a46d3f; font-size: 10px; }
.exception-box p { color: #856d58; font-size: 10px; line-height: 1.65; margin: 5px 0 0; }
.detail-aside { position: sticky; top: 20px; }
.aside-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 13px; color: var(--purple); background: var(--purple-soft); font-size: 18px; }
.detail-aside h3 { font: 800 15px "Manrope", sans-serif; margin: 13px 0 7px; }
.detail-aside p { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 0 0 15px; }
.related-exercise { margin-top: 7px; }
.quiz-intro { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-radius: 16px; background: #f0edff; margin-bottom: 17px; }
.quiz-intro h2 { margin: 6px 0; font: 800 21px "Manrope", sans-serif; }
.quiz-intro p { margin: 0; color: #77718f; font-size: 11px; }
.quiz-doodle { font-size: 48px; color: #8e82d7; transform: rotate(-12deg); padding: 0 16px; }
.exercise-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--peach); color: #cd9169; border-radius: 12px; font-size: 17px; margin-bottom: 16px; }
.exercise-card .eyebrow { color: #a29bbd; font-size: 8px; }
.exercise-card h3 { font: 800 14px/1.4 "Manrope", sans-serif; margin: 8px 0; }
.exercise-card > p { color: var(--muted); min-height: 40px; font-size: 10px; line-height: 1.65; }
.exercise-card-bottom { border-top: 1px solid #f0eef5; padding-top: 13px; margin-top: 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.exercise-card-bottom > span { color: #aaa6b4; font-size: 9px; }
.quiz-runner-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.quiz-runner-heading h2 { font: 800 19px "Manrope", sans-serif; margin: 7px 0 0; }
.question-count { color: var(--purple); background: var(--purple-soft); padding: 8px 12px; border-radius: 30px; font-size: 10px; font-weight: 800; }
.question-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 13px; }
.question-meta { display: flex; justify-content: space-between; gap: 12px; color: #a29db2; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.question-meta span:last-child { color: var(--purple); letter-spacing: 0; }
.question-card h3 { font: 700 14px/1.6 "Manrope", sans-serif; margin: 13px 0 18px; }
.answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.answer-option { position: relative; display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 9px 12px; border: 1px solid #eae8f1; border-radius: 10px; color: #5f5b70; font-size: 10px; cursor: pointer; }
.answer-option:has(input:checked) { border-color: #8a7cda; background: #f7f5ff; color: var(--purple-dark); }
.answer-option input { accent-color: var(--purple); }
.option-letter { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #938caf; background: #f2f0f7; font-size: 9px; font-weight: 800; }
.boolean-options { grid-template-columns: repeat(2, minmax(0, 150px)); }
.answer-text, .form-stack input, .form-stack select, .form-stack textarea, #rule-form input, #rule-form textarea { width: 100%; border: 1px solid #e6e3ee; background: #fff; border-radius: 9px; padding: 11px 12px; font-size: 11px; color: var(--ink); }
.answer-text { max-width: 460px; }
input::placeholder, textarea::placeholder { color: #b2aec0; }
.quiz-submit-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 16px 3px; }
.quiz-submit-row p { color: var(--muted); font-size: 10px; line-height: 1.5; }
.result-hero { text-align: center; background: linear-gradient(110deg, #6558b8, #8c82d8); color: white; padding: 26px; border-radius: 19px; margin-bottom: 17px; }
.result-trophy { margin: auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.15); color: #ffe5a8; font-size: 21px; }
.result-hero h2 { font: 800 23px "Manrope", sans-serif; margin: 10px 0; }
.result-score { font: 800 42px "Manrope", sans-serif; }
.result-score small { font: 600 11px "DM Sans", sans-serif; }
.result-hero > p { color: rgba(255,255,255,.8); font-size: 10px; margin: 3px 0 0; }
.result-panel { padding: 23px; }
.result-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-top: 1px solid #f0eef5; }
.result-symbol { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.is-correct .result-symbol { background: #e5f6ee; color: #329576; }
.is-wrong .result-symbol { background: #fff0eb; color: #d17b5e; }
.result-row > div:nth-child(2) { flex: 1; min-width: 0; }
.result-row strong { font-size: 10px; }
.result-row p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 5px 0 0; }
.result-points { font-size: 11px; font-weight: 800; color: #3b987b; }
.is-wrong .result-points { color: #cc7659; }
.result-actions { display: flex; gap: 10px; justify-content: center; padding: 18px 0; }
.ranking-hero { padding: 29px 34px; }
.ranking-hero h2 { margin-bottom: 6px; }
.ranking-hero p { margin: 0; }
.full-ranking { max-width: 820px; margin: auto; }
.leader-row { display: flex; align-items: center; gap: 13px; padding: 13px 8px; border-top: 1px solid #f0eef5; }
.leader-place { width: 26px; text-align: center; color: #9f9aaf; font: 800 11px "Manrope", sans-serif; }
.leader-row:first-of-type .leader-place { color: #d9a04f; font-size: 17px; }
.leader-avatar { width: 35px; height: 35px; border-radius: 12px; }
.leader-name { flex: 1; min-width: 0; }
.leader-name strong { font-size: 11px; }
.leader-name small { color: var(--purple); }
.leader-name span { display: block; color: #a7a3b4; font-size: 9px; margin-top: 3px; }
.leader-points { color: var(--purple-dark); font-size: 11px; }
.you-row { background: #faf9ff; border-radius: 10px; }
.admin-welcome { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(110deg, #514797, #8173ca); color: #fff; border-radius: 18px; padding: 25px 30px; margin-bottom: 18px; }
.admin-welcome h2 { font-size: 23px; margin: 7px 0; }
.admin-welcome p { margin: 0; font-size: 10px; }
.admin-lock { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 17px; background: rgba(255,255,255,.1); font-size: 26px; }
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.admin-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px 15px; color: #89859a; font-size: 11px; font-weight: 700; }
.admin-tabs button.active { color: var(--purple-dark); border-color: var(--purple); }
.admin-form-panel, .admin-list-panel { margin-bottom: 16px; }
.admin-form-panel > form, .form-stack { display: flex; flex-direction: column; gap: 13px; }
.admin-form-panel > p { margin-top: -7px; }
#rule-form > label, #rule-form .section-editor > label, .form-stack > label { display: flex; flex-direction: column; gap: 7px; color: #5d596d; font-size: 10px; font-weight: 800; }
.optional { color: #aaa5b7; font-weight: 500; }
.section-editor { background: #fbfaff; border: 1px solid #eeebf6; border-radius: 12px; padding: 15px; margin-top: 12px; display: flex; flex-direction: column; gap: 11px; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; color: var(--purple-dark); font: 800 11px "Manrope", sans-serif; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 5px; }
.icon-button { border: 0; background: #f4f2f9; color: #88839b; width: 30px; height: 30px; border-radius: 9px; font-size: 18px; line-height: 1; }
.icon-button:hover { background: #ebe8f5; color: var(--purple-dark); }
.danger-icon:hover { background: #fff0ed; color: #c95e56; }
.admin-list-row { min-height: 57px; border-top: 1px solid #f0eef5; display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.admin-list-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.admin-list-copy strong { font-size: 11px; overflow-wrap: anywhere; }
.admin-list-copy span { color: #a19cad; font-size: 9px; }
.admin-panel-icon { color: var(--purple); background: var(--purple-soft); padding: 9px 11px; border-radius: 10px; }
.json-help { padding: 14px; background: #f8f7fc; border-radius: 10px; }
.json-help strong { font-size: 10px; }
.json-help p { color: var(--muted); font-size: 9px; line-height: 1.7; margin: 6px 0 0; }
.json-help code { color: var(--purple-dark); background: #eeebf7; padding: 2px 4px; border-radius: 4px; }
.alert { padding: 11px 13px; margin: 0 0 15px; border-radius: 10px; font-size: 10px; line-height: 1.6; }
.alert-error { color: #a74d43; background: #fff0ed; border: 1px solid #f6d9d2; }
.alert-success { color: #277d62; background: #eaf8f1; border: 1px solid #d7f0e4; }
.auth-page { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 30px 16px; background: radial-gradient(circle at 12% 15%, #efebff 0, transparent 32%), radial-gradient(circle at 90% 85%, #e5f5f0 0, transparent 27%), #f7f6fb; }
.auth-decoration { position: absolute; border-radius: 50%; border: 1px solid rgba(121,104,202,.12); }
.decor-one { width: 430px; height: 430px; top: -240px; right: -110px; }
.decor-two { width: 330px; height: 330px; bottom: -200px; left: -100px; }
.auth-card { width: min(100%, 420px); position: relative; z-index: 1; background: #fff; padding: 31px; border: 1px solid #ebe8f3; border-radius: 20px; box-shadow: 0 22px 70px rgba(48,39,99,.1); }
.auth-brand { margin-bottom: 32px; }
.auth-intro { margin-bottom: 23px; }
.auth-intro h1 { margin: 8px 0; font: 800 25px "Manrope", sans-serif; letter-spacing: -.7px; }
.auth-intro p { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0; }
.auth-tabs { background: #f5f3fa; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { border: 0; border-radius: 8px; background: transparent; color: #8a869b; padding: 9px; font-size: 10px; font-weight: 800; }
.auth-tabs button.active { color: var(--purple-dark); background: white; box-shadow: 0 2px 5px rgba(38,33,78,.07); }
.auth-card .form-stack { gap: 14px; }
.auth-card .form-stack label { display: flex; flex-direction: column; gap: 7px; color: #5d596d; font-size: 10px; font-weight: 800; }
.admin-setup-link { display: block; margin: 16px auto 0; }
.auth-footnote { color: #aaa6b5; font-size: 9px; line-height: 1.6; text-align: center; margin: 17px 0 0; }
.auth-bottom { position: absolute; bottom: 17px; color: #aaa6b8; font-size: 9px; }
@media (max-width: 1180px) {
  .main-area { padding: 0 28px 20px; }
  .rules-grid, .exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-graphic { right: 1%; transform: scale(.88); transform-origin: right center; }
}
@media (max-width: 850px) {
  .sidebar { position: sticky; inset: auto; width: 100%; height: auto; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
  .sidebar .brand { padding: 0 2px 10px; }
  .logo-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 16px; }
  .brand-copy strong { font-size: 13px; }
  .sidebar .nav-caption, .sidebar-bottom { display: none; }
  .main-nav { flex-direction: row; overflow-x: auto; gap: 5px; padding-bottom: 1px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-link { min-height: 37px; flex: 0 0 auto; padding: 0 10px; gap: 6px; font-size: 10px; }
  .nav-symbol { font-size: 15px; width: auto; }
  .main-area { margin-left: 0; padding: 0 22px 18px; }
  .topbar { padding-top: 24px; }
  .page-content { margin-top: 20px; }
}
@media (max-width: 650px) {
  .main-area { padding: 0 14px 14px; }
  .topbar { padding: 20px 0 17px; align-items: flex-end; }
  .topbar h1 { font-size: 21px; }
  .topbar p { max-width: 235px; font-size: 10px; line-height: 1.5; }
  .topbar-score { min-width: 76px; }
  .topbar-score strong { font-size: 20px; }
  .welcome-banner { min-height: 0; padding: 26px 22px; }
  .welcome-text { max-width: 100%; }
  .welcome-text h2 { font-size: 25px; }
  .welcome-text p { max-width: 260px; font-size: 10px; }
  .welcome-graphic { opacity: .18; right: -48px; transform: scale(.8); }
  .stat-grid { grid-template-columns: 1fr; gap: 8px; margin: 12px 0 15px; }
  .stat-card { padding: 12px 15px; }
  .stat-icon { width: 34px; height: 34px; }
  .home-columns, .detail-layout { grid-template-columns: 1fr; gap: 13px; }
  .panel { padding: 17px; }
  .rules-grid, .exercise-grid { grid-template-columns: 1fr; gap: 11px; }
  .rule-card, .exercise-card { padding: 17px; }
  .rule-card p { min-height: 0; }
  .detail-aside { position: static; }
  .detail-hero, .ranking-hero { padding: 23px 21px; }
  .detail-hero h2, .ranking-hero h2 { font-size: 25px; }
  .quiz-intro { padding: 18px; }
  .quiz-intro h2 { font-size: 18px; }
  .quiz-doodle { font-size: 37px; padding: 0; }
  .question-card { padding: 17px; }
  .answer-options { grid-template-columns: 1fr; }
  .boolean-options { grid-template-columns: repeat(2, 1fr); }
  .quiz-submit-row { align-items: stretch; flex-direction: column; }
  .quiz-submit-row p { margin: 0; }
  .result-actions { flex-direction: column; }
  .admin-welcome { padding: 21px; }
  .admin-welcome h2 { font-size: 20px; }
  .admin-lock { width: 43px; height: 43px; flex: 0 0 auto; }
  .admin-tabs { overflow-x: auto; }
  .admin-tabs button { padding: 11px 12px; white-space: nowrap; }
  .form-actions { align-items: stretch; }
  .form-actions .btn { flex: 1 1 100%; }
  .auth-card { padding: 24px 20px; }
  .auth-intro h1 { font-size: 22px; }
  .leader-row { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}