/* THE AVIARY — UI chrome. Museum cream + Elliman navy, dawn-sky overlays. */
:root {
  --navy: #1a3e5c;
  --cyan: #00a8e1;
  --white: #ffffff;
  --gray: #333;
  --brass: #b08d3c;
  --brass-bright: #e8c56a;
  --cream: #f2ecdd;
  --ink: #14202b;
  --rose: #e8899e;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #18222c; }
body { font-family: 'Montserrat', Helvetica, Arial, sans-serif; color: var(--white); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(232, 137, 158, 0.18) 0%, rgba(232, 137, 158, 0) 55%),
    radial-gradient(ellipse at 50% 35%, #22394e 0%, #101821 75%);
  padding: 24px; overflow-y: auto;
}

.title-card { max-width: 580px; text-align: center; }
.title-kicker {
  font-size: 11px; letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--cyan); font-weight: 700; margin-bottom: 18px;
}
.title-main {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  font-size: clamp(46px, 10vw, 76px); line-height: 1.05; color: var(--cream);
  margin-bottom: 14px;
}
.title-sub {
  font-family: 'Playfair Display', Georgia, serif; font-style: italic;
  font-size: clamp(17px, 3.5vw, 21px); color: #b9c4cf; margin-bottom: 18px; line-height: 1.5;
}
.title-sub .brass { color: var(--brass-bright); font-style: normal; }
.title-body { font-size: 14px; line-height: 1.65; color: #93a1ae; margin: 0 auto 26px; max-width: 460px; }

#nameForm { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#playerName {
  font-family: inherit; font-size: 16px; padding: 13px 16px; border-radius: 8px;
  border: 1px solid #3c4c5c; background: #10161d; color: var(--white);
  width: min(240px, 60vw); outline: none;
}
#playerName:focus { border-color: var(--cyan); }

.btn-primary {
  font-family: inherit; font-weight: 700; font-size: 15px; letter-spacing: 0.5px;
  color: var(--white); background: var(--cyan); border: none; border-radius: 8px;
  padding: 13px 26px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 168, 225, 0.35); }
.btn-ghost {
  font-family: inherit; font-size: 13px; font-weight: 600; color: #b9c4cf;
  background: transparent; border: 1px solid #3c4c5c; border-radius: 8px;
  padding: 10px 18px; cursor: pointer; margin-top: 14px;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--white); }

.best-times { margin-top: 26px; font-size: 12px; color: #6d7d8c; line-height: 1.8; }
.best-times strong { color: var(--brass-bright); font-weight: 700; }
.best-times .bt-title { letter-spacing: 3px; text-transform: uppercase; font-size: 10px; margin-bottom: 4px; }

/* ---------- loading ---------- */
.load-card { text-align: center; width: min(360px, 80vw); }
.load-title { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; color: var(--cream); margin-bottom: 20px; }
.load-track { height: 4px; background: #202b36; border-radius: 2px; overflow: hidden; }
.load-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brass), var(--brass-bright)); transition: width 0.25s; }
.load-hint { margin-top: 14px; font-size: 12px; color: #6d7d8c; font-style: italic; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }

.hud-feathers {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #2a2318, #171208);
  border: 1px solid var(--brass); border-radius: 10px;
  padding: 6px 14px; box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.feather-face {
  font-weight: 800; font-size: 20px; color: var(--brass-bright);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.feather-total { font-size: 13px; color: var(--brass); }
.feather-label { font-size: 8px; letter-spacing: 2.5px; color: var(--brass); font-weight: 700; margin-top: 2px; }
.hud-feathers.pop { animation: featherPop 0.5s; }
@keyframes featherPop {
  0%, 100% { transform: none; }
  35% { transform: scale(1.12); }
}

.hud-buttons { display: flex; gap: 8px; }
.hud-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #3c4c5c;
  background: rgba(10, 14, 18, 0.55); color: var(--white); font-size: 16px; cursor: pointer;
}
.hud-btn:hover { border-color: var(--cyan); }
@media (max-width: 460px) {
  .hud-btn { width: 33px; height: 33px; font-size: 13px; }
  .feather-face { font-size: 17px; }
  .hud-feathers { padding: 5px 10px; }
}

#toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  z-index: 35; background: rgba(20, 32, 43, 0.92); border: 1px solid var(--brass);
  color: var(--cream); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; max-width: 86vw; text-align: center;
}
#tapHint {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 25; color: #b9c4cf; font-size: 12px; letter-spacing: 0.4px;
  background: rgba(10, 14, 18, 0.6); padding: 8px 16px; border-radius: 20px;
  pointer-events: none;
}

