:root{--navy:#102849;--ink:#193355;--muted:#647996;--line:#d6e5f2;--white:#fff;--mint:#28bd9a;--blue:#377fe6;--purple:#9170e8;--shadow:0 20px 60px #1d589414;--rad:22px;color-scheme:light;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif}
*{box-sizing:border-box}html{min-height:100%;background:#eaf5ff}body{margin:0;min-height:100vh;color:var(--ink);background:linear-gradient(145deg,#f7fcff 0%,#e8f3ff 46%,#e8faf6 100%);overflow-x:hidden}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #56a5ff;outline-offset:3px}
.ambient{position:fixed;inset:0;pointer-events:none;overflow:hidden}.orb{position:absolute;display:block;border-radius:50%;filter:blur(8px);opacity:.35}.orb-a{width:430px;height:430px;top:-230px;right:5%;background:#c8f3e8}.orb-b{width:400px;height:400px;bottom:-210px;left:-120px;background:#b3dbfa}.orb-c{width:290px;height:290px;right:-140px;bottom:13%;background:#e2d5ff}
.shell{position:relative;max-width:1390px;min-height:100vh;margin:auto;padding:23px clamp(16px,3.6vw,46px) 18px;display:flex;flex-direction:column;gap:20px}
.topbar{min-height:65px;display:flex;justify-content:space-between;align-items:center;gap:16px}.brand{display:inline-flex;gap:12px;align-items:center}.brand-mark{display:grid;place-items:center;width:49px;height:49px;border-radius:15px;background:#d9f4ee;border:1px solid #a5e6d5;color:#158c78;font-size:27px;font-weight:800}.brand b{font-size:clamp(13px,1.6vw,18px);letter-spacing:.06em;font-weight:900}.brand small{display:block;color:#748ca5;font-size:10px;letter-spacing:.15em;font-weight:700;margin-top:3px}.top-actions{display:flex;align-items:center;gap:18px}.network-status{font-size:12px;font-weight:700;color:#37876f;white-space:nowrap}.network-status.offline{color:#d56c59}.return-site{display:inline-flex;align-items:center;gap:8px;border:1px solid #c8d9ed;background:#ffffffd8;color:#315274;border-radius:12px;padding:11px 15px;font-size:13px;font-weight:750;transition:.18s}.return-site:hover{background:#e5effb;transform:translateY(-1px)}.return-symbol{font-size:22px;line-height:1}
.app{flex:1}.footer{font-size:11px;color:#8498ad;display:flex;justify-content:space-between;gap:10px;padding:9px 0}
.hero{padding:32px clamp(20px,4vw,52px);background:linear-gradient(125deg,#163d69,#275589 57%,#347c94);border-radius:28px;color:white;min-height:228px;display:flex;justify-content:space-between;align-items:center;gap:24px;box-shadow:0 22px 40px #13487530;position:relative;overflow:hidden}.hero:before{content:'';position:absolute;width:380px;height:380px;border:1px solid #ffffff20;border-radius:50%;right:-100px;top:-155px;box-shadow:0 0 0 45px #ffffff0a,0 0 0 95px #ffffff07}.hero-content{position:relative;z-index:1}.eyebrow{color:#70ffe0;letter-spacing:.17em;text-transform:uppercase;font-size:11px;font-weight:900;display:block;margin-bottom:11px}.hero h1{font-size:clamp(32px,5.2vw,64px);line-height:1.02;letter-spacing:-.045em;margin:0 0 13px;font-weight:900}.hero h1 em{font-style:normal;color:#87ffe5}.hero p{margin:0;max-width:570px;line-height:1.6;color:#d6e8ff;font-size:14px}.hero-art{display:grid;place-items:center;width:160px;height:160px;flex:0 0 160px;border-radius:32px;background:#ffffff1b;border:1px solid #ffffff35;font-size:87px;transform:rotate(9deg)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-top:22px}.panel{background:#ffffffea;border:1px solid #d9e7f3;border-radius:var(--rad);box-shadow:var(--shadow);padding:clamp(17px,2.5vw,27px);min-width:0}.panel h2{font-size:21px;margin:0 0 9px;letter-spacing:-.035em}.panel p{color:var(--muted);line-height:1.55;margin:0 0 14px;font-size:14px}.field-label{display:block;font-size:12px;font-weight:800;color:#516f91;margin:13px 0 7px}.text-input{display:block;width:100%;padding:14px 15px;border:1px solid #c9dced;border-radius:12px;background:#f7fbff;color:#183856;font-size:15px;outline:none}.text-input:focus{border-color:#48a5e9;box-shadow:0 0 0 3px #52adf126}.code-input{text-align:center;letter-spacing:.22em;font-size:24px;text-transform:uppercase;font-weight:850}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:13px;padding:13px 20px;min-height:48px;color:white;background:var(--blue);font-size:14px;font-weight:850;transition:transform .16s,background .16s,box-shadow .16s}.button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 10px 19px #337cde2a}.button.primary{background:#2774d7}.button.green{background:#199b82}.button.purple{background:#785ac6}.button.dark{background:#28476b}.button.light{background:#e8f2fa;color:#305477;border:1px solid #d4e3f0}.button.danger{background:#d35165}.button.full{width:100%}.actions{display:flex;gap:10px;flex-wrap:wrap}.helper{font-size:12px;color:#8195a8;margin-top:9px}.steps{display:flex;flex-wrap:wrap;gap:9px;margin:14px 0 0}.step{display:flex;align-items:center;gap:7px;padding:9px 12px;background:#eef7fd;border:1px solid #dcebf5;border-radius:99px;font-size:12px;font-weight:700;color:#52708a}
.pagebar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px;flex-wrap:wrap}.crumb{color:#6181a0;font-size:12px;font-weight:700;letter-spacing:.02em}.crumb strong{color:#274b73}.pagebar h1{font-size:clamp(25px,3vw,37px);letter-spacing:-.055em;margin:6px 0 0}.code-pill{display:inline-flex;align-items:center;gap:12px;background:#143c6a;border-radius:14px;color:white;padding:10px 14px;white-space:nowrap}.code-pill b{font-size:20px;letter-spacing:.16em}.code-pill small{display:block;color:#bad6ef;font-size:10px;letter-spacing:.05em}.icon-button{border:0;color:#546e88;background:#e8f1fa;border-radius:11px;min-height:38px;padding:8px 11px;font-weight:800}.code-pill .icon-button{background:#ffffff20;color:white}
.teams{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.team-card{background:#fff;border:1px solid #d5e4f1;border-radius:19px;padding:20px;min-width:0}.team-icon{font-size:27px;display:inline-flex;align-items:center;justify-content:center;background:#edf6ff;width:53px;height:53px;border-radius:15px;margin-bottom:11px}.team-card h3{font-size:18px;margin:0 0 6px}.team-card p{font-size:12px;color:#67819c;margin:0 0 13px}.role-list{display:grid;gap:8px;margin-bottom:14px}.role-line{display:flex;justify-content:space-between;gap:5px;border-radius:8px;background:#f2f8fd;padding:9px;font-size:12px;color:#50708c}.role-line b{color:#2c4966}.role-line em{font-style:normal;color:#97a6b6}.role-line .occupied{color:#1e977f;font-weight:700}.team-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.team-score{color:#477b9c;font-size:12px;font-weight:800}.team-card .button{width:100%}
.role-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.role-tile{border:2px solid #dceaf4;border-radius:22px;padding:23px;display:flex;flex-direction:column;background:white;align-items:flex-start;text-align:left;min-height:228px;color:var(--ink);transition:.17s}.role-tile:hover:not(:disabled){border-color:#7ebcea;transform:translateY(-2px);box-shadow:var(--shadow)}.role-tile.taken{opacity:.62}.role-tile strong{font-size:20px;margin:12px 0 7px}.role-tile p{font-size:13px;line-height:1.55;color:#73879c;flex:1}.role-tile .tag{font-size:12px;color:#368e7d;font-weight:800}.role-emoji{width:60px;height:60px;border-radius:16px;display:grid;place-items:center;font-size:32px;background:#edf6fc}.role-tile.role2 .role-emoji{background:#e8f8ef}.role-tile.role3 .role-emoji{background:#f3edff}
.stats-strip{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.stat-chip{display:inline-flex;align-items:center;gap:7px;padding:9px 11px;border-radius:12px;background:#f1f8fd;color:#53718a;font-size:12px;font-weight:750}.stat-chip strong{font-size:16px;color:#234a6e}.game-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(275px,.85fr);gap:18px}.game-layout.assistant{grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)}.game-layout .panel{height:100%}.section-heading{display:flex;justify-content:space-between;gap:10px;align-items:center}.section-heading h2{margin:0 0 12px}.micro{font-size:12px;color:#718fa9}.palette{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0 23px}.chem-pick{width:69px;min-height:82px;display:flex;flex-direction:column;align-items:center;gap:8px;padding:9px 5px;border:2px solid #d8e4ef;border-radius:13px;background:#fff;color:#56728a;font-size:11px;font-weight:750}.chem-pick.selected{border-color:#398fde;background:#ebf7ff;box-shadow:0 0 0 3px #8ad9ff38}.vial{display:grid;place-items:center;width:33px;height:40px;border-radius:9px 9px 13px 13px;border:2px solid #ffffffaa;box-shadow:0 2px 0 #0000001c,inset 0 7px #ffffff6e;background:var(--c);color:#26374d;font-size:12px;font-weight:900}.science-stage{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:220px;background:linear-gradient(180deg,#f0f9ff,#eaf7f5);border:1px dashed #bddbe7;border-radius:18px;overflow:hidden;margin:12px 0}.science-stage:before{content:'';position:absolute;inset:0;background-image:linear-gradient(#5b98b50b 1px,transparent 1px),linear-gradient(90deg,#5b98b50b 1px,transparent 1px);background-size:28px 28px}.stage-core{position:relative;font-size:76px;filter:drop-shadow(0 10px 12px #4397aa2a);transition:transform .2s}.stage-core.pulse{animation:bounce .22s ease}.stage-label{position:relative;color:#5c7b94;font-size:13px;font-weight:750;margin-top:4px}.progress-track{height:12px;border-radius:999px;background:#dcecf4;overflow:hidden;margin:10px 0}.progress-fill{height:100%;background:linear-gradient(90deg,#48a6ee,#29cda9);border-radius:999px;transition:width .13s}.inventory{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:10px;margin:15px 0}.item{display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;min-height:111px;border:1px solid #d6e5f0;background:#f7fbfe;border-radius:14px;padding:10px 5px;text-align:center;min-width:0}.item .emoji{font-size:28px}.item small{font-size:11px;color:#597895;line-height:1.2}.item .send-mini{min-height:29px;padding:6px 9px;font-size:11px}.empty{padding:29px 13px;background:#f4f9fd;border:1px dashed #cddfed;border-radius:14px;text-align:center;color:#7990a6;font-size:13px;margin-top:15px;line-height:1.5}.selectable{cursor:pointer;transition:.16s}.selectable:hover{background:#e9f7fb;border-color:#6eacc7}.selectable.active{border:2px solid #2bb398;background:#e7faf3}.instruction{background:#f0f9ff;border-left:3px solid #63b4f2;border-radius:8px;padding:12px;font-size:13px;line-height:1.5;color:#53758d;margin:12px 0}.arrows{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:12px}.arrow-key{min-width:55px;min-height:55px;border-radius:12px;border:2px solid #a7cae2;background:white;color:#2c6799;font-weight:900;font-size:25px}.arrow-key.done{background:#34ba99;color:white;border-color:#34ba99}.recipe-chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}.recipe-chip{border:1px solid #cddfec;padding:9px 12px;background:#eff7fc;border-radius:10px;font-size:12px;font-weight:750;display:flex;align-items:center;gap:8px}.reactor{width:175px;height:175px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 33% 28%,#bffff0,#42bad2 46%,#316dad 90%);border:10px solid #d6eaf7;box-shadow:inset 0 0 0 7px #ffffff70,0 12px 26px #5495b746;position:relative;margin:0 auto 9px;font-size:70px;color:#fff;transition:filter .3s}.reactor.mixing{animation:spinpulse .9s infinite alternate}.selected-list{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;font-size:12px;color:#5e7f98;min-height:26px;text-align:center}.hold-btn{touch-action:none;user-select:none;-webkit-user-select:none}.win{background:#eafaf0;border:1px solid #b1dfc7;color:#226d53;border-radius:14px;padding:13px;text-align:center;font-weight:800;margin:12px 0}.notice{font-size:12px;color:#7890a3;margin-top:12px}.lab-note{font-size:12px;color:#567d92;background:#f4fafb;border-radius:10px;padding:11px;margin-top:14px}
.admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:15px 0}.admin-team{border:1px solid #d8e6f1;background:#f5faff;border-radius:12px;padding:14px;font-size:13px}.admin-team .role-line{background:#fff}.ranking{display:grid;gap:10px}.ranking-row{display:flex;align-items:center;gap:16px;border:1px solid #d8e5ef;border-radius:13px;padding:14px;background:white}.ranking-num{font-size:23px;color:#538aab;font-weight:900;min-width:32px}.ranking-name{flex:1;font-weight:850}.ranking-score{font-weight:900;color:#298d80}.toast{position:fixed;z-index:50;bottom:24px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;padding:13px 20px;border-radius:14px;background:#163a5e;color:#fff;font-size:13px;font-weight:750;box-shadow:0 14px 26px #1f4f6d55;max-width:min(92vw,560px);text-align:center;transition:.24s}.toast.show{opacity:1;transform:translate(-50%,0)}.loading{padding:35px;text-align:center;color:#6283a1}
@keyframes bounce{50%{transform:scale(1.16) rotate(-5deg)}}@keyframes spinpulse{0%{transform:scale(.96) rotate(-5deg);filter:hue-rotate(0)}100%{transform:scale(1.06) rotate(8deg);filter:hue-rotate(32deg)}}
@media(max-width:980px){.teams{grid-template-columns:repeat(2,minmax(0,1fr))}.role-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}.hero-art{width:115px;height:115px;flex-basis:115px;font-size:65px}.game-layout.assistant{grid-template-columns:1fr}}
@media(max-width:720px){.shell{padding:10px 12px}.brand-mark{width:40px;height:40px;font-size:22px}.brand b{font-size:12px}.brand small{font-size:8px}.network-status{display:none}.return-label{display:none}.return-site{padding:6px 11px;min-height:40px}.topbar{min-height:52px}.hero{min-height:175px;padding:24px 19px}.hero-art{display:none}.hero h1{font-size:35px}.grid-2,.game-layout,.game-layout.assistant{grid-template-columns:1fr}.teams{grid-template-columns:1fr}.role-tiles{grid-template-columns:1fr}.role-tile{min-height:135px;padding:15px}.role-tile p{margin:4px 0}.panel{padding:18px}.footer{flex-direction:column;gap:3px}.stats-strip{gap:6px}.stat-chip{font-size:11px;padding:7px}.inventory{grid-template-columns:repeat(auto-fit,minmax(82px,1fr))}.game-layout .panel{height:auto}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* --- Обновлённый упрощённый интерфейс ролей --- */
.role-screen{--role:#2f7bd9;--role-strong:#2560af;--role-soft:#eef6ff;--role-line:#cfe0f7;--role-tint:#ffffff;display:grid;gap:18px}
.role-screen.chemist{--role:#b97a2e;--role-strong:#8d5c21;--role-soft:#fff5e8;--role-line:#efd4ad;--role-tint:#fffaf2}
.role-screen.researcher{--role:#338d50;--role-strong:#23653a;--role-soft:#eef9f0;--role-line:#c7e5cf;--role-tint:#f7fdf7}
.role-screen.assistant{--role:#7b4fc5;--role-strong:#5d379d;--role-soft:#f5efff;--role-line:#ddcdf6;--role-tint:#fbf8ff}
.role-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.team-badge{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:10px 20px;border-radius:999px;background:var(--role-soft);border:2px solid var(--role-line);color:var(--role-strong);font-size:28px;font-weight:900;letter-spacing:-.03em}
.role-banner{display:flex;align-items:center;gap:18px;padding:22px 24px;border-radius:28px;background:linear-gradient(135deg,var(--role),var(--role-strong));color:#fff;box-shadow:0 18px 35px color-mix(in srgb,var(--role) 30%, transparent)}
.role-banner-icon{width:82px;height:82px;border-radius:24px;display:grid;place-items:center;background:#ffffff1c;border:1px solid #ffffff40;font-size:44px;flex:0 0 82px}
.role-banner-text h1{margin:0;font-size:clamp(34px,4vw,52px);line-height:1;letter-spacing:-.04em}
.role-banner-sub{margin-top:8px;font-size:19px;font-weight:700;color:#f6fbff}
.role-screen .panel{background:var(--role-tint);border:2px solid var(--role-line);box-shadow:0 16px 32px #20406014}
.role-screen .button.primary,.role-screen .button.green,.role-screen .button.purple{background:linear-gradient(135deg,var(--role),var(--role-strong))}
.role-screen .button.light{background:#fff;color:var(--role-strong);border:2px solid var(--role-line)}
.role-screen .button:hover:not(:disabled){box-shadow:0 12px 22px color-mix(in srgb,var(--role) 24%, transparent)}
.role-screen .science-stage{background:linear-gradient(180deg,var(--role-soft),#fff);border:2px dashed var(--role-line)}
.role-screen .progress-fill{background:linear-gradient(90deg,var(--role),var(--role-strong))}
.role-screen .chem-pick{border-width:3px;min-height:96px;font-size:13px;font-weight:850;background:#fff}
.role-screen .chem-pick.selected{border-color:var(--role);background:var(--role-soft);box-shadow:0 0 0 4px color-mix(in srgb,var(--role) 18%, transparent)}
.role-screen .vial{width:40px;height:48px;font-size:15px}
.role-screen .stage-core{font-size:94px}
.role-screen .stage-label{font-size:22px;font-weight:900;color:var(--role-strong);text-align:center;padding:0 12px}
.role-screen .progress-track{height:16px;margin-top:14px}
.role-screen .progress-note{margin:12px 0 0;text-align:center;font-size:26px;font-weight:900;color:var(--role-strong)}
.role-screen .giant-btn{min-height:76px;border-radius:18px;font-size:29px;letter-spacing:.02em;margin-top:14px}
.role-screen .inventory{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:14px}
.role-screen .item{min-height:142px;padding:13px 10px;border:2px solid var(--role-line);background:#fff}
.role-screen .item .emoji{font-size:34px}
.role-screen .item small{font-size:14px;font-weight:800;color:var(--role-strong)}
.role-screen .item .send-mini{min-height:38px;font-size:14px;padding:8px 12px}
.role-screen .empty{font-size:18px;padding:34px 20px;border-width:2px;background:color-mix(in srgb,var(--role-soft) 70%, #fff);color:var(--role-strong)}
.role-screen .section-heading.big{margin-bottom:16px}
.role-screen .section-heading.big h2{font-size:34px;margin:0;color:var(--role-strong)}
.role-screen .section-heading.compact h3{font-size:24px;margin:0;color:var(--role-strong)}
.big-count{font-size:24px;font-weight:900;color:var(--role-strong);background:var(--role-soft);border:2px solid var(--role-line);padding:8px 12px;border-radius:14px;white-space:nowrap}
.role-screen .arrow-key{min-width:76px;min-height:76px;font-size:34px;border-width:3px;border-color:var(--role-line);color:var(--role-strong)}
.role-screen .arrow-key.done{background:var(--role);border-color:var(--role);color:#fff}
.role-screen .recipe-chips{margin:16px 0;gap:10px}
.role-screen .recipe-chip{font-size:15px;padding:11px 14px;border-width:2px;border-color:var(--role-line);background:#fff;color:var(--role-strong)}
.role-screen .reactor{border-color:var(--role-line)}
.role-screen .selected-list{font-size:18px;font-weight:800;color:var(--role-strong)}
.role-screen .pick-state{font-size:18px;font-weight:900;color:var(--role)}
.role-screen .win{font-size:22px;border-width:2px}
.role-screen .micro,.role-screen .instruction,.role-screen .lab-note,.role-screen .notice{display:none}
@media(max-width:720px){
  .role-topline{align-items:stretch}
  .team-badge{width:100%;font-size:22px;min-height:44px}
  .role-banner{padding:18px 16px;border-radius:22px}
  .role-banner-icon{width:66px;height:66px;flex-basis:66px;font-size:36px}
  .role-banner-text h1{font-size:30px}
  .role-banner-sub{font-size:16px}
  .role-screen .section-heading.big h2{font-size:26px}
  .big-count{font-size:18px;padding:6px 10px}
  .role-screen .chem-pick{width:calc(50% - 8px);flex:1 1 calc(50% - 8px);min-width:120px;min-height:88px}
  .role-screen .stage-core{font-size:74px}
  .role-screen .stage-label{font-size:18px}
  .role-screen .progress-note{font-size:20px}
  .role-screen .giant-btn{min-height:66px;font-size:24px}
  .role-screen .inventory{grid-template-columns:repeat(2,minmax(0,1fr))}
  .role-screen .item{min-height:124px}
  .role-screen .arrow-key{min-width:64px;min-height:64px;font-size:30px}
  .role-screen .selected-list{font-size:15px}
}
