/* The app around the lesson player: sign-in, home, the top bar, and iPad sizing. Colours and type come from board.css. */
html,body{margin:0}
body{min-height:100vh;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
button,a.btn{touch-action:manipulation}
a.btn{text-decoration:none;display:inline-block}
.btn{min-height:44px}
.btn.sm{min-height:38px}
.btn.big{font-size:28px;padding:16px 30px;border-radius:6px}

.screen{max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:16px;
  padding:max(18px,env(safe-area-inset-top,0px)) max(18px,env(safe-area-inset-right,0px)) 48px max(18px,env(safe-area-inset-left,0px))}
.screen.center{min-height:100vh;justify-content:center;align-items:flex-start;box-sizing:border-box}
.brand{font:800 clamp(44px,9vw,76px)/1 var(--display);text-transform:uppercase;letter-spacing:.01em;margin:0}
.brand span{color:var(--hero)}
.brand.sm{font-size:24px}
.bar{display:flex;align-items:center;gap:12px}
.bar.pad{max-width:1080px;margin:0 auto;padding:max(10px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px))}
.grow{flex:1}
.me{font-weight:600;color:var(--muted)}
.hello{font-size:clamp(34px,6vw,52px)}

/* the one thing to do next */
.next{display:flex;flex-direction:column;gap:10px;align-items:flex-start;padding:22px;border:2px solid var(--ink);border-radius:8px;background:var(--surface)}
.next h2{font-size:clamp(30px,5.4vw,46px)}
.next .eyebrow{color:var(--hero-line)}

