:root {
  --navy: #14213d; --navy2: #1f3366; --red: #c8102e; --cream: #fff8ec; --gold: #f5b82e; --ink: #1a2238; --muted: #5b6785;
  --bg1: #7fb6ff; --bg2: #d9ecff;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--navy); }
body { font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg1), var(--bg2)); transition: background .6s; }
#top { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 10px) 16px 6px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.ttl { display: flex; align-items: center; gap: 8px; font-size: 19px; letter-spacing: .2px; }
#ticon { font-size: 22px; }
.round { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 20px; display: grid; place-items: center; color: var(--navy); }
.round:active { transform: scale(.92); }
.round.off { opacity: .6; }
#stage { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.slide { position: absolute; inset: 0; padding: 4px 16px 8px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; animation: inR .45s cubic-bezier(.2, .8, .3, 1); -webkit-overflow-scrolling: touch; }
.slide.back { animation-name: inL; }
@keyframes inR { from { opacity: 0; transform: translateX(60px) scale(.96); } }
@keyframes inL { from { opacity: 0; transform: translateX(-60px) scale(.96); } }
#nav { display: flex; align-items: center; gap: 12px; padding: 8px 16px calc(env(safe-area-inset-bottom) + 12px); }
.nav { font-size: 30px; line-height: 1; padding-bottom: 3px; }
.nav.go { background: var(--red); color: #fff; width: 56px; height: 56px; font-size: 34px; animation: nudge 2.4s ease-in-out infinite; }
.nav[disabled] { opacity: .35; animation: none; }
@keyframes nudge { 0%, 80%, 100% { transform: translateX(0); } 88% { transform: translateX(5px); } 94% { transform: translateX(-2px); } }
#dots { flex: 1; display: flex; justify-content: center; gap: 7px; }
#dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: all .3s; }
#dots i.on { width: 26px; border-radius: 6px; background: #fff; }

h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.1; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.lead { color: #fff; margin: 0 0 10px; font-size: 16px; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.card { background: var(--cream); border-radius: 22px; padding: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.big { display: block; width: 100%; padding: 15px; border-radius: 18px; background: var(--red); color: #fff; font-weight: 800; font-size: 18px; box-shadow: 0 5px 0 #8e0b20, 0 8px 16px rgba(0, 0, 0, .25); transition: transform .1s, box-shadow .1s; }
.big:active { transform: translateY(4px); box-shadow: 0 1px 0 #8e0b20; }
.big.alt { background: var(--navy2); box-shadow: 0 5px 0 #0c1733, 0 8px 16px rgba(0, 0, 0, .25); }
.pop { animation: popin .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes popin { from { transform: scale(.5); opacity: 0; } }

/* ───── Portada ───── */
.intro { align-items: center; text-align: center; justify-content: flex-end; padding-bottom: 0; overflow: hidden; }
.intro .sun { position: absolute; top: 6%; right: -40px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, #fff6c2, #ffd75e 60%, rgba(255, 215, 94, 0) 72%); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); } }
.cloud { position: absolute; width: 120px; height: 44px; background: #fff; border-radius: 40px; opacity: .9; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .1)); animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 54px; height: 54px; left: 18px; top: -26px; }
.cloud::after { width: 40px; height: 40px; left: 62px; top: -18px; }
@keyframes drift { from { transform: translateX(-160px); } to { transform: translateX(520px); } }
.bigben { position: absolute; left: 84%; bottom: 58px; width: 92px; transform: translateX(-50%); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25)); z-index: 1; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 50% { transform: translateX(-50%) rotate(.7deg); } }
.intro .hero { position: relative; z-index: 3; margin-bottom: 104px; }
.intro h1 { margin: 0; font-size: 56px; letter-spacing: 3px; color: #fff; text-shadow: 0 4px 0 var(--red), 0 8px 14px rgba(0, 0, 0, .3); }
.intro .by { color: #fff; font-weight: 700; margin: 6px 0 10px; text-shadow: 0 2px 6px rgba(0, 0, 0, .35); font-size: 18px; }
.intro .name { width: 220px; text-align: center; border: 0; border-radius: 14px; padding: 10px; font-weight: 700; background: rgba(255, 255, 255, .85); margin-bottom: 12px; font-size: 18px; }
.intro .big { width: 250px; margin: 0 auto; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: #3a3f52; z-index: 2; border-top: 6px solid #8a90a6; }
.road::after { content: ''; position: absolute; left: 0; right: 0; top: 26px; height: 4px; background: repeating-linear-gradient(90deg, #ffd75e 0 28px, transparent 28px 56px); animation: lane 0.8s linear infinite; }
@keyframes lane { to { background-position: -56px 0; } }
.bus { position: absolute; bottom: 38px; left: 0; width: 150px; z-index: 4; animation: drive 9s linear infinite; }
.bus svg { display: block; animation: bounce .5s ease-in-out infinite; }
@keyframes drive { from { transform: translateX(-170px); } to { transform: translateX(520px); } }
@keyframes bounce { 50% { transform: translateY(-2px); } }

/* ───── Mapa ───── */
.mapbox { position: relative; border-radius: 24px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); border: 3px solid rgba(255, 255, 255, .9); background: #5aa5e6; flex: none; height: min(42vh, 400px); touch-action: none; }
.mapbox svg { width: 100%; height: 100%; display: block; }
.ocean { fill: #4f9de0; }
.grat line { stroke: rgba(255, 255, 255, .22); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.land { fill: #f2e6c0; stroke: #d3bf86; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.land.ireland { fill: #bfe3a6; stroke: #8fc473; }
.uk { fill: #f2e6c0; stroke: #fff; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .3s, transform .3s; transform-box: fill-box; transform-origin: center; }
.uk.hi { fill: var(--c); }
.uk.pick { cursor: pointer; fill: color-mix(in srgb, var(--c) 55%, #f2e6c0); }
.uk.pick.sel { fill: var(--c); stroke-width: 3; filter: drop-shadow(0 0 5px rgba(0, 0, 0, .45)); }
.thames { fill: none; stroke: #4f9de0; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: 0; transition: opacity .6s; }
.thames.on { opacity: 1; }
.meridian { stroke: var(--red); stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .6s; }
.meridian.on { opacity: 1; }
.lbl { fill: #fff; text-anchor: middle; font-weight: 800; paint-order: stroke; stroke: rgba(20, 33, 61, .45); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; transition: opacity .5s; font-size: 70px; }
.lbl.cont { fill: #14213d; stroke: none; opacity: .5; letter-spacing: .08em; }
.lbl.sea { fill: #dff1ff; stroke: none; font-style: italic; font-weight: 600; opacity: .85; }
.lbl.ctry { fill: #6b5a2a; stroke: none; opacity: 0; }
.pin { transform-box: fill-box; transform-origin: 50% 100%; pointer-events: none; }
.pin.drop { animation: pindrop .8s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pindrop { from { transform: translateY(-60px) scale(.6); opacity: 0; } }
.pulse { animation: ping 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; fill: rgba(200, 16, 46, .35); }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.mapcap { margin: 12px 0; padding: 12px 14px; font-weight: 700; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.chip { background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; animation: popin .5s both; }
.spacer { flex: 1; min-height: 8px; }

/* ───── Reino Unido ───── */
.uk2 .side { display: flex; flex-direction: column; }
.uk2 .ukinfo { margin-top: 12px; }
.ukinfo { display: flex; align-items: center; gap: 12px; }
.ukinfo .fl { font-size: 38px; }
.ukinfo b { font-size: 20px; display: block; }
.ukinfo span { color: var(--muted); }

/* ───── Visitas ───── */
.counter { text-align: center; }
.counter .n { font-size: 90px; line-height: 1; font-weight: 900; color: var(--red); text-shadow: 0 4px 0 rgba(0, 0, 0, .1); }
.counter .t { font-weight: 700; color: var(--navy2); }
.stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.stamp { border: 3px dashed var(--c); color: var(--c); border-radius: 16px; padding: 12px 10px; text-align: center; background: rgba(255, 255, 255, .85); transform: rotate(var(--r)); animation: stampin .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampin { from { transform: rotate(var(--r)) scale(2.2); opacity: 0; } }
.stamp .e { font-size: 30px; }
.stamp b { display: block; font-size: 17px; }
.stamp small { display: block; font-size: 13px; opacity: .85; margin-top: 2px; }
.empty { text-align: center; color: #fff; padding: 22px 8px; font-weight: 700; }
.empty .e { font-size: 60px; animation: fly 3s ease-in-out infinite; display: inline-block; }
@keyframes fly { 50% { transform: translate(14px, -12px) rotate(8deg); } }
.plane { display: inline-block; animation: fly 3s ease-in-out infinite; }

/* ───── Cartas que se giran ───── */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 6px; }
.flip { perspective: 800px; height: 150px; }
.flip .in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, 1.2, .5, 1); transform-style: preserve-3d; }
.flip.on .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.flip .f { background: var(--cream); }
.flip .f .e { font-size: 50px; line-height: 1.1; }
.flip .f b { font-size: 15px; margin-top: 4px; }
.flip .b { background: var(--navy2); color: #fff; transform: rotateY(180deg); font-size: 13.5px; line-height: 1.25; }
.flip .b b { color: var(--gold); font-size: 15px; display: block; margin-bottom: 3px; }
.hint { color: #fff; text-align: center; font-size: 14px; margin: 2px 0 10px; opacity: .95; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }

/* ───── Curiosidades ───── */
.deck { position: relative; flex: 1; min-height: 340px; margin-bottom: 8px; }
.fact { position: absolute; inset: 0 0 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; gap: 10px; border-radius: 28px; background: var(--cream); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); transition: transform .45s cubic-bezier(.3, 1.2, .5, 1), opacity .45s; }
.fact .e { font-size: 84px; line-height: 1; animation: wob 2.4s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(-6deg) scale(1.06); } }
.fact .k { font-weight: 900; color: var(--red); letter-spacing: 1.5px; font-size: 14px; }
.fact p { margin: 0; font-size: 20px; font-weight: 600; color: var(--navy); }
.fact .num { position: absolute; top: 14px; right: 18px; font-weight: 800; color: var(--muted); font-size: 14px; }
.fact.gone { transform: translateX(120%) rotate(18deg); opacity: 0; pointer-events: none; }
.fact.behind { transform: scale(.94) translateY(14px); opacity: .6; }

/* ───── Comidas ───── */
.hscroll { flex: 1; min-height: 0; margin-bottom: 4px; scrollbar-width: none; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; -webkit-overflow-scrolling: touch; }
.food { flex: none; width: 82%; justify-content: space-evenly; scroll-snap-align: center; background: var(--cream); border-radius: 26px; padding: 16px; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 6px; }
.food .e { font-size: 96px; line-height: 1.05; }
.food h3 { margin: 0; font-size: 26px; color: var(--navy); }
.food p { margin: 0; font-size: 17px; color: var(--muted); }
.food .votes { display: flex; gap: 8px; margin-top: 6px; }
.food .votes button { flex: 1; background: #fff; border-radius: 14px; padding: 9px 4px; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); font-size: 15px; }
.food .votes button:active { transform: scale(.94); }
.food .votes b { display: block; font-size: 20px; }

/* ───── Famosos ───── */
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding-bottom: 6px; }
.person { text-align: center; color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.15; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.person .av { width: 82px; height: 82px; margin: 0 auto 5px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; background: var(--c); box-shadow: 0 5px 12px rgba(0, 0, 0, .3), inset 0 -6px 0 rgba(0, 0, 0, .12); border: 3px solid #fff; transition: transform .2s; }
.person:active .av { transform: scale(.9); }
.person.seen .av { border-color: var(--gold); }

/* ───── Cuestionario ───── */
.quiz .q { font-size: 21px; font-weight: 800; color: var(--navy); margin: 0 0 12px; text-align: center; }
.quiz .opt { display: block; width: 100%; padding: 13px 14px; margin-bottom: 9px; border-radius: 16px; background: #fff; font-weight: 700; text-align: left; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); transition: transform .12s; }
.quiz .opt:active { transform: scale(.97); }
.quiz .opt.ok { background: #bff0c8; box-shadow: 0 3px 0 #5cb872; animation: popin .4s; }
.quiz .opt.bad { background: #ffc9c9; box-shadow: 0 3px 0 #e07a7a; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.prog { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .4); margin-bottom: 12px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--gold); border-radius: 6px; transition: width .4s; }
.final { text-align: center; color: #fff; }
.final .e { font-size: 90px; animation: wob 2s ease-in-out infinite; display: inline-block; }
.final h2 { font-size: 34px; }
.final .score { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }

/* ───── Hoja inferior ───── */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(10, 16, 35, .55); display: flex; align-items: flex-end; animation: fade .25s; }
.sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet .box { width: 100%; max-height: 86vh; overflow-y: auto; background: var(--cream); border-radius: 28px 28px 0 0; padding: 22px 18px calc(env(safe-area-inset-bottom) + 20px); animation: up .35s cubic-bezier(.2, 1, .3, 1); position: relative; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .x { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .08); font-size: 18px; }
.sheet .av { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 50px; margin: 0 auto 8px; background: var(--c); border: 4px solid #fff; box-shadow: 0 5px 12px rgba(0, 0, 0, .25); }
.sheet h3 { margin: 0; text-align: center; font-size: 24px; color: var(--navy); }
.sheet .tag { text-align: center; color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: 1px; margin: 2px 0 10px; }
.sheet p { margin: 0 0 8px; font-size: 17px; }
.sheet .row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.sheet .row input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 12px; border: 2px solid rgba(0, 0, 0, .12); background: #fff; font-size: 16px; }
.sheet .row .del { width: 40px; height: 40px; border-radius: 50%; background: #ffe0e0; font-size: 16px; flex: none; }
.sheet .big { margin-top: 10px; }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }
@media (max-height: 640px) { .intro h1 { font-size: 46px; } .bigben { width: 92px; } .intro .hero { margin-bottom: 70px; } }

.hscroll::-webkit-scrollbar { display: none; }
.food .votes button { font-size: 16px; padding: 12px 4px; } .food .votes b { font-size: 26px; }

/* ───── Ordenador (pantalla ancha) ───── */
@media (min-width: 900px) {
  body { font-size: 20px; }
  #top, #nav { padding-left: max(24px, calc((100% - 1120px) / 2)); padding-right: max(24px, calc((100% - 1120px) / 2)); }
  #top { padding-top: 16px; padding-bottom: 8px; }
  .ttl { font-size: 26px; } #ticon { font-size: 30px; }
  .round { width: 52px; height: 52px; font-size: 24px; cursor: pointer; }
  .nav.go { width: 66px; height: 66px; }
  #nav { padding-bottom: 18px; }
  #dots i { width: 11px; height: 11px; } #dots i.on { width: 34px; }
  .slide { padding: 6px max(24px, calc((100% - 1120px) / 2)) 14px; }
  h2 { font-size: 36px; } .lead { font-size: 21px; }
  .big { font-size: 21px; padding: 17px; max-width: 520px; margin-left: auto; margin-right: auto; cursor: pointer; }
  .card { padding: 20px; }

  .intro h1 { font-size: 120px; letter-spacing: 6px; text-shadow: 0 6px 0 var(--red), 0 12px 22px rgba(0, 0, 0, .3); }
  .intro .by { font-size: 30px; margin: 10px 0 24px; }
  .intro .big { width: 360px; }
  .intro .hero { margin-bottom: 150px; }
  .intro .sun { width: 260px; height: 260px; right: 8%; top: 4%; }
  .bigben { left: 82%; width: 160px; bottom: 90px; }
  .road { height: 84px; } .road::after { top: 38px; }
  .bus { width: 250px; bottom: 60px; } .bus svg { width: 250px; height: auto; }
  @keyframes drive { from { transform: translateX(-280px); } to { transform: translateX(1900px); } }
  @keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(1900px); } }

  .mapbox { height: min(42vh, 520px); }
  .mapcap { font-size: 21px; margin: 10px 0; padding: 10px 14px; }
  .chip { font-size: 17px; padding: 8px 16px; }
  .uk2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; flex: 1; min-height: 0; align-items: start; }
  .uk2 .mapbox { height: min(64vh, 560px); }
  .uk2 .ukinfo { margin-top: 0; }
  .uk2 .hint { font-size: 19px; margin-top: 18px; }
  .ukinfo .fl { font-size: 52px; } .ukinfo b { font-size: 26px; }

  .counter .n { font-size: 130px; } .counter .t { font-size: 24px; }
  .stamps { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .stamp b { font-size: 21px; } .stamp small { font-size: 16px; } .stamp .e { font-size: 42px; }
  #edit { max-width: 520px; }

  .cards { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .flip { height: 210px; cursor: pointer; }
  .flip .f .e { font-size: 72px; } .flip .f b { font-size: 20px; }
  .flip .b { font-size: 17px; padding: 14px; } .flip .b b { font-size: 19px; }
  .hint { font-size: 17px; }

  .deck { max-width: 780px; width: 100%; margin: 0 auto 10px; min-height: 380px; cursor: pointer; }
  .fact .e { font-size: 110px; } .fact p { font-size: 28px; } .fact .k { font-size: 17px; }

  .hscroll { margin: 0; padding-left: 4px; padding-right: 4px; gap: 22px; scroll-snap-type: x proximity; }
  .food { width: 360px; }
  .food p { font-size: 18px; }
  .people { grid-template-columns: repeat(5, 1fr); gap: 20px 12px; max-width: 980px; margin: 0 auto; }
  .person { font-size: 17px; cursor: pointer; }
  .person .av { width: 112px; height: 112px; font-size: 58px; }

  .quiz { max-width: 760px; margin: 0 auto; width: 100%; padding-left: 0; padding-right: 0; }
  .quiz .q { font-size: 28px; } .quiz .opt { font-size: 21px; padding: 17px 20px; cursor: pointer; }
  .final h2 { font-size: 48px; } .final .e { font-size: 120px; }
  .final .big { margin-left: auto; margin-right: auto; }

  .sheet { align-items: center; justify-content: center; }
  .sheet .box { max-width: 620px; border-radius: 28px; padding: 28px 28px 28px; }
  .sheet h3 { font-size: 30px; } .sheet p { font-size: 20px; }
  .sheet .av { width: 120px; height: 120px; font-size: 64px; }
  button { cursor: pointer; }
}
