/* Ollie's Dino Dig — chunky kid-friendly styling, big touch targets */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  touch-action: manipulation;
  font-family: "Chalkboard SE", "Comic Sans MS", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #ffe9b8 0%, #f7d98b 45%, #eec27a 100%);
  min-height: 100vh;
  color: #4a2f16;
  user-select: none; -webkit-user-select: none;
}

#app { max-width: 860px; margin: 0 auto; padding: 12px 14px 40px; }

h1 { font-size: 2.2rem; margin: 6px 0 2px; text-align: center; }
.subtitle { text-align: center; font-size: 1.15rem; margin-bottom: 14px; opacity: .85; }

/* ---------- hub ---------- */
.stations { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .stations { grid-template-columns: 1fr; } }

.station {
  background: #fffdf6;
  border: 4px solid #8a5a2b;
  border-radius: 26px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #8a5a2b;
  transition: transform .08s;
}
.station:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a2b; }
.station .emoji { font-size: 3.2rem; line-height: 1; }
.station .name { font-size: 1.35rem; font-weight: bold; margin-top: 6px; }
.station .desc { font-size: .95rem; opacity: .75; margin-top: 2px; }
.station .stars { font-size: 1.1rem; margin-top: 6px; }

.grownups {
  margin-top: 22px; background: rgba(255,255,255,.55);
  border: 2px dashed #8a5a2b; border-radius: 16px;
  padding: 10px 14px; font-size: .85rem; line-height: 1.5;
}

/* ---------- game chrome ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.homebtn {
  font-size: 1.6rem; background: #fffdf6; border: 3px solid #8a5a2b;
  border-radius: 16px; width: 56px; height: 56px; cursor: pointer;
  box-shadow: 0 3px 0 #8a5a2b;
}
.gametitle { font-size: 1.5rem; font-weight: bold; flex: 1; }
.score { font-size: 1.3rem; font-weight: bold; background: #fffdf6;
  border: 3px solid #8a5a2b; border-radius: 14px; padding: 6px 12px; }

.prompt {
  background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 22px;
  padding: 16px; font-size: 1.5rem; font-weight: bold; text-align: center;
  margin-bottom: 14px; line-height: 1.35;
}
.prompt .say { font-size: 2rem; }

.replay {
  display: block; margin: 0 auto 14px; font-size: 1.15rem; font-family: inherit;
  background: #7ec8f7; border: 3px solid #2f6d9e; color: #123;
  border-radius: 999px; padding: 10px 22px; cursor: pointer;
  box-shadow: 0 3px 0 #2f6d9e;
}
.replay:active { transform: translateY(2px); box-shadow: none; }

.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.choice {
  font-family: inherit;
  background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 24px;
  min-width: 104px; min-height: 104px; padding: 10px 14px;
  font-size: 3rem; cursor: pointer; box-shadow: 0 5px 0 #8a5a2b;
  transition: transform .08s; color: #4a2f16;
}
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a2b; }
.choice.word { font-size: 2rem; font-weight: bold; min-width: 130px; }
.choice.num { font-size: 3.4rem; font-weight: bold; }
.choice.shake { animation: shake .4s; border-color: #c0392b; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.choice.lit { background: #ffe27a; border-color: #d99a1f; }

.hatch { animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(74,47,22,.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.overlay .card {
  background: #fffdf6; border: 5px solid #8a5a2b; border-radius: 28px;
  padding: 30px 44px; text-align: center; animation: pop .35s;
}
.overlay .card .big { font-size: 4rem; }
.overlay .card .msg { font-size: 1.8rem; font-weight: bold; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #4a2f16; color: #ffe9b8; font-size: 1.3rem; font-weight: bold;
  padding: 12px 26px; border-radius: 999px; z-index: 60;
  animation: toastin .25s;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- stretchy tiles ---------- */
