/* Fonts are bundled with the site: no third-party requests. */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/baloo2.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/nunito.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/spacemono-700.woff2") format("woff2"); }

:root {
  --bg: #fff7f2;
  --ink: #3d2c3e;
  --muted: #8a7488;
  --pink: #ffc8d6;
  --pink-deep: #ff8fab;
  --peach: #ffd9b8;
  --lav: #e3d7ff;
  --mint: #cdeedd;
  --sky: #d6ecff;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(61, 44, 62, .08), 0 14px 30px rgba(61, 44, 62, .08);
  --r: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 10% 10%, #ffe6ee 0, transparent 40%),
                    radial-gradient(circle at 90% 30%, #ece4ff 0, transparent 40%);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  padding: 0 16px;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: "Baloo 2", "Nunito", sans-serif; margin: 0; }
.muted { color: var(--muted); }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; }
.gate-card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 32px 28px; max-width: 380px; width: 100%; text-align: center;
}
.gate-faces { display: flex; justify-content: center; gap: 4px; height: 90px; }
.gate-faces svg { height: 90px; width: auto; }
.gate-card h1 { font-size: 30px; margin-top: 8px; }
.gate-card form { display: flex; gap: 8px; margin-top: 18px; }
.gate-card input {
  flex: 1; min-width: 0; border: 2px solid var(--lav); border-radius: 14px;
  padding: 12px 14px; font: inherit; outline: none;
}
.gate-card input:focus { border-color: var(--pink-deep); }
.gate-card button, .btn {
  border: 0; border-radius: 14px; background: var(--pink-deep); color: #fff;
  font-weight: 800; padding: 12px 16px; box-shadow: 0 4px 0 #e0708f;
  transition: transform .1s;
}
.gate-card button:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e0708f; }
.gate-err { color: #d14d72; font-weight: 700; min-height: 1.4em; margin: 12px 0 0; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- layout ---------- */
main { max-width: 920px; margin: 0 auto; padding-block: 20px 40px; }
.top { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo { font-family: "Baloo 2"; font-weight: 800; font-size: 28px; letter-spacing: 2px; }
.plane-mini { display: inline-block; color: var(--pink-deep); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-6deg); } }

