@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f8f0;
  --paper: #fffdf7;
  --ink: #24333b;
  --muted: #66757f;
  --line: #dfe4d7;
  --green: #168a72;
  --green-dark: #0b6653;
  --mint: #dff7ee;
  --coral: #ec6b57;
  --coral-soft: #ffe8e2;
  --blue: #3b7ddd;
  --blue-soft: #e4efff;
  --yellow: #f2c94c;
  --yellow-soft: #fff4c2;
  --purple: #8c62d8;
  --shadow: 0 18px 45px rgb(36 51 59 / 0.12);
  font-family: "Outfit", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at top left, #fff4c2, transparent 28rem), var(--bg); }
body, #app { overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 0 #c9d2c2;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 0 #c9d2c2; }
button:active, button.pop { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 #c9d2c2; }
button.primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
button.coral { background: var(--coral); color: #fff; border-color: var(--coral); box-shadow: 0 4px 0 #b94a3a; }
button.ghost { background: transparent; box-shadow: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 13px;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.required-note {
  display: inline-flex;
  width: fit-content;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #76580b;
  font-size: 10px;
  font-weight: 600;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1; letter-spacing: -1.1px; font-weight: 600; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
a { color: var(--green-dark); }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; padding: 34px; }
.hero { padding: 42px; border-radius: 34px; background: linear-gradient(135deg, #fffdf7, #eaf8f0); box-shadow: var(--shadow); border: 1px solid #fff; }
.logo-mark { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--green); color: #fff; font-size: 38px; box-shadow: 0 8px 0 var(--green-dark); margin-bottom: 24px; }
.hero-logo {
  width: auto;
  max-width: min(340px, 82%);
  height: 20px;
  max-height: 20px;
  margin-bottom: 28px;
}
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: 30px; padding: 28px; box-shadow: var(--shadow); }
.tabs-auth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.tabs-auth button.active { background: var(--yellow-soft); }

.topbar { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 22px; border-bottom: 4px solid var(--yellow); background: rgb(255 253 247 / .92); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 20px; min-width: max-content; }
.brand img { width: auto; max-width: 120px; height: 20px; max-height: 20px; object-fit: contain; }
.brand-fallback { display: inline-flex; gap: 8px; align-items: center; }
.counters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.pill.mint { background: var(--mint); }
.pill.coral { background: var(--coral-soft); }
.pill.blue { background: var(--blue-soft); }

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 78px); }
.sidebar { padding: 18px; border-right: 1px solid var(--line); background: rgb(255 253 247 / .72); }
.sidebar { position: relative; z-index: 20; }
.profile-card, .panel, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 10px 24px rgb(36 51 59 / .07); }
.profile-card { margin-bottom: 14px; }
button.profile-card {
  display: grid;
  width: 100%;
  min-height: auto;
  text-align: left;
  box-shadow: 0 10px 24px rgb(36 51 59 / .07);
}
.avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; background: var(--yellow-soft); font-size: 34px; box-shadow: inset 0 -5px 0 rgb(0 0 0 / .07); }
.nav { display: grid; gap: 8px; }
.nav button { justify-content: flex-start; text-align: left; box-shadow: none; min-height: 44px; }
.nav button.active { background: var(--green); color: white; border-color: var(--green); }
.primary .ui-icon,
.primary .mini-icon,
.coral .ui-icon,
.coral .mini-icon,
.nav button.active .ui-icon,
.segmented button.active .ui-icon,
.filter-strip button.active .ui-icon {
  filter: brightness(0) invert(1);
}
.main { padding: 24px; max-width: 1420px; width: 100%; min-width: 0; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.grid > *,
.task-grid > *,
.project-grid > *,
.shop-grid > *,
.home-layout > *,
.shell > * {
  min-width: 0;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--green-dark); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-size: 12px; }
