:root {
  --blue-900: #0b3a82;
  --blue-700: #1b5fc4;
  --blue-500: #2f86f0;
  --blue-300: #8cc2ff;
  --blue-100: #dcecff;
  --blue-50: #f0f7ff;
  --green: #46c93a;
  --green-dark: #2d9a26;
  --pink: #ff5fa2;
  --purple: #8e5cf7;
  --ink: #1d2b44;
  --muted: #5a6b85;
  --pb: #4cd137;
  --radius: 22px;
  --shadow: 0 12px 34px rgba(20, 60, 130, .16);
}

body.love { --pb: #ff5fa2; }
body.borahae {
  --pb: #9b6bff;
  --blue-900: #3b1a7a;
  --blue-700: #6a3fd1;
  --blue-500: #8e5cf7;
  --blue-300: #c4a8ff;
  --blue-100: #ece2ff;
  --blue-50: #f7f2ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blue-300) 0%, var(--blue-100) 30%, var(--blue-50) 70%, #fff 100%) fixed;
  padding-bottom: 110px;
  overflow-x: hidden;
  transition: background .6s;
}
body.locked { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 900; }
.hidden { display: none !important; }

/* ---------- Plumbob ---------- */
.plumbob { display: inline-block; width: 34px; animation: pb-float 3s ease-in-out infinite; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--pb) 55%, transparent)); }
.plumbob svg { display: block; width: 100%; height: auto; animation: pb-spin 5s linear infinite; }
.plumbob.big { width: 64px; }
.plumbob.tiny { width: 14px; vertical-align: -3px; animation: none; }
.plumbob polygon.base { fill: var(--pb); transition: fill .6s; }
@keyframes pb-float { 50% { transform: translateY(-8px); } }
@keyframes pb-spin { 0%, 100% { transform: scaleX(1); } 25%, 75% { transform: scaleX(.5); } 50% { transform: scaleX(1) scaleY(1.02); } }