.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.stats div{display:flex;flex-direction:column;gap:5px;padding:12px 14px;border:1.5px solid var(--line);border-radius:6px;background:var(--surface)}
.stats b{font:800 34px/1 var(--display);font-variant-numeric:tabular-nums}
.stats span{font:600 12px/1.1 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.sec{font-size:22px;margin-top:8px}
.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
@media (max-width:560px){ .tiles{grid-template-columns:repeat(2,minmax(0,1fr))} }
.tiles .unit{grid-column:1/-1;margin:6px 0 0;font:700 12px/1 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.tiles button{display:flex;flex-direction:column;gap:6px;align-items:flex-start;text-align:left;padding:12px;min-height:84px;border:1.5px solid var(--line);border-radius:6px;
  background:var(--surface);color:var(--ink);font:600 15px/1.2 var(--body);cursor:pointer}
.tiles button i{font:800 22px/1 var(--display);font-style:normal;color:var(--muted)}
.tiles button.done{border-color:var(--good)}
.tiles button.done i{color:var(--good)}
.tiles button.up{border-color:var(--hero);box-shadow:inset 0 0 0 1px var(--hero)}
.row{display:flex;flex-wrap:wrap;gap:8px}

/* position: asked once, shown on the home screen, and a switch to look at the other position's lessons */
.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;width:100%}
@media (max-width:560px){ .choices{grid-template-columns:1fr} }
.choices button{display:flex;flex-direction:column;gap:10px;align-items:flex-start;text-align:left;padding:22px;min-height:170px;border:2px solid var(--ink);border-radius:8px;
  background:var(--surface);color:var(--ink);cursor:pointer;touch-action:manipulation}
.choices button b{font:800 clamp(34px,6vw,50px)/1 var(--display);text-transform:uppercase;letter-spacing:.01em}
.choices button span{font:500 17px/1.4 var(--body);color:var(--muted)}
.choices button em{font:700 12px/1 var(--body);font-style:normal;letter-spacing:.12em;text-transform:uppercase;color:var(--hero-line)}
.choices button[aria-pressed="true"]{border-color:var(--hero);box-shadow:inset 0 0 0 2px var(--hero)}
.pos{display:flex;align-items:center;gap:6px;margin-top:-10px;color:var(--muted);font-weight:600}
.link{border:0;background:none;color:var(--ink);font:600 15px/1 var(--body);text-decoration:underline;text-underline-offset:3px;padding:14px 8px;cursor:pointer;touch-action:manipulation}
.sechead{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.seg{display:flex;border:1.5px solid var(--ink);border-radius:4px;overflow:hidden}
.seg button{padding:10px 14px;min-height:40px;border:0;background:transparent;color:var(--ink);font:800 16px/1 var(--display);letter-spacing:.06em;text-transform:uppercase;cursor:pointer;touch-action:manipulation}
.seg button[aria-selected="true"]{background:var(--ink);color:var(--bg)}
#home .lb{display:flex;max-width:none}

/* inside the app the player has no big page header, and players are accounts, not typed names */
.hosted .top,.hosted #d-who,.hosted .add{display:none}
.hosted .wrap{padding-block:10px 40px;gap:12px}
/* Inside the app the home screen does the navigating, so a lesson shows only what it needs: the rink, the caption and the controls. */
.hosted #modes,.hosted #plays,.hosted #games,.hosted .card,.hosted .cues,.hosted #again{display:none}
.where{font:800 22px/1 var(--display);text-transform:uppercase;letter-spacing:.03em}
.hosted .ctrl{gap:10px}
.hosted .ctrl .btn{min-height:48px}
.hosted .ctrl .btn.go{font-size:24px;padding:12px 30px;min-width:132px}
.hosted .ctrl .btn.sm{min-height:44px}
.hosted #speed{margin-left:auto}
.hosted .say{font-size:18px}
.hosted .legend,.hosted .nums{opacity:.85}
/* iPad landscape: keep the whole rink on screen */
@media (orientation:landscape) and (min-width:860px) and (max-height:900px){
  .hosted .board{grid-template-columns:minmax(0,min(520px,calc((100vh - 150px) * .93))) minmax(0,1fr)}
}
/* these were style attributes in the playbook page; the server's policy allows none */
.legend .arr{stroke-width:1.6}
.legend .arr.pass{stroke-dasharray:4 3.5}
.legend .arr.shot{stroke-width:5}
.legend .arr.shot2{stroke-width:1.8}

/* privacy and terms: plain reading pages */
.doc{max-width:680px;gap:14px}
.doc h1{font-size:clamp(40px,8vw,60px);margin-top:10px}
.doc h2{font-size:26px;margin-top:12px}
.doc p,.doc li{font-size:17px;line-height:1.55;max-width:66ch}
.doc ul{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:8px}
.doc .note{font-size:14px;margin-top:10px}
.doc a,.foot a{color:inherit;text-underline-offset:3px}
.doc a.brand{text-decoration:none;align-self:flex-start}
.foot{font-size:14px;color:var(--muted);display:flex;gap:16px}
.foot a{display:inline-block;padding:10px 0}

/* a short note when something new has been added */
.news{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0;padding:10px 14px;border:1.5px solid var(--hero);border-radius:6px;background:var(--surface);font-weight:600}
.news span{flex:1;min-width:220px}

/* one thing for the next game */
.focus{display:flex;flex-direction:column;gap:10px;align-items:flex-start;padding:16px 18px;border:1.5px solid var(--line);border-radius:8px;background:var(--surface)}
.focus .eyebrow{color:var(--hero-line);margin:0}
.focus-rule{margin:0;font:800 clamp(22px,3.8vw,30px)/1.1 var(--display);text-transform:uppercase;letter-spacing:.01em}
.focus .row{width:100%}
.focus .row .btn.rule{flex:1 1 200px;text-align:left;white-space:normal;line-height:1.25;text-transform:none;letter-spacing:0;font:600 16px/1.25 var(--body)}
.focus .note{margin:0}

/* unit challenge tiles */
.tiles button.chal{border-style:dashed}
.tiles button.chal i{font-size:16px;letter-spacing:.08em;text-transform:uppercase;color:var(--hero-line)}
.tiles button.chal.done{border-style:solid}
.tiles button.chal.done i{color:var(--good)}
.tiles button.chal:disabled{opacity:.55;cursor:default}

/* the parent view */
.fam{display:flex;flex-direction:column;gap:14px}
.fam .kid{display:flex;flex-direction:column;gap:8px;padding:18px;border:1.5px solid var(--line);border-radius:8px;background:var(--surface)}
.fam .kid h2{font-size:30px;margin:0}
.fam .kid p{margin:0}
.fam .kid .part{margin-top:6px}
.fam .kid ul{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:4px}
.fam .facts{display:flex;flex-wrap:wrap;gap:6px 18px;color:var(--muted);font-weight:600}
.tiles button.chal{grid-column:1/-1;flex-direction:row;align-items:center;gap:14px;min-height:56px}

/* my rules: one card per finished lesson */
.cards{display:flex;flex-direction:column;gap:12px}
.cards .unit{margin:10px 0 0;font:700 12px/1 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.rcard{display:grid;grid-template-columns:minmax(0,200px) minmax(0,1fr);gap:16px;align-items:start;padding:14px;border:1.5px solid var(--line);border-radius:8px;background:var(--surface);break-inside:avoid}
.rcard img{width:100%;height:auto;border-radius:4px;display:block}
.rcard .eyebrow{margin:0 0 6px}
.rcard h2{font-size:clamp(22px,3.6vw,30px);margin:0 0 8px}
.rcard ul{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:3px;color:var(--muted)}
@media (max-width:560px){ .rcard{grid-template-columns:1fr} .rcard img{max-width:240px} }
@media print{
  #myrules .bar button{display:none}
  body{background:#fff}
  .rcard{border-color:#999}
}

/* a unit's row on the home screen: open for the unit being worked on, one line for the rest */
.tiles .unitrow{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:12px;min-height:48px;padding:8px 14px;margin-top:4px;border:1.5px solid var(--line);border-radius:6px;background:transparent;cursor:pointer}
.tiles .unitrow b{font:700 12px/1.2 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--ink)}
.tiles .unitrow span{flex:1;font:500 14px/1.2 var(--body);color:var(--muted)}
.tiles .unitrow em{font:700 12px/1 var(--body);font-style:normal;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);text-decoration:underline;text-underline-offset:3px}
.tiles .unitrow[aria-expanded="true"]{border-color:transparent;padding-left:0;padding-right:0;min-height:36px}

/* ice view: the 3D picture takes the stage, with the question written over it */
.hosted .board.ice{grid-template-columns:minmax(0,1fr);grid-template-areas:"stage" "head" "panel"}
.hosted .board.ice .stage{max-width:none}
.board.ice #rink{display:none}
.icewrap{position:relative;width:100%;aspect-ratio:16/9;max-height:calc(100vh - 120px);border-radius:10px;overflow:hidden;background:#0b1622;touch-action:none;user-select:none;-webkit-user-select:none}
.icecanvas{display:block;width:100%;height:100%;cursor:crosshair}
.ice-hud{position:absolute;left:12px;top:14px;max-width:min(62%,560px);padding:10px 14px;border-radius:8px;background:rgba(11,22,34,.74);color:#fff;pointer-events:none}
.ice-hud p{margin:0}
.ice-sit{font:700 11px/1.3 var(--body);letter-spacing:.12em;text-transform:uppercase;color:#ffb37a}
.ice-ask{font:800 clamp(20px,3.2vw,30px)/1.1 var(--display);text-transform:uppercase;letter-spacing:.01em}
.ice-ask.y{color:#7fe3a4}.ice-ask.n{color:#ff9aa5}.ice-ask.fix{color:#ffd27a}
.ice-why{font:500 15px/1.35 var(--body);color:#e4ecf3}
.ice-hud p:empty{display:none}
.ice-clock{position:absolute;left:0;top:0;width:100%;height:5px;background:#f2701c;transform-origin:left center}
.ice-score{position:absolute;right:12px;top:14px;margin:0;padding:8px 12px;border-radius:8px;background:rgba(11,22,34,.74);color:#fff;font:700 13px/1 var(--body);letter-spacing:.06em;white-space:pre;pointer-events:none}
.ice-score:empty{display:none}
.ice-back{position:absolute;right:12px;bottom:12px;min-height:48px;padding:10px 18px;border:2px solid #fff;border-radius:8px;background:rgba(11,22,34,.74);color:#fff;font:800 17px/1 var(--display);letter-spacing:.06em;text-transform:uppercase;cursor:pointer;touch-action:manipulation}
.ice-back[aria-pressed="true"]{background:#f2701c;border-color:#f2701c;color:#0b1622}
.ice-tip{position:absolute;left:12px;bottom:14px;margin:0;padding:8px 12px;border-radius:8px;background:rgba(11,22,34,.6);color:#dfe8f0;font:500 13px/1.2 var(--body);pointer-events:none}
.board.ice #d-sit,.board.ice #d-ask,.board.ice #d-why{display:none}
