/* Targeted refinements after the shared system; keep Sentinela and all themes. */
html body.tg-ui #study-clock{position:fixed;inset:auto auto max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));width:214px;max-width:calc(100vw - 16px);padding:7px 9px;gap:4px;display:grid;grid-template-columns:1fr auto;align-items:center;border-radius:12px;background:var(--op-surface,#132235);border:1px solid var(--op-border,#354958);box-shadow:0 5px 18px #0003;z-index:35;box-sizing:border-box}
html body.tg-ui #study-clock .clock-handle{grid-column:1;grid-row:1;font-size:10px!important;justify-self:start;cursor:grab;touch-action:none;color:var(--op-muted);background:transparent}
html body.tg-ui #study-clock button{min-height:28px!important;min-width:28px;padding:4px 6px!important;line-height:1.2!important;font-size:11px!important;border-radius:6px}
html body.tg-ui #study-clock #timer-display{font:600 23px/1.2 var(--tg-font-title)!important;letter-spacing:.04em;grid-column:1;grid-row:2;padding:0;margin:0;font-variant-numeric:tabular-nums}
html body.tg-ui #study-clock #timer-toggle{grid-row:2;grid-column:2}
html body.tg-ui #study-clock #clock-expand{grid-row:1;grid-column:2;justify-self:end;background:transparent;color:var(--op-text)}
html body.tg-ui #study-clock :is(.timer-tabs,#timer-reset,#clock-home,.timer-help){display:none}
html body.tg-ui #study-clock[data-expanded=true] .timer-tabs{display:flex;grid-column:1/-1;gap:4px;padding-top:6px}
html body.tg-ui #study-clock[data-expanded=true] :is(#timer-reset,#clock-home){display:block}
html body.tg-ui #study-clock[data-expanded=true] .timer-help{display:block;grid-column:1/-1;font-size:10px!important;line-height:1.45!important;margin:4px 0}
html body.tg-ui #study-clock[data-save-error=true] .timer-help{display:block;grid-column:1/-1;font-size:11px!important}
html body.tg-ui .profile .avatar{width:64px;height:64px;min-width:64px;flex:0 0 64px;display:grid;place-items:center;padding:0;overflow:hidden;border-radius:50%;text-decoration:none;font:600 28px var(--tg-font-title);position:relative;border:2px solid var(--op-accent)}
html body.tg-ui .profile .avatar img,html body.tg-ui .profile-photo>img{width:100%;height:100%;object-fit:cover;object-position:50% 50%;border-radius:50%;display:block}
html body.tg-ui .profile-photo>img{width:100px;height:100px;flex:none}
html body.tg-ui .profile .avatar:hover{box-shadow:0 0 0 4px color-mix(in srgb,var(--op-accent) 22%,transparent)}
html body.tg-ui .preparation-choices{grid-template-columns:repeat(2,minmax(0,260px));gap:12px;margin:24px 0;max-width:532px}
html body.tg-ui .preparation-choices .select{min-height:0;padding:16px 40px 16px 16px;border-radius:12px;border-width:1px}
html body.tg-ui .preparation-choices .select strong{font:600 18px/1.3 var(--tg-font-title)!important;margin:0 0 6px}
html body.tg-ui .preparation-choices .select p{font-size:12px!important;line-height:1.5!important;margin:0}
html body.tg-ui .preparation-choices .select input{right:13px;top:17px;width:18px;height:18px}
html body.tg-ui #rank-promotion{position:fixed!important;inset:0!important;margin:auto!important;box-sizing:border-box;width:min(560px,calc(100vw - 24px))!important;height:fit-content!important;max-width:none!important;max-height:calc(100dvh - 24px)!important;padding:24px!important;overflow:auto!important;text-align:center;border-radius:22px;background:radial-gradient(ellipse at 50% 20%,color-mix(in srgb,var(--op-accent) 13%,var(--op-surface)),var(--op-surface) 75%);color:var(--op-text)}
html body.tg-ui #rank-promotion::backdrop{background:#020812cf;backdrop-filter:blur(7px)}
html body.tg-ui #rank-promotion .promotion-close{position:absolute;inset:10px 10px auto auto;width:36px;height:36px;min-height:36px!important;padding:0!important;z-index:3}
html body.tg-ui #rank-promotion .promotion-scene{height:clamp(150px,31dvh,230px);min-height:0;margin:0 0 12px;isolation:isolate;overflow:hidden;display:grid;place-items:center}
html body.tg-ui #rank-promotion .promotion-crest{display:grid;place-items:center;width:100%;height:100%;z-index:2}
html body.tg-ui #rank-promotion .promotion-crest svg{width:auto!important;height:clamp(130px,27dvh,205px)!important;max-width:90%;max-height:100%;display:block}
html body.tg-ui #rank-promotion .ring-one{width:170px;height:170px}
html body.tg-ui #rank-promotion .ring-two{width:220px;height:220px}
html body.tg-ui #rank-promotion #promotion-title{font-size:clamp(26px,5vw,38px)!important;line-height:1.2!important;margin:10px 0!important;overflow-wrap:anywhere}
html body.tg-ui #rank-promotion .promotion-overline{font:600 12px/1.5 var(--tg-font-title)!important;letter-spacing:.13em;color:var(--op-accent)}
html body.tg-ui #rank-promotion :is(#promotion-from,#promotion-phrase,#promotion-message){font-size:14px!important;line-height:1.5!important;margin:10px auto!important;max-width:430px;overflow-wrap:anywhere}
html body.tg-ui #rank-promotion .promotion-continue{width:100%;min-width:0;white-space:normal;margin-top:12px!important}
html body.tg-ui #photo-editor{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(450px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:24px;overflow:auto;border:1px solid var(--op-border);border-radius:18px;background:var(--op-surface);color:var(--op-text)}
#photo-editor::backdrop{background:#020812cf;backdrop-filter:blur(6px)}
#photo-editor .photo-close-form{position:absolute;right:8px;top:8px}
html body.tg-ui #photo-editor h2{font-size:22px!important;padding-right:28px}
html body.tg-ui #photo-editor p{font-size:13px!important;line-height:1.5!important}
.photo-crop-frame{width:min(250px,100%);margin:18px auto;aspect-ratio:1;border-radius:50%;overflow:hidden;border:2px solid var(--op-accent);background:#07101b}
#photo-crop{width:100%;height:100%;display:block;touch-action:none;cursor:move}
.photo-adjustments{display:grid;gap:8px}.photo-adjustments label{display:grid;grid-template-columns:80px 1fr;align-items:center;font-size:12px}.photo-adjustments input{width:100%;padding:0;min-height:24px;accent-color:var(--op-accent)}
.photo-actions{display:flex;justify-content:space-between;gap:8px}html body.tg-ui .photo-actions button{font-size:13px!important;min-height:40px!important;padding:10px!important}
html body.tg-ui #welcome-opening{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;padding:20px;margin:0;overflow:hidden;background:#030912;color:#f2f7fa;z-index:1000}
#welcome-opening::backdrop{background:#030912}
.opening-copy{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px;z-index:2}
.opening-copy img{width:clamp(190px,28vw,330px);height:auto;max-height:130px;object-fit:contain;filter:drop-shadow(0 0 22px #a3cce12b)}
html body.tg-ui #welcome-opening h1{font:600 clamp(28px,4.7vw,60px)/1.18 var(--tg-font-title)!important;color:#edf5fc!important;max-width:900px;margin:16px 0}
html body.tg-ui #welcome-opening p{font:500 12px var(--tg-font-title)!important;letter-spacing:.25em;color:#9bbacf!important;margin:28px 0 0}
.opening-copy>span{color:#9bafbd;font-size:14px;letter-spacing:.05em}
.opening-grid{position:absolute;inset:-40%;background:linear-gradient(#a4cad30b 1px,transparent 1px),linear-gradient(90deg,#a4cad30b 1px,transparent 1px);background-size:64px 64px;transform:perspective(500px) rotateX(60deg);opacity:.6}
.opening-halo{position:absolute;width:min(85vw,750px);aspect-ratio:1;border:1px solid #99b8c433;border-radius:50%;left:50%;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 130px #63818b18,inset 0 0 130px #63818b18;animation:opening-arrive 4.6s ease-out both}
.opening-copy{animation:opening-copy 1.2s ease-out both}.opening-progress{height:2px;width:min(250px,60vw);background:#89b4ce;margin-top:35px;transform-origin:left;animation:opening-track 4.6s linear both}
#welcome-opening [data-opening-form]{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));right:24px;z-index:3}html body.tg-ui #welcome-opening button{color:#dbeaf0!important;background:#16232e!important;border:1px solid #6e8a9a!important}
@keyframes opening-arrive{from{transform:translate(-50%,-50%) scale(.65);opacity:0}to{transform:translate(-50%,-50%) scale(1);opacity:1}}
@keyframes opening-copy{from{transform:translateY(18px);opacity:0}to{transform:none;opacity:1}}
@keyframes opening-track{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(max-width:520px){html body.tg-ui .preparation-choices{grid-template-columns:1fr}html body.tg-ui #rank-promotion{padding:20px 16px!important}html body.tg-ui #study-clock{width:198px}html body.tg-ui #study-clock #timer-display{font-size:21px!important}}
@media(prefers-reduced-motion:reduce){#welcome-opening *,#rank-promotion *{animation:none!important;transition:none!important}}
html body.effects-paused #welcome-opening *,html body.effects-paused #rank-promotion *{animation:none!important;transition:none!important}

html{background:var(--op-bg,var(--tg-bg,#07111c));scrollbar-gutter:stable}

html body.tg-ui #study-clock :is(.clock-handle,#clock-expand,#clock-home){background:transparent!important;color:var(--op-muted)!important;box-shadow:none!important}
