/* Elevated Roof Lab — flat Elevated-branded UI around the 3D house (ART-DIRECTION.md). */
:root {
  --blue: #003B71;
  --gold: #E7B00C;
  --red: #E63A27;
  --green: #2E7D32; /* right answers (Matt, 2026-10-14); not a brand color — Dennis to confirm the shade */
  --dark: #141422;
  --light: #F3F1F2;
  --white: #ffffff;
  --muted: #5b5d66;
  --sky-rain: #6491B8; /* Secondary Blue, start-screen rain only (Dennis) */
  --heading: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --body: Carlito, Calibri, 'Segoe UI', Arial, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--light);
  color: var(--dark);
  font-family: var(--body);
  font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}
#app { height: 100%; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: var(--gutter); padding-bottom: max(var(--gutter), env(safe-area-inset-bottom)); }
.screen-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; }
.screen-actions { display: flex; flex-direction: column; gap: 10px; }

h1, h2, .btn, .tile-title, .eyebrow { font-family: var(--heading); }
h1 { font-size: 2rem; font-weight: 800; margin: 0; text-align: center; line-height: 1.1; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* Start screen = storm sky (Dennis; Matt: "love opt 1"): blue top ~65%, light ground ~35% with the buttons. */
.screen.start { padding: 0; }
.start-sky {
  flex: 65 1 0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--blue); color: var(--white);
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) var(--gutter);
  /* edge to edge past the 720px column on a PC, without a sideways scroll */
  box-shadow: 0 0 0 100vmax var(--blue); clip-path: inset(0 -100vmax);
}
.start-sky > :not(.rain-field, .bolt) { position: relative; }
.start-ground { flex: 35 1 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; background: var(--light); padding: var(--gutter); padding-bottom: max(var(--gutter), env(safe-area-inset-bottom)); }
.start-sky h1 { color: var(--white); }
.logo { display: block; width: min(70vw, 460px); height: auto; margin: 0 auto 6px; }
.subtitle { color: var(--gold); font-family: var(--heading); font-weight: 800; font-size: 1.15rem; text-align: center; margin: 0; letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase; }
.rain-field { position: absolute; inset: 0; pointer-events: none; }
.rain { position: absolute; width: 1.5px; background: var(--sky-rain); opacity: 0.5; border-radius: 1px; transform: rotate(20deg); animation: rain-drift 6s linear infinite; }
@keyframes rain-drift {
  from { translate: 0 -24px; }
  to { translate: -17px 24px; } /* along the 20° lean */
}
.bolt { position: absolute; top: max(18px, calc(env(safe-area-inset-top) + 10px)); right: 22px; width: 30px; height: auto; fill: var(--gold); }
.draft-tag { align-self: center; background: var(--dark); color: var(--white); font-family: var(--heading); font-weight: 700; font-size: 0.75rem; padding: 4px 10px; border-radius: 4px; letter-spacing: 0.04em; }

.btn {
  appearance: none; border: 2px solid var(--blue); border-radius: 10px;
  background: var(--blue); color: var(--white);
  font-size: 1.05rem; font-weight: 700; min-height: 56px; padding: 10px 14px;
  cursor: pointer; touch-action: manipulation; text-align: center;
}
.btn.secondary { background: var(--white); color: var(--blue); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--dark); } /* Title Dark on gold: easy to read, the one to press (Dennis) */
.btn:disabled { background: #d9d8dc; border-color: #d9d8dc; color: var(--muted); cursor: default; }
.btn-note { display: block; font-family: var(--body); font-weight: 400; font-size: 0.85rem; margin-top: 2px; }

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.link-btn { white-space: nowrap; flex: none; appearance: none; border: 0; background: none; color: var(--blue); font-family: var(--heading); font-weight: 700; font-size: 0.95rem; padding: 8px 4px; cursor: pointer; min-height: 44px; }
.topbar .eyebrow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { flex: none; height: 30px; width: auto; margin-left: auto; }
.counter + .brand-mark { margin-left: 10px; }
.counter { flex: none; margin-left: auto; font-family: var(--heading); font-weight: 700; color: var(--blue); }
@media (max-width: 480px) {
  .round-title { display: none; }
}

.tile { display: flex; align-items: center; gap: 12px; text-align: left; }
.tile-id { font-size: 1.3rem; min-width: 2.2em; }
.tile-title { flex: 1; }
.tile .check { color: var(--gold); font-size: 1.4rem; }

/* Round screen: 3D on top, question and choices in thumb reach at the bottom. */
.round { padding: 0; }
.round .topbar { padding: 8px var(--gutter) 0; margin: 0; }
.stage { flex: 1; min-height: 220px; position: relative; touch-action: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 0.85rem; color: var(--dark); opacity: 0.75; pointer-events: none; transition: opacity 0.6s; }
.hint.is-gone { opacity: 0; }
.question-panel { background: var(--white); padding: 12px var(--gutter); padding-bottom: max(var(--gutter), env(safe-area-inset-bottom)); border-top: 4px solid var(--blue); }
.question { margin: 0 0 4px; font-family: var(--heading); font-weight: 700; font-size: 1.1rem; }
.feedback { min-height: 1.4em; margin: 0 0 8px; font-size: 1rem; }
.feedback.right { color: var(--green); }
.feedback.wrong { color: var(--dark); } /* red #E63A27 on white is ~4.2:1, under 4.5:1 for small text (Dennis); red stays on the button */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices .btn { font-size: 0.98rem; min-height: 60px; }
.btn.is-right { background: var(--green); border-color: var(--green); color: var(--white); }
.btn.is-wrong { background: var(--red); border-color: var(--red); color: var(--white); }

.tip { background: var(--white); color: var(--dark); border-left: 5px solid var(--blue); border-radius: 8px; padding: 12px 14px; margin: 0; font-size: 1rem; }
.done-date { text-align: center; color: var(--muted); margin: 0; }
.big-check { text-align: center; font-size: 3rem; color: var(--gold); margin: 0; line-height: 1; }

.plain-message { padding: var(--gutter); font-size: 1.1rem; text-align: center; }

/* Level 2: the layer tray, three compact cards across, in thumb reach (Milestone 2). */
.intro-text { margin: 0 0 12px; }
.hint-line { min-height: 1.3em; margin: 0 0 8px; font-size: 0.95rem; color: var(--dark); }
.tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tray .card { min-height: 52px; padding: 6px; font-size: 0.85rem; line-height: 1.15; touch-action: none; user-select: none; -webkit-user-select: none; }
.tray .card.dragging { opacity: 0.35; }
/* The card copy that follows the finger, held just above it so the finger doesn't hide it. */
.drag-ghost { position: fixed; z-index: 10; transform: translate(-50%, -120%); pointer-events: none; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--blue); background: var(--white); color: var(--blue); font-family: var(--heading); font-weight: 700; font-size: 0.95rem; box-shadow: 0 6px 18px rgba(20, 20, 34, 0.25); white-space: nowrap; }
.drag-ghost.over-roof { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold), 0 6px 18px rgba(20, 20, 34, 0.25); }
.drag-ghost.fly-back { transition: left 0.28s ease-in, top 0.28s ease-in, opacity 0.28s; opacity: 0; }
.drag-ghost.landed { transition: transform 0.22s ease-in, opacity 0.22s; transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
.card.bounce { animation: bounce-back 0.45s ease-out; border-color: var(--red); }
@keyframes bounce-back {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .rain { animation: none; }
  .card.bounce { animation: none; }
  .drag-ghost.fly-back, .drag-ghost.landed { transition: none; }
}
