:root {
  --ice: #eaf5fc;
  --ice2: #cfe8f8;
  --blush: #ffe1ea;
  --blush-deep: #ff9db6;
  --accent: #5db1e4;
  --accent-deep: #327fbd;
  --ink: #2b3a4a;
  --muted: #7089a0;
  --card: #ffffff;
  --gold: #f2c65c;
  --good: #4bbf8a;
  --bad: #ef7b8e;
  --shadow: 0 10px 30px rgba(50, 90, 130, 0.14);
  --radius: 18px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -8%, var(--blush) 0%, rgba(255,225,234,0) 60%),
    linear-gradient(180deg, var(--ice) 0%, var(--ice2) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: "Trebuchet MS", "Segoe UI", sans-serif; }

/* ---------- Snow ---------- */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.flake {
  position: absolute; top: -12px; color: #fff; opacity: 0.9;
  text-shadow: 0 0 4px rgba(120,170,210,0.5);
  animation-name: fall; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes fall {
  0% { transform: translateY(-20px) translateX(0) rotate(0deg); }
  100% { transform: translateY(105vh) translateX(40px) rotate(360deg); }
}

/* ---------- Penguins ---------- */
.penguin {
  width: 62px; height: 74px; display: inline-block;
  transform-origin: 50% 90%;
}
.parade-peng { position: absolute; bottom: 0; }
@keyframes waddle {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}
@keyframes walk {
  0% { left: -80px; }
  100% { left: 100%; }
}
.penguin-parade { position: relative; height: 78px; width: 100%; }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: flex-start; padding: 24px 24px 24px 5vw; }
@media (max-width: 600px) { .login-body { justify-content: center; padding: 24px; } }
.login-card {
  position: relative; z-index: 2;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow);
  padding: 34px 30px 30px; width: 100%; max-width: 380px; text-align: center;
  border: 3px solid #fff;
}
.login-penguins { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.login-penguins .penguin { width: 76px; height: 92px; animation: waddle 2.2s ease-in-out infinite; }
.login-penguins .penguin:nth-child(2) { animation-delay: .5s; }
.login-card h1 { margin: 4px 0 2px; font-size: 1.5rem; color: var(--accent-deep); }
.login-couple { margin: 2px 0; font-weight: 700; color: var(--blush-deep); }
.login-sub { margin: 0 0 18px; color: var(--muted); }
.login-card input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 2px solid var(--ice2);
  font-size: 1rem; margin-bottom: 12px; outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 1.05rem; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 6px 14px rgba(50,127,189,0.35); transition: transform .1s;
}
.login-card button:active { transform: translateY(2px); }
.login-error {
  background: #ffe6ea; color: #b23a4e; border-radius: 10px; padding: 9px 12px;
  margin-bottom: 12px; font-size: .92rem;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 20px; background: rgba(255,255,255,0.9); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(120,170,210,0.25);
}
.topbar .logout { justify-self: end; }
.brand { display: flex; align-items: center; gap: 12px; }

/* live countdown centered in the header */
.header-countdown { justify-self: center; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.hc-days { font-family: "Trebuchet MS", sans-serif; font-weight: 800; font-size: 2rem; line-height: 1; color: var(--accent-deep); }
.hc-dlabel { font-size: .8rem; color: var(--muted); font-weight: 700; margin-right: 4px; }
.hc-time { font-family: "Trebuchet MS", sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--blush-deep); letter-spacing: 1px; }
.hc-time i { color: var(--ice2); font-style: normal; margin: 0 1px; animation: blinkc 1s steps(1) infinite; }
@keyframes blinkc { 50% { opacity: 0.3; } }
.hc-msg { font-weight: 800; color: var(--accent-deep); font-family: "Trebuchet MS", sans-serif; }
.brand-peng { width: 44px; height: 52px; display: inline-block; animation: waddle 2.6s ease-in-out infinite; }
.brand-title { font-weight: 800; font-size: 1.12rem; color: var(--accent-deep); font-family: "Trebuchet MS", sans-serif; }
.brand-sub { font-size: .82rem; color: var(--muted); }
.logout {
  color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600;
  border: 1.5px solid var(--ice2); padding: 7px 12px; border-radius: 10px; white-space: nowrap;
}
.logout:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ---------- Tabs ---------- */
.tabs {
  position: relative; z-index: 3;
  display: flex; gap: 6px; padding: 12px 16px 0; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto;
}
.tab {
  border: none; cursor: pointer; font-size: .96rem; font-weight: 600;
  padding: 10px 15px; border-radius: 14px 14px 0 0; color: var(--muted);
  background: rgba(255,255,255,0.55); white-space: nowrap;
}
.tab:hover { color: var(--accent-deep); }
.tab.active { background: var(--card); color: var(--accent-deep); box-shadow: var(--shadow); }

