#tutorial-coach{position:absolute;z-index:800;left:10px;right:10px;top:max(8px,env(safe-area-inset-top));color:#102627;font:14px/1.4 system-ui;pointer-events:none}.tutorial-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px;gap:8px;color:#e7f4e9;font-size:12px;font-weight:800}.tutorial-top button{pointer-events:auto;padding:7px 10px;border:1px solid #93aa9b;background:#102627;color:#f0f7f1;border-radius:8px;font-size:12px}.coach-row{display:flex;gap:8px;align-items:flex-end}.coach-row img{width:76px;height:100px;object-fit:contain;image-rendering:pixelated;flex:none}.coach-bubble{position:relative;background:#fffef7;border:2px solid #243d31;border-radius:14px;padding:13px;box-shadow:0 4px 0 #0004;min-height:76px;flex:1;font-size:14px;line-height:1.4}.coach-bubble:before{content:'';position:absolute;left:-10px;bottom:14px;width:16px;height:16px;background:#fffef7;border-left:2px solid #243d31;border-bottom:2px solid #243d31;transform:rotate(45deg)}.tutorial-controls{display:flex;gap:8px;justify-content:flex-end;margin:8px 0;pointer-events:auto}.tutorial-controls button,.tutorial-ending button{min-height:38px;padding:9px 18px;border:1px solid #597b68;border-radius:9px;background:#e6f1e8;color:#102627;font-weight:800}.tutorial-controls #tutorial-go,.tutorial-ending button:first-child{background:#b5f56b}.tutorial-controls button:disabled{opacity:.45}.tutorial-playing #match-screen{padding-top:205px!important}.tutorial-playing #score-bar,.tutorial-playing .match-heading,.tutorial-playing #ga-countdown,.tutorial-playing #pause-btn,.tutorial-playing #mute-btn,.tutorial-playing #timer,.tutorial-playing #coach-hint,.tutorial-playing #pvp-network{visibility:hidden!important}.tutorial-playing #bottom-bar{min-height:80px}.tutorial-playing #subs-panel{z-index:810;top:210px!important}.tutorial-playing #result-panel{display:none!important}.tutorial-playing #field-wrap{min-height:0}.tutorial-playing #home-menu{display:none}.coach-at-home{top:auto!important;bottom:max(10px,env(safe-area-inset-bottom))}.tutorial-highlight{outline:3px solid #fff1a2!important;outline-offset:2px;box-shadow:0 0 18px #fff1a255!important}.tutorial-ending{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;pointer-events:auto;margin-top:8px}.tutorial-ending button{font-size:13px;padding:9px 12px}#tutorial-pack{margin:auto;width:min(94vw,430px);max-height:90dvh;overflow:auto;background:#102d24;color:#eef6e8;border:2px solid #a7ca87;border-radius:18px;padding:22px 16px;text-align:center}#tutorial-pack::backdrop{background:#03100dee}#tutorial-pack h2{font-size:24px;margin-bottom:8px}#tutorial-pack p{color:#d3e2d2;margin-bottom:18px}.starter-sealed{width:80%;min-height:260px;margin:14px auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;background:linear-gradient(135deg,#49734b,#16382c);color:#edffc5;border:8px double #b9da8b;box-shadow:0 12px 35px #0009;cursor:pointer}.starter-sealed strong{font-size:27px;letter-spacing:3px}.starter-sealed small{font-size:16px}.starter-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.starter-cards article{border:1px solid var(--rarity);border-radius:10px;background:#234537;padding:8px 3px;display:flex;flex-direction:column;align-items:center;gap:4px;animation:starterReveal .35s both;animation-delay:var(--delay)}.starter-cards canvas{width:64px;height:64px;max-width:100%;object-fit:contain;image-rendering:pixelated}.starter-cards strong{font-size:11px;line-height:1.2}.starter-cards small{font-size:11px;color:#d5e8cf}.starter-continue{margin-top:18px;width:100%;min-height:44px;border:0;border-radius:10px;background:#b5f56b;color:#102627;font-weight:800}#tutorial-pack [hidden],#tutorial-coach [hidden]{display:none!important}@keyframes starterReveal{from{opacity:0;transform:translateY(12px) scale(.85)}to{opacity:1;transform:none}}@media(max-height:700px){.tutorial-playing #match-screen{padding-top:183px!important}.coach-row img{height:80px;width:58px}.coach-bubble{padding:9px;font-size:13px}.tutorial-controls{margin:5px 0}.tutorial-playing #subs-panel{top:185px!important}}

