/* Firebird: The Golden Grove — shell styles. Canvas does the scenery. */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  background: #0c1a12;
  font-family: Georgia, 'Times New Roman', serif;
  color: #f3e9d0;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

#cv { flex: 1 1 auto; width: 100%; height: 100%; display: block; touch-action: manipulation; }

/* ------------------------------------------------------------------ HUD */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(6,14,9,.88), rgba(6,14,9,.55) 75%, transparent);
  pointer-events: none;
  z-index: 5;
}
#hud > * { pointer-events: auto; }
#hud-mid { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 0; }
#hud-chapter { font-size: 13px; letter-spacing: .04em; color: #d8c79a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#hud-score { font-size: 19px; font-weight: 700; color: #ffe9a8; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.hbtn {
  border: 1px solid rgba(246,196,83,.45);
  background: rgba(20,32,22,.85);
  color: #ffe9a8;
  border-radius: 9px;
  min-width: 38px; height: 36px;
  font-size: 16px; font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s ease, background .12s ease;
}
.hbtn:active { transform: scale(.92); }
.hbtn.boost span { font-size: 11px; color: #f6c453; }
.hbtn:hover { background: rgba(60,50,20,.9); }

/* ------------------------------------------------------------- overlays */
.ov {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 6, .66);
  backdrop-filter: blur(3px);
  z-index: 10;
  overflow-y: auto;
}
.card {
  background: linear-gradient(180deg, #1b2b1d, #101c11);
  border: 1px solid rgba(246,196,83,.5);
  border-radius: 18px;
  padding: 26px 30px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,233,168,.15);
  animation: rise .35s ease;
}
.card.wide { max-width: 560px; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.kicker {
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: #b8a468; margin-bottom: 8px;
}
h1 {
  font-size: clamp(38px, 9vw, 58px);
  color: #f6c453;
  letter-spacing: .06em;
  text-shadow: 0 2px 0 #7d5324, 0 6px 22px rgba(246,196,83,.35);
  line-height: 1;
}
h2 { font-size: 24px; color: #f6c453; margin-bottom: 10px; letter-spacing: .03em; }
.title-card .sub {
  font-size: 17px; letter-spacing: .34em; text-transform: uppercase;
  color: #d8c79a; margin: 6px 0 14px;
}
.lore { font-size: 14.5px; line-height: 1.65; color: #cfc3a2; margin: 10px 0 16px; }
.goal { font-size: 13px; color: #9db389; margin-bottom: 16px; font-style: italic; }
.hint { font-size: 13px; color: #9a9276; margin: 8px 0 14px; }
.stars { font-size: 34px; color: #f6c453; letter-spacing: .1em; margin: 6px 0 10px; text-shadow: 0 0 18px rgba(246,196,83,.5); }

button.big, button.ghost {
  display: block; width: 100%;
  margin: 9px 0 0;
  padding: 13px 18px;
  border-radius: 12px;
  font-family: inherit; font-size: 17px; letter-spacing: .05em;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
button.big {
  border: none;
  background: linear-gradient(180deg, #f6c453, #d89a2e);
  color: #2a1c07; font-weight: 700;
  box-shadow: 0 6px 18px rgba(246,196,83,.35);
}
button.big:hover { filter: brightness(1.07); }
button.ghost {
  background: transparent;
  border: 1px solid rgba(246,196,83,.4);
  color: #d8c79a; font-size: 14px; padding: 10px 18px;
}
button.ghost:hover { background: rgba(246,196,83,.08); }
button.big:active, button.ghost:active { transform: scale(.97); }

/* ------------------------------------------------------------ chapter map */
#grid-btns { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0 10px; }
.grid-act {
  grid-column: 1 / -1;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: #b8a468; text-align: left; margin: 10px 0 2px;
  border-bottom: 1px solid rgba(246,196,83,.2); padding-bottom: 4px;
}
.grid-btn {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(246,196,83,.45);
  background: rgba(246,196,83,.1);
  color: #ffe9a8; font-family: inherit; font-size: 13px;
  cursor: pointer; transition: transform .1s ease, background .1s ease;
  white-space: nowrap; overflow: hidden;
}
.grid-btn:hover { background: rgba(246,196,83,.25); transform: scale(1.06); }
.grid-btn.locked { opacity: .32; cursor: not-allowed; }
.grid-btn.locked:hover { transform: none; background: rgba(246,196,83,.1); }

@media (max-width: 560px) {
  .card { padding: 20px 18px; }
  #grid-btns { grid-template-columns: repeat(5, 1fr); }
  .hbtn { min-width: 34px; height: 33px; font-size: 14px; }
  #hud-chapter { font-size: 11px; }
}