.metric { display: grid; gap: 4px; }
.metric strong { font-size: 30px; letter-spacing: -1px; }
.badge-list { display: flex; gap: 7px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; background: #eef2e8; color: #40505a; font-weight: 600; font-size: 12px; }
.badge.green { background: var(--mint); color: var(--green-dark); }
.badge.red { background: var(--coral-soft); color: #9d3d31; }
.badge.blue { background: var(--blue-soft); color: #255a9f; }
.badge.yellow { background: var(--yellow-soft); color: #76580b; }

.task-card { display: grid; gap: 12px; border-left: 7px solid var(--green); }
.task-card.done { opacity: .78; border-left-color: var(--blue); }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions > form,
form.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.actions input,
.actions select {
  min-width: 190px;
  flex: 1 1 190px;
}
.comments { display: grid; gap: 8px; margin-top: 8px; }
.comment { border-radius: 14px; padding: 10px 12px; background: #f3f6ef; }
.comment small { color: var(--muted); display: block; margin-top: 3px; }
.chat-box { display: grid; gap: 8px; max-height: 380px; overflow: auto; padding-right: 4px; }
.chat-message { width: fit-content; max-width: 78%; padding: 10px 12px; border-radius: 16px; background: #eef2e8; }
.chat-message.me { justify-self: end; background: var(--mint); }
.calendar-list { display: grid; gap: 16px; }
.calendar-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.date-chip { border-radius: 16px; background: var(--yellow-soft); padding: 12px; text-align: center; font-weight: 600; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 18px; box-shadow: var(--shadow); max-width: 360px; }
.modal-toast {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -8px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 30px rgb(36 51 59 / .22);
}
dialog { border: 0; border-radius: 28px; padding: 0; background: transparent; }
dialog::backdrop { background: rgb(36 51 59 / .42); backdrop-filter: blur(5px); }
.celebration-card { width: min(420px, 92vw); text-align: center; padding: 30px; border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line); }
.avatar-party { font-size: 38px; animation: party .8s ease-in-out infinite alternate; }
@keyframes party { from { transform: translateY(0) rotate(-5deg) scale(1); } to { transform: translateY(-8px) rotate(6deg) scale(1.06); } }

.ui-icon,
.area-icon,
.mini-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 0 rgb(0 0 0 / .08));
}

.mini-icon {
  width: 20px;
  height: 20px;
}

.compact.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 300;
  padding: 10px 18px;
}

.compact.topbar + .shell {
  padding-top: 64px;
}

.compact .brand img {
  width: auto;
  height: 20px;
  max-height: 20px;
}

.top-counters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.top-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
  font-size: 14px;
}

.top-icon img {
  width: 24px;
  height: 24px;
}

.racha-counter .top-icon { color: #d29f13; background: #fff7dc; }
.monedas-counter .top-icon { color: #6ba539; background: #edf8e5; }
.xp-counter .top-icon { color: #485cc7; background: #eef1ff; }
.vida-counter .top-icon { color: #be121b; background: #ffe9eb; }
.notificaciones-counter .top-icon { color: #9c6ade; background: #f3edff; }
.racha-counter .top-icon .ui-icon { filter: brightness(0) saturate(100%) invert(62%) sepia(54%) saturate(759%) hue-rotate(6deg) brightness(90%) contrast(88%); }
.monedas-counter .top-icon .ui-icon { filter: brightness(0) saturate(100%) invert(56%) sepia(22%) saturate(1058%) hue-rotate(51deg) brightness(92%) contrast(89%); }
.xp-counter .top-icon .ui-icon { filter: brightness(0) saturate(100%) invert(35%) sepia(25%) saturate(2184%) hue-rotate(208deg) brightness(91%) contrast(89%); }
.vida-counter .top-icon .ui-icon { filter: brightness(0) saturate(100%) invert(13%) sepia(98%) saturate(4319%) hue-rotate(348deg) brightness(89%) contrast(98%); }
.notificaciones-counter .top-icon .ui-icon { filter: brightness(0) saturate(100%) invert(48%) sepia(42%) saturate(1099%) hue-rotate(221deg) brightness(87%) contrast(90%); }

.icon-racha { filter: brightness(0) saturate(100%) invert(62%) sepia(54%) saturate(759%) hue-rotate(6deg) brightness(90%) contrast(88%); }
.icon-monedas { filter: brightness(0) saturate(100%) invert(56%) sepia(22%) saturate(1058%) hue-rotate(51deg) brightness(92%) contrast(89%); }
.icon-xp { filter: brightness(0) saturate(100%) invert(35%) sepia(25%) saturate(2184%) hue-rotate(208deg) brightness(91%) contrast(89%); }
.icon-vida { filter: brightness(0) saturate(100%) invert(13%) sepia(98%) saturate(4319%) hue-rotate(348deg) brightness(89%) contrast(98%); }

.vida-counter .top-icon .ui-icon {
  opacity: calc(.32 + (var(--life-pct, 1) * .68));
  filter: grayscale(calc(1 - var(--life-pct, 1))) brightness(0) saturate(100%) invert(13%) sepia(98%) saturate(4319%) hue-rotate(348deg) brightness(89%) contrast(98%);
}

.coin-gain { animation: coinGain .75s ease; }
.heart-break { animation: heartBreak .8s ease; }
.heart-heal { animation: heartHeal .75s ease; }
.badge-gain { animation: badgeGain .8s ease; }
.notification-pop { animation: notificationPop .7s ease; }
.xp-jump { animation: xpJump .7s cubic-bezier(.2, 1.8, .45, 1); }

@keyframes coinGain {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.22) rotate(-8deg); box-shadow: 0 0 0 8px rgb(107 165 57 / .18); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes heartBreak {
  0%, 100% { transform: translateX(0) scale(1); filter: saturate(1); }
  20% { transform: translateX(-4px) rotate(-5deg); filter: saturate(2); }
  40% { transform: translateX(4px) rotate(5deg); opacity: .72; }
  60% { transform: translateX(-3px) rotate(-3deg); }
}

@keyframes heartHeal {
  0% { transform: scale(.9); }
  40% { transform: scale(1.22); box-shadow: 0 0 0 8px rgb(190 18 27 / .14); }
  100% { transform: scale(1); }
}

@keyframes badgeGain {
  0% { transform: scale(1); }
  45% { transform: scale(1.2) rotate(4deg); box-shadow: 0 0 0 8px rgb(72 92 199 / .18); }
  100% { transform: scale(1); }
}

@keyframes notificationPop {
  0% { transform: translateY(0); }
  45% { transform: translateY(-5px) scale(1.08); }
  100% { transform: translateY(0); }
}

@keyframes xpJump {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-10px) scale(1.14); }
  70% { transform: translateY(3px) scale(.98); }
  100% { transform: translateY(0) scale(1); }
}

.counter-pop {
  position: relative;
}

.counter-pop .floating-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: auto;
  right: 0;
  display: none;
  width: min(310px, calc(100vw - 32px));
  z-index: 120;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--yellow) 26%, transparent), transparent 8rem),
    #fff;
  padding: 16px;
  box-shadow: var(--shadow);
  transform: none;
}