/* ---------- placard ---------- */
#placard {
  position: fixed; z-index: 50;
  left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  pointer-events: none;
}
.placard-inner {
  pointer-events: auto; position: relative;
  width: 100%; max-height: 72vh; overflow-y: auto;
  background: var(--cream); color: var(--ink);
  border-radius: 16px 16px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: sheetUp 0.35s ease-out;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) {
  #placard { left: auto; right: 28px; bottom: 28px; top: 90px; align-items: flex-end; }
  .placard-inner { width: 430px; max-height: 100%; border-radius: 14px; }
}
.placard-close {
  position: absolute; top: 10px; right: 12px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: rgba(20, 32, 43, 0.08);
  color: var(--ink); font-size: 20px; cursor: pointer; line-height: 1;
}
.placard-kicker { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--brass); font-weight: 700; margin-bottom: 6px; }
.placard-title { font-family: 'Playfair Display', Georgia, serif; font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.15; }
.placard-artist { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 13px; color: #5a6a76; margin: 4px 0 14px; line-height: 1.45; }
.placard-lesson { font-size: 14px; line-height: 1.65; color: var(--gray); margin-bottom: 10px; }
.placard-lesson strong { color: var(--navy); }
.placard-status {
  font-size: 12px; font-weight: 700; color: #7c5a10; background: #fdf3d8;
  border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; line-height: 1.5;
}
.placard-credit { font-size: 10px; color: #97a3ad; margin-top: 14px; line-height: 1.5; }
.placard-divider { border: none; border-top: 1px solid rgba(26, 62, 92, 0.15); margin: 16px 0; }

.puzzle-q { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.5; margin-bottom: 14px; }

.opt {
  display: block; width: 100%; text-align: left; font-family: inherit;
  font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--white); border: 2px solid rgba(26, 62, 92, 0.18);
  border-radius: 10px; padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { border-color: var(--cyan); }
.opt.sel { border-color: var(--navy); background: #eaf6fc; }
.opt.right { border-color: #2e9e5b; background: #e7f6ec; }
.opt.wrong { border-color: #cc4b3d; background: #fbe9e6; }
.opt:disabled { cursor: default; opacity: 0.85; }

.check-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.btn-check {
  font-family: inherit; font-weight: 700; font-size: 14px; color: var(--white);
  background: var(--navy); border: none; border-radius: 8px; padding: 12px 24px; cursor: pointer;
}
.btn-check:hover { background: #234e73; }
.btn-check:disabled { background: #9fb0be; cursor: default; }
.feather-chip {
  font-size: 12px; font-weight: 700; color: var(--brass); margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.feedback { font-size: 13px; line-height: 1.55; margin-top: 12px; padding: 12px 14px; border-radius: 8px; }
.feedback.good { background: #e7f6ec; color: #1d5c38; }
.feedback.bad { background: #fbe9e6; color: #7c2c22; }
.feedback.hint { background: #fdf6e3; color: #6d5518; }

/* ---------- life list ---------- */
.ll-list { margin-top: 6px; }
.ll-row {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  font-family: inherit; background: var(--white); border: 2px solid rgba(26, 62, 92, 0.14);
  border-radius: 8px; padding: 9px 12px; margin-bottom: 7px; cursor: pointer; color: var(--ink);
}
.ll-row:hover { border-color: var(--cyan); }
.ll-row.got { background: #f7f2e2; border-color: rgba(176, 141, 60, 0.5); }
.ll-check { width: 20px; flex: none; text-align: center; }
.ll-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.ll-sci { font-size: 11px; font-style: italic; color: #8a97a2; margin-left: auto; text-align: right; }

/* ---------- certificate ---------- */
.cert-wrap { text-align: center; max-width: 520px; width: 100%; }
.commission-label { font-size: 11px; letter-spacing: 4px; color: var(--brass); font-weight: 700; }
.commission {
  font-weight: 800; font-size: clamp(34px, 7vw, 48px); color: var(--brass-bright);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(232, 197, 106, 0.45);
  margin: 4px 0 22px;
}
.certificate {
  background: var(--cream); color: var(--ink); border: 3px double var(--brass);
  border-radius: 6px; padding: 30px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.cert-kicker { font-size: 10px; letter-spacing: 4px; text-transform: uppercase; color: var(--brass); font-weight: 700; margin-bottom: 12px; }
.cert-name { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(28px, 6vw, 40px); color: var(--navy); margin-bottom: 10px; }
.cert-body { font-size: 14px; line-height: 1.6; color: var(--gray); }
.cert-body strong { color: var(--navy); font-size: 17px; }
.cert-line { font-size: 12px; color: #5a6a76; margin-top: 10px; }
.cert-sig { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 15px; color: var(--navy); margin-top: 18px; }
.cert-wrap .btn-primary { margin-top: 24px; }
