/* The screens: home, choosing a couple, the lists, the story map, visits and
   the festival. Phone first; two columns where there is room. */

.title-row { display: flex; align-items: center; gap: 10px; padding: 4px 14px 6px; flex: none; }
.title-row h2 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-note { margin: 0 16px 12px; color: var(--muted); max-width: 60ch; }
.flames { display: inline-flex; gap: 3px; }
.flames i { width: 14px; height: 13px; display: inline-block; background: var(--line); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 18'%3E%3Cpath d='M0 6C-10 -2 -8 -10 -3 -10C-1 -10 0 -8 0 -7C0 -8 1 -10 3 -10C8 -10 10 -2 0 6Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 18'%3E%3Cpath d='M0 6C-10 -2 -8 -10 -3 -10C-1 -10 0 -8 0 -7C0 -8 1 -10 3 -10C8 -10 10 -2 0 6Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.flames i.lit { background: #ff7a9a; }
.chip.done { background: #d9f2df; color: #1f6b35; }
:root[data-theme="dark"] .chip.done { background: #24432e; color: #9fe0b2; }
.scene-svg { display: block; width: 100%; height: 100%; overflow: hidden; }

/* ------------------------------------------------------------ home */
.home-wrap { display: grid; gap: 14px; padding: 4px 14px 22px; max-width: 1100px; margin: 0 auto; width: 100%; }
.hero { overflow: hidden; display: flex; flex-direction: column; }
.hero-art { position: relative; aspect-ratio: 4 / 3; max-height: 46dvh; width: 100%; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.hero-art .scene-svg { cursor: pointer; }
.hero-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px; flex-wrap: wrap; }
.hero-names { display: flex; flex-direction: column; min-width: 0; }
.hero-names b { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.hero-names span { color: var(--muted); font-size: 14px; font-weight: 700; }
.home-side { display: flex; flex-direction: column; gap: 12px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.diff button { min-height: 46px; border: 0; border-radius: 14px; background: transparent; font-weight: 800; font-size: 15px; cursor: pointer; color: var(--muted); transition: background 0.2s, color 0.2s, transform 0.15s; }
.diff button.on { background: var(--btn); color: #fff; box-shadow: 0 4px 10px -4px rgba(194, 58, 107, 0.6); }
.diff button:active { transform: scale(0.97); }
.diff-note { margin: -4px 6px 0; color: var(--muted); font-size: 14px; }
.mode {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s;
}
.mode:hover { transform: translateY(-2px); }
.mode:active { transform: translateY(1px) scale(0.99); }
.mode-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); }
.mode-ico svg { width: 56px; height: 56px; }
.mode-txt { display: flex; flex-direction: column; min-width: 0; }
.mode-txt b { font-size: 18px; font-weight: 900; }
.mode-txt small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.mode-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mode-meta small { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mode-meta .count { font-size: 15px; font-weight: 900; background: var(--accent-soft); border-radius: 12px; padding: 4px 10px; }
.mode-story { background: linear-gradient(135deg, var(--surface) 55%, var(--accent-soft)); }
@media (max-width: 420px) {
  .mode { grid-template-columns: 52px 1fr; }
  .mode-ico { width: 52px; height: 52px; }
  .mode-ico svg { width: 46px; height: 46px; }
  .mode-meta { grid-column: 2; align-items: flex-start; flex-direction: row; align-items: center; gap: 8px; }
}
@media (min-width: 820px) {
  .home-wrap { grid-template-columns: 1.15fr 1fr; align-items: start; padding-top: 10px; }
  .hero-art { max-height: none; }
}

/* ------------------------------------------------------------ choose a couple */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 0 14px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.pick-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 2px solid transparent; box-shadow: var(--shadow-sm); transition: transform 0.15s, border-color 0.2s; text-align: center;
}
.pick-card:hover { transform: translateY(-2px); }
.pick-card.on { border-color: var(--btn); }
.pick-art { width: 100%; aspect-ratio: 210 / 150; border-radius: 16px; background: var(--tint, #fff3e3); display: block; overflow: hidden; }
:root[data-theme="dark"] .pick-art { background: color-mix(in srgb, var(--tint, #fff3e3) 82%, #000); }
.pick-art .pair-art { width: 100%; height: 100%; display: block; }
.pick-card b { font-size: 15px; font-weight: 900; margin-top: 6px; }
.pick-card small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pick-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.pick-meta .flames i { width: 11px; height: 10px; }

/* ------------------------------------------------------------ lists: mini games, escape rooms */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; padding: 0 14px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.list-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; transition: transform 0.15s; }
.list-card:hover { transform: translateY(-2px); }
.list-card b { font-size: 15.5px; font-weight: 900; margin: 6px 4px 0; }
.list-card small { color: var(--muted); font-size: 12.5px; font-weight: 700; margin: 0 4px; }
.list-meta { font-size: 12px; color: var(--muted); margin: 2px 4px 0; min-height: 1em; }
.list-art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--surface2); overflow: hidden; }
.list-art .pair-art { width: 100%; height: 100%; }
.list-card.locked .list-art > svg { filter: grayscale(0.85) opacity(0.55); }
.list-card.locked b, .list-card.locked small { opacity: 0.6; }
.lock { position: absolute; inset: auto 10px 10px auto; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--muted); }
.lock svg { width: 20px; height: 20px; }
.room-art { background: linear-gradient(160deg, #fff1e4, #ffe3ec); }
:root[data-theme="dark"] .room-art { background: linear-gradient(160deg, #3a2d3c, #2e2540); }
.room-art svg { width: 80%; height: 80%; }
.room-art .chip.new { position: absolute; top: 8px; right: 8px; background: var(--btn); color: #fff; }

/* ------------------------------------------------------------ the story map */
.map-area { position: relative; flex: 1; min-height: 0; padding: 0 10px; display: grid; place-items: center; }
.map-svg { width: 100%; height: 100%; max-width: 760px; display: block; }
.map-svg [data-loc] { cursor: pointer; outline: none; }
.map-svg [data-loc]:focus-visible { filter: drop-shadow(0 0 0 #ff7a9a) drop-shadow(0 0 5px #ff7a9a); }
.map-svg [data-loc].picked { filter: drop-shadow(0 0 6px rgba(255, 207, 90, 0.95)); }
.map-labels { position: absolute; inset: 0; pointer-events: none; }
.map-label {
  position: absolute; transform: translate(-50%, 0); max-width: 112px; width: max-content; text-align: center; font-size: 12px; line-height: 1.15; font-weight: 800;
  padding: 3px 8px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); box-shadow: var(--shadow-sm);
}
.map-label.next { background: var(--btn); color: #fff; }
.map-label.done { color: var(--muted); }
@media (max-width: 380px) { .map-label { font-size: 11px; max-width: 92px; padding: 2px 6px; } }
.map-panel { margin: 8px 12px 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex: none; }
.map-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.map-info small { color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.map-info b { font-size: 19px; font-weight: 900; }
.map-flames { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.map-flames small { text-transform: none; letter-spacing: 0; font-weight: 700; }
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.map-actions p { margin: 0; max-width: 30ch; }

/* ------------------------------------------------------------ visits and the festival */
.visit { justify-content: center; }
/* the scene keeps a landscape-ish shape (a tall phone would crop the couples away); the talk sits under it */
.visit-stage { position: relative; flex: 1 1 auto; min-height: 220px; max-height: calc((100vw - 20px) * 1.28); margin: 0 10px; border-radius: 26px; overflow: hidden; background: var(--scene-bg, #fff3e3); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); isolation: isolate; }
.visit-stage > .scene-svg { position: absolute; inset: 0; }
.visit-top { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 12; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.visit-top > * { pointer-events: auto; }
.visit-title { display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 6px 14px; border-radius: 16px; box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); }
.visit-title b { font-weight: 900; font-size: 16px; }
.visit-title small { color: var(--muted); font-size: 12px; font-weight: 700; }
.visit-dock { position: relative; flex: none; min-height: 132px; padding: 10px 10px 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; }
.visit-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; animation: pop-in 0.4s cubic-bezier(.2,.9,.3,1.25) both; }
.visit-actions.hint-only p { margin: 0; padding: 10px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 90%, transparent); font-weight: 800; box-shadow: var(--shadow-sm); }

.talk {
  position: relative; z-index: 14; width: min(100%, 680px);
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 22px;
  background: var(--surface); color: var(--text); border: 2px solid #4b3328; box-shadow: var(--shadow); cursor: pointer; text-align: left;
}
.talk.pop { animation: talk-in 0.32s cubic-bezier(.2,.9,.3,1.2) both; }
.talk:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.talk-face { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; }
.talk-face svg { width: 60px; height: 60px; }
.talk-body { min-width: 0; }
.talk-name { display: block; font-size: 13px; font-weight: 900; color: var(--btn); text-transform: uppercase; letter-spacing: 0.05em; }
:root[data-theme="dark"] .talk-name { color: var(--accent); }
.talk.narrator .talk-name { color: var(--muted); }
.talk-text { margin: 2px 0 0; font-size: 16.5px; font-weight: 700; line-height: 1.4; min-height: 2.8em; }
.talk.narrator .talk-text { font-style: italic; font-weight: 600; }
.talk-next { width: 14px; height: 14px; border-right: 3px solid var(--btn); border-bottom: 3px solid var(--btn); transform: rotate(45deg); animation: talk-bob 1s ease-in-out infinite; margin-right: 4px; }
.talk-skip { position: absolute; right: 22px; bottom: calc(100% + 8px); z-index: 13; min-height: 36px; padding: 0 12px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--surface) 80%, transparent); font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer; }
@keyframes talk-in { from { opacity: 0.4; transform: translateY(8px) scale(0.98); } }
@keyframes talk-bob { 0%, 100% { transform: rotate(45deg) translate(0, 0); } 50% { transform: rotate(45deg) translate(3px, 3px); } }
@media (max-width: 480px) {
  .talk { grid-template-columns: 48px 1fr; padding: 8px 12px 8px 8px; }
  .talk-face { width: 48px; height: 48px; border-radius: 14px; }
  .talk-face svg { width: 46px; height: 46px; }
  .talk-next { display: none; }
  .talk-text { font-size: 15.5px; }
}

.map-svg [data-loc], .scene-svg [data-lantern] { transition: transform 0.2s; }
.scene-svg [data-lantern].to-light { animation: lantern-call 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; cursor: pointer; }
.scene-svg [data-lantern].nudge { animation: wiggle 0.5s ease-in-out; }
@keyframes lantern-call { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.reduce .talk.pop, .reduce .visit-actions, .reduce .talk-next, .reduce .scene-svg [data-lantern].to-light { animation: none !important; }
