:root {
  --sky1: #4cc3ff;
  --sky2: #b5ecff;
  --card: #ffffff;
  --card2: #eef4ff;
  --ink: #1d2433;
  --line: #1d2433;
  --text: #1d2433;
  --muted: #5b6785;
  --accent: #3ccf4e;
  --accent-dark: #22943a;
  --accent-ink: #ffffff;
  --coin: #ffc928;
  --coin-dark: #d99a00;
  --red: #ff4d5e;
  --red-dark: #c42a3a;
  --blue: #2f80ff;
  --blue-dark: #1b55b8;
  --warn: #ff9f1c;
  --bad: #ff4d5e;
  --good: #22943a;
  --radius: 16px;
  --px: "Press Start 2P", monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); }
body {
  font: 600 16px/1.4 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(84px + var(--safe-b));
  overscroll-behavior-y: none;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 70%) fixed;
  min-height: 100vh;
}
/* Nuvens e colinas ao fundo */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body::before {
  top: 60px; left: -200px; width: 1400px; height: 120px;
  background:
    radial-gradient(circle at 60px 60px, #fff 34px, transparent 35px),
    radial-gradient(circle at 105px 45px, #fff 42px, transparent 43px),
    radial-gradient(circle at 150px 62px, #fff 30px, transparent 31px),
    radial-gradient(circle at 560px 40px, #fff 26px, transparent 27px),
    radial-gradient(circle at 595px 30px, #fff 32px, transparent 33px),
    radial-gradient(circle at 630px 42px, #fff 24px, transparent 25px);
  opacity: .75; animation: clouds 60s linear infinite;
}
body::after {
  left: 0; right: 0; bottom: 0; height: 160px;
  background:
    radial-gradient(ellipse 260px 120px at 15% 100%, #5fd16b 99%, transparent 100%),
    radial-gradient(ellipse 320px 150px at 75% 100%, #47bf55 99%, transparent 100%);
  opacity: .55;
}
@keyframes clouds { from { transform: translateX(0); } to { transform: translateX(600px); } }

button, input, select, textarea { font: inherit; color: inherit; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }
main.enter > * { animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1) both; }
main.enter > *:nth-child(2) { animation-delay: .03s; }
main.enter > *:nth-child(3) { animation-delay: .06s; }
main.enter > *:nth-child(4) { animation-delay: .09s; }
main.enter > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.loading { color: var(--ink); padding: 40px 0; text-align: center; font-family: var(--px); font-size: 12px; }

h1 { font-family: var(--px); font-size: 17px; line-height: 1.5; margin: 10px 0 4px; color: #fff; text-shadow: 3px 3px 0 var(--ink); letter-spacing: .02em; }
h2 { font-family: var(--px); font-size: 11px; line-height: 1.6; margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; color: var(--ink); text-transform: uppercase; }
h2 .sp { flex: 1; }
.sub { color: var(--ink); margin: 0 0 12px; font-weight: 800; opacity: .75; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: 0 4px 0 var(--line); }
.card.hl { background: #fff7d6; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.list .item, .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 3px solid var(--line); border-radius: 14px; margin-bottom: 10px; box-shadow: 0 4px 0 var(--line); }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 800; overflow-wrap: anywhere; }
.item .s { color: var(--muted); font-size: 13px; font-weight: 700; }
.item.done { background: #e9f9ec; }
.item.done .t { text-decoration: line-through; color: var(--muted); }
.item.late { background: #ffe8ea; }
[data-open-test], [data-edit-task], [data-edit-event], [data-edit-slot], [data-edit-card], [data-edit-reward], [data-edit-routine], [data-edit-checklist] { cursor: pointer; }
.dot { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 2px solid var(--line); }
.bar { width: 8px; align-self: stretch; border-radius: 4px; flex: none; border: 2px solid var(--line); }
.empty { color: var(--ink); padding: 14px; text-align: center; border: 3px dashed rgba(29, 36, 51, .45); background: rgba(255, 255, 255, .55); border-radius: 14px; font-size: 14px; font-weight: 700; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--card2); border: 2px solid var(--line); font-size: 14px; font-weight: 800; }
.chip.accent { background: var(--coin); color: var(--ink); }
.tag { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--card2); color: var(--ink); font-weight: 800; white-space: nowrap; border: 2px solid var(--line); }
.tag.bad { background: var(--red); color: #fff; }
.tag.warn { background: var(--coin); }
.tag.good { background: var(--accent); color: #fff; }

/* Botões "de consola": afundam ao carregar */
.btn { border: 3px solid var(--line); background: var(--accent); color: #fff; font-weight: 900; padding: 11px 16px; border-radius: 14px; cursor: pointer; min-height: 48px; box-shadow: 0 5px 0 var(--line); transition: transform .06s, box-shadow .06s; text-shadow: 1px 1px 0 rgba(0,0,0,.25); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--line); }
.btn.ghost { background: #fff; color: var(--ink); text-shadow: none; }
.btn.bad { background: var(--red); }
.btn.blue { background: var(--blue); }
.btn.sm { padding: 5px 10px; min-height: 36px; font-size: 14px; border-radius: 10px; box-shadow: 0 3px 0 var(--line); }
.btn.sm:active:not(:disabled) { transform: translateY(3px); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: #fff; border: 3px solid var(--line); width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 3px 0 var(--line); }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.check { width: 32px; height: 32px; border-radius: 10px; border: 3px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; box-shadow: 0 3px 0 var(--line); }
.check.on { background: var(--accent); color: #fff; animation: stamp .35s cubic-bezier(.2, 1.8, .4, 1); }
.check:active { transform: translateY(3px); box-shadow: none; }
@keyframes stamp { 0% { transform: scale(.4) rotate(-20deg); } 100% { transform: scale(1); } }

.seg { display: flex; background: rgba(255,255,255,.6); border: 3px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font-weight: 900; color: var(--muted); cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--coin); color: var(--ink); box-shadow: inset 0 -3px 0 var(--coin-dark); }

/* Painel do herói */
.hero { background: linear-gradient(180deg, #2b3a67, #1d2433); color: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 14px; margin: 12px 0 6px; box-shadow: 0 5px 0 var(--line); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#ffffff22 1px, transparent 1px); background-size: 14px 14px; pointer-events: none; }
.hero .muted { color: #b9c4e6; }
.hero .big { font-family: var(--px); font-size: 13px; line-height: 1.6; }
.hero-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.sprite { image-rendering: pixelated; shape-rendering: crispEdges; display: block; }
.buddy { width: 76px; height: 91px; flex: none; cursor: pointer; animation: bob 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
.buddy.jump { animation: jump .55s cubic-bezier(.3, 1.6, .5, 1); }
.buddy.run { animation: run .32s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes jump { 0% { transform: scale(1.1, .85); } 35% { transform: translateY(-34px) scale(.95, 1.08); } 70% { transform: translateY(0) scale(1.08, .9); } 100% { transform: none; } }
@keyframes run { 0% { transform: translateY(0) rotate(-4deg); } 100% { transform: translateY(-6px) rotate(4deg); } }
.stats { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.25); border-radius: 10px; padding: 5px 10px; font-weight: 900; font-size: 15px; }
.xp { height: 16px; background: #0d1222; border: 3px solid #fff; border-radius: 6px; overflow: hidden; margin-top: 12px; position: relative; z-index: 1; }
.xp > i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, #5fe36f 10px 20px); transition: width .8s cubic-bezier(.2, 1.2, .4, 1); }
.xp-label { font-family: var(--px); font-size: 8px; margin-top: 6px; color: #b9c4e6; position: relative; z-index: 1; }
.progress { height: 12px; background: var(--card2); border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }

/* Moeda */
.coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0 0 18%, var(--coin) 20% 100%); border: 2px solid var(--coin-dark); box-shadow: inset -2px -2px 0 var(--coin-dark); flex: none; vertical-align: -3px; }
.coin.spin { animation: spin 1.6s linear infinite; }
@keyframes spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.15); } }
.flame { display: inline-block; animation: flicker .9s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.15) rotate(4deg); } }

/* Contagem decrescente / boss */
.countdown { min-width: 56px; text-align: center; border-radius: 10px; padding: 6px 4px; background: var(--card2); border: 2px solid var(--line); }
.countdown b { display: block; font-size: 20px; line-height: 1; font-weight: 900; }
.countdown span { font-size: 11px; color: var(--muted); font-weight: 800; }
.countdown.soon { background: var(--coin); }
.countdown.now { background: var(--red); color: #fff; }
.countdown.now span { color: #fff; }
.boss-mini { width: 40px; height: 40px; flex: none; animation: bossIdle 1.2s steps(2) infinite; }
@keyframes bossIdle { 50% { transform: translateY(-2px) scaleY(1.05); } }
.hp { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.hp b { font-family: var(--px); font-size: 8px; color: var(--red-dark); }
.hp .hpbar { flex: 1; height: 10px; border: 2px solid var(--line); border-radius: 4px; background: #ffd6da; overflow: hidden; }
.hp .hpbar i { display: block; height: 100%; background: var(--red); transition: width .6s; }
.boss-stage { display: grid; place-items: center; padding: 16px 0 8px; background: linear-gradient(180deg, #2b3a67, #3d2b67); border: 3px solid var(--line); border-radius: 16px; margin-bottom: 12px; position: relative; }
.boss-stage .boss-big { width: 120px; height: 120px; animation: bossIdle 1.2s steps(2) infinite; }
.boss-stage.hit .boss-big { animation: hit .45s; }
@keyframes hit { 0%, 100% { transform: none; filter: none; } 20% { transform: translateX(-10px); filter: brightness(3); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); filter: brightness(3); } 80% { transform: translateX(4px); } }
.boss-stage .hp { width: 70%; }
.boss-stage .hp b { color: #fff; }
.boss-stage .defeated { font-family: var(--px); font-size: 12px; color: var(--coin); margin-top: 8px; }

.slot { display: flex; gap: 12px; align-items: stretch; }
.slot .time { width: 52px; flex: none; font-size: 13px; color: var(--ink); padding-top: 13px; text-align: right; font-weight: 900; }
.slot .item { flex: 1; }
.slot.now .item { background: #fff7d6; animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 4px 0 var(--line), 0 0 0 4px var(--coin); } }

/* Temporizador */
.timer { display: grid; place-items: center; margin: 10px 0 18px; }
.timer svg.ring { width: 250px; height: 250px; transform: rotate(-90deg); }
.timer .lbl { position: absolute; text-align: center; display: grid; place-items: center; gap: 4px; }
.timer .lbl b { font-family: var(--px); font-size: 26px; display: block; color: var(--ink); }
.timer .lbl .buddy { width: 58px; height: 70px; }
.timer-wrap { position: relative; display: grid; place-items: center; background: #fff; border: 3px solid var(--line); border-radius: 50%; box-shadow: 0 5px 0 var(--line); }

/* Cartões */
.flash { min-height: 220px; display: grid; place-items: center; text-align: center; font-size: 21px; font-weight: 900; padding: 24px; cursor: pointer; background: #fff; border: 3px solid var(--line); border-radius: 20px; margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 6px 0 var(--line); animation: flipIn .35s ease-out; }
.flash.back { background: #e6f0ff; }
@keyframes flipIn { from { transform: rotateY(90deg); } to { transform: none; } }

/* Barras */
.hbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.hbar .n { width: 70px; flex: none; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.hbar .b { flex: 1; height: 14px; background: var(--card2); border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.hbar .b i { display: block; height: 100%; }
.hbar .v { width: 64px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 900; }

/* Troféus */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: 0 4px 0 var(--line); }
.badge .e { font-size: 30px; line-height: 1.2; }
.badge .n { font-size: 12px; font-weight: 900; line-height: 1.2; margin-top: 4px; }
.badge .d { font-size: 11px; color: var(--muted); font-weight: 700; line-height: 1.2; margin-top: 3px; }
.badge.locked { background: #dfe5f2; }
.badge.locked .e { filter: grayscale(1) brightness(.6); opacity: .5; }
.badge.got { background: linear-gradient(180deg, #fff7d6, #fff); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 40px; height: 40px; border-radius: 12px; border: 3px solid var(--line); cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.colors button.on { outline: 3px solid #fff; outline-offset: -7px; }

/* Barra de separadores */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); border-top: 3px solid #000; display: flex; justify-content: center; padding: 6px 4px calc(6px + var(--safe-b)); z-index: 10; }
#tabs button { flex: 1; max-width: 112px; border: 0; background: transparent; color: #8d99bd; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 900; padding: 6px 0; cursor: pointer; border-radius: 12px; }
#tabs button.on { color: var(--coin); background: rgba(255,255,255,.08); }
#tabs button.on svg { animation: tabHop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes tabHop { 40% { transform: translateY(-6px); } }
#tabs svg { width: 24px; height: 24px; }

/* Folha (formulários) */
.sheet { position: fixed; inset: 0; background: rgba(13, 18, 34, .6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); border: 3px solid var(--line); border-bottom: 0; animation: slideUp .3s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet h3 { margin: 0 0 14px; font-family: var(--px); font-size: 12px; line-height: 1.6; display: flex; align-items: center; gap: 10px; }
.sheet h3 span { flex: 1; }
.sheet h2 { color: var(--ink); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 900; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; background: #fff; border: 3px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 48px; outline: none; font-weight: 700;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #bcd6ff; }
textarea { min-height: 96px; resize: vertical; }
input[type=color] { width: 100%; height: 48px; border: 3px solid var(--line); border-radius: 12px; background: #fff; padding: 4px; }
.frow { display: flex; gap: 10px; }
.frow > * { flex: 1; min-width: 0; }
.factions { display: flex; gap: 10px; margin-top: 8px; }
.factions .btn { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 900; z-index: 30; max-width: calc(100% - 32px); text-align: center; border: 3px solid #fff; box-shadow: 0 5px 0 #000; animation: toastIn .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.toast.err { background: var(--red); }

/* Efeitos */
.fx-coin { position: fixed; z-index: 40; pointer-events: none; width: 22px; height: 22px; animation: coinPop .9s cubic-bezier(.2, .8, .4, 1) forwards; }
@keyframes coinPop { 0% { transform: translate(0, 0) scale(.4); opacity: 1; } 45% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 50px)) scale(.8); opacity: 0; } }
.fx-coin .coin { width: 22px; height: 22px; animation: spin .4s linear infinite; }
.fx-plus { position: fixed; z-index: 41; pointer-events: none; font-family: var(--px); font-size: 16px; color: var(--coin); text-shadow: 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); animation: plusUp 1.1s ease-out forwards; transform: translateX(-50%); }
@keyframes plusUp { 0% { transform: translate(-50%, 0) scale(.5); opacity: 0; } 20% { transform: translate(-50%, -14px) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(13, 18, 34, .78); overflow: hidden; cursor: pointer; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.overlay .box { text-align: center; color: #fff; position: relative; z-index: 2; padding: 20px; }
.overlay .title { font-family: var(--px); font-size: 26px; line-height: 1.4; color: var(--coin); text-shadow: 4px 4px 0 var(--red-dark); animation: bigPop .6s cubic-bezier(.2, 1.8, .4, 1); }
.overlay .subt { font-family: var(--px); font-size: 11px; line-height: 1.8; margin-top: 14px; }
.overlay .emoji { font-size: 76px; animation: bigPop .6s cubic-bezier(.2, 1.8, .4, 1), wobble 1.2s .6s ease-in-out infinite; display: inline-block; }
.overlay .hint { font-size: 12px; color: #b9c4e6; margin-top: 22px; font-weight: 800; }
.overlay .rays { position: absolute; width: 900px; height: 900px; left: 50%; top: 50%; margin: -450px; background: repeating-conic-gradient(rgba(255, 201, 40, .16) 0 12deg, transparent 12deg 24deg); animation: rays 10s linear infinite; z-index: 1; }
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes bigPop { 0% { transform: scale(0) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes wobble { 50% { transform: rotate(8deg) scale(1.05); } }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; z-index: 3; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* Entrada */
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: stretch; }
.login .buddy { width: 110px; height: 132px; margin: 0 auto 8px; }
.login h1 { text-align: center; font-size: 22px; }
.login .sub { text-align: center; }
.press { text-align: center; font-family: var(--px); font-size: 10px; color: #fff; text-shadow: 2px 2px 0 var(--ink); animation: blink 1s steps(2) infinite; margin-bottom: 10px; }
@keyframes blink { 50% { opacity: 0; } }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 14px; }
.who button { padding: 16px 10px; border-radius: 16px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-weight: 900; box-shadow: 0 5px 0 var(--line); }
.who button.on { background: var(--coin); }
.who button div { font-size: 30px; margin-bottom: 4px; }

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

/* Botão Desfazer no aviso */
.toast .undo { margin-left: 12px; background: var(--coin); color: var(--ink); border: 2px solid #fff; border-radius: 8px; padding: 4px 10px; font-weight: 900; cursor: pointer; }

/* Horário: vista semanal */
.week { display: grid; grid-template-columns: 44px repeat(5, 1fr); gap: 4px; background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 4px 0 var(--line); }
.week .wh { text-align: center; font-weight: 900; font-size: 13px; padding: 4px 0; border-radius: 8px; }
.week .wh.today { background: var(--coin); }
.week .wt { font-size: 11px; font-weight: 800; color: var(--muted); display: grid; place-items: center; }
.week .wc { min-height: 40px; border-radius: 8px; border: 2px solid var(--line); color: #fff; display: grid; place-items: center; text-align: center; line-height: 1.1; cursor: pointer; padding: 3px 1px; text-shadow: 1px 1px 0 rgba(0,0,0,.35); }
.week .wc b { font-size: 12px; font-weight: 900; }
.week .wc span { font-size: 10px; opacity: .9; }
.week .wc.now { outline: 3px solid var(--coin); outline-offset: 1px; }
.week .empty-c { background: var(--card2); border-color: transparent; cursor: default; }

/* Laboratório: mapa */
.map { position: relative; padding: 10px 0 20px; }
.map::before { content: ""; position: absolute; left: 50%; top: 20px; bottom: 30px; width: 6px; margin-left: -3px; background: repeating-linear-gradient(180deg, rgba(255,255,255,.95) 0 12px, transparent 12px 22px); border-radius: 3px; }
.node-row { position: relative; display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.node { position: relative; width: 64px; height: 64px; flex: none; border-radius: 50%; border: 3px solid var(--line); background: #dfe5f2; box-shadow: 0 5px 0 var(--line); cursor: pointer; display: grid; place-items: center; padding: 0; }
.node .ne { font-size: 28px; filter: grayscale(.6); }
.node.ok { background: var(--coin); }
.node.ok .ne { filter: none; }
.node.cur { background: #fff; animation: glowNode 1.2s ease-in-out infinite alternate; }
.node.cur .ne { filter: none; }
@keyframes glowNode { to { box-shadow: 0 5px 0 var(--line), 0 0 0 7px rgba(255, 201, 40, .8); } }
.node .nstar { position: absolute; top: -10px; right: -8px; font-size: 20px; }
.nlabel { background: rgba(255,255,255,.92); border: 2px solid var(--line); border-radius: 10px; padding: 4px 8px; max-width: 46%; line-height: 1.2; }
.nlabel b { display: block; font-size: 13px; }
.nlabel span { font-size: 11px; color: var(--muted); font-weight: 800; }
.map-buddy { width: 44px; height: 53px; flex: none; }

/* Decorações: fundos */
.temas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tema { min-height: 56px; border-radius: 12px; border: 3px solid var(--line); color: #fff; font-weight: 900; text-shadow: 1px 1px 0 rgba(0,0,0,.5); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; }
.tema small { font-size: 10px; font-weight: 800; }
.tema.on { outline: 4px solid var(--coin); outline-offset: 1px; }
.tema:disabled { filter: grayscale(.8); opacity: .6; cursor: default; }
.t-dia { background: linear-gradient(#4cc3ff, #b5ecff); }
.t-por-do-sol { background: linear-gradient(#ff6b6b, #feb47b); }
.t-noite { background: linear-gradient(#0b1340, #2b3a7a); }
.t-oceano { background: linear-gradient(#0077b6, #90e0ef); }
.t-floresta { background: linear-gradient(#2d6a4f, #95d5b2); }
.t-neve { background: linear-gradient(#8ec5ff, #eef7ff); }
.t-espaco { background: linear-gradient(#000014, #3a0f5c); }
.t-arco-iris { background: linear-gradient(90deg, #ff4d5e, #ff9f1c, #ffc928, #3ccf4e, #2f80ff, #a855f7); }

/* Fundos da app */
:root { --hill1: #5fd16b; --hill2: #47bf55; }
body::after { background: radial-gradient(ellipse 260px 120px at 15% 100%, var(--hill1) 99%, transparent 100%), radial-gradient(ellipse 320px 150px at 75% 100%, var(--hill2) 99%, transparent 100%) !important; }
html[data-tema="por-do-sol"] { --sky1: #ff6b6b; --sky2: #feb47b; --hill1: #c0603a; --hill2: #a24e2c; }
html[data-tema="oceano"] { --sky1: #0077b6; --sky2: #90e0ef; --hill1: #f4d58d; --hill2: #e9c46a; }
html[data-tema="floresta"] { --sky1: #2d6a4f; --sky2: #95d5b2; --hill1: #1b4332; --hill2: #2d6a4f; }
html[data-tema="neve"] { --sky1: #8ec5ff; --sky2: #eef7ff; --hill1: #ffffff; --hill2: #e3f0ff; }
html[data-tema="noite"] { --sky1: #0b1340; --sky2: #2b3a7a; --hill1: #1f4d3a; --hill2: #173d2e; }
html[data-tema="espaco"] { --sky1: #000014; --sky2: #3a0f5c; --hill1: #6c6c7c; --hill2: #55556a; }
html[data-tema="arco-iris"] { --sky1: #a855f7; --sky2: #ffd6e8; }
html[data-tema="noite"] body::before, html[data-tema="espaco"] body::before {
  top: 0; left: 0; width: 100%; height: 100%; opacity: .8; animation: twinkle 3s ease-in-out infinite alternate;
  background: radial-gradient(#fff 1px, transparent 1.5px) 0 0 / 46px 46px, radial-gradient(#fff 1.2px, transparent 1.7px) 23px 17px / 71px 71px;
}
@keyframes twinkle { to { opacity: .45; } }
html[data-tema="noite"] .sub, html[data-tema="espaco"] .sub, html[data-tema="noite"] h2, html[data-tema="espaco"] h2, html[data-tema="floresta"] h2, html[data-tema="oceano"] h2 { color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.hero .som { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 10px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); font-size: 18px; cursor: pointer; }

/* Hoje: menu de secções */
.now-class { margin-top: 10px; }
.now-class .s:first-child { font-family: var(--px); font-size: 8px; color: var(--accent-dark); margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.tile { position: relative; background: #fff; border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 var(--line); padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; text-align: center; transition: transform .06s, box-shadow .06s; }
.tile:active { transform: translateY(5px); box-shadow: 0 0 0 var(--line); }
.tile .te { font-size: 30px; line-height: 1.1; }
.tile b { font-size: 16px; font-weight: 900; }
.tile small { font-size: 12px; color: var(--muted); font-weight: 800; line-height: 1.2; }
.tbadge { position: absolute; top: -8px; right: -6px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--red); color: #fff; border: 3px solid var(--line); font-style: normal; font-weight: 900; font-size: 13px; display: grid; place-items: center; padding: 0 4px; animation: bob 1.6s ease-in-out infinite; }
.back { margin: 4px 0 6px; }
.week .wh { border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 900; font-size: 13px; }

/* Hoje: mapa de ilhas */
.mar { position: relative; border: 3px solid var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--line); padding: 18px 10px 30px; overflow: hidden;
  background:
    radial-gradient(ellipse 16px 4px at 20% 30%, rgba(255,255,255,.55) 98%, transparent 100%),
    radial-gradient(ellipse 14px 4px at 75% 55%, rgba(255,255,255,.5) 98%, transparent 100%),
    radial-gradient(ellipse 18px 4px at 40% 85%, rgba(255,255,255,.5) 98%, transparent 100%),
    linear-gradient(180deg, #2fa6e8, #1c7fc4); }
.mar::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, transparent 0 22px, rgba(255,255,255,.07) 22px 26px); animation: ondas 6s linear infinite; pointer-events: none; }
@keyframes ondas { to { transform: translateY(-26px); } }
.mar .tiles { position: relative; gap: 22px 14px; margin-top: 0; }
.mar .tile { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 0; }
.mar .tile:nth-child(even) { transform: translateY(26px); }
.mar .tile:active { transform: scale(.94); box-shadow: none; }
.mar .tile:nth-child(even):active { transform: translateY(26px) scale(.94); }
.terra { --t1: #6ad16f; --t2: #3faa4c; width: 100%; max-width: 150px; height: 84px; display: grid; place-items: center;
  border-radius: 48% 52% 45% 55% / 55% 48% 52% 45%; border: 3px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, var(--t1) 0 55%, var(--t2) 56% 70%, #f2d68b 71%);
  box-shadow: 0 0 0 5px rgba(255,255,255,.55), 0 8px 0 rgba(0,0,0,.18); animation: flutua 3.2s ease-in-out infinite; }
.mar .tile:nth-child(3n) .terra { animation-delay: -1s; border-radius: 55% 45% 52% 48% / 45% 55% 45% 55%; }
.mar .tile:nth-child(3n+1) .terra { animation-delay: -2s; }
@keyframes flutua { 50% { transform: translateY(-4px); } }
.terra .te { font-size: 36px; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.25)); }
.placa { margin-top: -10px; position: relative; z-index: 1; background: #a8743f; color: #fff; border: 3px solid var(--line); border-radius: 10px; padding: 3px 9px 4px; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.placa b { font-size: 14px; font-weight: 900; text-shadow: 1px 1px 0 rgba(0,0,0,.35); }
.placa small { color: #ffe9c7; font-size: 11px; font-weight: 800; line-height: 1.2; }
.mar .tbadge { top: -6px; right: 4px; }
.ilha-treinos .terra { --t1: #c0603a; --t2: #8a3f22; }
.ilha-treinos .terra::after { content: ""; }
.ilha-testes .terra { --t1: #8b6cc9; --t2: #5b3f96; }
.ilha-missoes .terra { --t1: #3faa4c; --t2: #2d6a4f; }
.ilha-agenda .terra { --t1: #f7c873; --t2: #e3a646; }
.ilha-horario .terra { --t1: #eef7ff; --t2: #b9d6f2; }
.ilha-mochila .terra { --t1: #ff9f6b; --t2: #e06b3a; }
.ilha-noite .terra { --t1: #2b3a7a; --t2: #0b1340; }
.ilha-rotina .terra { --t1: #6ad16f; --t2: #2fa66b; }
.mar .tbadge { right: calc(50% - 78px); }