.counter-pop .floating-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heart-icon,
.vida-counter .top-icon .ui-icon {
  animation: heartbeat 2.7s ease-in-out infinite;
}

.racha-counter:not(.streak-zero) .top-icon .ui-icon {
  animation: flameShake max(.28s, calc(1.8s - (var(--streak, 0) * .08s))) linear infinite;
  transform-origin: center bottom;
}

.racha-counter.streak-zero .top-icon .ui-icon {
  animation: none;
}

@keyframes flameShake {
  0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
  25% { transform: translateX(-1px) rotate(-4deg) scale(1.04); }
  50% { transform: translateX(1px) rotate(3deg) scale(.98); }
  75% { transform: translateX(-1px) rotate(5deg) scale(1.03); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.14); }
  45% { transform: scale(.96); }
  60% { transform: scale(1.1); }
}

.counter-pop:hover .floating-panel,
.counter-pop:focus-within .floating-panel {
  display: block;
}

.dot {
  display: block;
  width: 18px;
  height: 18px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #dbe3d3;
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 18px);
  gap: 7px;
  align-items: center;
}

.dot.on {
  background: var(--green);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .16);
}

.minimal.sidebar {
  width: 236px;
}

.icon-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
}

.icon-nav .ui-icon {
  width: 28px;
  height: 28px;
}

.emoji-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 20px;
}

.svg-avatar img,
.tiny-avatar img,
.big-avatar img,
.party-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tiny-avatar,
.avatar.tiny-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--yellow-soft);
  font-size: 18px;
  vertical-align: middle;
}

.big-avatar {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  border-radius: 34px;
  background: var(--yellow-soft);
  font-size: 38px;
  animation: breathe 2.6s ease-in-out infinite;
}

.party-avatar-inner {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  font-size: 38px;
}

.profile-card .avatar,
.profile-card .svg-avatar {
  animation: breathe 3s ease-in-out infinite;
}

.avatar-excited {
  animation: avatarJump .65s cubic-bezier(.2, 1.8, .45, 1) !important;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes avatarJump {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-18px) scale(1.12) rotate(-7deg); }
  70% { transform: translateY(4px) scale(.96) rotate(5deg); }
  100% { transform: translateY(0) scale(1); }
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 14px;
}