/* departure board */
.board {
  background: #2b2233; color: #ffe9a8; border-radius: 18px; padding: 14px 18px 12px;
  box-shadow: var(--shadow); text-align: center; width: 100%; max-width: 520px;
}
.board-label, .board-status { font-family: "Space Mono", monospace; font-size: 12px; letter-spacing: 2px; opacity: .85; }
.board-status { color: #9fe3b5; margin-top: 8px; }
.flaps { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.flap-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flap-digits { display: flex; gap: 3px; }
.flap {
  font-family: "Space Mono", monospace; font-size: clamp(26px, 7vw, 40px); line-height: 1;
  background: #3d3247; border-radius: 6px; padding: 8px 6px; min-width: 1.1em; position: relative;
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #2b2233; }
.flap.tick { animation: flip .35s ease; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.flap-unit { font-family: "Space Mono"; font-size: 10px; letter-spacing: 2px; opacity: .7; }

/* world */
.world { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 22px; align-items: stretch; position: relative; }
.box { border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.box-a { background: linear-gradient(180deg, #ffe3ec, #fff3e4); }
.box-d { background: linear-gradient(180deg, #e2f0ff, #efe9ff); }
.box-tag { font-weight: 800; font-size: 13px; padding: 10px 14px; background: rgba(255,255,255,.6); display: flex; justify-content: space-between; gap: 8px; }
.clock { font-family: "Space Mono"; color: var(--muted); }
.scene { position: relative; height: 220px; display: flex; align-items: flex-end; justify-content: center; }
.char { background: none; border: 0; padding: 0; width: 120px; height: 160px; transform-origin: bottom center; animation: idle 3s ease-in-out infinite; }
.char svg { width: 100%; height: 100%; overflow: visible; }
.char:focus-visible { outline: 3px dashed var(--pink-deep); outline-offset: 4px; border-radius: 12px; }
.char.poked { animation: poked .5s ease; }
@keyframes idle { 50% { transform: translateY(-3px) scaleY(1.02); } }
@keyframes poked { 0% { transform: scale(1); } 25% { transform: scale(1.1, .85) translateY(4px); } 55% { transform: translateY(-22px) rotate(-6deg); } 100% { transform: none; } }
.gap { display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.gap span { border-left: 2px dashed #d9c6d6; padding-left: 6px; }

/* props */
.prop-controller { left: 8%; width: 58px; height: 30px; background: #6b7196; border-radius: 16px 16px 20px 20px; box-shadow: inset 0 -4px 0 #555a7d; }
.prop-controller::before { content: ""; position: absolute; left: 10px; top: 9px; width: 12px; height: 12px;
  background: linear-gradient(#fff 0 0) center/4px 12px no-repeat, linear-gradient(#fff 0 0) center/12px 4px no-repeat; opacity: .85; }
.prop-controller::after { content: ""; position: absolute; right: 10px; top: 8px; width: 5px; height: 5px; border-radius: 50%;
  background: #ff8fab; box-shadow: 7px 0 0 #8fd6a0, 0 7px 0 #ffd166, 7px 7px 0 #8fb8ff; }
.prop-controller span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-family: "Baloo 2"; font-weight: 800; font-size: 13px; color: #ff6fa0; background: #fff; border-radius: 6px; padding: 0 6px; white-space: nowrap; animation: bob 2s ease-in-out infinite; }
.prop { position: absolute; bottom: 10px; }
.prop-coffee { right: 14%; width: 34px; height: 30px; background: #fff; border-radius: 0 0 12px 12px; border: 3px solid #b08968; border-top-width: 0; }
.prop-coffee::before { content: ""; position: absolute; top: 4px; right: -12px; width: 10px; height: 12px; border: 3px solid #b08968; border-left: 0; border-radius: 0 8px 8px 0; }
.prop-coffee::after { content: "~"; position: absolute; top: -26px; left: 8px; font-size: 20px; color: #c9a88a; animation: steam 2s infinite; }
@keyframes steam { 50% { transform: translateY(-5px); opacity: .4; } }
.prop-suitcase { left: 10%; width: 40px; height: 52px; background: #ffb4a2; border-radius: 8px; border: 3px solid #e5887a; }
.prop-suitcase::before { content: ""; position: absolute; top: -12px; left: 9px; width: 16px; height: 10px; border: 3px solid #e5887a; border-bottom: 0; border-radius: 6px 6px 0 0; }
.prop-suitcase::after { content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 6px; background: #fff3; border-top: 3px solid #e5887a; border-bottom: 3px solid #e5887a; }
.prop-noodles { right: 12%; width: 46px; height: 24px; background: #fff; border: 3px solid #9bb7e0; border-top: 0; border-radius: 0 0 24px 24px; }
.prop-noodles::before { content: ""; position: absolute; top: -12px; left: 6px; width: 30px; height: 14px; border-top: 3px wavy #f1c76b; border-radius: 50%; }
.prop-noodles::after { content: ""; position: absolute; top: -26px; left: 24px; width: 3px; height: 30px; background: #b58b5a; transform: rotate(20deg); box-shadow: 6px 0 0 #b58b5a; }
.prop-plant { left: 12%; width: 30px; height: 24px; background: #e8a87c; border-radius: 0 0 8px 8px; }
.prop-plant::before { content: ""; position: absolute; top: -20px; left: 6px; width: 18px; height: 22px; background: #b8b38a; border-radius: 50% 50% 0 50%; transform: rotate(35deg); filter: saturate(.4); }

.bubble {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%) scale(.6); opacity: 0;
  background: #fff; padding: 8px 12px; border-radius: 14px; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08); white-space: nowrap; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 90%; overflow: hidden; text-overflow: ellipsis;
}
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.poke-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* reunion */
.world.landed .box, .world.landed .gap { display: none; }
.world.landed { grid-template-columns: 1fr; }
.reunion { background: linear-gradient(180deg, #ffe3ec, #e2f0ff); border-radius: var(--r); box-shadow: var(--shadow); height: 260px; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.reunion-chars { display: flex; align-items: flex-end; }
.reunion-chars svg { width: 120px; height: 160px; }
.reunion-chars .ra { animation: runR 1.2s ease-out both; }
.reunion-chars .rd { animation: runL 1.2s ease-out both; margin-left: -28px; }
@keyframes runR { from { transform: translateX(-160px); } to { transform: none; } }
@keyframes runL { from { transform: translateX(160px) scaleX(-1); } to { transform: scaleX(-1); } }
.sign { position: absolute; top: 18px; background: #fff; border: 3px solid var(--ink); border-radius: 8px; padding: 6px 16px; font-family: "Baloo 2"; font-weight: 800; font-size: 22px; transform: rotate(-4deg); animation: pop .5s 1.2s both; }
@keyframes pop { from { transform: scale(0) rotate(-4deg); } to { transform: scale(1) rotate(-4deg); } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.stat { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; text-align: center; }
.stat b { display: block; font-family: "Baloo 2"; font-size: 30px; line-height: 1.1; color: var(--pink-deep); }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat em { font-style: normal; font-size: 11px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 26px; }
.door {
  border: 0; border-radius: 16px; padding: 10px 4px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); transition: transform .15s;
}
.door:hover { transform: translateY(-3px); }
.door .dn { font-family: "Baloo 2"; font-weight: 800; font-size: 22px; line-height: 1; }
.door .dd { font-size: 11px; color: var(--muted); font-weight: 700; }
.door .di { font-size: 16px; height: 20px; }
.door.locked { background: repeating-linear-gradient(45deg, #f4ecf2, #f4ecf2 8px, #efe4ec 8px, #efe4ec 16px); color: #b9a6b6; }
.door.active { background: var(--pink); outline: 3px solid var(--pink-deep); }
.door.today .dd { color: var(--pink-deep); }

/* panel */
.panel { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; margin-top: 14px; min-height: 160px; }
.panel h2 { font-size: 26px; }
.panel .kicker { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--pink-deep); text-transform: uppercase; }
.panel .intro { color: var(--muted); margin: 6px 0 16px; }
.panel-foot { margin-top: 16px; font-weight: 700; color: var(--muted); font-size: 14px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: 16px; font-weight: 600; opacity: 0; transform: translateY(6px); animation: msgIn .3s forwards; }
.msg.A { align-self: flex-start; background: #ffe3ec; border-bottom-left-radius: 4px; }
.msg.D { align-self: flex-end; background: #e2f0ff; border-bottom-right-radius: 4px; }
.msg small { display: block; font-size: 10px; font-weight: 800; color: var(--muted); }
@keyframes msgIn { to { opacity: 1; transform: none; } }

/* clocks */
.clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.clockcard { border-radius: 18px; padding: 16px; text-align: center; }
.clockcard.a { background: #ffe3ec; } .clockcard.d { background: #e2f0ff; }
.clockcard .big { font-family: "Space Mono"; font-size: 34px; }
.clockcard .who { font-weight: 800; }
.clockcard .doing { font-weight: 600; margin-top: 6px; min-height: 2.6em; }

/* translate flip cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tcard { border: 0; padding: 0; background: none; height: 96px; perspective: 600px; position: relative; color: var(--ink); text-align: left; }
.tface { position: absolute; inset: 0; border-radius: 16px; padding: 12px 14px; font-weight: 700; backface-visibility: hidden; transition: transform .45s; display: flex; flex-direction: column; justify-content: center; }
.tface small { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.tcard.A .front { background: #ffe3ec; } .tcard.D .front { background: #e2f0ff; }
.tface.back { background: var(--ink); color: #fff; transform: rotateY(180deg); }
.tface.back small { color: #d9c6d6; }
.tcard.flipped .front { transform: rotateY(180deg); } .tcard.flipped .back { transform: rotateY(360deg); }

/* contract */
.contract { background: #fffaf0; border: 2px dashed #e7d3b5; border-radius: 16px; padding: 16px 18px; }
.contract ol { margin: 0; padding-left: 22px; } .contract li { margin: 6px 0; font-weight: 600; }
.sigs { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; align-items: flex-end; }
.sig { flex: 1; min-width: 160px; border-top: 2px solid var(--ink); padding-top: 4px; font-size: 13px; color: var(--muted); }
.sig .ink { font-family: "Baloo 2"; font-size: 22px; color: #3a4fb8; display: block; min-height: 32px; transform: rotate(-3deg); }

/* reviews */
.review { border-bottom: 1px solid #f1e6ee; padding: 10px 0; }
.review:last-child { border: 0; }
.stars { color: #ffb84d; letter-spacing: 2px; } .stars .off { color: #e8dde6; }
.review p { margin: 4px 0 0; font-weight: 600; } .review small { color: var(--muted); font-weight: 800; }

/* packing */
.pack { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pack label { display: flex; gap: 10px; align-items: center; background: #fff3e4; padding: 10px 12px; border-radius: 14px; font-weight: 600; cursor: pointer; }
.pack input { width: 20px; height: 20px; accent-color: var(--pink-deep); }
.pack input:checked + span { text-decoration: line-through; opacity: .55; }

/* cleaning */
.bar { height: 22px; background: #f1e6ee; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), #8fd6b0); border-radius: 99px; transition: width .8s cubic-bezier(.3,1.4,.5,1); }
.barpct { font-family: "Space Mono"; font-size: 28px; margin: 10px 0 4px; }
.barmsg { font-weight: 700; min-height: 1.5em; }

/* flight */
.flight svg { width: 100%; height: auto; display: block; }
.flight .status { font-weight: 800; margin-top: 10px; font-size: 18px; }
.flight .note { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* locked */
.locked-panel { text-align: center; padding: 26px 0; }
.locked-panel .lock { font-size: 40px; }
.locked-panel h2 { margin-top: 6px; }

/* finale */
.finale { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.finale-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 32px 24px; max-width: 460px; }
.finale-card h1 { font-size: 30px; margin: 10px 0; }
.finale-card p { font-size: 19px; font-weight: 700; margin: 10px 0; opacity: 0; animation: msgIn .5s forwards; }

/* misc */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 800; transition: .25s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 30px; }

@media (max-width: 640px) {
  .world { grid-template-columns: 1fr; }
  .gap { writing-mode: horizontal-tb; }
  .gap span { border-left: 0; border-top: 2px dashed #d9c6d6; padding: 6px 0 0; }
  .scene { height: 190px; }
  .stats { grid-template-columns: 1fr; }
  .stat { display: flex; align-items: center; gap: 12px; text-align: left; }
  .stat b { min-width: 48px; text-align: center; }
  .cal { grid-template-columns: repeat(4, 1fr); }
  .clocks { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