.tutorial-playing #team-shape-btn,.tutorial-playing #go-btn{visibility:hidden!important}.tutorial-playing:not(.tutorial-subs-step) #form-btn{visibility:hidden!important}.tutorial-playing #form-pop button[data-f],.tutorial-playing #form-pop>small{display:none!important}.tutorial-tour .home-content{padding-bottom:220px!important}
/* Coach stays beside the touchline; the pitch keeps its own space. */
#tutorial-coach{top:auto!important;bottom:max(8px,env(safe-area-inset-bottom));left:8px;right:8px}
.coach-row{align-items:flex-end;gap:6px}.coach-row img{width:108px;height:142px;object-fit:contain;object-position:left bottom}.coach-bubble{font-weight:750;font-size:14px;line-height:1.4;padding:12px;min-height:98px}.tutorial-top{font-weight:800}.tutorial-controls{margin:7px 0 0}
.tutorial-playing #match-screen{padding-top:0!important;padding-bottom:235px!important}
.tutorial-playing #subs-panel{top:12px!important;bottom:245px!important;max-height:calc(100% - 257px);overflow:auto}
.tutorial-tour .home-content{padding-bottom:235px!important}
.tutorial-glow{animation:tutorialGlow 1.05s ease-in-out infinite!important;outline:2px solid #fff3af!important;outline-offset:3px}
.tutorial-highlight{animation:tutorialGlow 1.05s ease-in-out infinite!important}
@keyframes tutorialGlow{0%,100%{filter:brightness(1);box-shadow:0 0 4px #ffefac55}50%{filter:brightness(1.22);box-shadow:0 0 20px #ffefacc9,0 0 0 4px #ffefac44}}
#tutorial-pack{position:absolute;z-index:790;top:max(18px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);bottom:auto;margin:0;width:min(88%,360px);max-height:calc(100% - 255px);overflow:auto;padding:16px 12px;background:linear-gradient(150deg,#274c3bf5,#102b23fa);border:1px solid #95b986;border-radius:18px;box-shadow:0 12px 35px #0009;text-align:center}
.pack-heading{display:flex;gap:10px;align-items:center;text-align:left;margin-bottom:8px}.pack-heading>img{width:44px;height:44px;object-fit:contain}.pack-heading h2{font-size:20px!important;margin:0!important}.pack-heading p{font-size:12px;line-height:1.4;margin:5px 0 0!important;color:#dbe9d4}
#tutorial-pack .starter-sealed{position:relative;width:166px;min-height:190px;margin:16px auto 12px;gap:12px;overflow:hidden;border:6px double #d3eda8;border-radius:9px;background:linear-gradient(140deg,#91b85b,#305b38 30%,#152d25 68%,#466d3c);box-shadow:0 10px 24px #0008;transition:transform .4s,filter .4s}
.starter-sealed>img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 3px 2px #0007)}#tutorial-pack .starter-sealed strong{font-size:18px;letter-spacing:2px}#tutorial-pack .starter-sealed small{font-size:13px;font-weight:800}
.starter-sealed:after{content:'';position:absolute;inset:-100% -70%;background:linear-gradient(120deg,transparent 43%,#fff7c76b 49%,transparent 55%);animation:packShine 3s ease-in-out infinite;pointer-events:none}
#tutorial-pack.pack-opening .starter-sealed{animation:packBurst .65s forwards!important}#tutorial-pack .starter-cards{gap:7px}#tutorial-pack .starter-cards canvas{width:47px;height:47px}#tutorial-pack .starter-cards article{padding:6px 2px;background:linear-gradient(150deg,#3c6349,#193a2d);box-shadow:0 3px 7px #0004;animation:starterReveal .5s both;animation-delay:var(--delay)}#tutorial-pack .starter-cards strong{font-size:11px;min-height:25px}.pack-revealed{animation:packFlash .7s ease-out}.starter-continue{min-height:40px;margin-top:12px}
@keyframes packShine{0%,35%{transform:translateX(-65%)}75%,100%{transform:translateX(65%)}}
@keyframes packBurst{0%{transform:scale(1)}35%{transform:scale(1.08) rotate(-3deg);filter:brightness(1.4)}65%{transform:scale(1.1) rotate(3deg);filter:brightness(1.8)}100%{transform:scale(1.18);opacity:0;filter:brightness(2)}}
@keyframes packFlash{from{box-shadow:0 0 55px #e9ff9fcc}to{box-shadow:0 12px 35px #0009}}
@media(max-height:700px){.coach-row img{width:88px;height:118px}.coach-bubble{font-size:13px;min-height:80px;padding:10px}.tutorial-playing #match-screen{padding-bottom:215px!important}#tutorial-pack{max-height:calc(100% - 235px);top:12px}.tutorial-playing #subs-panel{bottom:220px!important;max-height:calc(100% - 232px)}}
@media(prefers-reduced-motion:reduce){.tutorial-glow,.tutorial-highlight,.starter-sealed:after{animation:none!important}.tutorial-glow,.tutorial-highlight{box-shadow:0 0 14px #fff2a2!important}}

.tutorial-tour #home-screen .home-top{display:none!important}

/* On-pitch coach: overlay the lower grass without shrinking the match canvas. */
.tutorial-playing #match-screen{padding:0!important}
.tutorial-playing #bottom-bar{min-height:0}
.tutorial-playing:not(.tutorial-subs-step) #bottom-bar{visibility:hidden!important}
.tutorial-playing #tutorial-coach{left:50%;right:auto;bottom:calc(var(--pitch-bottom,0px) + 8px);width:calc(var(--pitch-width,100%) - 16px);transform:translateX(-50%)}
.tutorial-playing .coach-row img{width:clamp(88px,26vw,120px);height:clamp(118px,34vw,158px)}
.tutorial-playing .coach-bubble{align-self:flex-start;min-height:0;font-size:14px;font-weight:800;padding:10px;line-height:1.35}
.tutorial-playing .tutorial-top{font-size:12px;text-shadow:0 2px 3px #000}
.tutorial-playing .tutorial-controls{margin-top:4px}
.tutorial-playing .tutorial-controls button{padding:8px 12px}
.tutorial-playing #subs-panel{top:12px!important;bottom:240px!important;max-height:calc(100% - 252px)}

#tutorial-label{display:inline-block;margin-left:22px}
#tutorial-skip{position:absolute;z-index:850;top:calc(env(safe-area-inset-top,0px) + 10px);right:14px;pointer-events:auto;padding:8px 12px;border:1px solid #93aa9b;background:#102627;color:#f0f7f1;border-radius:8px;font:700 12px system-ui}
#tutorial-skip[hidden]{display:none!important}
#tutorial-coach.coach-at-home{padding:12px;border:1px solid #91b3a56b;border-radius:16px;background:linear-gradient(135deg,#102d27f5,#16362ff0);box-shadow:0 8px 30px #0006;backdrop-filter:blur(12px)}
#tutorial-coach.coach-at-home #tutorial-label{margin-left:4px}
.tutorial-playing #tutorial-coach.coach-subs{z-index:830;top:52px!important;bottom:auto;left:12px;right:12px;width:auto;transform:none;background:#102d27f5;border-radius:12px;padding:10px}
.tutorial-playing #tutorial-coach.coach-subs .coach-row img{height:100px;width:76px}
.tutorial-playing #subs-panel{top:calc(var(--sub-coach-height,170px) + 64px)!important;bottom:12px!important;max-height:none}
.tutorial-playing #form-pop{z-index:840}
#tutorial-pack{top:calc((100% - var(--pack-coach-height,210px))/2);transform:translate(-50%,-50%);max-height:calc(100% - var(--pack-coach-height,210px) - 30px)}
.tutorial-dismiss{display:block;pointer-events:auto;margin:10px 0 0 auto;border:0;border-radius:8px;background:#b5f56b;color:#102627;font-weight:800;padding:9px 18px;min-height:38px}

.tutorial-subs-step #bottom-bar{z-index:820}

.tutorial-playing #field-wrap>#tutorial-label{position:absolute;z-index:100;top:var(--label-top,50px);left:var(--label-left,24px);margin:0;color:#fff5ce;font:800 13px/1.4 system-ui;text-shadow:0 2px 3px #102b20;pointer-events:none}
#tutorial-logo{position:absolute;z-index:110;top:calc(env(safe-area-inset-top,0px) + 5px);left:16px;width:132px;height:64px;object-fit:contain;border-radius:6px;pointer-events:none}
#tutorial-logo[hidden]{display:none!important}
.tutorial-playing .tutorial-top:empty{display:none}

/* Supplied logo fills the spare header area; crop its green margins in layout. */
#tutorial-logo{left:50%;width:calc(100% - 32px);max-width:360px;transform:translateX(-50%);overflow:hidden;border-radius:0;z-index:110}
#tutorial-logo img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:180%;width:auto;max-width:none;object-fit:contain}
.tutorial-playing #tutorial-coach.coach-subs{z-index:830}

/* The header owns the logo: it cannot extend into the pitch. */
.tutorial-playing #score-bar{position:relative;overflow:hidden}
#score-bar #tutorial-logo{visibility:visible;top:4px;bottom:4px;height:auto;width:calc(100% - 240px);max-width:300px;min-width:0;left:50%;overflow:hidden}
#score-bar #tutorial-logo img{height:170%;max-height:none}

/* Anchor the coach to the match footer, outside the clipped field wrapper. */
.tutorial-playing #tutorial-coach{left:8px;right:8px;bottom:0;width:auto;transform:none;display:grid;grid-template-columns:clamp(112px,30vw,142px) minmax(0,1fr);column-gap:8px;align-items:end}
.tutorial-playing #tutorial-coach .tutorial-top{grid-column:2}
.tutorial-playing #tutorial-coach .coach-row{display:contents}
.tutorial-playing #tutorial-coach .coach-row img{grid-column:1;grid-row:1/4;width:100%;height:clamp(158px,43vw,192px);align-self:end;object-position:left bottom}
.tutorial-playing #tutorial-coach .coach-bubble{grid-column:2;grid-row:2;align-self:end;margin-bottom:4px;font-size:14px;line-height:1.4}
.tutorial-playing #tutorial-coach .tutorial-controls{grid-column:2;grid-row:3;flex-wrap:wrap;margin:0;padding-bottom:max(8px,env(safe-area-inset-bottom))}
.tutorial-playing #tutorial-coach.coach-subs{top:auto!important;bottom:0;left:8px;right:8px;padding:0;background:transparent}
.tutorial-playing #subs-panel{top:12px!important;bottom:calc(var(--sub-coach-height,195px) + 12px)!important;max-height:none}
.tutorial-subs-step #form-pop{bottom:calc(100% + var(--tutorial-coach-height,192px) + 24px)}
@media(max-width:350px){.tutorial-playing #tutorial-coach{grid-template-columns:100px minmax(0,1fr);gap:5px}.tutorial-playing #tutorial-coach .coach-bubble{padding:8px}}

/* Keep the coach above the tactics bar throughout the substitution lesson. */
.tutorial-subs-step #tutorial-coach{z-index:830}
.tutorial-subs-step #tutorial-coach:not(.coach-subs){bottom:var(--tutorial-bar-height,110px)}

/* All tutorial stages, including the club tour and starter pack. */
.tutorial-active #home-coins,.tutorial-active .coin-amount:not(#tutorial-coins):not(.tutorial-earned){display:none!important}

/* Slightly larger coach and copy; lift the tutorial controls off the footer. */
.tutorial-playing #tutorial-coach{grid-template-columns:clamp(120px,32vw,152px) minmax(0,1fr)}
.tutorial-playing #tutorial-coach .coach-row img{height:clamp(170px,46vw,206px)}
.tutorial-playing #tutorial-coach .coach-bubble,.coach-bubble{font-size:15px}
.tutorial-playing #tutorial-coach .tutorial-controls{padding-bottom:max(18px,env(safe-area-inset-bottom))}
#first-match-coach{position:absolute;inset:0;z-index:900;display:flex;align-items:flex-end;justify-content:center;padding:18px 12px;background:#0003;touch-action:none}
#first-match-coach .coach-row{width:min(100%,480px);align-items:center}
#first-match-coach img{width:110px;height:150px}
#first-match-coach .coach-bubble{font-size:15px;pointer-events:auto;color:#102627;min-width:0;overflow-wrap:break-word}
#first-match-coach button{display:block;margin:8px 0 0 auto;border:0;border-radius:8px;background:#b5f56b;padding:8px 16px;color:#102627;font-weight:800}
@media(max-width:350px){.tutorial-playing #tutorial-coach{grid-template-columns:108px minmax(0,1fr)}#first-match-coach img{width:82px;height:118px}}

#tutorial-pack .starter-cards article.starter-epic{position:relative;overflow:hidden;border:2px solid #c084fc;background:radial-gradient(ellipse at top,#643b85,#222943);box-shadow:0 0 18px #c084fc55}#tutorial-pack .starter-cards .starter-epic canvas{width:47px;height:47px}.starter-epic>span{position:absolute;right:3px;top:3px;color:#e3bdff;text-transform:uppercase;font-size:8px;font-weight:900;letter-spacing:.5px}.starter-epic strong{font-size:11px!important}.tutorial-earned svg{width:25px;height:25px}

.tutorial-playing #plan-bar:not(.plan){visibility:hidden}

#first-match-coach{pointer-events:none;background:transparent;touch-action:auto}#first-match-coach .coach-bubble{pointer-events:none}#first-match-coach button{pointer-events:auto}

#tutorial-pack .starter-cards article{position:relative;cursor:pointer;min-height:110px;perspective:600px}
.starter-front,.starter-back{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;backface-visibility:hidden;transition:transform .3s ease}
.starter-front{transform:rotateY(0)}.starter-back{position:absolute;inset:0;padding:5px;box-sizing:border-box;transform:rotateY(180deg);overflow:auto}
.flipped .starter-front{transform:rotateY(-180deg)}.flipped .starter-back{transform:rotateY(0)}
#tutorial-pack .starter-back small{font-size:14px;line-height:1.3;font-weight:600}#tutorial-pack .flipped>span{visibility:hidden}
@media(prefers-reduced-motion:reduce){.starter-front,.starter-back{transition:none}}

/* Tutorial wordmark: transparent artwork, dedicated room beside the skip control. */
#score-bar #tutorial-logo{left:12px;right:128px;top:0;bottom:0;width:auto;max-width:none;height:auto;transform:none;display:flex;align-items:center;justify-content:center;overflow:hidden}
#score-bar #tutorial-logo img{position:static;transform:none;width:100%;height:auto;max-width:380px;max-height:none;object-fit:contain;filter:drop-shadow(0 2px 0 #061713)}
.tutorial-playing #tutorial-skip{top:calc(env(safe-area-inset-top,0px) + 12px);right:14px;min-height:36px;padding:7px 10px;border-color:#416057;background:#142d29;color:#dcebe2;font-size:11px;border-radius:9px}
@media(max-width:360px){#score-bar #tutorial-logo{left:6px;right:108px}.tutorial-playing #tutorial-skip{right:9px;padding:7px;font-size:10px}}

/* First injury: brief reading pause; OK dismisses early. */
#first-match-coach.injury-coach-pause{pointer-events:auto;touch-action:none}
#tutorial-coach .tutorial-ending-close{position:absolute;right:0;top:-4px;width:28px;height:28px;padding:0;border:1px solid #597b68;border-radius:50%;background:#fffef7;color:#102627;font:22px/1 system-ui;cursor:pointer;pointer-events:auto}
#tutorial-coach:has(.tutorial-ending-close) .tutorial-top{padding-right:34px}

/* Opaque coaching card separates the coach from the player portrait underneath. */
#first-match-coach .coach-row{box-sizing:border-box;background:#142f29;border:1px solid #668b76;border-radius:16px;padding:10px;box-shadow:0 5px 20px #0008;gap:10px}
#first-match-coach img{object-position:center bottom;align-self:flex-end}