.board-panel {
  min-height: 520px;
  background:
    radial-gradient(circle at 10% 20%, #fff4c2, transparent 13rem),
    radial-gradient(circle at 80% 10%, #dff7ee, transparent 15rem),
    var(--paper);
}

.finish-lines {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.finish-lines div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 7px;
  padding: 8px;
  border-radius: 14px;
  background: rgb(255 255 255 / .72);
  border: 1px dashed var(--line);
}

.finish-lines span {
  grid-row: span 2;
  font-size: 18px;
}

.finish-lines b {
  font-size: 12px;
}

.finish-lines small {
  font-size: 11px;
}

.finish-lines .mini-progress {
  grid-column: 1 / -1;
}

.game-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 16px;
  align-items: center;
}

.board-tile {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 148px;
  padding: 16px;
  border: 3px solid var(--area);
  border-radius: 30px;
  background: #fff;
  text-align: center;
}

.board-tile-main {
  display: grid;
  place-items: center;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.board-tile-main:hover {
  transform: none;
  box-shadow: none;
}

.tile-action {
  min-height: 34px;
  padding: 0 12px;
  margin-top: 6px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
}

.board-tile:nth-child(even) {
  transform: translateY(28px);
}

.board-tile:hover {
  background: color-mix(in srgb, var(--area) 10%, white);
}

.board-tile.locked {
  filter: grayscale(.95);
  opacity: .62;
}

.board-tile.accepted {
  box-shadow: 0 8px 0 color-mix(in srgb, var(--area) 45%, #c9d2c2);
}

.goal-tile {
  border-style: dashed;
  background: linear-gradient(135deg, #fff, #f5efff);
}

.tile-goal-icon {
  font-size: 30px;
}

.tile-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: none;
  width: min(240px, 74vw);
  transform: translateX(-50%);
  padding: 12px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 12;
}

.tile-popover small {
  display: block;
  color: #eaf0e6;
  margin-top: 4px;
}

.board-tile:hover .tile-popover,
.board-tile:focus .tile-popover {
  display: block;
}

.tile-step {
  position: absolute;
  top: -10px;
  left: -10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--area);
  color: #fff;
  font-weight: 600;
}

.progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7ecdF;
}

.progress-objective {
  position: relative;
  height: 22px;
}

.progress-objective em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-style: normal;
  color: var(--ink);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.segmented {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.segmented button {
  box-shadow: none;
}

.segmented button.active,
.filter-strip button.active {
  background: var(--green);
  color: #fff;
}

.filter-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-strip button {
  min-height: 38px;
  box-shadow: none;
}

.task-grid,
.project-grid,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-card-new {
  border: 2px solid color-mix(in srgb, var(--area) 55%, white);
  border-radius: 28px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 12px 26px rgb(36 51 59 / .08);
}

.task-main {
  width: 100%;
  display: grid;
  grid-template-columns: 62px minmax(84px, 110px) minmax(0, 1fr) minmax(96px, auto) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  background: linear-gradient(90deg, color-mix(in srgb, var(--area) 14%, white), #fff);
}

.task-image,
.project-hero span,
.shop-image {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--area, var(--yellow)) 18%, white);
  font-size: 38px;
}

.task-title {
  font-size: 18px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-codeblock {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.task-people {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.timer {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  font-weight: 600;
}

.task-details {
  display: none;
  padding: 16px;
}

.task-details.open {
  display: block;
}

.participants {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.participants button,
.compact-row,
.notification-card {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  box-shadow: none;
  background: #fff;
}

.compact-row small {
  display: block;
  color: var(--muted);
}

.project-card,
.shop-card {
  border: 1px solid var(--line);
  border-top: 8px solid var(--area, var(--green));
  border-radius: 28px;
  padding: 18px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgb(36 51 59 / .08);
}

.create-choice {
  margin-bottom: 14px;
}

.big-choice {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  text-align: left;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fff, #eef8e9);
}

.big-choice .ui-icon {
  width: 54px;
  height: 54px;
}

.big-choice b {
  display: block;
  font-size: 24px;
}

.big-choice small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.project-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.creation-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
}

.calendar-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.calendar-day {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  padding: 10px;
}

.calendar-event,
.calendar-day a {
  display: block;
  width: 100%;
  margin-top: 7px;
  min-height: auto;
  border-radius: 10px;
  padding: 6px;
  background: var(--mint);
  font-size: 12px;
  text-decoration: none;
  box-shadow: none;
  text-align: left;
}

.calendar-day.highlight {
  outline: 4px solid var(--yellow);
  animation: calendarPulse 1.8s ease;
}

.calendar-day.today {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 3px var(--coral-soft);
}

.calendar-filters {
  margin-bottom: 12px;
}

@keyframes calendarPulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.035); }
}

.achievement {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 18px;
  background: #f3f6ef;
}

.achievement span {
  font-size: 32px;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) 1fr 46px;
  gap: 10px;
  align-items: center;
}

