/* welcome.css - the home screen: Hak says hello and there is one big Play button.
   It replaces the old dashboard-style home. Load after css/adventure.css and before css/input.css.
   Everything is sized from the viewport (vmin) with clamps, so it reads well on a phone, an iPad and a laptop. */

#screen-title{display:block;padding:0;background:#8fd6ff;overflow-x:hidden;overflow-y:auto;touch-action:pan-y;color:var(--ink);isolation:isolate;text-align:left}

.welcome{position:relative;min-height:100%;box-sizing:border-box;display:flex;flex-direction:column;
  padding:calc(clamp(12px,2.4vmin,26px) + env(safe-area-inset-top,0px)) calc(clamp(16px,4vw,56px) + env(safe-area-inset-right,0px)) calc(clamp(12px,2.4vmin,26px) + env(safe-area-inset-bottom,0px)) calc(clamp(16px,4vw,56px) + env(safe-area-inset-left,0px))}

/* ---------- the sunny scene behind everything ---------- */
.welcome-scene{position:absolute;inset:0;z-index:-1;overflow:hidden;background:linear-gradient(180deg,#58C1FF 0%,#86D5FF 40%,#B4E7FF 72%,#D3F3FF 100%)}
.welcome-scene::after{content:"";position:absolute;left:0;right:0;bottom:0;height:5%;background:#2FCB70}
.welcome-scene .sun{position:absolute;top:5%;right:7%;width:clamp(70px,17vmin,170px);aspect-ratio:1;border-radius:50%;
  background:radial-gradient(circle at 38% 35%,#FFF6B8,#FFD84D 55%,#FFC53D);
  box-shadow:0 0 0 clamp(8px,2.4vmin,22px) #fff3a855,0 0 0 clamp(18px,5vmin,46px) #fff3a82e}
.welcome-scene .cloud{position:absolute;top:var(--y);left:-30%;width:var(--w);height:calc(var(--w) * .3);background:#fff;border-radius:999px;opacity:.95;
  filter:drop-shadow(0 6px 0 #c4e9fa);animation:cloud var(--d) linear var(--l) infinite;will-change:transform}
.welcome-scene .cloud::before,.welcome-scene .cloud::after{content:"";position:absolute;background:#fff;border-radius:50%}
.welcome-scene .cloud::before{width:40%;height:150%;left:14%;bottom:34%}
.welcome-scene .cloud::after{width:32%;height:120%;right:16%;bottom:34%}
@keyframes cloud{from{transform:translateX(0)}to{transform:translateX(170vw)}}
/* the Kenney background tiles are opaque with a white sky: multiply (faded far hills) and darken (the green near hills keep their colour) let the sky behind them show through */
.welcome-scene .hills{position:absolute;left:0;right:0;bottom:0;background-repeat:repeat-x}
.welcome-scene .hills.far{height:64%;background-image:url('../assets/kenney/bg/background_fade_hills.png');background-size:auto 100%;background-position:18% 100%;mix-blend-mode:multiply}
.welcome-scene .hills.near{height:46%;background-image:url('../assets/kenney/bg/background_color_trees.png');background-size:auto 100%;background-position:40% 100%;mix-blend-mode:darken}
.welcome-scene .float{position:absolute;left:var(--x);top:var(--y);width:var(--s);height:var(--s);filter:drop-shadow(0 6px 0 rgba(10,79,122,.18));animation:bob var(--d) ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0) rotate(-6deg)}50%{transform:translateY(-14px) rotate(6deg)}}

.welcome-noscript{position:relative;z-index:2;margin:0 0 12px;padding:14px 18px;border-radius:18px;background:#fff;color:var(--ink);font:700 20px/1.4 var(--body);box-shadow:0 4px 0 #9fd0e6}

/* ---------- the top bar ---------- */
.welcome-top{display:flex;align-items:center;justify-content:space-between;gap:16px}
.welcome-mark{display:inline-block;font:800 clamp(26px,4.6vmin,44px)/1 var(--display);color:#0E8E86;letter-spacing:-.5px;background:#fff;border-radius:999px;padding:.16em .6em .22em;box-shadow:0 5px 0 #9fd0e6,0 10px 22px #0a4f7a33;transform:rotate(-2deg)}
.welcome-mark b{color:#F08A00;font-weight:800}
.welcome .round-button{width:clamp(46px,6.4vmin,60px);height:clamp(46px,6.4vmin,60px);border:0;background:#fff;color:#1d6f93;box-shadow:0 4px 0 #9fd0e6,0 8px 18px #0a4f7a30;--mq-lip:0 4px 0 #9fd0e6,0 8px 18px #0a4f7a30}
.welcome .round-button svg{width:52%;height:52%}
.welcome .round-button[aria-pressed=true]{opacity:1;background:#ffe3df;color:#c4503f}

/* ---------- Hak and what he says ---------- */
.welcome-main{flex:1;display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.5fr);align-items:center;gap:clamp(12px,3vw,48px);width:100%;max-width:1180px;margin:0 auto;padding:clamp(8px,2vmin,24px) 0}
.welcome-hak{display:grid;place-items:end center;min-width:0}
.welcome-hak canvas{display:block;width:min(100%,clamp(150px,42vmin,390px));height:auto;aspect-ratio:360/390;filter:drop-shadow(0 12px 0 rgba(20,90,70,.16));transform-origin:50% 100%;animation:hakBob 3.4s ease-in-out infinite}
@keyframes hakBob{0%,100%{transform:translateY(0) rotate(-1.5deg)}50%{transform:translateY(-12px) rotate(1.5deg)}}
.welcome-talk{display:flex;flex-direction:column;align-items:flex-start;gap:clamp(12px,2.4vmin,24px);min-width:0}

.bubble{position:relative;isolation:isolate;box-sizing:border-box;width:100%;max-width:40rem;background:#fff;border-radius:clamp(22px,4vmin,34px);padding:clamp(16px,3.2vmin,34px) clamp(20px,4vmin,40px);
  box-shadow:0 10px 0 #b8def0,0 24px 50px rgba(20,80,120,.25)}
.bubble::after{content:"";position:absolute;z-index:-1;left:-15px;top:clamp(34px,8.4vmin,84px);width:36px;height:36px;border-radius:8px;background:#fff;transform:rotate(45deg);box-shadow:-4px 5px 0 #b8def0}
.bubble h1{margin:0 0 .3em;font:800 clamp(30px,6.2vmin,60px)/1.05 var(--display);color:#0E8E86;letter-spacing:-.5px}
.bubble p{margin:.3em 0 0;font:700 clamp(20px,3.6vmin,32px)/1.3 var(--body);color:var(--ink)}
.bubble h1,.bubble p{animation:rise .7s cubic-bezier(.2,.9,.3,1.2) both}
.bubble h1{animation-delay:.15s}
.bubble p:nth-of-type(1){animation-delay:.8s}
.bubble p:nth-of-type(2){animation-delay:1.4s}
@keyframes rise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}

.welcome-back,.welcome-hint{margin:0;border-radius:999px;background:#ffffffeb;box-shadow:0 4px 0 #9fd0e6;padding:.3em 1em}
.welcome-back{font:800 clamp(20px,3.2vmin,28px)/1.2 var(--display);color:#0E8E86}
.welcome-hint{display:inline-block;font:700 clamp(16px,2.4vmin,20px)/1.3 var(--body);color:var(--ink)}
.welcome-hint:empty,.welcome-back[hidden]{display:none}

/* ---------- the big Play button ---------- */
.play-button{--lip:#C97C00;appearance:none;-webkit-appearance:none;border:0;cursor:pointer;display:inline-flex;align-items:center;gap:.45em;
  padding:.34em 1.15em .34em .42em;border-radius:999px;font:800 clamp(36px,6.6vmin,64px)/1 var(--display);color:#4A2B00;letter-spacing:.5px;
  background:linear-gradient(#FFE27A,#FFB92B);box-shadow:0 9px 0 var(--lip),0 20px 34px #0a4f7a44,inset 0 4px 0 #fff9;
  --mq-lip:0 9px 0 #C97C00,0 20px 34px #0a4f7a44;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
  transition:transform .12s ease,box-shadow .12s ease;animation:popIn .6s cubic-bezier(.2,.9,.3,1.3) .1s both,playPulse 2.6s ease-in-out 1.2s infinite}
.play-icon{display:grid;place-items:center;flex:none;width:1.45em;height:1.45em;border-radius:50%;background:#fff;color:#F08A00;box-shadow:inset 0 -5px 0 #ffd88a}
.play-icon svg{width:60%;height:60%;fill:currentColor;stroke:none;margin-left:8%}
.play-button:hover{transform:translateY(-3px) scale(1.04)}
.play-button:active{transform:translateY(7px);box-shadow:0 2px 0 var(--lip),0 6px 12px #0a4f7a44,inset 0 4px 0 #fff9;animation:none}
@keyframes popIn{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}
@keyframes playPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}

/* ---------- the little buttons at the bottom ---------- */
.welcome-foot{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;padding-top:8px}
.pill-button{display:inline-flex;align-items:center;gap:.5em;min-height:48px;padding:.5em 1.15em;border:0;border-radius:999px;cursor:pointer;background:#ffffffeb;color:#1d5f7a;
  font:800 clamp(16px,2.7vmin,22px)/1 var(--body);box-shadow:0 4px 0 #9fd0e6,0 8px 18px #0a4f7a30;--mq-lip:0 4px 0 #9fd0e6,0 8px 18px #0a4f7a30;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.pill-button svg{width:1.25em;height:1.25em;flex:none}
.pill-button:hover{background:#fff;transform:translateY(-2px)}
.pill-button:active{transform:translateY(3px);box-shadow:0 1px 0 #9fd0e6}

/* ---------- tall and narrow screens (a phone, an iPad held upright): Hak on top, then what he says ---------- */
@media (max-aspect-ratio:1/1),(max-width:700px){
  .welcome-main{grid-template-columns:minmax(0,1fr);align-content:center;justify-items:center;gap:clamp(6px,1.6vmin,18px)}
  .welcome-hak{margin-bottom:12px}
  .welcome-hak canvas{width:min(100%,clamp(120px,27vh,320px))}
  .welcome-scene .hills.near{height:34%}
  .welcome-scene .hills.far{height:50%}
  .welcome-talk{align-items:center;text-align:center;width:100%}
  .bubble{text-align:center}
  .bubble::after{left:calc(50% - 18px);top:-15px;transform:rotate(45deg);box-shadow:-5px -4px 0 #b8def0}
}

/* ---------- a short window (a phone on its side, Safari with its toolbars) ---------- */
@media (max-height:560px){
  .welcome{padding-top:calc(8px + env(safe-area-inset-top,0px));padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}
  .welcome-main{padding:4px 0}
  .welcome-talk{gap:10px}
  .bubble{padding:12px 20px}
  .welcome-foot{padding-top:2px}
  .pill-button{min-height:44px}
}

/* ---------- the other screens (creator, settings, report) share the sunny scene ---------- */
.screen:not(#screen-title){background-color:#8fd6ff;
  background-image:url('../assets/kenney/bg/background_color_trees.png'),linear-gradient(180deg,#58C1FF 0%,#86D5FF 45%,#B4E7FF 100%);
  background-repeat:repeat-x,no-repeat;background-position:40% 100%,0 0;background-size:auto 46%,100% 100%;background-blend-mode:darken,normal}

/* ---------- text a seven-year-old can read: the creator, the guide and the journal ---------- */
.creator{max-width:520px}
.creator .eyebrow{font-size:12px;letter-spacing:1.4px;color:#2d7d8c}
.creator h2{font-size:clamp(30px,5vmin,40px)}
.panel-back{font-size:15px;color:#2d7d8c;padding:6px 0 10px}
.creator .field .lbl{font-size:13px;letter-spacing:.8px;color:#2d7d8c}
.creator .pickview{font-size:19px}
.creator .arrow{width:42px;height:42px;min-width:42px;min-height:42px;font-size:26px}
.creator .seg button{font-size:17px;padding:9px}
.creator .ctrlcard .cl{font-size:14px}
.creator #nameInput{font-size:18px;padding:10px 14px}
.creator .sw{width:40px;height:40px;min-width:40px;min-height:40px}
.pose-picker button{font-size:14px}

.info-dialog{width:min(94vw,580px);padding:clamp(22px,4vmin,38px)}
.info-dialog .eyebrow{font-size:13px;letter-spacing:1.4px;color:#2d7d8c}
.info-dialog h2{font-size:clamp(30px,5vmin,42px);margin:10px 0 14px}
.info-dialog p{font-size:17px;line-height:1.5;color:#3d5a61}
.guide-step{gap:16px;margin:16px 0}
.guide-step>span{width:52px;height:52px;font-size:28px;border-radius:16px;background:#e4f6f4}
.guide-step b{display:block;font-size:21px;color:var(--ink)}
.guide-step p{font-size:17px;margin:4px 0 0}
.journal-table>div:first-child{font-size:19px}
.journal-table small{font-size:15px}
.journal-table .quest-track{height:12px}
.info-dialog .adventure-button{font-size:22px;padding:.6em 1.4em}

/* the creator in two columns on a wide screen: Hak's explorer on the left, the choices on the right (no scrolling on an iPad lying down) */
.creator-cols{display:block}
@media (min-aspect-ratio:11/10) and (min-width:760px){
  .creator{max-width:980px;width:min(94vw,980px);padding:clamp(14px,2.4vmin,26px) clamp(22px,3.4vw,44px)}
  .creator>.eyebrow,.creator>h2{text-align:center}
  .creator>.panel-back{align-self:flex-start}
  .creator-cols{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);column-gap:clamp(20px,3.4vw,48px);align-items:center}
  .creator-left{display:flex;flex-direction:column;align-items:center}
  .creator .creator-left #avatarPreview{width:clamp(170px,38vmin,330px)!important;height:clamp(170px,38vmin,330px)!important}
}

@media (prefers-reduced-motion:reduce){
  .welcome-scene .cloud,.welcome-scene .float,.welcome-hak canvas,.play-button,.bubble h1,.bubble p{animation:none}
  .welcome-scene .cloud:nth-child(2){left:8%}.welcome-scene .cloud:nth-child(3){left:60%}.welcome-scene .cloud:nth-child(4){left:34%}
  .play-button,.pill-button{transition:none}
}
