:root{--ink:#173e36;--muted:#60756c;--green:#237e5d;--lime:#d9ee91;--paper:#f3f7f3;--line:#dce6dd;--red:#bb4a4a;--shadow:0 12px 40px #163d3510;font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);font-size:18px}*{box-sizing:border-box}body{margin:0;background:var(--paper)}button,input,select,textarea{font:inherit}button{cursor:pointer;touch-action:manipulation;border:1px solid var(--line);border-radius:12px;background:white;color:var(--ink);min-height:52px;padding:10px 20px;font-weight:650}button:active{transform:translateY(1px)}button:disabled{opacity:.42;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #7fb5ff;outline-offset:3px}button:hover{border-color:#8ab19d}input,select,textarea{border:1px solid #bbcfc1;border-radius:12px;background:white;color:var(--ink);padding:13px 16px;min-height:54px;min-width:0}input[type=number]{width:130px}input[type=file]{max-width:100%}label{display:grid;gap:10px;font-weight:650}textarea{resize:vertical}h1,h2,h3,p{margin:0}h1{font-size:30px;letter-spacing:-1px}h2{font-size:28px}h3{font-size:22px}.topbar{height:100px;display:flex;align-items:center;justify-content:space-between;padding:0 36px;background:white;border-bottom:1px solid var(--line);gap:20px}.school{display:flex;align-items:center;gap:14px;padding:0;border:0;text-align:left;background:transparent}.school strong{display:block;font-size:22px;letter-spacing:2px}.school span span{display:block;font-size:17px;margin-top:5px;font-weight:500}.emblem{height:58px;width:58px;border-radius:50%;border:2px solid #386454;display:grid;place-items:center;font-family:serif;font-size:30px;background:#edf3eb;overflow:hidden;flex-shrink:0}.emblem img{width:100%;height:100%;object-fit:contain;background:white}nav{display:flex;gap:10px;background:#f0f4f0;border-radius:16px;padding:6px}nav button{border:0;background:transparent;min-height:48px;padding:10px 26px}nav button.active{background:var(--ink);color:white;box-shadow:0 4px 12px #173e3620}.header-actions{display:flex;align-items:center;gap:12px}time{font-variant-numeric:tabular-nums;font-weight:600;font-size:21px;margin-right:8px}.icon-button{padding:8px;width:52px;font-size:27px}.lock-button{display:flex;align-items:center;gap:10px}.lock-button.locked{background:#fff1d9;border-color:#e4b873}main{padding:26px 36px 88px;max-width:2560px;margin:auto}.toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:20px}.title-group{display:flex;align-items:center;gap:16px}.eyebrow{display:none}h1 span{font-size:16px;font-weight:500;color:var(--muted);background:#e3ece3;border-radius:20px;padding:6px 12px;margin-left:12px;vertical-align:middle;letter-spacing:0}.toolbar-actions{display:flex;gap:12px;align-items:center}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#1d6e50}.secondary{background:#e5eee7;border-color:#d9e5da}.danger{color:var(--red)}.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:16px}.student{position:relative;display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;padding:15px 18px 13px;border-radius:18px;border:1px solid #dce6dd;box-shadow:0 3px 1px #244c3610;min-width:0;height:190px;overflow:hidden;text-align:left;transition:box-shadow .2s,border-color .2s;background:white}.student:hover{border-color:#6ea789;box-shadow:0 6px 22px #244c3612}.student.selected{border:3px solid var(--green);padding:13px 16px 11px;background:#f0fae8}.card-top{display:flex;align-items:center;justify-content:space-between;gap:5px}.student-name{font-size:23px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-index{font-size:13px;color:#8a9b90;font-weight:500}.card-middle{display:flex;align-items:center;justify-content:space-between;gap:4px;height:98px}.sprite-stage{height:96px;width:100px;display:flex;align-items:center;justify-content:center;position:relative;flex-shrink:0}.sprite-stage:after{content:"";position:absolute;width:62px;height:10px;background:#dbe7da;border-radius:50%;bottom:5px;z-index:0}.sprite{display:block;flex-shrink:0;position:relative;z-index:1;background-repeat:no-repeat;image-rendering:pixelated;animation:walk 1s steps(var(--frames)) infinite;filter:drop-shadow(0 3px 0 #122c2810)}@keyframes walk{to{background-position-x:var(--end)}}.score{font-size:36px;letter-spacing:-1.5px;font-weight:750;font-variant-numeric:tabular-nums;line-height:1}.score small{display:block;text-align:right;font-size:13px;font-weight:500;letter-spacing:0;color:var(--muted);margin-top:7px}.card-bottom{display:flex;justify-content:space-between;font-size:13px;font-weight:500;color:var(--muted);margin-bottom:7px;gap:4px}.progress{height:5px;background:#ecf1e9;border-radius:10px;overflow:hidden}.progress>i{height:100%;display:block;background:#8dbf6a;border-radius:10px}.student:nth-child(5n+2) .progress>i{background:#e8ad6c}.student:nth-child(5n+3) .progress>i{background:#81b4db}.student:nth-child(5n+4) .progress>i{background:#d9bd58}.empty{min-height:60vh;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:28px}.empty-art{display:flex;gap:25px;align-items:end}.empty-art .sprite-stage{width:140px;height:145px}.empty h2{font-size:32px}.empty-buttons{display:flex;gap:15px}.badge{font-size:14px;padding:6px 12px;border-radius:20px;background:#edf2e8;color:#56744b}.demo-badge{background:#fff1d6;color:#926325}footer{position:fixed;bottom:0;left:0;right:0;height:58px;padding:0 36px;display:flex;align-items:center;justify-content:space-between;background:#f3f7f3ed;border-top:1px solid var(--line);font-size:14px;z-index:3}footer>span{display:flex;align-items:center;gap:8px;color:var(--muted)}footer button{font-size:16px;background:transparent;border:0;min-height:44px;padding:8px 16px}.status-dot{width:7px;height:7px;background:#7b9e7d;border-radius:100%}#batch-bar{position:fixed;bottom:76px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;border-radius:18px;box-shadow:0 10px 40px #173e3640;z-index:5;padding:12px 18px;display:flex;align-items:center;gap:20px;white-space:nowrap}#batch-bar[hidden]{display:none}#batch-bar button{border:0}#batch-bar .primary{background:var(--lime);color:var(--ink)}dialog{width:min(900px,calc(100vw - 48px));max-height:90vh;padding:0;border:0;border-radius:24px;box-shadow:0 30px 100px #0b261f40;color:var(--ink);background:#f8faf7}dialog::backdrop{background:#102d2866;backdrop-filter:blur(5px)}.modal-header{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;padding:22px 28px;background:#f8faf7;z-index:4;border-bottom:1px solid var(--line)}.close{font-size:24px;min-height:48px;width:48px;padding:5px;background:white}.modal-body{padding:24px 28px}.stack{display:grid;gap:22px}.row{display:flex;align-items:center;gap:12px}.row.spread{justify-content:space-between}.row.wrap{flex-wrap:wrap}.grow{flex:1}.modal-footer{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.muted{color:var(--muted);font-size:16px}.rule-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.rule-button{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:8px;background:white;text-align:left;font-size:20px}.rule-button b{font-size:28px;color:var(--green)}.rule-button.minus b{color:var(--red)}.score-person{display:flex;align-items:center;justify-content:center;gap:30px;padding:0 0 20px}.score-person .sprite-stage{width:120px;height:120px}.score-person h3{font-size:30px}.score-person p{margin-top:10px;font-size:21px}.divider{border:0;border-top:1px solid var(--line);margin:24px 0}.inline-form{display:flex;gap:12px;align-items:end}.inline-form label:first-child{flex:1}.inline-form input[type=text]{width:100%}.inline-form button{height:54px}.dex-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;max-height:380px;overflow-y:auto;padding:6px 5px 6px 0;overscroll-behavior:contain}.dex-card{padding:7px;display:flex;flex-direction:column;align-items:center;min-height:120px;font-size:15px;gap:4px}.dex-card .sprite-stage{height:72px;width:78px}.dex-card.selected{background:#e6f3cf;border:2px solid var(--green);padding:6px}.search{width:100%}.picker-head{display:flex;gap:12px}.form-error{color:var(--red);font-size:16px;min-height:20px}.record{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;background:white;border:1px solid var(--line);border-radius:16px;gap:20px}.record h3{margin-bottom:8px}.records{display:grid;gap:12px}.record .delta{font-size:28px;color:var(--green);font-weight:700}.record .delta.minus{color:var(--red)}.record.undone{opacity:.55}.podium{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:24px}.podium-card{text-align:center;background:white;border:1px solid var(--line);border-radius:24px;padding:24px;position:relative;display:flex;align-items:center;gap:24px}.podium-card:first-child{background:#edf3d5;border-color:#d7e1b2}.podium-card:nth-child(2){background:#e9f1f6}.podium-card:nth-child(3){background:#f9eee3}.podium-card .place{font-size:42px;opacity:.45;font-weight:800}.podium-card .sprite-stage{width:110px;height:110px}.podium-card h2{font-size:25px}.podium-card .score{margin-top:15px}.rank-row{display:grid;grid-template-columns:60px 100px 1fr 180px 90px;align-items:center;background:white;border-bottom:1px solid var(--line);padding:8px 24px;min-height:90px}.rank-row:first-child{border-radius:16px 16px 0 0}.rank-row:last-child{border-radius:0 0 16px 16px}.rank-row .sprite-stage{height:70px;width:70px}.rank-number{font-size:26px;font-weight:700;color:var(--muted)}.rank-row strong{font-size:23px}.rank-row .score{font-size:28px;text-align:right}#toast{position:fixed;left:50%;bottom:90px;transform:translate(-50%,20px);background:var(--ink);color:white;border-radius:14px;padding:18px 28px;z-index:100;opacity:0;pointer-events:none;transition:.2s;max-width:90vw;text-align:center;font-size:20px}#toast.show{opacity:1;transform:translate(-50%,0)}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-width:360px;margin:auto}.keypad button{height:66px;font-size:25px}.pin-box{display:block;width:100%;max-width:360px;text-align:center;letter-spacing:16px;font-size:28px;margin:0 auto 20px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.settings-grid input{width:100%}.settings-section{padding:20px;background:white;border:1px solid var(--line);border-radius:16px}.settings-section h3{margin-bottom:18px}.class-choice{width:100%;display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.evolution-choice{display:flex;gap:20px;justify-content:center;flex-wrap:wrap}.evolution-choice button{display:flex;flex-direction:column;align-items:center;gap:12px;font-size:23px;min-width:160px}.pending{color:#926325!important}#celebration{position:fixed;inset:0;z-index:200;background:#123e35e8;display:flex;align-items:center;justify-content:center;flex-direction:column;color:white;gap:25px;backdrop-filter:blur(8px)}#celebration[hidden]{display:none}#celebration h2{font-size:44px}#celebration .sprite-stage{width:250px;height:250px;filter:drop-shadow(0 0 40px #e4f7a8)}#celebration p{font-size:28px}#celebration button{margin-top:15px;background:var(--lime);min-width:180px}.backup-file{display:none}.locked-state .student{cursor:default}.locked-state footer button{color:var(--muted)}@media(min-width:2200px){:root{font-size:22px}.topbar{height:120px}.student{height:240px}.student-name{font-size:28px}.card-middle{height:128px}.score{font-size:44px}.sprite-stage{transform:scale(1.15)}}@media(max-width:1550px){.grid{grid-template-columns:repeat(6,minmax(0,1fr))}.topbar{padding:0 24px}main{padding-left:24px;padding-right:24px}nav button{padding:10px 18px}.student{padding:14px;height:188px}.student-name{font-size:21px}.sprite-stage{width:86px}.school strong{font-size:20px}time{display:none}.score{font-size:32px}}@media(max-width:1100px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}.topbar{flex-wrap:wrap;height:auto;min-height:100px;padding:15px 20px;gap:16px}nav{order:3;width:100%;justify-content:center}.header-actions{margin-left:auto}.student{height:195px}.podium-card{gap:10px;padding:15px;flex-wrap:wrap;justify-content:center}.dex-grid{grid-template-columns:repeat(5,1fr)}}@media(max-width:650px){:root{font-size:16px}main{padding:20px 14px 90px}.toolbar{align-items:start;flex-direction:column}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.student-name{font-size:20px}.school strong{font-size:17px}.school span span{font-size:14px}.emblem{width:44px;height:44px}.school{gap:8px}.header-actions{gap:6px}.icon-button{display:none}.lock-button{padding:10px}.toolbar-actions{width:100%;flex-wrap:wrap}.rule-grid{grid-template-columns:repeat(2,1fr)}.modal-body{padding:18px}.modal-header{padding:18px}.inline-form{flex-wrap:wrap}.inline-form label{min-width:100px}.dex-grid{grid-template-columns:repeat(3,1fr)}.settings-grid{grid-template-columns:1fr}.podium{gap:8px}.podium-card{padding:12px 5px;gap:4px}.podium-card .place{font-size:24px}.podium-card h2{font-size:18px}.podium-card .sprite-stage{width:80px;height:80px}.rank-row{grid-template-columns:30px 65px 1fr 60px;padding:8px 12px}.rank-row .species{display:none}.rank-row strong{font-size:18px}.record{padding:16px;flex-wrap:wrap}#batch-bar{gap:8px;padding:10px;font-size:15px}#batch-bar button{padding:8px 12px}footer{padding:0 14px}.picker-head{flex-wrap:wrap}.empty h2{font-size:26px}.empty-art{gap:0}.empty-art .sprite-stage{width:100px}.title-group{gap:8px}h1{font-size:27px}}
@media(prefers-reduced-motion:reduce){.sprite{animation:none}*{scroll-behavior:auto!important;transition:none!important}}

/* Low-frequency membership action: compact plus beside heading. */
.add-inline{width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:#698276;font-size:28px;font-weight:400;border-radius:50%;flex-shrink:0}.add-inline:hover{background:#e4ece4;color:var(--green)}.add-inline[hidden]{display:none}.title-group{gap:8px}.emblem{border:0;background:transparent;border-radius:0;width:70px;height:64px}.emblem img{object-fit:contain;background:transparent}

.emblem{position:relative;width:44px;height:44px;min-width:44px;aspect-ratio:1;border-radius:50%;overflow:hidden}.emblem img.official-crest{position:absolute;width:88px;height:72.8px;max-width:none;left:-22.4px;top:-22px;object-fit:contain}

.student-fields{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:18px}.student-fields input{width:100%}.card-index{font-size:15px;white-space:nowrap;flex-shrink:0}

.header-actions .rules-button{white-space:nowrap}@media(max-width:650px){.header-actions .rules-button{padding:10px 12px}.topbar{column-gap:10px}.school strong{letter-spacing:0}}

.student-identity{display:flex;align-items:center;gap:18px;padding:6px 0 16px;border-bottom:1px solid var(--line)}.student-identity strong{font-size:28px}.student-identity span{color:var(--muted);font-size:20px}

.score-inputs{display:flex;gap:14px;align-items:flex-end;flex-shrink:0}.score-direction{margin:0;padding:0;border:0;min-width:0}.score-direction legend{padding:0;margin:0 0 10px;font-weight:650}.direction-options{display:flex;padding:4px;background:#e8eee8;border:1px solid var(--line);border-radius:12px;gap:4px;height:54px}.direction-options label{position:relative;display:flex;min-width:72px;cursor:pointer}.direction-options input{position:absolute;opacity:0;width:1px;height:1px;min-height:0;padding:0;margin:0}.direction-options span{display:flex;align-items:center;justify-content:center;padding:0 16px;border-radius:8px;width:100%;font-weight:650}.direction-options input:checked+span{background:var(--green);color:white}.direction-options input[value="-1"]:checked+span{background:var(--red)}.direction-options input:focus-visible+span{outline:3px solid #7fb5ff;outline-offset:2px}.score-inputs input.score-amount{width:100px;text-align:center;font-size:22px}.score-inputs>label{flex:none}@media(max-width:650px){.score-inputs{width:100%;justify-content:space-between}.score-inputs>label{min-width:0}.inline-form .score-inputs .direction-options label{min-width:76px}}

/* Personal profile: large score, quiet identity, expandable history. */
.modal-actions{display:flex;align-items:center;gap:10px}.modal-actions>button:not(.close){font-size:16px;padding:10px 16px;min-height:48px}.modal-header h2{flex-shrink:0}dialog[data-kind="score"]{width:min(980px,calc(100vw - 40px))}.profile-hero{display:flex;align-items:center;justify-content:center;gap:64px;padding:0 16px 24px}.profile-partner{display:flex;flex-direction:column;align-items:center;gap:4px}.partner-name{font-size:18px;color:var(--muted);font-weight:650}.profile-partner .sprite-stage{width:170px;height:164px}.profile-points{min-width:260px}.points-label{font-size:17px;color:var(--muted)}.points-total{font-size:88px;line-height:1.15;font-weight:800;letter-spacing:-3px;font-variant-numeric:tabular-nums}.points-total small{font-size:22px;letter-spacing:0;margin-left:12px;font-weight:500;color:var(--muted)}.profile-progress{margin-top:10px}.profile-progress .progress{height:7px}.profile-progress>span{display:block;color:var(--muted);font-size:15px;margin-top:10px}.profile-points>button{margin-top:12px}.profile-scoring{background:#eaf1e9;padding:20px;border:1px solid #dbe6d9;border-radius:18px}.profile-scoring .rule-grid:empty{display:none}.profile-scoring .rule-grid:not(:empty){margin-bottom:20px}.profile-scoring .score-amount{font-size:28px;font-weight:750;border:2px solid #8aae99;background:#fff;width:110px;height:60px}.profile-scoring .direction-options{height:60px;background:#dce8dc}.profile-scoring .inline-form>button{height:60px}.profile-scoring #reason{height:60px}.growth-section{margin-top:24px}.growth-section h3{font-size:18px;margin-bottom:12px}.growth-timeline{display:flex;gap:14px;overflow-x:auto;padding-bottom:4px}.growth-step{flex:1;min-width:230px;background:white;border:1px solid var(--line);border-radius:14px;padding:12px 18px}.growth-sprites{display:flex;align-items:center;justify-content:center;gap:16px}.growth-sprites .sprite-stage{width:65px;height:66px}.growth-sprites .sprite-stage:after{width:40px;height:6px}.growth-sprites>span:not(.sprite-stage){color:#95aa9c}.growth-step>strong{display:block;text-align:center;font-size:16px;margin:4px 0 8px}.growth-step>.history-meta{text-align:center}.history-meta{display:block;color:var(--muted);font-size:14px;margin-top:5px;font-weight:400}.history-empty{color:var(--muted);font-size:16px;padding:12px 0}.personal-history{margin-top:20px;border-top:1px solid var(--line)}.personal-history summary{min-height:64px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:18px;font-weight:650;list-style:none}.personal-history summary::-webkit-details-marker{display:none}.personal-history summary small{font-size:14px;margin-left:8px;color:var(--muted);background:#e7eee4;border-radius:16px;padding:3px 8px}.history-chevron{font-size:26px;transition:transform .15s}.personal-history[open] .history-chevron{transform:rotate(180deg)}.personal-records{max-height:290px;overflow-y:auto}.personal-record{display:flex;justify-content:space-between;gap:16px;padding:16px 0;border-top:1px solid #e5ece3}.personal-record strong{font-size:18px}.record-value{text-align:right;flex-shrink:0}.record-value b{font-size:26px;color:var(--green)}.record-value b.negative{color:var(--red)}.is-undone{opacity:.5}.profile-scoring .inline-form>label{min-width:140px}.personal-history summary:focus-visible{outline:3px solid #7fb5ff;outline-offset:2px;border-radius:8px}
/* Period rankings and three-level podium. */
.rank-tabs{display:flex;justify-content:center;gap:8px;background:#e5ede4;border-radius:16px;padding:6px;width:max-content;margin:0 auto 24px}.rank-tabs button{background:transparent;border-color:transparent;min-width:112px;min-height:58px;font-size:22px}.rank-tabs button.active{background:var(--green);color:white;box-shadow:0 3px 9px #173e3615}.award-podium{display:flex;align-items:end;justify-content:center;gap:16px;max-width:920px;margin:0 auto 28px;padding-top:20px}.award-place{display:flex;flex-direction:column;align-items:center;flex:1;max-width:270px}.award-pokemon{position:relative;height:120px;display:flex;align-items:center;justify-content:center}.award-pokemon .sprite-stage{width:125px;height:115px}.award-place>strong{font-size:26px;margin:12px 0 4px}.award-points{font-size:32px;font-weight:750;margin-bottom:18px}.award-points small{font-size:16px;font-weight:500;color:var(--muted)}.crown{position:absolute;top:-20px;left:50%;transform:translateX(-50%) rotate(-8deg);font-size:34px;color:#d6a936;z-index:2}.podium-block{height:95px;border-radius:18px 18px 4px 4px;background:linear-gradient(#e2ebef,#cddde4);width:100%;display:flex;align-items:center;justify-content:center;box-shadow:inset 0 2px 0 #ffffffb0}.podium-block span{font-size:50px;font-weight:800;color:#6d8d9b}.place-1 .podium-block{height:135px;background:linear-gradient(#f4e7b9,#e9d38a)}.place-1 .podium-block span{color:#a57e24}.place-3 .podium-block{height:65px;background:linear-gradient(#f1dfcf,#e2c5ac)}.place-3 .podium-block span{color:#ac7c51}.ranking-list{max-width:1100px;margin:auto;background:white;border:1px solid var(--line);border-radius:20px;overflow:hidden}.ranking-line{display:grid;grid-template-columns:54px 80px 1fr 90px 110px;align-items:center;gap:18px;padding:10px 26px;min-height:90px;border-bottom:1px solid #e7ede5}.ranking-line:last-child{border-bottom:0}.ranking-number{text-align:center;font-size:23px;font-weight:700;color:var(--muted)}.ranking-line .sprite-stage{width:65px;height:64px}.ranking-line .sprite-stage:after{width:42px;height:6px}.ranking-line>strong{font-size:23px}.ranking-student-no{color:var(--muted);font-size:17px}.ranking-line>b{text-align:right;font-size:28px;font-variant-numeric:tabular-nums}.ranking-line>b small{font-size:15px;color:var(--muted);font-weight:400}.medal{border-radius:50%;width:40px;height:40px;line-height:40px}.medal-1{background:#f3e4b3;color:#a57e24}.medal-2{background:#e2ebef;color:#6d8d9b}.medal-3{background:#f1dfcf;color:#ac7c51}
@media(max-width:650px){.modal-header{gap:10px;flex-wrap:wrap}.modal-actions{gap:6px;margin-left:auto}.modal-actions>button:not(.close){font-size:14px;padding:8px 10px}.profile-hero{gap:20px;padding:0 0 20px}.profile-partner .sprite-stage{width:130px;height:145px}.profile-points{min-width:0;flex:1;max-width:240px}.points-total{font-size:70px}.profile-scoring{padding:16px}.profile-scoring .inline-form>label{flex-basis:100%}.profile-scoring .inline-form>button{width:100%}.profile-scoring .score-inputs{gap:12px}.profile-scoring .score-amount{width:110px}.rank-tabs{gap:0;width:100%}.rank-tabs button{flex:1;min-width:0;font-size:19px;padding:10px}.award-podium{gap:8px}.award-place>strong{font-size:20px}.award-points{font-size:26px}.ranking-line{grid-template-columns:36px 55px 1fr 50px 65px;gap:8px;padding:10px 12px}.ranking-line>strong{font-size:18px}.ranking-line>b{font-size:24px}.ranking-student-no{font-size:14px}.ranking-line .sprite-stage{width:50px}.medal{width:32px;height:32px;line-height:32px}}

/* Rule settings: consistent type, aligned fields, quiet secondary actions. */
#rule-list .record{display:grid;grid-template-columns:minmax(0,1fr) 80px auto;gap:20px;padding:14px 20px}
#rule-list .record>strong,#rule-list .record>.delta{font-size:20px;line-height:28px;font-weight:650}
#rule-list .record>.delta{text-align:right;font-variant-numeric:tabular-nums}
#rule-list .record>.row{gap:4px;margin-left:12px}
#rule-list [data-edit-rule],#rule-list [data-delete-rule]{min-height:44px;padding:8px 10px;border:0;background:transparent;font-size:15px;line-height:20px;font-weight:500;color:var(--muted)}
#rule-list [data-delete-rule]{color:var(--red)}
#rule-list [data-edit-rule]:hover,#rule-list [data-delete-rule]:hover{background:#edf2eb}
#rule-form{display:grid;grid-template-columns:minmax(180px,1fr) auto 168px auto;gap:12px;align-items:end}
#rule-form .score-inputs{display:contents}
#rule-form label,#rule-form legend{font-size:20px;line-height:26px;font-weight:600}
#rule-form>label,#rule-form .score-inputs>label{gap:10px;min-width:0}
#rule-form legend{margin:0 0 10px}
#rule-form input:not([type=radio]),#rule-form .direction-options,#rule-form>button{height:56px;min-height:56px;box-sizing:border-box;font-size:20px;line-height:26px}
#rule-form input:not([type=radio]){width:100%;padding:14px 16px;font-weight:500}
#rule-form input::placeholder{font-size:20px;line-height:26px;font-weight:500;opacity:1;color:#88938d}
#rule-form .direction-options{margin:0}
#rule-form .direction-options label{min-width:68px;gap:0}
#rule-form .direction-options span{font-size:20px;line-height:26px;padding:0 14px;font-weight:600}
#rule-form>button{padding:14px 20px;font-weight:600}
@media(max-width:650px){#rule-list .record{grid-template-columns:minmax(0,1fr) 50px auto;gap:8px;padding:12px}#rule-list .record>.row{margin-left:0}#rule-list [data-edit-rule],#rule-list [data-delete-rule]{padding:8px}#rule-form{grid-template-columns:minmax(0,1fr) 168px auto;gap:12px}#rule-form>label{grid-column:1/-1}#rule-form .direction-options label{min-width:0;flex:1}#rule-form .direction-options span{padding:0 12px}}

/* Scoring actions share one level within separate positive/negative panels. */
.scoring-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.scoring-section{--action-color:#237e5d;--action-border:#bddac8;--action-fill:#dfefe5;--action-hover:#cee5d8;min-width:0;padding:18px;border:1px solid var(--action-border);border-radius:18px;background:#eef7f0;color:var(--action-color)}
.scoring-minus{--action-color:#b84646;--action-border:#e8c2c2;--action-fill:#f7e3e3;--action-hover:#efd3d3;background:#fcf1f1}
.scoring-section h3{display:flex;align-items:center;gap:9px;font-size:20px;line-height:28px;margin:0 0 14px;font-weight:650}
.scoring-section h3>span{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:var(--action-fill);font-size:22px}
.score-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.score-action{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:60px;padding:12px 14px;background:var(--action-fill);border:1px solid var(--action-border);color:var(--action-color);text-align:left;font-size:20px;line-height:28px;font-weight:600}
.score-action>span:first-child{overflow-wrap:anywhere}.score-action>b{font-size:20px;line-height:28px;font-weight:650;white-space:nowrap}
.score-action:hover{background:var(--action-hover);border-color:var(--action-color)}
.custom-action{border-style:dashed}.custom-action[aria-expanded=true]{border-style:solid;box-shadow:inset 0 0 0 1px var(--action-color)}
.section-score-form{display:grid;grid-template-columns:minmax(100px,1fr) 168px auto;gap:10px;align-items:end;margin-top:16px;padding-top:16px;border-top:1px solid var(--action-border)}
.section-score-form[hidden]{display:none}
.section-score-form label{min-width:0;font-size:20px;line-height:26px;font-weight:600;gap:8px}
.section-score-form input,.section-score-form>button{height:56px;min-height:56px;font-size:20px;line-height:26px;border-color:var(--action-border);color:var(--action-color)}
.section-score-form input{width:100%;min-width:0;padding:14px 10px;background:#ffffffb3;font-weight:500}
.section-score-form input::placeholder{color:var(--action-color);opacity:.6;font-size:20px;font-weight:500}
.section-score-form input[inputmode=numeric]{text-align:center}
.section-score-form>button{padding:14px;background:var(--action-color);border-color:var(--action-color);color:white;font-weight:600}
@media(max-width:800px){.scoring-sections{grid-template-columns:1fr}.score-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Metallic ranking medals and a consistent point-token badge. */
.rank-medal{--metal-light:#ffe9a2;--metal-face:#efc45c;--metal-edge:#c4922e;--metal-ink:#865c14;--ribbon:#b98728;width:58px;height:68px;display:block;overflow:visible;filter:drop-shadow(0 3px 2px #49380e20)}
.rank-medal.silver{--metal-light:#f7fbff;--metal-face:#cddbe6;--metal-edge:#8da5b7;--metal-ink:#496579;--ribbon:#718da1}
.rank-medal.bronze{--metal-light:#ffe2c9;--metal-face:#dca77c;--metal-edge:#aa7149;--metal-ink:#754728;--ribbon:#99633f}
.medal-ribbon{fill:var(--ribbon)}.medal-edge{fill:var(--metal-edge)}.medal-face{fill:var(--metal-face);stroke:var(--metal-light);stroke-width:2}.medal-ring{fill:none;stroke:var(--metal-edge);stroke-width:1;opacity:.65}.medal-shine{fill:none;stroke:var(--metal-light);stroke-width:3;stroke-linecap:round}.medal-leaf{fill:none;stroke:var(--metal-ink);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.6}.rank-medal text{fill:var(--metal-ink);font-size:28px;font-weight:800;font-family:inherit;letter-spacing:-1px}
.podium-block{height:118px;border:1px solid #bfced7;border-bottom:4px solid #b3c6d1;box-shadow:inset 0 2px 0 #ffffffc0,0 5px 10px #173e3609}.place-1 .podium-block{height:158px;border-color:#deca85;border-bottom-color:#d1b86a}.place-3 .podium-block{height:94px;border-color:#d8b493;border-bottom-color:#cba17b}.podium-block .rank-medal{width:68px;height:80px}.place-1 .podium-block .rank-medal{width:80px;height:94px}
.points-badge{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:108px;max-width:100%;padding:8px 13px;border:1px solid #d7e5d5;border-radius:14px;background:linear-gradient(135deg,#f2f7ee,#e8f1e2);color:#315e47;font-variant-numeric:tabular-nums;white-space:nowrap;justify-self:end}
.points-badge strong{font-size:26px;line-height:32px;font-weight:750;letter-spacing:-.5px}.points-badge small{font-size:14px;font-weight:500;opacity:.75}.point-token{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border-radius:50%;background:#d4e6bf;border:1px solid #b4c99e;color:#688548;box-shadow:inset 0 1px 0 #ffffffb0}.point-token svg{width:16px;height:16px;fill:currentColor}
.points-badge-hero{min-width:130px;padding:9px 17px;border-radius:16px;margin:8px 0 18px;background:linear-gradient(135deg,#faf4de,#f2e6b9);border-color:#e5d495;color:#8a691e;box-shadow:0 3px 0 #b69a4a15}.points-badge-hero strong{font-size:32px;line-height:38px}.points-badge-hero .point-token{width:28px;height:28px;background:#edda9b;border-color:#d7bc6b;color:#a1802d}.place-2 .points-badge-hero{background:linear-gradient(135deg,#f4f8fb,#e0eaf1);border-color:#c9d9e4;color:#527185}.place-2 .point-token{background:#d4e0e9;border-color:#aec3d2;color:#6e8da2}.place-3 .points-badge-hero{background:linear-gradient(135deg,#fff4eb,#f1dcc9);border-color:#e5c8ae;color:#926442}.place-3 .point-token{background:#ead0b9;border-color:#cdab8e;color:#a87a54}
.ranking-line{grid-template-columns:58px 80px 1fr 90px minmax(130px,max-content);min-height:96px}.ranking-number{display:flex;align-items:center;justify-content:center}.ranking-number .rank-medal{width:48px;height:57px}
@media(max-width:650px){.points-badge{min-width:0;padding:6px 9px;gap:5px;border-radius:11px}.points-badge strong{font-size:22px;line-height:28px}.points-badge small{font-size:12px}.point-token{width:20px;height:20px}.point-token svg{width:13px;height:13px}.points-badge-hero{min-width:95px;margin:7px 0 14px;padding:8px 10px}.points-badge-hero strong{font-size:26px;line-height:32px}.points-badge-hero .point-token{width:23px;height:23px}.ranking-line{grid-template-columns:40px 48px minmax(0,1fr) 40px minmax(95px,max-content);gap:7px;padding:10px 12px}.ranking-number .rank-medal{width:38px;height:45px}.ranking-line>strong{min-width:0}.podium-block .rank-medal{width:58px;height:68px}.place-1 .podium-block .rank-medal{width:70px;height:82px}}

/* Personal score stands alone; the partner joins the student's name. */
.modal-identity{display:flex;align-items:center;gap:14px;min-width:0}.modal-identity .sprite-stage{width:60px;height:60px}.modal-identity .sprite-stage:after{width:38px;height:6px;bottom:0}.modal-identity h2{margin:0}
.profile-score-display{display:flex;justify-content:center;padding:4px 0 24px}
.profile-score-display .points-badge{min-width:250px;padding:14px 32px;gap:14px;border-radius:24px;background:linear-gradient(135deg,#f6f9e8,#e4efcf);border:1px solid #cbdcb2;box-shadow:inset 0 2px 0 #ffffff,0 5px 0 #b3c49b25;color:#234d38}
.profile-score-display .points-badge strong{font-size:72px;line-height:82px;letter-spacing:-2px}
.profile-score-display .points-badge small{font-size:22px;align-self:flex-end;padding-bottom:13px}
.profile-score-display .point-token{width:46px;height:46px;background:linear-gradient(140deg,#f2df9c,#d9bc62);border:2px solid #c1a451;color:#92702c;box-shadow:inset 0 0 0 3px #fff2c46b,0 2px 3px #84621d15}
.profile-score-display .point-token svg{width:28px;height:28px}
@media(max-width:650px){.modal-identity{gap:10px}.modal-identity .sprite-stage{width:48px;height:54px}.modal-identity h2{font-size:25px}.profile-score-display .points-badge{min-width:220px;padding:12px 26px}.profile-score-display .points-badge strong{font-size:64px;line-height:74px}.profile-score-display .points-badge small{font-size:20px}.profile-score-display .point-token{width:40px;height:40px}}

/* Strong section headings; custom actions live in their header row. */
.scoring-section-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px;min-height:48px}
.scoring-section-header h3{margin:0;font-size:28px;line-height:36px;font-weight:800;letter-spacing:1px;color:#165d40;gap:12px}
.scoring-minus .scoring-section-header h3{color:#a72e35}
.scoring-section-header h3>span{width:36px;height:36px;font-size:28px;background:#cce7d6;color:#165d40;border-radius:10px}
.scoring-minus .scoring-section-header h3>span{background:#f0cfd2;color:#a72e35}
.scoring-section-header .custom-action{display:flex;align-items:center;gap:8px;flex-shrink:0;min-height:48px;padding:10px 18px;border:1px solid var(--action-border);border-radius:10px;background:#fff;color:var(--action-color);font-size:18px;line-height:26px;font-weight:600}
.scoring-section-header .custom-action:hover{background:var(--action-fill);border-color:var(--action-border)}
.scoring-section-header .custom-action[aria-expanded=true]{background:var(--action-fill);border-color:var(--action-border);box-shadow:none}
.score-actions:empty{display:none}.scoring-section:has(.score-actions:empty) .scoring-section-header{margin-bottom:0}

.profile-score-display{flex-direction:column;align-items:center;gap:12px;padding-top:0}
.profile-score-display>.sprite-stage{width:156px;height:150px}
.profile-score-display>.sprite-stage:after{width:76px;height:9px;bottom:0}

/* Large touch targets for changing score amounts without a keyboard. */
.score-amount-field{display:flex;flex-direction:column;gap:8px;min-width:0}
.score-stepper{display:grid;grid-template-columns:50px minmax(0,1fr) 50px;align-items:stretch;width:168px;height:56px;border:1px solid var(--action-border,var(--line));border-radius:12px;background:white;overflow:hidden}
.score-stepper>button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:54px;padding:0;border:0;border-radius:0;color:var(--action-color,var(--green));background:var(--action-fill,#e8eee8);touch-action:manipulation}
.score-stepper>button:active{background:var(--action-hover,#cee5d8)}
.score-stepper>button:focus-visible{outline-offset:-3px}
.score-stepper svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.score-stepper input.score-amount,#rule-form .score-stepper input.score-amount{width:100%;height:54px;min-height:0;padding:0;border:0;border-radius:0;text-align:center;background:white;font-size:24px;line-height:54px;font-weight:700}
#rule-form .score-amount-field{gap:10px}
@media(min-width:801px) and (max-width:1200px),(max-width:520px){.section-score-form{grid-template-columns:168px 1fr}.section-score-form>label{grid-column:1/-1}}
@media(max-width:520px){#rule-form{grid-template-columns:168px 1fr}#rule-form .score-direction{grid-column:1/-1}#rule-form>button{grid-column:2}}

.partner-collection{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.partner-collection h3{font-size:22px;margin:0 0 14px}
.partner-collection-grid{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 10px}
.collected-partner{display:flex;flex-direction:column;align-items:center;flex:0 0 120px;gap:4px;padding:12px;background:#fff;border:1px solid var(--line);border-radius:16px;font-size:16px;color:var(--muted)}
.collected-partner .sprite-stage{width:90px;height:84px}

/* Keep the picker actions visible while only the catalogue scrolls. */
dialog[data-kind="student"]{height:min(820px,90vh);height:min(820px,90dvh);overflow:hidden}
dialog[data-kind="student"] #modal-content{height:100%;display:flex;flex-direction:column}
dialog[data-kind="student"] .modal-header{flex:none}
dialog[data-kind="student"] .modal-body{flex:1;min-height:0;display:flex;overflow:hidden}
#student-form{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;min-width:0}
#student-form> :not(.dex-grid){flex-shrink:0}
#student-form .dex-grid{flex:1;min-height:0;max-height:none;align-content:start}
#student-form .modal-footer{margin-top:0;padding-top:16px;border-top:1px solid var(--line);background:#f8faf7}
#student-form .modal-footer button{min-width:150px;min-height:56px}
@media(max-height:650px){dialog[data-kind="student"] .modal-header{padding:12px 20px}dialog[data-kind="student"] .modal-body{padding:12px 20px}#student-form{gap:10px}#student-form .modal-footer{padding-top:10px}}