/* ---------- Content ---------- */
.content { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 16px; }
.panel { display: none; animation: rise .25s ease; }
.panel.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 1.3rem; color: var(--accent-deep); }
.add-btn {
  border: none; cursor: pointer; font-weight: 700; color: #fff; font-size: .95rem;
  padding: 10px 16px; border-radius: 12px;
  background: linear-gradient(180deg, var(--blush-deep) 0%, #ef6f8e 100%);
  box-shadow: 0 6px 14px rgba(239,111,142,0.32); transition: transform .1s;
}
.add-btn:active { transform: translateY(2px); }

/* ---------- Countdown ---------- */
.countdown-card {
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff; border-radius: var(--radius); padding: 26px; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 16px; position: relative; overflow: hidden;
}
.countdown-num { font-size: 3.4rem; font-weight: 800; line-height: 1; font-family: "Trebuchet MS", sans-serif; }
.countdown-label { font-size: 1.05rem; opacity: .92; margin-top: 4px; }
.countdown-date { margin-top: 8px; font-size: .95rem; opacity: .85; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-emoji { font-size: 1.4rem; }
.stat-val { font-size: 1.7rem; font-weight: 800; color: var(--accent-deep); }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.stat-sub { color: var(--ink); font-size: .85rem; margin-top: 6px; }
.bar { height: 8px; border-radius: 6px; background: var(--ice2); margin-top: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--good), #7bd6ad); transition: width .4s; }

.waddle-strip { margin-top: 18px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; min-width: 560px; }
table.grid th, table.grid td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--ice); font-size: .95rem; }
table.grid th { background: var(--ice); color: var(--accent-deep); font-weight: 700; position: sticky; top: 0; }
table.grid tbody tr:hover { background: #f7fbfe; }
table.grid tfoot td { font-weight: 800; color: var(--accent-deep); border-top: 2px solid var(--ice2); }
.row-actions { display: flex; gap: 6px; }
.icon-btn { border: none; background: var(--ice); cursor: pointer; border-radius: 8px; padding: 6px 9px; font-size: .9rem; }
.icon-btn:hover { background: var(--ice2); }
.icon-btn.del:hover { background: #ffdbe2; }

.pill { padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 700; }
.pill.yes { background: #dff3e9; color: #2c8c63; }
.pill.no { background: #ffe0e6; color: #c0435a; }
.pill.pending { background: #fff2d6; color: #b98a1f; }

.chk { width: 22px; height: 22px; cursor: pointer; accent-color: var(--good); }
.done-row td:not(.keep) { opacity: .5; text-decoration: line-through; }

.empty-hint { text-align: center; color: var(--muted); padding: 22px; font-size: .95rem; }
.empty-hint.hide { display: none; }

/* ---------- Settings ---------- */
.settings-form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; max-width: 480px; }
.settings-form label { display: block; margin-bottom: 14px; font-weight: 600; color: var(--ink); font-size: .92rem; }
.settings-form input { width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px; border: 2px solid var(--ice2); font-size: 1rem; outline: none; }
.settings-form input:focus { border-color: var(--accent); }
.settings-form hr { border: none; border-top: 1px solid var(--ice2); margin: 18px 0; }
.save-note { margin-left: 12px; color: var(--good); font-weight: 700; font-size: .9rem; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43,58,74,0.42); z-index: 20; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-back.show { display: flex; }
.modal { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 22px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 14px; color: var(--accent-deep); }
.modal label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.modal input, .modal select, .modal textarea { width: 100%; margin-top: 5px; padding: 10px 11px; border-radius: 10px; border: 2px solid var(--ice2); font-size: 1rem; outline: none; font-family: inherit; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.ghost { border: 2px solid var(--ice2); background: #fff; color: var(--muted); font-weight: 700; padding: 9px 15px; border-radius: 11px; cursor: pointer; }
.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- Couple "texting" scene ---------- */
.scene-card {
  background: linear-gradient(160deg, #fff 0%, var(--blush) 120%);
  border: 2px solid #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 12px 4px; margin-bottom: 16px; text-align: center;
}
.scene-title { font-weight: 800; color: var(--blush-deep); font-size: 1rem; margin-bottom: 2px; font-family: "Trebuchet MS", sans-serif; }
.scene-sub { color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.couple-scene { width: 100%; height: auto; display: block; max-width: 440px; margin: 0 auto; }

.bob { animation: bob 3.2s ease-in-out infinite; }
.bob-b { animation-delay: .7s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.peng-eyes { animation: blink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }

.msg { offset-rotate: 0deg; opacity: 0; animation: msgfly 2.8s ease-in-out infinite; }
.msg-a { offset-path: path("M250,152 Q220,106 190,152"); }
.msg-b { offset-path: path("M190,152 Q220,106 250,152"); animation-delay: 1.4s; }
@keyframes msgfly {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  46% { opacity: 1; }
  56% { offset-distance: 100%; opacity: 0; }
  100% { offset-distance: 100%; opacity: 0; }
}

.fheart { opacity: 0; animation: fheart 4s ease-in infinite; }
@keyframes fheart {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  25% { opacity: .85; }
  100% { transform: translateY(-52px) scale(1); opacity: 0; }
}

@keyframes hop {
  0%, 60%, 100% { transform: translateY(0); }
  75% { transform: translateY(-14px); }
  85% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bob, .peng-eyes, .msg, .fheart, .flake, .parade-peng, .penguin,
  .parade-peng div, .hheart, .mem-img { animation: none !important; }
  .msg, .mem-img.show { opacity: 1; }
}

/* ---------- Header fun strip ---------- */
.header-strip {
  position: relative; z-index: 3; height: 62px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,225,234,0.35));
  border-bottom: 1px solid rgba(120,170,210,0.25);
}
.header-strip .penguin-parade { height: 62px; }
.hheart {
  position: absolute; bottom: -8px; color: var(--blush-deep); opacity: 0;
  animation: hheart 4s ease-in infinite; pointer-events: none; text-shadow: 0 0 3px rgba(255,157,182,0.4);
}
@keyframes hheart {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  25% { opacity: .95; }
  100% { transform: translateY(-58px) scale(1); opacity: 0; }
}

/* ---------- Drifting memories (side borders) ---------- */
.memory-float { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.mem-img {
  position: fixed; opacity: 0; transition: opacity 1.1s ease;
  border: 5px solid #fff; border-radius: 12px; box-shadow: var(--shadow);
  object-fit: cover; height: auto; transform: rotate(var(--r, 0deg));
}
.mem-img.show { opacity: 0.92; animation: memdrift 7.4s ease-in-out forwards; }
@keyframes memdrift {
  0% { transform: translateY(12px) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-6px) rotate(var(--r, 0deg)); }
  100% { transform: translateY(-18px) rotate(var(--r, 0deg)); }
}

/* ---------- Memories tab ---------- */
.upload-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.file-drop {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 2px dashed var(--accent); color: var(--accent-deep); font-weight: 700;
  padding: 11px 16px; border-radius: 12px; background: var(--ice);
}
.file-drop:hover { background: var(--ice2); }
.file-name { color: var(--muted); font-size: .88rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-input { flex: 1; min-width: 160px; padding: 11px 12px; border-radius: 10px; border: 2px solid var(--ice2); font-size: 1rem; outline: none; }
.cap-input:focus { border-color: var(--accent); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-cell { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: #fff; border: 4px solid #fff; }
.photo-cell img, .photo-cell video { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: 10px; background: #000; }

/* staging area: selected files before upload */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stage-cell { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); background: #000; aspect-ratio: 1; }
.stage-cell img, .stage-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; cursor: pointer;
  border-radius: 50%; background: rgba(43,58,74,0.75); color: #fff; font-size: 1rem; line-height: 1; padding: 0;
}
.stage-x:hover { background: var(--bad); }
.stage-badge { position: absolute; bottom: 4px; left: 4px; background: rgba(43,58,74,0.72); color: #fff; font-size: .68rem; padding: 2px 6px; border-radius: 8px; }
.photo-cap { padding: 7px 9px; font-size: .85rem; color: var(--ink); }
.photo-del {
  position: absolute; top: 8px; right: 8px; border: none; cursor: pointer;
  background: rgba(255,255,255,0.9); border-radius: 9px; padding: 5px 8px; font-size: .9rem; line-height: 1;
}
.photo-del:hover { background: #ffdbe2; }

/* ---------- Couple video ---------- */
.couple-video { position: relative; margin-top: 6px; max-width: 380px; }
.couple-video video { width: 100%; border-radius: 16px; display: block; box-shadow: var(--shadow); border: 4px solid #fff; background: #000; }
.vid-mute {
  position: absolute; bottom: 12px; right: 12px; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; line-height: 1;
  background: rgba(43,58,74,0.6); color: #fff; backdrop-filter: blur(3px); transition: background .15s;
}
.vid-mute:hover { background: rgba(43,58,74,0.85); }
.vid-mute.on { background: var(--blush-deep); }

/* ---------- Memories carousel (tablets/phones) ---------- */
.mem-carousel { display: none; }
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 2px 8px; }
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--ice2); border-radius: 3px; }
.carousel .slide { flex: 0 0 auto; width: min(80%, 340px); scroll-snap-align: center; }
.carousel .slide img { width: 100%; height: 230px; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow); border: 4px solid #fff; background: #000; }
/* show the carousel only where the side-border drift can't (no gutters) */
@media (max-width: 1259px) { .mem-carousel:not([hidden]) { display: block; } }

/* ---------- Filter bar (guests) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filter-bar .cap-input { flex: 1; min-width: 160px; }
.filter-bar select.cap-input { flex: 0 0 auto; min-width: 160px; }

/* ---------- Overview split: penguins left, calendar right ---------- */
.overview-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.scene-col { text-align: left; }
.scene-col .scene-title, .scene-col .scene-sub { text-align: left; }
.scene-col .couple-scene { margin: 0; max-width: 380px; }
.cal-col { background: linear-gradient(160deg, #fff, var(--ice)); border-radius: 14px; padding: 14px; }
.cal-title { font-weight: 800; color: var(--accent-deep); text-align: center; margin-bottom: 8px; font-family: "Trebuchet MS", sans-serif; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { font-size: .68rem; color: var(--muted); text-align: center; padding-bottom: 2px; font-weight: 700; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: .8rem; background: #fff; color: var(--ink); position: relative; }
.cal-day.empty { background: transparent; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 800; }
.cal-day.has-task::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--blush-deep); }
.cal-day.today.has-task::after { background: #fff; }
.upcoming h3 { margin: 14px 0 4px; color: var(--accent-deep); font-size: 1rem; }
.upcoming ul { list-style: none; margin: 0; padding: 0; }
.up-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ice); cursor: pointer; }
.up-item:hover { background: #f7fbfe; }
.up-date { font-weight: 800; color: var(--accent-deep); min-width: 52px; font-size: .84rem; }
.up-title { flex: 1; font-size: .9rem; }
.up-cat { font-size: .72rem; color: var(--muted); background: var(--ice); padding: 1px 7px; border-radius: 10px; margin-left: 4px; }
.up-days { font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* ---------- Photo lock badge ---------- */
.photo-lock { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.92); border-radius: 9px; padding: 4px 7px; font-size: .9rem; line-height: 1; }
.photo-cell.locked { border-color: var(--blush); }

/* ---------- Login: snowball game ---------- */
.login-play { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.floater { position: fixed; left: -8vw; animation: floatcross 18s linear infinite; }
.floater .penguin { display: block; }
@keyframes floatcross { from { left: -8vw; } to { left: 106vw; } }
/* the struck penguin gives a quick squash then shatters away */
.floater.hit { animation: pengPop .24s ease-out forwards; }
@keyframes pengPop {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(.06); opacity: 0; }
}
/* penguin shards that morph into hearts and fall independently to the bottom */
.shard, .shard-heart {
  position: fixed; pointer-events: none;
  animation-name: shardMove, shardFade;
  animation-timing-function: cubic-bezier(.28,.5,.5,1), linear;
  animation-fill-mode: forwards, forwards;
}
.shard { z-index: 3; }
.shard-heart { z-index: 4; color: #ff2d55; text-shadow: 0 1px 2px rgba(0,0,0,0.15); animation-name: shardMove, heartFade; }
@keyframes shardMove {
  0% { transform: translate(-50%, -50%) scale(.5) rotate(0); }
  22% { transform: translate(calc(-50% + var(--ex)), calc(-50% + var(--ey))) scale(1) rotate(calc(var(--rot) * 0.15)); }
  100% { transform: translate(calc(-50% + var(--ex) + var(--dx)), 100vh) rotate(var(--rot)); }
}
@keyframes shardFade { 0%, 26% { opacity: 1; } 42%, 100% { opacity: 0; } }
@keyframes heartFade { 0%, 30% { opacity: 0; } 44%, 86% { opacity: 1; } 100% { opacity: 0; } }
.snowball {
  position: fixed; width: 18px; height: 18px; margin: -9px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 34% 30%, #fff7d4 0%, #f2c65c 55%, #e0a020 100%);
  box-shadow: 0 0 10px rgba(242,198,92,0.85), inset 0 -2px 3px rgba(180,130,20,0.4);
}
.trail-dot {
  position: fixed; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%;
  background: #55677c; opacity: .6; z-index: 2; animation: traildot .5s ease-out forwards;
}
@keyframes traildot { to { opacity: 0; transform: scale(.35); } }
.burst {
  position: fixed; width: 8px; height: 8px; margin: -4px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #fff, #f2c65c); animation: burst .6s ease-out forwards;
}
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
.drop-heart { position: fixed; color: #ff2d55; font-size: 28px; z-index: 3; transform: translate(-50%, -50%); animation: heartpop 2.1s ease-in forwards; }
@keyframes heartpop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  18% { opacity: 1; transform: translate(-50%, -75%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, 60vh) scale(1); }
}
.thrower { position: fixed; left: 14px; bottom: 8px; width: 74px; z-index: 2; pointer-events: none; }
.thrower.throw { animation: windup .5s ease; }
@keyframes windup { 0% { transform: rotate(0); } 30% { transform: rotate(-13deg); } 60% { transform: rotate(9deg); } 100% { transform: rotate(0); } }
.login-hint { margin: 12px 0 0; font-size: .74rem; color: var(--muted); }

/* Phone-only: minimise the login box so the game can be played behind it */
.login-min { display: none; }
body.is-phone .login-min {
  display: inline-block; position: absolute; top: 10px; right: 10px; z-index: 3;
  border: none; cursor: pointer; background: var(--ice); color: var(--accent-deep);
  font-weight: 700; font-size: .78rem; padding: 6px 11px; border-radius: 10px;
}
.login-expand { display: none; }
body.is-phone.login-collapsed .login-card { display: none; }
body.is-phone.login-collapsed .login-expand {
  display: inline-block; position: fixed; right: 16px; bottom: 16px; z-index: 46;
  border: none; cursor: pointer; color: #fff; font-weight: 800; font-size: 1rem;
  padding: 12px 18px; border-radius: 14px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 6px 16px rgba(50,127,189,0.4);
}

/* ---------- Login: animated sign-in ---------- */
.login-card { transition: opacity .5s ease, transform .5s ease; }
.login-card.bye { opacity: 0; transform: scale(.9) translateY(-12px); }
.login-body form.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.fly-phone { position: fixed; z-index: 41; transition: transform .7s ease, opacity .7s ease; }
.fly-phone.go { transform: translate(var(--fx), -190px) rotate(250deg); opacity: 0; }
.run-couple { position: fixed; bottom: 15vh; left: -16vw; z-index: 40; display: flex; align-items: flex-end; }
.run-couple.go { animation: runcross 5s linear forwards; }
@keyframes runcross { from { left: -16vw; } to { left: 118vw; } }
.run-couple .penguin { width: 82px; animation: waddle .24s ease-in-out infinite; }
.rc-heart { align-self: center; color: #ff5c78; font-size: 28px; margin: 0 -6px; }
.heart-balloon { position: fixed; z-index: 39; color: #ff5c78; pointer-events: none; animation: balloonup 2.5s ease-in forwards; }
@keyframes balloonup {
  0% { opacity: 0; transform: translateY(0) scale(.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-170px) translateX(12px) scale(1); }
}
.whiteout { position: fixed; inset: 0; background: #fff; opacity: 0; z-index: 60; pointer-events: none; transition: opacity 1.2s ease; }
.whiteout.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .floater, .shard, .shard-heart { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .overview-split { grid-template-columns: 1fr; }
  .scene-col .couple-scene { max-width: 320px; margin: 0 auto; }
  .couple-video { margin-left: auto; margin-right: auto; }
  .topbar { padding: 10px 12px; gap: 6px; }
  .brand-title { display: none; }
  .hc-days { font-size: 1.5rem; }
  .hc-dlabel { display: none; }
  .hc-time { font-size: 1.15rem; }
  .logout { padding: 6px 9px; font-size: .82rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .countdown-num { font-size: 2.8rem; }
  .brand-sub { display: none; }
  .tab { font-size: .88rem; padding: 9px 12px; }
}