.team-dashboard {
  margin-bottom: 14px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.leaderboard-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 24px 28px 1fr auto;
  gap: 8px;
  align-items: center;
}

.leaderboard-row span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--yellow-soft);
  font-size: 12px;
}

.leaderboard-row em {
  font-style: normal;
  color: var(--green-dark);
  font-weight: 600;
}

.pie-card {
  align-content: start;
}

.pie-chart {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  margin: 2px auto 8px;
  box-shadow: inset 0 0 0 12px rgb(255 255 255 / .58), 0 8px 18px rgb(36 51 59 / .08);
}

.pie-chart-svg {
  width: 168px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.pie-chart-svg text {
  fill: #fff;
  font-size: 7px;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgb(36 51 59 / .28);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.leaderboard-row.compact {
  grid-template-columns: 18px 28px 1fr auto;
}

.leaderboard-row.compact span:first-child {
  width: 14px;
  height: 14px;
  align-self: center;
}

.avatar-status-wrap {
  position: relative;
  width: fit-content;
  display: inline-grid;
}

.online-dot {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #aeb7ad;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}

.online-dot.on {
  background: #42b96b;
  animation: onlineBlink 1.2s ease-in-out infinite;
}

@keyframes onlineBlink {
  0%, 100% { box-shadow: 0 0 0 1px var(--line), 0 0 0 0 rgb(66 185 107 / .55); }
  50% { box-shadow: 0 0 0 1px var(--line), 0 0 0 8px rgb(66 185 107 / 0); }
}

.accepted-tasks {
  margin: 12px 0;
}

.accepted-tasks .compact-row {
  width: 100%;
  margin-top: 8px;
}

.accepted-tasks .compact-row + .compact-row {
  margin-top: 10px;
}

.compact-team {
  display: grid;
  gap: 10px;
}

.team-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-summary h3 {
  margin-bottom: 2px;
}

.team-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-details,
.accepted-tasks {
  padding: 8px 10px;
  border-radius: 14px;
  background: #f7f9f3;
}

.live-pill,
.status-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-weight: 600;
}

.status-legend .online-dot {
  position: static;
  display: inline-block;
  border-color: #fff;
  flex: 0 0 auto;
}

.live-pill {
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(22 138 114 / .16); }
  50% { box-shadow: 0 0 0 8px rgb(22 138 114 / 0); }
}

.trophy-list {
  margin: 10px 0;
}

.scout-badge {
  display: inline-grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.scout-circle {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, #fff 0 34%, transparent 35%),
    color-mix(in srgb, var(--area) 78%, #fff);
  border: 5px solid color-mix(in srgb, var(--area) 55%, #fff);
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .08), 0 8px 16px rgb(36 51 59 / .1);
}

.scout-circle b {
  font-size: 23px;
  line-height: 1;
  animation: trophyWiggle 1.8s ease-in-out infinite;
}

.scout-circle small {
  font-size: 10px;
  color: var(--ink);
  font-weight: 600;
}

.scout-title {
  max-width: 110px;
}

.scout-grid {
  align-items: start;
}

.scout-card summary {
  justify-content: center;
}

@keyframes trophyWiggle {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50% { transform: rotate(5deg) scale(1.08); }
}

.vote-card details,
.task-card-new details {
  margin-top: 10px;
}

.shop-grid {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shop-card {
  --area: var(--yellow);
}

.shop-image {
  width: 100%;
  height: 150px;
  font-size: 38px;
  margin-bottom: 12px;
}

.chat-form {
  align-items: stretch;
}

.emoji-picker {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}

.emoji-picker button {
  min-height: 38px;
  padding: 0 9px;
  box-shadow: none;
}

.profile-map {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.treasure-panel {
  margin-top: 14px;
  background:
    radial-gradient(circle at 15% 25%, rgb(242 201 76 / .28), transparent 10rem),
    radial-gradient(circle at 85% 20%, rgb(72 92 199 / .12), transparent 12rem),
    linear-gradient(135deg, #fffdf7, #eef6e8);
}

.treasure-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(115deg, transparent 0 46%, rgb(210 159 19 / .22) 46% 49%, transparent 49% 100%),
    linear-gradient(62deg, transparent 0 38%, rgb(22 138 114 / .16) 38% 41%, transparent 41% 100%),
    rgb(255 255 255 / .55);
  border: 1px dashed color-mix(in srgb, var(--yellow) 55%, var(--line));
}

.treasure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.treasure-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.treasure-legend .perfil { background: #edf8e5; color: #406f20; }
.treasure-legend .nivel { background: #eef1ff; color: #485cc7; }
.treasure-legend .insignia { background: #fff7dc; color: #8a650c; }

.treasure-node {
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--area) 14%, white);
  border: 1px solid color-mix(in srgb, var(--area) 40%, white);
  box-shadow: 0 9px 18px rgb(36 51 59 / .08);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.treasure-node.perfil {
  border-style: solid;
  border-width: 2px;
}

.treasure-node.nivel {
  border-radius: 999px 28px 999px 28px;
  background: color-mix(in srgb, #485cc7 13%, white);
}

.treasure-node.insignia {
  border-style: dashed;
  background:
    radial-gradient(circle at top right, rgb(242 201 76 / .22), transparent 48%),
    color-mix(in srgb, var(--area) 15%, white);
}

.treasure-node:hover {
  transform: scale(1.12) rotate(-1deg);
  z-index: 4;
  box-shadow: 0 18px 34px rgb(36 51 59 / .16);
  background: color-mix(in srgb, var(--area) 22%, white);
}

.treasure-node span {
  font-size: 25px;
}

.treasure-node small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}

.treasure-node p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.role-map,
.badge-map,
.level-road {
  display: grid;
  gap: 12px;
}

.instruction-card {
  overflow: hidden;
}

.instruction-card.full-width {
  grid-column: 1 / -1;
}

.instruction-step,
.level-node {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.instruction-step summary,
.level-node summary {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.instruction-step summary::-webkit-details-marker,
.level-node summary::-webkit-details-marker {
  display: none;
}

.instruction-step[open],
.level-node[open] {
  background: color-mix(in srgb, var(--mint) 40%, white);
  transform: translateY(-1px);
}

.role-map {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.badge-map {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.badge-prize {
  border-radius: 20px;
  padding: 14px;
  background: color-mix(in srgb, var(--area) 12%, white);
  border: 1px solid color-mix(in srgb, var(--area) 30%, white);
}

.level-road {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.level-road div,
.level-road details {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.level-road span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  margin-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.stats-grid div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.stats-grid b {
  color: var(--green-dark);
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.achievement-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.achievement-token {
  display: inline-grid;
  place-items: center;
  text-align: center;
  align-items: center;
  gap: 7px;
  width: 116px;
  min-height: 104px;
  padding: 12px;
  border-radius: 22px;
  background: #f3f6ef;
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}

.achievement-token.done {
  background: var(--yellow-soft);
}

.achievement-token b {
  font-size: 28px;
  transition: transform .18s ease;
}

.achievement-token:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: var(--shadow);
}

.achievement-token:hover b {
  animation: trophyWiggle .7s ease-in-out infinite;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.template-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  min-width: min(260px, 100%);
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.template-chip span {
  grid-row: span 2;
  font-size: 24px;
}

.notification-card.read {
  opacity: .72;
}

.notification-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.mini-progress {
  height: 8px;
  border-radius: 999px;
  background: #e7ecdf;
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.wellbeing-alert {
  margin: -4px 0 14px;
  padding: 12px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--green-dark);
}

.wellbeing-alert.coral {
  background: var(--coral-soft);
  color: #9d3d31;
}

.area-xp-grid,
.area-xp-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.area-xp-grid div,
.area-xp-editor label {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--area) 14%, white);
  border: 1px solid color-mix(in srgb, var(--area) 36%, white);
}

.admin-settings .setting-tags {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.finance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.finance-pay-grid {
  display: grid;
  gap: 10px;
}

.finance-row.pay-row {
  grid-template-columns: 220px 1fr;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.finance-pay-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.project-cost-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
  padding: 10px;
  border-radius: 16px;
  background: #fff9e8;
  border: 1px solid #efdca9;
}

.project-cost-form button {
  min-height: 42px;
}

.budget-planner {
  margin: 12px 0;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--area) 35%, white);
  background: color-mix(in srgb, var(--area) 8%, white);
}

.budget-planner summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green-dark);
}

.budget-bar {
  height: 14px;
  border-radius: 999px;
  background: #e8eee4;
  overflow: hidden;
  margin: 10px 0;
}

.budget-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.budget-bar.over span {
  background: var(--red);
}

.budget-distribution {
  display: grid;
  gap: 8px;
}

.budget-distribution label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--area) 30%, white);
  background: #fff;
}

.budget-distribution label span {
  display: grid;
  gap: 3px;
}

.budget-distribution small {
  color: var(--muted);
}

.finance-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-settings button {
  grid-column: 1 / -1;
}

.finance-table-wrap {
  overflow-x: auto;
}

.finance-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.finance-table th,
.finance-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.finance-table small {
  display: block;
  color: var(--muted);
}

.finance-table .total {
  background: var(--yellow-soft);
  font-weight: 600;
}

.annual-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 190px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.month-bar {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 48px;
}

.bar-pair {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 120px;
  width: 100%;
  padding: 8px 4px;
  border-radius: 16px;
  background: #f4f7ef;
}

.bar-pair span {
  width: 12px;
  min-height: 4px;
  border-radius: 999px 999px 4px 4px;
}

.bar-pair .income,
.chart-legend .income {
  background: #6ba539;
}

.bar-pair .expense,
.chart-legend .expense {
  background: #be121b;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
}

.chart-legend span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.finance-ledger {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.ledger-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.ledger-row summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ledger-row.ingreso {
  border-color: rgb(107 165 57 / .28);
}

.ledger-row.egreso {
  border-color: rgb(190 18 27 / .22);
}

.ledger-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.area-budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.area-budget-grid label {
  padding: 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--area) 12%, white);
  border: 1px solid color-mix(in srgb, var(--area) 35%, white);
}

.area-budget-grid button {
  grid-column: 1 / -1;
}

.budget-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.survey-details {
  margin: 10px 0;
  padding: 10px;
  border-radius: 16px;
  background: #f3f6ef;
}

.settings-shortcuts .card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.shop-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.treasure-node.insignia .scout-badge {
  transform: scale(.9);
}

.treasure-node.insignia .scout-title {
  display: none;
}

.shortcut-emoji {
  font-size: 28px;
}

.admin-user-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.admin-user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.emoji-field {
  position: relative;
}

.emoji-field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.emoji-catalog {
  margin-top: 4px;
}

.emoji-catalog summary {
  cursor: pointer;
  color: var(--green-dark);
  font-size: 12px;
}

.emoji-catalog div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  background: #f7f9f3;
  border: 1px solid var(--line);
}

.emoji-catalog button {
  min-height: 34px;
  width: 38px;
  padding: 0;
  border-radius: 12px;
  box-shadow: none;
  font-size: 18px;
}

.avatar-talk {
  position: relative;
  width: fit-content;
  min-width: 160px;
  margin-bottom: 10px;
}

.speech-bubbles {
  position: absolute;
  left: 76px;
  top: 4px;
  width: min(220px, 48vw);
  min-height: 54px;
  pointer-events: none;
}

.speech-bubbles span {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 210px;
  padding: 9px 12px;
  border-radius: 18px 18px 18px 4px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgb(36 51 59 / .11);
  color: var(--green-dark);
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  animation: speechCycle 90s ease-in-out infinite;
  animation-delay: calc(var(--i) * 15s);
}

@keyframes speechCycle {
  0%, 100% { opacity: 0; transform: translateY(8px) scale(.96); }
  1.5%, 11.1% { opacity: 1; transform: translateY(0) scale(1); }
  16.7% { opacity: 0; transform: translateY(8px) scale(.96); }
}

.fireworks-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.fireworks-layer span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color);
  opacity: 0;
  animation: fireworkBurst 1.25s ease-out forwards;
  animation-delay: var(--delay);
  box-shadow:
    0 -28px 0 var(--color),
    24px -14px 0 var(--color),
    24px 14px 0 var(--color),
    0 28px 0 var(--color),
    -24px 14px 0 var(--color),
    -24px -14px 0 var(--color);
}

@keyframes fireworkBurst {
  0% { opacity: 0; transform: scale(.2) rotate(0deg); filter: blur(0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.9) rotate(22deg); filter: blur(1px); }
}

.finance-row span small {
  display: block;
  color: var(--muted);
}

.project-task-group {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.project-task-group summary,
.project-tasks summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}

.flying-coin {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  animation: flyCoin .85s cubic-bezier(.2, .85, .2, 1) forwards;
}

@keyframes flyCoin {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(.45); opacity: 0; }
}

.joy {
  animation: joyGlow 1.8s ease-in-out infinite;
}

.notification-card + .notification-card {
  margin-top: 12px;
}

.notification-card {
  padding: 16px;
  border-radius: 20px;
}

.modal-card {
  width: min(760px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

@keyframes joyGlow {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.5) brightness(1.05); }
}

@media (max-width: 980px) {
  body { font-size: 14px; }
  .auth-shell, .shell { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { padding: 14px; }
  .hero, .auth-card, .panel, .card { padding: 14px; border-radius: 22px; }
  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 8px 10px;
    gap: 8px;
  }
  .top-counters {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .top-icon {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .top-icon img { width: 20px; height: 20px; }
  .counter-pop .floating-panel {
    position: fixed;
    top: 54px;
    left: 10px;
    right: 10px;
    width: auto;
  }
  .sidebar {
    position: sticky;
    top: 52px;
    z-index: 40;
    width: 100%;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgb(255 253 247 / .96);
    max-width: 100vw;
    overflow: hidden;
  }
  .minimal.sidebar { width: 100%; }
  .profile-card { display: none !important; }
  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 4px;
  }
  .icon-nav button {
    min-width: 76px;
    flex: 0 0 auto;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 8px;
    font-size: 11px;
    min-height: 54px;
    text-align: center;
  }
  .icon-nav .ui-icon { width: 22px; height: 22px; }
  .main { padding: 12px; }
  .main, .section-head, .task-grid, .project-grid, .shop-grid { max-width: 100%; min-width: 0; }
  h1 { font-size: clamp(26px, 8vw, 38px); }
  h2 { font-size: 21px; }
  .grid.two, .grid.three, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .home-layout, .task-grid, .project-grid, .shop-grid { grid-template-columns: 1fr; }
  .leaderboard-grid, .stats-grid {
    grid-template-columns: 1fr;
  }
  .finish-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-xp-grid, .area-xp-editor, .admin-settings .setting-tags {
    grid-template-columns: 1fr;
  }
  .finance-row,
  .finance-row.pay-row,
  .finance-pay-form,
  .finance-settings,
  .project-cost-form,
  .budget-distribution label,
  .area-budget-grid {
    grid-template-columns: 1fr;
  }
  .annual-chart {
    grid-template-columns: repeat(12, 52px);
  }
  .ledger-row summary {
    grid-template-columns: 1fr;
  }
  .game-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-tile { min-height: 128px; padding: 12px; }
  .board-tile:nth-child(even) { transform: none; }
  .section-head {
    display: grid;
    gap: 10px;
  }
  .segmented, .filter-strip, .calendar-toolbar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .task-main {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }
  .task-image { width: 48px; height: 48px; border-radius: 16px; font-size: 28px; }
  .task-title,
  .task-codeblock,
  .task-people,
  .task-main .timer,
  .task-main .badge {
    grid-column: 2;
    justify-self: start;
  }
  .task-title {
    white-space: normal;
    line-height: 1.12;
  }
  .actions,
  form.actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .actions input,
  .actions select {
    min-width: 0;
    width: 100%;
  }
  .calendar-scroll {
    margin-inline: -12px;
    padding-inline: 12px;
  }
  .calendar-month {
    min-width: 760px;
    gap: 8px;
  }
  .calendar-day {
    min-height: 118px;
    padding: 8px;
    border-radius: 14px;
    font-size: 12px;
  }
  .calendar-event { font-size: 12px; padding: 6px; line-height: 1.15; white-space: normal; }
  .calendar-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .role-map, .badge-map, .level-road { grid-template-columns: 1fr; }
  .treasure-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .treasure-node { min-height: 118px; }
  .treasure-node:hover { transform: scale(1.04); }
  .chart-row { grid-template-columns: 1fr; }
  .modal-card { width: 94vw; padding: 18px; }
}