.tiles { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.tile {
  background: #fffdf6; border: 4px solid #2f9e44; border-radius: 20px;
  min-width: 92px; min-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #1d5c2a;
}
.tletter { font-size: 2.4rem; font-weight: bold; line-height: 1.1; }
.tsound { font-size: 1.2rem; color: #5a8a63; line-height: 1.2; }
.tile.lit { background: #b8f0c2; transform: scale(1.12); }
.wordlabel { font-size: 1.15rem; font-weight: bold; margin-top: 4px; color: #4a2f16; }

/* ---------- magnet cave ---------- */
.magnet-stage {
  background: #3b2b1f; border-radius: 24px; height: 190px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.magnet {
  position: absolute; top: 66px; transition: transform .8s ease;
}
.magnet.left { left: 14%; }
.magnet.right { right: 14%; }
.magnet-stage.pull .magnet.left { transform: translateX(46px); }
.magnet-stage.pull .magnet.right { transform: translateX(-46px); }
.magnet-stage.push .magnet.left { transform: translateX(-58px); }
.magnet-stage.push .magnet.right { transform: translateX(58px); }
.magnet-stage.push { animation: mshake .45s; }
@keyframes mshake {
  0%,100% { margin-left: 0; } 25% { margin-left: -10px; } 75% { margin-left: 10px; }
}

/* bar magnets with N/S poles */
.barmag {
  display: flex; width: 150px; height: 52px;
  border: 4px solid #211a13; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.barmag.flip { flex-direction: row-reverse; }
.barmag .pole {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 900; color: #fff;
}
.barmag .pole.N { background: #e53935; }
.barmag .pole.S { background: #1e88e5; }
.polecap { text-align: center; font-size: 1.35rem; font-weight: bold; margin: 4px 0 12px; }

.bigbtn {
  font-family: inherit; font-size: 1.7rem; font-weight: bold;
  background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 22px;
  padding: 16px 26px; cursor: pointer; box-shadow: 0 5px 0 #8a5a2b; color: #4a2f16;
}
.bigbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a2b; }
.bigbtn.go { background: #9be15d; border-color: #3f7a1f; font-size: 2rem; }

.stompbtn { font-size: 4.5rem; background: none; border: none; cursor: pointer; }
.stompbtn:active { transform: scale(.9); }
.stompcount { font-size: 2.2rem; font-weight: bold; text-align: center; margin: 8px 0 14px; }

.dino-says {
  display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 8px;
}
.dino-says .dino { font-size: 4rem; }
.speech {
  background: #fffdf6; border: 3px solid #8a5a2b; border-radius: 18px;
  padding: 10px 16px; font-size: 1.4rem; font-weight: bold; position: relative;
}

.endstars { font-size: 3.4rem; text-align: center; margin: 10px 0; }
.endmsg { font-size: 1.7rem; font-weight: bold; text-align: center; margin-bottom: 18px; }
.endbtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================= v2: Dino Trek ================= */

/* ---------- buddy picker ---------- */
.buddy-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.buddy-card {
  font-family: inherit; color: #4a2f16;
  background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 24px;
  padding: 18px 22px; cursor: pointer; text-align: center;
  box-shadow: 0 5px 0 #8a5a2b; transition: transform .08s;
}
.buddy-card:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a2b; }
.buddy-face {
  font-size: 3.6rem; width: 104px; height: 104px; line-height: 104px;
  border-radius: 50%; margin: 0 auto 8px; border: 5px solid; background: #fff;
}
.buddy-name { font-size: 1.6rem; font-weight: bold; }

/* ---------- trail hub ---------- */
.buddy-chip { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 4px; }
.buddy-chip .face {
  font-size: 2rem; width: 54px; height: 54px; line-height: 54px;
  border-radius: 50%; border: 4px solid; text-align: center; background: #fffdf6;
}
.buddy-chip .bname { font-size: 1.4rem; font-weight: bold; }
.iconbtn {
  font-family: inherit; font-size: 1.4rem; background: #fffdf6;
  border: 3px solid #8a5a2b; border-radius: 14px; width: 52px; height: 52px;
  cursor: pointer; box-shadow: 0 3px 0 #8a5a2b;
}
.iconbtn:active { transform: translateY(2px); box-shadow: none; }

.trail { position: relative; max-width: 600px; margin: 0 auto; padding: 14px 0 6px; }
.trail::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 8px; margin-left: -4px; border-radius: 4px; opacity: .55;
  background-image: linear-gradient(#b98a4e 60%, rgba(0,0,0,0) 40%);
  background-size: 8px 26px;
}
.tstop {
  position: relative; width: 46%;
  font-family: inherit; color: #4a2f16;
  background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 22px;
  padding: 12px 10px; margin: 14px 0; cursor: pointer; text-align: center;
  box-shadow: 0 5px 0 #8a5a2b; transition: transform .08s;
}
.tstop:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a2b; }
.tstop:nth-child(odd) { margin-right: 54%; }
.tstop:nth-child(even) { margin-left: 54%; }
.tstop .emoji { font-size: 3rem; line-height: 1; }
.tstop .name { font-size: 1.25rem; font-weight: bold; margin-top: 4px; }
.tstop .desc { font-size: .9rem; opacity: .75; margin-top: 2px; }
.tstop .stars { font-size: 1rem; margin-top: 4px; }
.tstop.done { border-color: #2f9e44; }
.tstop.done .emoji, .tstop.done .name { opacity: .7; }
.tstop .donemark { position: absolute; top: -16px; right: -12px; font-size: 2rem; }
.buddy-here {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  font-size: 2.4rem; animation: bob 1.2s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); }
}
.treknote { text-align: center; font-size: 1.15rem; font-weight: bold; margin: 8px 0 0; }

/* ---------- trek strip on end screens ---------- */
.trekstrip { display: flex; gap: 8px; justify-content: center; margin: 2px 0 8px; font-size: 2rem; }
.trekmsg { text-align: center; font-size: 1.25rem; font-weight: bold; margin-bottom: 14px; }

/* ---------- fossil dig + collection book ---------- */
.dig-mound { font-size: 5rem; text-align: center; cursor: pointer; margin: 16px 0; animation: bob 1.2s ease-in-out infinite; }
.dig-reveal { text-align: center; animation: pop .5s; margin-bottom: 8px; }
.dig-reveal .femoji { font-size: 5rem; }
.dig-reveal .fname { font-size: 2rem; font-weight: bold; margin-top: 6px; }
.fossil-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 560px; margin: 14px auto; }
@media (max-width: 560px) { .fossil-grid { grid-template-columns: repeat(2, 1fr); } }
.fossil { background: #fffdf6; border: 4px solid #8a5a2b; border-radius: 20px; padding: 14px 8px; text-align: center; }
.fossil .femoji { font-size: 3rem; }
.fossil .fname { font-size: 1.05rem; font-weight: bold; margin-top: 4px; }
.fossil.missing { opacity: .55; border-style: dashed; }