/* ---------- Botões ---------- */
.btn {
  font: inherit; font-weight: 800; font-size: 1.05rem;
  border: 0; border-radius: 999px; padding: 12px 26px; cursor: pointer;
  color: #fff; text-decoration: none; display: inline-block;
  background: linear-gradient(180deg, #52a3ff, var(--blue-700));
  box-shadow: 0 4px 0 var(--blue-900), 0 8px 18px rgba(20, 60, 130, .25);
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-900); }
.btn-green { background: linear-gradient(180deg, #7de35a, var(--green-dark)); box-shadow: 0 4px 0 #1f6d1a, 0 8px 18px rgba(30, 110, 30, .3); }
.btn-green:active { box-shadow: 0 1px 0 #1f6d1a; }
.btn-gray { background: linear-gradient(180deg, #c3ccd9, #8792a5); box-shadow: 0 4px 0 #5f6a7d; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; overflow-y: auto; padding: 16px; text-align: center;
  background: radial-gradient(circle at 50% 35%, #5aa9ff, #1b5fc4 60%, #0b3a82);
  color: #fff; transition: opacity .6s, visibility .6s;
}
#loader.gone { opacity: 0; visibility: hidden; }
.loader-inner { width: min(460px, 100%); margin: auto; }
@media (max-height: 560px) {
  .loader-title { margin-top: 6px; }
  .loader-sub { margin-bottom: 14px; }
  #loader .plumbob.big { width: 40px; }
  .tip { margin: 10px 0 12px; }
}
.loader-title { font-size: clamp(2rem, 8vw, 3.2rem); margin-top: 18px; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.loader-title span { display: block; font-size: .45em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.loader-sub { margin: 6px 0 26px; font-weight: 700; opacity: .9; }
.loader-bar { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.loader-bar div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #9df27c, #4cd137); animation: load 5s cubic-bezier(.3, .1, .3, 1) forwards; }
@keyframes load { 70% { width: 83%; } 85% { width: 84%; } 100% { width: 100%; } }
.tip { min-height: 3em; margin: 16px 0 20px; font-weight: 700; transition: opacity .25s; }
.tip.fade { opacity: 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: linear-gradient(180deg, #3a92f5, var(--blue-700));
  color: #fff; box-shadow: 0 4px 16px rgba(10, 50, 120, .25);
}
.brand { color: #fff; text-decoration: none; font-weight: 900; white-space: nowrap; }
.topbar nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14);
}
.topbar nav a:hover { background: rgba(255, 255, 255, .3); }
.som { margin-left: auto; flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.1rem; background: rgba(255, 255, 255, .2); }
.som:hover { background: rgba(255, 255, 255, .35); }

/* ---------- Layout ---------- */
main { width: min(1000px, 100%); margin: 0 auto; padding: 0 16px; }
section { padding: 40px 0; }
.simlish { margin: 0; font-weight: 900; color: var(--blue-500); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; }
.section-title { text-align: center; margin-bottom: 26px; }
.section-title h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--blue-900); }
.section-title p:last-child { color: var(--muted); margin: 6px 0 0; }

.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 22px; color: #fff; font-weight: 900; font-size: 1.15rem;
  background: linear-gradient(180deg, #3a92f5, var(--blue-700));
}
.panel-head small { font-weight: 700; opacity: .85; font-size: .85rem; margin-left: auto; }
.panel-body { padding: 24px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Avatar ---------- */
.avatar {
  --av: var(--blue-500);
  position: relative; width: 96px; aspect-ratio: 1; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--av) 60%, #fff), var(--av));
  border: 4px solid #fff; box-shadow: 0 6px 16px rgba(20, 60, 130, .2);
  color: #fff; font-weight: 900; font-size: 2rem;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 150px; font-size: 3rem; }
.avatar.sm { width: 48px; font-size: 1rem; border-width: 3px; }
.sim { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sim-name { font-weight: 900; }

/* ---------- Hero / save ---------- */
.hero { text-align: center; padding-top: 48px; }
.hero h1 { font-size: clamp(1.8rem, 7vw, 2.8rem); color: var(--blue-900); margin-bottom: 24px; }
.save-card { display: grid; grid-template-columns: 1fr 1.2fr; text-align: left; }
.save-art {
  display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 30px 20px;
  background: linear-gradient(180deg, #bde0ff, #7fbf6a 78%, #5ea54c 78%);
}
.save-info { padding: 26px; }
.save-info small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.save-info h2 { color: var(--blue-900); font-size: 1.7rem; margin: 4px 0 12px; }
.save-info ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; color: var(--muted); }
.save-info b { color: var(--ink); }

/* ---------- Necessidades ---------- */
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.need-top { display: flex; align-items: center; gap: 8px; font-weight: 900; margin-bottom: 6px; }
.need-top .pct { margin-left: auto; font-size: .85rem; color: var(--muted); }
.bar { height: 16px; border-radius: 99px; background: #e3eaf3; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .08); }
.fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(180deg, #8ae966, #3fae2f); transition: width 1.8s cubic-bezier(.2, .8, .2, 1); }
.fill.mid { background: linear-gradient(180deg, #ffe066, #f5b400); }
.fill.low { background: linear-gradient(180deg, #ff9a7a, #e8452c); }
.fill.love { background: linear-gradient(90deg, #ff9ccc, var(--pink), #ff9ccc); background-size: 200% 100%; animation: shimmer 2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.need p { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }

/* ---------- CAS ---------- */
.cas { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.cas-portrait { text-align: center; }
.cas-portrait .pedestal { width: 160px; height: 22px; margin: -8px auto 0; border-radius: 50%; background: radial-gradient(ellipse, rgba(20, 60, 130, .25), transparent 70%); }
.cas-portrait h3 { margin-top: 12px; font-size: 1.4rem; color: var(--blue-900); }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 22px; }
.info div { background: var(--blue-50); border-radius: 14px; padding: 10px 14px; }
.info small { display: block; color: var(--muted); font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.info span { font-weight: 800; }
.cas h4 { margin: 0 0 12px; color: var(--blue-700); font-weight: 900; }
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.trait { text-align: center; padding: 14px 10px; border-radius: 16px; border: 2px solid var(--blue-100); transition: transform .2s, border-color .2s; }
.trait:hover { transform: translateY(-4px); border-color: var(--blue-300); }
.trait .ico {
  width: 58px; aspect-ratio: 1; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem;
  background: linear-gradient(180deg, #fff, var(--blue-100)); border: 3px solid var(--blue-300);
}
.trait b { display: block; font-size: .95rem; }
.trait p { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- Humores ---------- */
.moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mood { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--blue-50); }
.mood .em { width: 50px; aspect-ratio: 1; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--c); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.mood b { display: block; }
.mood p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.mood .meta { font-size: .75rem; font-weight: 800; color: var(--blue-700); margin-top: 4px; }

/* ---------- Relacionamento ---------- */
.couple { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 5vw, 48px); margin-bottom: 26px; }
.couple .heart { font-size: 2.4rem; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } 60% { transform: scale(1); } }
.clickable { cursor: pointer; background: none; border: 0; font: inherit; color: inherit; padding: 0; }
.clickable .avatar { animation: ring 2s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(76, 209, 55, .6), 0 6px 16px rgba(20, 60, 130, .2); } 100% { box-shadow: 0 0 0 18px rgba(76, 209, 55, 0), 0 6px 16px rgba(20, 60, 130, .2); } }
.click-hint { font-size: .8rem; font-weight: 800; color: var(--green-dark); }
.rel-bars { display: grid; gap: 14px; max-width: 560px; margin: 0 auto 20px; }
.rel-bars label { display: flex; justify-content: space-between; font-weight: 900; margin-bottom: 5px; }
.rel-bars .fill.romance { background: linear-gradient(180deg, #ff9ccc, var(--pink)); }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 26px; }
.tag { padding: 6px 14px; border-radius: 999px; background: var(--blue-100); color: var(--blue-900); font-weight: 800; font-size: .9rem; }
.tag:first-child { background: var(--pink); color: #fff; }
.counter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.counter div { text-align: center; padding: 14px 6px; border-radius: 16px; background: linear-gradient(180deg, var(--blue-500), var(--blue-700)); color: #fff; }
.counter b { display: block; font-size: clamp(1.3rem, 5vw, 2.1rem); font-variant-numeric: tabular-nums; }
.counter small { font-weight: 700; opacity: .9; }
.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stats li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--blue-50); }
.stats li span:nth-child(2) { flex: 1; color: var(--muted); font-weight: 700; }
.stats li b { color: var(--blue-900); font-size: 1.1rem; white-space: nowrap; }

/* ---------- Timeline ---------- */
.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.achv-card { position: relative; padding: 22px 18px; border-radius: var(--radius); text-align: center; background: #fff; box-shadow: var(--shadow); }
.achv-card h3 { margin: 12px 0 6px; font-size: 1.1rem; color: #8a94a6; transition: color .4s; }
.achv-card p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.achv-ico {
  position: relative; width: 72px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  font-size: 2rem; background: #eef1f5; border: 4px solid #dfe5ee; filter: grayscale(1); opacity: .55;
  transition: filter .5s, opacity .5s, background .5s, border-color .5s, transform .5s;
}
.achv-ico .lock { position: absolute; right: -6px; bottom: -6px; font-size: 1.1rem; width: 30px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.achv-card.unlocked .achv-ico { filter: none; opacity: 1; background: linear-gradient(180deg, #fff3c4, #ffd766); border-color: #f5b400; transform: scale(1.08); }
.achv-card.unlocked h3 { color: var(--blue-900); }

/* ---------- Evento final ---------- */
.event .panel-head { background: linear-gradient(180deg, #ff8cc0, #e8468f); }
.letter { max-width: 640px; margin: 0 auto; font-size: 1.1rem; line-height: 1.75; }
.letter p { margin: 0 0 14px; }
.letter .sign { text-align: right; font-weight: 900; color: var(--pink); margin-top: 20px; }
.question { text-align: center; margin-top: 30px; padding-top: 26px; border-top: 2px dashed var(--blue-100); }
.q-title { font-weight: 900; font-size: 1.2rem; }
.q-buttons { position: relative; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; min-height: 90px; padding-top: 10px; }
#recusar { transition: transform .25s; }
.final-msg { text-align: center; padding: 20px 0 6px; }
.final-msg h3 { font-size: 2rem; color: var(--pink); margin: 12px 0 8px; }

footer { text-align: center; color: var(--muted); padding: 30px 16px; }
.cheat-hint { font: inherit; font-size: .8rem; border: 0; background: none; color: var(--blue-300); cursor: pointer; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 64px; right: 16px; z-index: 90; display: grid; gap: 10px; width: min(340px, calc(100% - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px;
  background: #fff; box-shadow: 0 10px 30px rgba(10, 40, 100, .25); border-left: 6px solid var(--blue-500);
  animation: toast-in .35s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.out { opacity: 0; transform: translateX(30px); transition: .4s; }
.toast-icon { font-size: 1.6rem; line-height: 1; }
.toast strong { display: block; color: var(--blue-900); }
.toast p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }

/* ---------- HUD ---------- */
#hud {
  position: fixed; left: 16px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px;
  border-radius: 999px; background: linear-gradient(180deg, #3a92f5, var(--blue-700)); color: #fff;
  box-shadow: 0 10px 30px rgba(10, 40, 100, .35);
  transform: translateY(150%); transition: transform .6s cubic-bezier(.2, 1.2, .4, 1);
}
#hud.show { transform: none; }
.hud-av { position: relative; }
.hud-av .plumbob { position: absolute; top: -34px; left: 50%; width: 18px; margin-left: -9px; cursor: pointer; }
.hud-txt b { display: block; line-height: 1.1; }
.hud-txt small { font-weight: 700; opacity: .9; }
.hud-money { font-weight: 900; padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, .3); font-variant-numeric: tabular-nums; }

/* ---------- Menu de interação ---------- */
.pie { position: fixed; inset: 0; z-index: 80; background: rgba(10, 30, 70, .35); backdrop-filter: blur(2px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.pie-center { position: absolute; transform: translate(-50%, -50%); text-align: center; color: #fff; font-weight: 900; text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.pie-opt {
  position: absolute; transform: translate(-50%, -50%) scale(.3); opacity: 0;
  width: 150px; padding: 9px 12px; border: 3px solid #fff; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: .85rem; line-height: 1.15; color: #fff;
  background: linear-gradient(180deg, #52a3ff, var(--blue-700)); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.pie-opt:hover { background: linear-gradient(180deg, #7de35a, var(--green-dark)); }
.pie-opt.special { background: linear-gradient(180deg, #ff9ccc, #e8468f); }
@keyframes pop { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---------- Console de cheats ---------- */
.cheat { position: fixed; top: 0; left: 0; right: 0; z-index: 95; padding: 10px 16px; background: rgba(10, 20, 40, .92); }
.cheat input { width: 100%; font: 700 1rem ui-monospace, Consolas, monospace; color: #9df27c; background: transparent; border: 1px solid #3b5a3b; border-radius: 8px; padding: 10px 12px; outline: none; }

/* ---------- Confete ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 85; overflow: hidden; }
#confetti span { position: absolute; top: -40px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }


/* ---------- Lote 3D ---------- */
.lot { position: relative; }
.lot-canvas { height: min(72vh, 640px); min-height: 380px; background: var(--sky, linear-gradient(180deg, #7cc3ff, #dff1ff)); cursor: grab; }
.lot-canvas:active { cursor: grabbing; }
.lot-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.lot-ui { position: absolute; top: 12px; right: 12px; left: 12px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; pointer-events: none; }
.lot-ui > * { pointer-events: auto; }
.clock { padding: 8px 14px; border-radius: 999px; color: #fff; font-weight: 900; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #3a92f5, var(--blue-700)); box-shadow: 0 4px 12px rgba(10, 40, 100, .25); }
.speed { display: flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 12px rgba(10, 40, 100, .2); }
.speed button, .daynight { font: inherit; font-weight: 900; font-size: .8rem; border: 0; cursor: pointer; }
.speed button { padding: 6px 9px; border-radius: 999px; background: none; color: var(--blue-700); }
.speed button.on { background: var(--green); color: #fff; }
.daynight { width: 38px; height: 38px; border-radius: 50%; background: #fff; font-size: 1.1rem; box-shadow: 0 4px 12px rgba(10, 40, 100, .2); }
.lot-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lot-label { position: absolute; left: 0; top: 0; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-weight: 900; font-size: .85rem; color: var(--blue-900); background: rgba(255, 255, 255, .92); box-shadow: 0 3px 10px rgba(10, 40, 100, .2); }
.lot-label small { color: var(--green-dark); }
.lot-tip { position: absolute; left: 0; top: 0; pointer-events: none; max-width: 240px; padding: 6px 12px; border-radius: 12px; font-weight: 800; font-size: .85rem; background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(10, 40, 100, .25); opacity: 0; transition: opacity .15s; }
.lot-tip.show { opacity: 1; }
.lot-hint { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #fff; background: rgba(10, 40, 100, .45); pointer-events: none; }
.lot-fallback { display: none; position: absolute; inset: 0; place-items: center; text-align: center; padding: 20px; font-weight: 800; color: var(--blue-900); background: var(--blue-50); }
.lot.no3d .lot-fallback { display: grid; }
.lot.no3d .lot-ui, .lot.no3d .lot-hint { display: none; }

/* ---------- Trocar de família ---------- */
.fam { position: fixed; inset: 0; z-index: 88; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(10, 30, 70, .55); animation: fade .25s; }
.fam-panel { width: min(640px, 100%); }
.fam-close { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer; font-weight: 900; color: #fff; background: rgba(255, 255, 255, .25); }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.fam-card { font: inherit; text-align: center; padding: 16px 10px; border-radius: 16px; cursor: pointer; background: var(--blue-50); border: 3px solid transparent; color: var(--ink); transition: transform .15s, border-color .15s; }
.fam-card:hover { transform: translateY(-3px); border-color: var(--blue-300); }
.fam-card .em { display: block; font-size: 2.2rem; }
.fam-card b { display: block; margin: 6px 0 2px; }
.fam-card small { color: var(--muted); font-weight: 700; }
.fam-card.atual { background: linear-gradient(180deg, #eaffe4, #cdf5c2); border-color: var(--green); }
.fam-card.loading { opacity: .6; pointer-events: none; }
.fam-card.erro { animation: shake .4s; border-color: #e8452c; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.fam-msg { margin: 16px 0 0; min-height: 2.6em; text-align: center; font-weight: 800; color: var(--blue-900); }

/* ---------- Carta de Hogwarts ---------- */
.hogwarts { position: fixed; inset: 0; z-index: 88; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(20, 12, 4, .6); animation: fade .3s; }
.parchment {
  position: relative; width: min(520px, 100%); padding: 44px 34px 30px; border-radius: 6px;
  font-family: "IM Fell English", Georgia, serif; font-size: 1.15rem; line-height: 1.6; color: #3b2a14;
  background: radial-gradient(ellipse at 30% 20%, #fbf1d6, #ecd9a8 70%, #d9bf82);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), inset 0 0 60px rgba(120, 80, 20, .35);
  animation: unroll .6s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes unroll { from { transform: scaleY(.1) rotate(-4deg); opacity: 0; } }
.parchment p { margin: 0 0 12px; }
.parchment p:first-child { text-align: center; font-size: .95rem; letter-spacing: .12em; font-weight: 700; color: #6b1d1d; }
.parchment p:last-child { font-style: italic; }
.parchment .btn { display: block; margin: 18px auto 0; font-family: "Nunito", sans-serif; }
.seal { position: absolute; top: -26px; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; display: grid; place-items: center; color: #f5d7a0; font-size: 1.6rem; font-weight: 700; background: radial-gradient(circle at 35% 35%, #c0392b, #7b1010); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }

@media (max-width: 760px) {
  .lot-canvas { height: 62vh; min-height: 340px; }
  .clock { font-size: .8rem; padding: 7px 10px; }
  .speed button { padding: 5px 7px; }
  .lot-hint { font-size: .7rem; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .save-card { grid-template-columns: 1fr; }
  .needs { grid-template-columns: 1fr; }
  .cas { grid-template-columns: 1fr; }
  .counter { grid-template-columns: repeat(2, 1fr); }
  .panel-body { padding: 18px; }
  .topbar .brand { display: none; }
  .avatar.lg { width: 120px; }
  .pie-opt { width: 118px; font-size: .75rem; padding: 7px 8px; }
  #hud { left: 10px; right: 10px; bottom: 10px; justify-content: flex-start; }
  .hud-money { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
