/* Un unico linguaggio visivo per archivio e controllo: profondità, orbite e luce tenue. */
body[data-story="hub"],body.admin-surface{
  --bg:#050712;--panel:#0c1220;--line:#28344b;--accent:#bcb0ff;--muted:#a3adc1;
  background-color:#050712;
  background-image:
    radial-gradient(ellipse 70% 48% at 77% 8%,#2532646b,transparent 70%),
    radial-gradient(ellipse 58% 40% at 19% 78%,#102e5050,transparent 75%),
    radial-gradient(circle at 12% 16%,#d8e7ff91 0 1px,transparent 1.5px),
    radial-gradient(circle at 71% 43%,#c9bcff82 0 1px,transparent 1.5px),
    radial-gradient(circle at 32% 81%,#83e4f382 0 1px,transparent 1.5px);
  background-size:100% 100%,100% 100%,279px 261px,397px 317px,487px 419px;
  background-attachment:fixed;
}
@media(prefers-reduced-motion:no-preference){
  body[data-story="hub"],body.admin-surface{animation:nova-star-drift 55s linear infinite alternate}
  @keyframes nova-star-drift{
    from{background-position:0 0,0 0,0 0,0 0,0 0}
    to{background-position:0 0,0 0,105px -75px,-78px 98px,64px 118px}
  }
}
body[data-story="hub"]::before,body.admin-surface::before{
  content:"";position:fixed;inset:-35px;z-index:0;pointer-events:none;opacity:.8;
  background-image:radial-gradient(circle,#d9e8ff 0 1.5px,transparent 2.2px),radial-gradient(circle,#9ddbe9 0 1.2px,transparent 2px),radial-gradient(circle,#c7b7fb 0 1px,transparent 1.8px);
  background-size:271px 229px,389px 307px,503px 409px;
  background-position:16px 12px,130px 83px,75px 157px;
  animation:nova-stars-near 10s ease-in-out infinite alternate;
}
body[data-story="hub"]::after,body.admin-surface::after{
  content:"";position:fixed;inset:-45px;z-index:0;pointer-events:none;opacity:.5;
  background-image:radial-gradient(circle,#e4d9ff 0 1px,transparent 1.8px),radial-gradient(circle,#85c9e6 0 1.1px,transparent 1.9px);
  background-size:337px 283px,433px 353px;
  background-position:70px 31px,198px 135px;
  animation:nova-stars-far 14s ease-in-out infinite alternate;
}
@keyframes nova-stars-near{from{transform:translate3d(-20px,13px,0);opacity:.55}to{transform:translate3d(34px,-27px,0);opacity:.9}}
@keyframes nova-stars-far{from{transform:translate3d(23px,-14px,0);opacity:.42}to{transform:translate3d(-28px,31px,0);opacity:.72}}
body[data-story="hub"] .shell,body.admin-surface .admin-header,body.admin-surface .admin-main{position:relative;z-index:1}
body[data-story="hub"] .sidebar{z-index:2}
@media(prefers-reduced-motion:reduce){body[data-story="hub"]::before,body[data-story="hub"]::after,body.admin-surface::before,body.admin-surface::after{animation:none;transform:none}}
body[data-story="hub"] .sidebar{
  background:linear-gradient(160deg,#090c1af7,#080e1cfb 58%,#060913fc);
  border-color:#29334b;box-shadow:18px 0 65px #02051280;
}
.brand-icon{display:block;flex:none;width:48px;height:48px;object-fit:contain;background:transparent;border:0;border-radius:0;clip-path:none;box-shadow:none;filter:drop-shadow(0 0 10px #a592ff58)}
.brand{gap:11px;color:#eff0ff;text-shadow:0 0 24px #9d88ea24}
.brand-sub{color:#aaaec7}
body[data-story="hub"] .nav-item.active{background:linear-gradient(90deg,#bcaaff21,#6acced0a);border:1px solid #bcaaff55;border-left:2px solid #bcaaff;color:#eeeaff}
body[data-story="hub"] .topbar{background:#090e1bcc;border-color:#28344b;backdrop-filter:blur(18px)}
body[data-story="hub"] .sidebar-case{background:radial-gradient(circle at 50% 40%,#67529b2e,transparent 70%),linear-gradient(145deg,#13182a,#0a0e1a);border-color:#353750;box-shadow:inset 0 1px #d0bfff17}
.mini-lighthouse img{width:94px;height:94px;display:block;margin:auto;filter:drop-shadow(0 0 17px #9c8cee66)}
.mini-lighthouse{line-height:1;margin:13px 0 20px}
.mini-lighthouse:after{width:116px;height:116px;border-color:#bba5ff26;box-shadow:0 0 0 13px #bba5ff08}
body[data-story="hub"] .hub-intro{
  position:relative;overflow:hidden;min-height:240px;margin:0 0 23px;padding:34px 48px;
  border:1px solid #3b4266;border-radius:18px;
  background:radial-gradient(ellipse at 70% 42%,#5a478149,transparent 54%),linear-gradient(115deg,#12182b,#090e1d 62%,#111a31);
  box-shadow:inset 0 1px #c2b5ff24,0 24px 80px #01030d70;
}
body[data-story="hub"] .hub-intro:before{content:"";position:absolute;inset:-270px -180px -260px 43%;pointer-events:none;border:1px solid #b9a8f41a;border-radius:50%;box-shadow:0 0 0 65px #87a8ff08,0 0 0 136px #a7adff06,0 0 0 225px #8cb6fb04;transform:rotate(-22deg)}
body[data-story="hub"] .hub-intro:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 0 56%,#bfcaff08 57%,transparent 58%),repeating-linear-gradient(0deg,transparent 0 6px,#9bacf003 7px);mask-image:linear-gradient(90deg,transparent 40%,#000 100%)}
body[data-story="hub"] .hub-intro>div:first-child,body[data-story="hub"] .hub-seal{position:relative;z-index:1}
body[data-story="hub"] .hub-intro h1{font-size:clamp(42px,4.2vw,66px);font-weight:560;line-height:1.05;letter-spacing:-2px;margin:14px 0}
body[data-story="hub"] .hub-intro h1 em{color:#d6c5ff;text-shadow:0 0 34px #aa8cfa5c}
body[data-story="hub"] .hub-intro p{color:#c1c6dc;max-width:590px}
.hub-seal{width:176px;height:176px;margin:0 26px 0 0;filter:drop-shadow(0 0 34px #af9fff38)}
.hub-seal img{display:block;width:121px;height:121px;object-fit:contain;margin-top:2px;filter:drop-shadow(0 0 16px #9d9dff6b)}
.hub-seal small{margin-top:0;color:#bcc8eb;font-size:8px;letter-spacing:2.5px}
.seal-ring{border-color:#bcaeff4d;box-shadow:0 0 0 19px #bcaeff08,0 0 0 39px #77a5e307,0 0 80px #8c7cb341}
.seal-ring:before{border-color:#a5c7ec29}.seal-ring:after{border-color:#bcaeff20}
body[data-story="hub"] .portal{background:linear-gradient(155deg,#171c2b,#090d18 78%);border-color:#313a50;box-shadow:inset 0 1px #ffffff0b}
body[data-story="hub"] .portal-grid{grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:1400px;margin-inline:auto}
body[data-story="hub"] .portal-grid-secret .portal[data-story="quarta-parete"]{box-shadow:0 0 58px #4de4d340}
body[data-story="hub"] .portal-grid-secret.secret-appearing .portal[data-story="quarta-parete"]{animation:nova-secret-reveal .9s cubic-bezier(.16,.85,.15,1) .25s both}
@keyframes nova-secret-reveal{0%{opacity:0;filter:blur(15px) brightness(2);transform:scale(.45) rotate(-6deg)}50%{opacity:.9;filter:blur(3px) brightness(1.7)}100%{opacity:1;filter:blur(0) brightness(1);transform:scale(1) rotate(0)}}
body[data-story="hub"] .portal,body[data-story="hub"] .portal-secret{border:1px solid #394255}
body[data-story="hub"] .portal:hover,body[data-story="hub"] .portal:focus-visible{border-color:#738095}
body[data-story="hub"] .portal-image{inset:-1px;width:calc(100% + 2px);height:calc(100% + 2px)}
body[data-story="hub"] .portal-art:after{inset:-1px}
body[data-story="hub"] .portal:hover,body[data-story="hub"] .portal:focus-visible{box-shadow:0 23px 65px #010410d9,0 0 42px color-mix(in srgb,var(--door) 15%,transparent)}
body[data-story="hub"] .portal-image{opacity:.73;filter:saturate(.8)}
body[data-story="hub"] .portal-art:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#02050c28,transparent 37%,#070b18c2);}
body[data-story="hub"] .team-welcome,body[data-story="hub"] .credit-wallet,body[data-story="hub"] .time-panel{background:linear-gradient(115deg,#161a31df,#0d1929e8);border-color:#3a4664;box-shadow:inset 0 1px #bdacff17}
body.admin-surface .admin-header{max-width:none;background:#080d1bea;border-color:#2c3752;box-shadow:0 10px 45px #02030c7a;backdrop-filter:blur(16px)}
body.admin-surface .admin-main{max-width:1460px}
body.admin-surface .admin-access{background:radial-gradient(circle at 82% 7%,#6b529633,transparent 45%),linear-gradient(140deg,#141a2d,#0a1020);border-color:#4b4875;box-shadow:0 28px 100px #01030bc4,inset 0 1px #ddd0ff1d}
body.admin-surface .admin-heading h1,body.admin-surface .editor-heading h1{color:#f1edff;text-shadow:0 0 30px #aa9aff2c}
body.admin-surface .admin-tabs{border-bottom:1px solid #32405b;margin-bottom:24px}
body.admin-surface .admin-tabs button{background:#0d1424;border-color:#394761;color:#c9cbe1}
body.admin-surface .admin-tabs button.selected{background:linear-gradient(120deg,#332a55,#162d46);border-color:#a99af6;color:#faf7ff;box-shadow:0 0 24px #a99af61d}
body.admin-surface .editor-block,body.admin-surface .story-select,body.admin-surface .admin-controls,body.admin-surface .stat,body.admin-surface .table-wrap{background:linear-gradient(145deg,#141b2cfa,#0b1120f8);border-color:#35435d;box-shadow:inset 0 1px #b8c5fc10}
body.admin-surface .story-select.selected{background:linear-gradient(125deg,#34284d,#12273e);border-color:#b6a2fa}
body.admin-surface .admin-controls{border-color:#52628b}
body.admin-surface .story-monitor-grid>div{background:#0b1526;border-color:#354963}
body.admin-surface .primary{color:#110f24;background:#bcaeff;border-color:#bcaeff}
body.admin-surface .primary:hover{background:#d8ceff}
body.admin-surface .secondary{background:#17233a;border-color:#3d4c67}
body.admin-surface .secondary:hover{border-color:#a7a1de}
body.admin-surface input,body.admin-surface select,body.admin-surface textarea{background:#0a1222;border-color:#3d4c68;color:#eef1ff}
body.admin-surface input:focus,body.admin-surface select:focus,body.admin-surface textarea:focus{border-color:#baa8ff;outline:1px solid #baa8ff77}
body.admin-surface table{background:#0e1524}
body.admin-surface th{background:#151f33;color:#bdc8dd}
body.admin-surface tbody tr:hover{background:#b4a6ff0a}
body.admin-surface dialog{background:#101725;border-color:#53617c}
#timer-preview:not([hidden]){position:fixed;right:24px;bottom:24px;z-index:30;padding:12px 16px;border:1px solid #b89ff3;border-radius:9px;background:#201936ee;color:#f3eaff;box-shadow:0 8px 28px #0009,0 0 20px #ad8ff42b;backdrop-filter:blur(10px)}
#timer-preview:not([hidden]):hover{background:#35254d;box-shadow:0 10px 33px #000b,0 0 30px #ad8ff46b}
#glitch-preview:not([hidden]){position:fixed;right:24px;bottom:76px;z-index:30;padding:12px 16px;border:0;border-radius:9px;background:#113639ee;color:#ddfff8;box-shadow:0 8px 28px #0009,0 0 20px #76efdf2b;backdrop-filter:blur(10px)}
#glitch-preview:not([hidden]):hover{background:#1b4b50;box-shadow:0 10px 33px #000b,0 0 30px #76efdf6b}
.retry-countdown{color:#ffb2bb;font:700 12px var(--mono);min-height:1em;margin:5px 0 0}
@media(max-width:700px){#timer-preview:not([hidden]){right:10px;bottom:10px;max-width:calc(100vw - 20px);font-size:12px}}
@media(max-width:700px){#glitch-preview:not([hidden]){right:10px;bottom:65px;max-width:calc(100vw - 20px);font-size:12px}}
body.admin-surface .stat,body.admin-surface .editor-block,body.admin-surface .story-select,body[data-story="hub"] .portal{transition:transform .24s ease,border-color .24s ease,box-shadow .24s ease}
body.admin-surface .stat:hover,body.admin-surface .editor-block:hover,body.admin-surface .story-select:hover{transform:translateY(-3px);border-color:#766a9f;box-shadow:0 14px 36px #0206117a,inset 0 1px #d8cbff1b}
body.admin-surface button,body[data-story] .primary,body[data-story] .secondary,body[data-story] .nav-item{transition:transform .2s ease,background .2s ease,border-color .2s ease,box-shadow .2s ease}
body.admin-surface button:hover:not(:disabled),body[data-story] .primary:hover:not(:disabled),body[data-story] .secondary:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 8px 22px #0005}
body[data-story="hub"] .portal:hover{transform:translateY(-6px)}
/* Once a team enters a story, its own visual world replaces the archive palette. */
body[data-story]:not([data-story="hub"]) .sidebar{background:linear-gradient(165deg,color-mix(in srgb,var(--accent) 12%,#080b16),#080b16 58%);border-right-color:color-mix(in srgb,var(--accent) 32%,#293044)}
body[data-story]:not([data-story="hub"]) .sidebar-case{background:radial-gradient(circle at 50% 30%,color-mix(in srgb,var(--accent) 22%,transparent),transparent 64%),#0d111e;border-color:color-mix(in srgb,var(--accent) 34%,#343b50)}
body[data-story]:not([data-story="hub"]) .topbar{background:color-mix(in srgb,var(--accent) 7%,#090d17);border-bottom-color:color-mix(in srgb,var(--accent) 24%,#293044)}
body[data-story]:not([data-story="hub"]) .story-heading{isolation:isolate;box-shadow:0 22px 75px color-mix(in srgb,var(--accent) 13%,transparent),inset 0 1px color-mix(in srgb,var(--accent) 28%,transparent);animation:nova-world-enter .7s ease-out both}
body[data-story]:not([data-story="hub"]) .story-heading:after{content:"";position:absolute;inset:-120% -35%;pointer-events:none;z-index:0;background:linear-gradient(105deg,transparent 42%,color-mix(in srgb,var(--accent) 13%,transparent) 50%,transparent 58%);animation:nova-world-light 13s ease-in-out infinite}
body[data-story]:not([data-story="hub"]) .story-scene{animation:nova-scene-breathe 15s ease-in-out infinite alternate}
body[data-story]:not([data-story="hub"]) .card{transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease;animation:nova-world-enter .6s ease-out both}
body[data-story]:not([data-story="hub"]) .card:nth-child(2n){animation-delay:.08s}
body[data-story]:not([data-story="hub"]) .card:nth-child(3n){animation-delay:.16s}
body[data-story]:not([data-story="hub"]) .card:hover{transform:translateY(-5px);border-color:color-mix(in srgb,var(--accent) 58%,#31394b);box-shadow:0 18px 45px #0007,0 0 28px color-mix(in srgb,var(--accent) 10%,transparent)}
body[data-story="detective"] .story-heading{border-radius:3px;background-image:repeating-linear-gradient(0deg,transparent 0 37px,#e7c2870b 38px),radial-gradient(circle at 85% 30%,#96704439,transparent 62%)}
body[data-story="detective"] .story-heading h1{letter-spacing:.025em;text-shadow:1px 2px #0b0908}
body[data-story="horror"] .story-heading{background-image:radial-gradient(ellipse at 70% 35%,#6a243d55,transparent 65%),linear-gradient(130deg,#1b101d,#100b16)}
body[data-story="horror"] .story-heading:after{animation-duration:19s;opacity:.55}
body[data-story="scifi"] .story-heading{background-image:linear-gradient(#7cd9f00a 1px,transparent 1px),linear-gradient(90deg,#7cd9f00a 1px,transparent 1px),radial-gradient(circle at 80% 38%,#1b608052,transparent 60%);background-size:36px 36px,36px 36px,100% 100%}
body[data-story="scifi"] .story-heading h1{font-family:var(--mono);letter-spacing:-.04em}
body[data-story="faro"] .story-heading{background-image:radial-gradient(circle at 84% 30%,#8de6b84a,transparent 30%),linear-gradient(130deg,#132c31,#0a1c29)}
body[data-story="darkness"] .story-heading{background-image:radial-gradient(circle at 80% 32%,#74439970,transparent 42%),linear-gradient(120deg,#140f21,#080913)}
body[data-story="convergence"] .story-heading{background-image:radial-gradient(circle at 78% 30%,#99763955,transparent 50%),linear-gradient(120deg,#1d1a19,#111926)}
body[data-story="secret"] .story-heading{background-image:repeating-linear-gradient(100deg,transparent 0 48px,#e0ccff07 49px),radial-gradient(circle at 80% 40%,#68418c69,transparent 56%)}
@keyframes nova-world-enter{from{opacity:0;transform:translateY(15px)}to{opacity:1;transform:translateY(0)}}
@keyframes nova-world-light{0%,65%{transform:translateX(-70%) rotate(-10deg)}100%{transform:translateX(85%) rotate(-10deg)}}
@keyframes nova-scene-breathe{from{transform:scale(1);opacity:.38}to{transform:scale(1.045);opacity:.58}}
@media(prefers-reduced-motion:reduce){body[data-story]:not([data-story="hub"]) .story-heading,body[data-story]:not([data-story="hub"]) .story-heading:after,body[data-story]:not([data-story="hub"]) .story-scene,body[data-story]:not([data-story="hub"]) .card{animation:none}body[data-story]:not([data-story="hub"]) .card:hover,body[data-story="hub"] .portal:hover,body.admin-surface button:hover:not(:disabled),body.admin-surface .stat:hover,body.admin-surface .editor-block:hover,body.admin-surface .story-select:hover{transform:none}}
@media(max-width:700px){
  .brand-icon{width:39px;height:39px}
  body[data-story="hub"] .hub-intro{min-height:0;padding:26px 22px;border-radius:13px}
  body[data-story="hub"] .hub-intro h1{font-size:clamp(37px,10vw,49px)}
  .hub-seal{display:none}
  body.admin-surface .admin-header{padding:16px}
  body.admin-surface .admin-main{padding:20px 16px}
}
@media(min-width:1101px){
 body[data-story="hub"] main{padding-top:30px;padding-bottom:72px}
 body[data-story="hub"] .credit-wallet{padding:15px 21px;margin-bottom:26px}
 body[data-story="hub"] .hub-intro{min-height:240px;padding:32px 44px;margin-bottom:25px}
 body[data-story="hub"] .hub-intro h1{font-size:56px;line-height:1.05;margin:14px 0}
 body[data-story="hub"] .hub-intro p{display:block;font-size:14px;line-height:1.6;margin:7px 0}
 body[data-story="hub"] .hub-seal{width:176px;height:176px;margin:0 24px 0 0}
 body[data-story="hub"] .hub-seal img{width:121px;height:121px}
 body[data-story="hub"] .hub-seal small{font-size:8px;letter-spacing:2px}
 body[data-story="hub"] .portal-instruction{margin:15px 0 20px}
 body[data-story="hub"] .team-welcome{padding:20px 25px;margin:0 0 20px}
 body[data-story="hub"] .team-welcome h2{font-size:25px;margin:7px 0}
 body[data-story="hub"] .team-welcome strong{font-size:34px}
 body[data-story="hub"] .team-welcome p{font-size:12px}
 body[data-story="hub"] .time-panel{padding:18px 25px;margin:0 0 30px}
 body[data-story="hub"] .time-panel strong{font-size:25px}
 body[data-story="hub"] .time-panel p{display:block}
 body[data-story="hub"] .portal-grid{gap:30px 30px}
 body[data-story="hub"] .portal{height:330px}
 body[data-story="hub"] .portal-number{position:absolute;inset:0 0 auto;z-index:3;padding:12px 15px 8px;font-size:12px;background:linear-gradient(#07101ac9,transparent)}
 body[data-story="hub"] .portal-number>span{font-size:9px}
 body[data-story="hub"] .portal-art{position:absolute;top:39px;left:12px;width:210px;height:278px;flex:none;margin-top:0;border-radius:9px}
 body[data-story="hub"] .portal-world,body[data-story="hub"] .door-frame,body[data-story="hub"] .portal-floor{display:none}
 body[data-story="hub"] .portal-copy{margin-left:235px;padding:46px 17px 8px}
 body[data-story="hub"] .portal-tag{display:block;font-size:9px;line-height:1.4;min-height:0;margin-bottom:11px}
 body[data-story="hub"] .portal-meta{display:none}
 body[data-story="hub"] .portal-description{display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;min-height:0;margin:14px 0 0;font-size:12px;line-height:1.55}
 body[data-story="hub"] .portal-copy>strong{font-size:26px;line-height:1.12;min-height:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
 body[data-story="hub"] .portal-progress{padding:12px 0;margin-top:auto;font-size:10px;line-height:1.3;flex-direction:column;align-items:flex-start;gap:7px}
 body[data-story="hub"] .team-link-panel{margin-top:35px}
 body[data-story="hub"] .hub-bottom{margin-top:25px}
}
@media(min-width:1101px) and (max-width:1700px){
 body[data-story="hub"] .portal-grid{max-width:1080px}
 body[data-story="hub"] .portal-art{width:155px}
 body[data-story="hub"] .portal-copy{margin-left:170px;padding-left:12px;padding-right:10px}
 body[data-story="hub"] .portal-copy>strong{font-size:22px}
 body[data-story="hub"] .portal-description{font-size:11px}
}
@media(min-width:1101px) and (max-width:1250px){
 body[data-story="hub"] .portal-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:850px}
 body[data-story="hub"] .portal-art{width:185px}
 body[data-story="hub"] .portal-copy{margin-left:200px}
}
@media(min-width:601px) and (max-width:1100px){
 body[data-story="hub"] .portal-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:620px}
 body[data-story="hub"] .hub-seal{display:none}
 body[data-story="hub"] .hub-intro{min-height:0;padding:21px 25px;margin-bottom:15px}
 body[data-story="hub"] .hub-intro h1{font-size:42px;margin:9px 0}
 body[data-story="hub"] .portal{height:245px}
 body[data-story="hub"] .portal-art{height:145px;margin-top:0}
 body[data-story="hub"] .portal-copy{padding:7px 12px 0}
 body[data-story="hub"] .portal-copy>strong{font-size:20px;min-height:0}
 body[data-story="hub"] .portal-description,body[data-story="hub"] .portal-meta,body[data-story="hub"] .portal-tag{display:none}
 body[data-story="hub"] .portal-progress{font-size:9px;padding:7px 0}
}
@media(max-width:600px){
 body[data-story="hub"] .portal-grid{grid-template-columns:1fr;max-width:330px}
 body[data-story="hub"] .hub-intro{padding:17px 19px;margin-bottom:12px}
 body[data-story="hub"] .hub-intro h1{font-size:34px;margin:8px 0}
 body[data-story="hub"] .hub-intro p{font-size:11px;line-height:1.45}
 body[data-story="hub"] .credit-wallet{padding:10px 12px;margin-bottom:11px}
 body[data-story="hub"] .credit-wallet strong{font-size:13px}
 body[data-story="hub"] .credit-wallet span{font-size:10px}
 body[data-story="hub"] .team-welcome{padding:12px;margin-bottom:10px}
 body[data-story="hub"] .team-welcome h2{font-size:18px}
 body[data-story="hub"] .team-welcome strong{font-size:23px}
 body[data-story="hub"] .time-panel{padding:10px 12px;margin:10px 0}
 body[data-story="hub"] .time-panel strong{font-size:21px}
 body[data-story="hub"] .portal{height:auto;min-height:0}
 body[data-story="hub"] .portal-number{position:relative;inset:auto;z-index:3;padding:13px 16px 10px;font-size:11px;flex-direction:row;background:none}
 body[data-story="hub"] .portal-number>span{font-size:8px}
 body[data-story="hub"] .portal-art{position:relative;top:auto;left:auto;width:calc(100% - 24px);height:170px;margin:0 12px;border-radius:9px}
 body[data-story="hub"] .portal-world,body[data-story="hub"] .door-frame,body[data-story="hub"] .portal-floor{display:none}
 body[data-story="hub"] .portal-copy{margin-left:0;padding:15px 17px 7px}
 body[data-story="hub"] .portal-tag{display:block;font-size:8px;min-height:0;margin-bottom:8px}
 body[data-story="hub"] .portal-description{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;line-height:1.55;min-height:0;margin:11px 0 15px}
 body[data-story="hub"] .portal-meta{display:none}
 body[data-story="hub"] .portal-copy>strong{font-size:23px;line-height:1.12;min-height:0;display:block}
 body[data-story="hub"] .portal-progress{padding:12px 0;margin-top:auto;font-size:10px;line-height:1.3;flex-direction:row;align-items:center;gap:8px}
 body[data-story="hub"] .hub-bottom{display:none}
 #timer-preview:not([hidden]),#glitch-preview:not([hidden]){position:static;max-width:100%;margin-top:8px;box-shadow:none}
}
@media(min-width:701px) and (max-width:900px){
 .sidebar{position:relative;inset:auto;width:100%;padding:16px 24px;display:block;border-right:0;border-bottom:1px solid #29334b}
 .sidebar .workspace-label,.sidebar .sidebar-case,.sidebar .sidebar-bottom{display:none}
 .sidebar nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:12px}
 .sidebar .nav-item{justify-content:center;align-items:center;min-width:0;padding:9px 5px;font-size:11px}
 .shell{margin-left:0}
 .topbar{height:64px;padding:0 24px}
 main{padding:28px 24px 45px}
 body[data-story="hub"] .portal-grid{max-width:720px;gap:18px}
 body[data-story="hub"] .portal{height:auto}
 body[data-story="hub"] .portal-art{height:170px}
 body[data-story="hub"] .portal-copy{padding:12px 16px 6px}
 body[data-story="hub"] .portal-description{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:0;margin:10px 0 12px;font-size:11px;line-height:1.5}
 body[data-story="hub"] .portal-progress{padding:11px 0;font-size:10px}
 #timer-preview:not([hidden]),#glitch-preview:not([hidden]){position:static;max-width:100%;margin-top:8px;box-shadow:none}
}
@media(prefers-reduced-motion:reduce){body[data-story="hub"] .portal-grid-secret.secret-appearing .portal{animation:none!important}}

/* Superfici senza contorni sottili: evitano frange cromatiche sul display. */
body[data-story] dialog:not(#timer-warning):not(#golden-reward),body.admin-surface dialog{border:0;box-shadow:0 30px 100px #000c}
#difficulty-select .difficulty-option{border:0;background:#202a3a;box-shadow:0 5px 18px #050a1666}
#difficulty-select .difficulty-option:hover:not(:disabled),#difficulty-select .difficulty-option:focus-visible{background:#2a3548}
body[data-story] :is(.hub-intro,.sidebar-case,.portal,.team-welcome,.credit-wallet,.time-panel,.card,.stat,.notice,.rules,.table-wrap){border-width:0}
body.admin-surface :is(.admin-access,.editor-block,.story-select,.admin-controls,.stat,.table-wrap){border-width:0}
body[data-story="hub"] .hub-intro{box-shadow:0 24px 80px #01030d80}
body[data-story="hub"] .portal:not([data-story="quarta-parete"]){box-shadow:0 14px 35px #01041091}

html.entry-pending,body.entry-active{overflow:hidden}
.entry-screen,.entry-screen[hidden]{display:none}
html.entry-pending .entry-screen:not([hidden]){display:grid}
.entry-screen{position:fixed;inset:0;z-index:80;grid-template-rows:1fr auto;place-items:center;min-height:100vh;min-height:100dvh;padding:52px 24px 48px;overflow:hidden;background:radial-gradient(ellipse 45% 40% at 50% 48%,#1d254b 0,#0b1026 54%,#03050f 100%);color:#f3f0ff;text-align:center;isolation:isolate;transition:opacity .85s ease,filter .85s ease,transform .85s ease}
.entry-screen::before{content:"";position:absolute;inset:-6%;z-index:-1;opacity:.55;background-image:radial-gradient(circle,#d7e2ff 0 1px,transparent 1.8px),radial-gradient(circle,#8ecddd 0 1px,transparent 1.8px),radial-gradient(circle,#c6afff 0 1px,transparent 1.8px);background-size:281px 239px,397px 313px,509px 433px;background-position:29px 17px,163px 92px,87px 188px;animation:entry-stars 16s ease-in-out infinite alternate}
.entry-screen::after{content:"";position:absolute;z-index:-1;left:50%;top:48%;width:min(92vw,950px);aspect-ratio:1;transform:translate(-50%,-50%);background:radial-gradient(circle,#8e7ad41f 0,transparent 64%);filter:blur(25px);pointer-events:none}
.entry-content{align-self:center;max-width:1120px}
.entry-kicker{display:block;color:#b9b3dc;font:600 11px var(--mono);letter-spacing:.38em;margin-bottom:32px}
.entry-content h1{font-size:clamp(43px,6.2vw,104px);font-weight:500;letter-spacing:-.055em;line-height:1.08;margin:0;text-wrap:balance;text-shadow:0 8px 45px #0008}
.entry-content h1 em{display:inline-block;margin-top:.08em;font-family:Georgia,serif;font-weight:400;letter-spacing:-.045em;color:#d9c8ff;text-shadow:0 0 55px #aa8cff66}
.entry-content p{font-size:clamp(14px,1.3vw,18px);line-height:1.7;color:#aeb7cf;margin:38px auto 0;max-width:560px}
.entry-continue{align-self:end;display:inline-flex;align-items:center;gap:17px;padding:15px 20px;border:0;border-radius:9px;background:#e0d5ff;color:#151125;font:700 12px var(--mono);letter-spacing:.12em;box-shadow:0 12px 42px #0008;transition:transform .25s ease,background .25s ease,box-shadow .25s ease}
.entry-continue span{font-size:20px;line-height:1}
.entry-continue:hover,.entry-continue:focus-visible{transform:translateY(-4px);background:#f2eaff;box-shadow:0 18px 48px #000a}
.entry-continue:focus-visible{outline:0;box-shadow:0 0 34px #bda5ff70,0 18px 48px #000a}
.entry-screen.is-leaving{opacity:0;filter:blur(14px);transform:scale(1.035);pointer-events:none}
@keyframes entry-stars{from{transform:translate3d(-15px,12px,0)}to{transform:translate3d(22px,-24px,0)}}
@media(max-width:700px){.entry-screen{padding:35px 20px 38px}.entry-kicker{font-size:9px;letter-spacing:.27em;margin-bottom:26px}.entry-content h1{font-size:clamp(40px,11vw,65px)}.entry-content p{margin-top:28px}.entry-continue{font-size:11px}}
@media(prefers-reduced-motion:reduce){.entry-screen,.entry-continue{transition:none}.entry-screen::before{animation:none}}

.profile-gallery{margin:18px 0 22px;padding:18px;border-radius:14px;background:linear-gradient(135deg,#182132,#101522)}
.profile-gallery>p{margin:0 0 15px}
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.profile-card{display:flex;align-items:center;gap:12px;min-width:0;padding:10px;border-radius:11px;background:#0a101d}
.profile-card img{width:80px;height:80px;flex:none;border-radius:10px;object-fit:cover}
.profile-card div{display:flex;flex-direction:column;gap:5px;min-width:0}
.profile-card strong{font-size:14px;color:#e9e7f5;overflow-wrap:anywhere}
.profile-card code{font-size:11px;color:#b4c9ef;overflow-wrap:anywhere}
.profile-card span{font-size:11px;color:#93a1b9}
@media(max-width:700px){.profile-gallery{padding:13px}.profile-grid{grid-template-columns:1fr}.profile-card img{width:64px;height:64px}}

/* Le superfici usano ombre morbide: nessun filetto cromatico sui bordi. */
body[data-story] :is(dialog,.sidebar,.topbar,footer,.nav-item.active,.hub-intro,.sidebar-case,.portal,.team-welcome,.credit-wallet,.time-panel,.card,.stat,.notice,.completion,.final-cipher,.secret-access,.story-heading,.rules,.table-wrap,.audio-evidence,.morse-reference,.cyber-tools,.cyber-lab,#music-player,#timer-preview,#glitch-preview),
body.admin-surface :is(dialog,.admin-header,.admin-access,.admin-tabs button.selected,.editor-block,.story-select,.admin-controls,.stat,.table-wrap){border:0}
body[data-story] :is(button,input,select,textarea):focus-visible,body.admin-surface :is(button,input,select,textarea):focus-visible{outline:2px solid #e5e9f5;outline-offset:3px}
