/* My Tama tracker, collection progress, quick answers */
.egg-symbol {
  width: 11px;
  height: 14px;
  border: 1.7px solid;
  border-radius: 50% 50% 50% 50%/62% 62% 38% 38%;
}

/* Home card */
.tama-home-wrap {
  margin: 14px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  overflow: hidden;
}
.tama-home {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px 9px 10px;
  text-decoration: none;
  color: var(--ink);
  min-height: 60px;
}
.tama-home:hover {
  background: #f3f7ef;
}
.tama-home > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.tama-home small {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.tama-home strong {
  display: block;
  font-weight: 700;
  line-height: 1.25;
}
.tama-home b {
  color: #246254;
  font-size: 0.9rem;
  white-space: nowrap;
}
.tama-home .portrait {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
}
.tama-egg {
  flex: none;
  width: 34px;
  height: 42px;
  margin: 0 5px;
  border-radius: 50% 50% 50% 50%/62% 62% 38% 38%;
  background: radial-gradient(circle at 34% 30%, #fff 0 9%, transparent 10%), linear-gradient(160deg, #ffe9a8, #f6c96a);
  box-shadow: inset -4px -5px 0 #0000000f;
  transform: rotate(-8deg);
}
.tama-home:hover .tama-egg {
  animation: egg-wobble 0.7s ease-in-out;
}
@keyframes egg-wobble {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  25% {
    transform: rotate(7deg);
  }
  50% {
    transform: rotate(-12deg);
  }
  75% {
    transform: rotate(3deg);
  }
}
.tama-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  background: #fafbf6;
}
.tama-progress:hover {
  background: #f0f5ea;
}
.tama-progress b {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.tama-progress .collection-track {
  flex: 1;
}

/* Collection */
.collection-track {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #e3e8df;
  overflow: hidden;
}
.collection-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #79c3a9, #2d684c);
  transition: width 0.4s ease;
}
.collection-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 12px 14px;
  margin: 0 0 16px;
}
.collection-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.collection-text strong {
  font: 750 1.08rem var(--title);
  letter-spacing: -0.03em;
}
.collection-text span {
  color: var(--muted);
  font-size: 0.88rem;
}
.collection-bar .collection-track {
  grid-column: 1/-1;
  grid-row: 2;
}
.collection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1/-1;
  flex-wrap: wrap;
}
.collection-filter {
  margin: 0;
  flex: 1;
  min-width: 150px;
  max-width: 220px;
}
.collection-done {
  font-weight: 700;
  color: #2c573b;
}
.character-card {
  position: relative;
}
.raised-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2d684c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

/* Tracker page */
.tama-card,
.tama-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 16px 18px;
  margin: 0 0 14px;
}
.tama-now {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tama-now .portrait {
  width: 76px;
  height: 76px;
  flex: none;
}
.tama-now h2 {
  font-size: 1.7rem;
  margin-bottom: 3px;
}
.tama-now .muted {
  font-size: 0.9rem;
  color: var(--muted);
}
.tama-stages {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
}
.tama-stages li {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 7px 2px 6px;
  border-top: 4px solid #e3e8df;
}
.tama-stages li.done {
  border-color: #8cbd91;
  color: #42715c;
}
.tama-stages li.now {
  border-color: #245646;
  color: var(--ink);
}
.tama-panel h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.tama-panel h3 {
  font-size: 1.12rem;
  margin-bottom: 6px;
}
.tama-panel p {
  color: var(--muted);
  margin-bottom: 10px;
}
.tama-panel > :last-child {
  margin-bottom: 0;
}
.tama-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tama-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tama-row .primary,
.tama-row .bookmark {
  padding: 11px 16px;
  font-size: 0.96rem;
}
.tama-next {
  margin: 4px 0 16px;
}
.tama-next .primary {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.02rem;
  border-radius: 12px;
}
.tama-links {
  margin-top: 8px;
}
.tama-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.tama-branch {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 8px 10px;
  min-height: 54px;
}
.tama-branch img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: none;
}
.tama-branch strong,
.tama-branch small {
  display: block;
}
.tama-branch small {
  color: var(--muted);
  font-size: 0.8rem;
}
.tama-branch.active {
  border-color: #245646;
  background: #e6f1df;
  box-shadow: inset 0 0 0 1px #245646;
}
.tama-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.tama-counter:first-of-type {
  border-top: 0;
}
.tama-counter-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  min-width: 0;
}
.tama-counter-label > span {
  display: grid;
  gap: 5px;
}
.tama-pips {
  display: flex;
  gap: 4px;
}
.tama-pips i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.6px solid #9fb5a5;
  background: transparent;
}
.tama-pips i.on {
  background: #2d684c;
  border-color: #2d684c;
}
.tama-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.tama-stepper button {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f3f7ef;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--deep);
}
.tama-stepper button:hover:not(:disabled) {
  background: #e6f1df;
}
.tama-stepper button[data-action="my-inc"] {
  background: #245646;
  border-color: #245646;
  color: #fff;
}
.tama-stepper button[data-action="my-inc"]:hover {
  background: #1b4638;
}
.tama-stepper output {
  min-width: 38px;
  text-align: center;
  font: 750 1.6rem var(--title);
  letter-spacing: -0.04em;
}
.tama-goal {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 14px;
  background: var(--white);
  padding: 10px 14px 10px 10px;
  margin: 0 0 14px;
}
.tama-goal.ok {
  border-left-color: #79a880;
}
.tama-goal.warn {
  border-left-color: #d29516;
}
.tama-goal.lost {
  border-left-color: #b9566b;
}
.tama-goal > div {
  flex: 1;
  min-width: 0;
}
.tama-goal small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.tama-goal strong {
  display: block;
  font: 750 1.15rem var(--title);
  letter-spacing: -0.03em;
}
.tama-goal p {
  font-size: 0.92rem;
  color: var(--ink);
  margin-top: 2px;
}
.tama-goal-art {
  flex: none;
  padding: 0;
  border-radius: 10px;
}
.tama-goal-art .portrait {
  width: 58px;
  height: 58px;
}
.tama-panel .predicted-result {
  margin-bottom: 10px;
}
.tama-clock {
  font: 750 3rem/1 var(--title);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--deep);
  margin: 4px 0 2px;
}
.tama-timer-done {
  color: var(--ink) !important;
  font-weight: 650;
}
.tama-finish {
  text-align: center;
}
.tama-finish .portrait {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
}
.tama-finish .tama-row {
  justify-content: center;
}
.tama-finish .needs {
  text-align: left;
}
.tama-offer {
  margin: 0 0 14px;
}
.tama-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 12px;
}
.tama-privacy {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -4px 0 12px;
}
.special-button.predicted {
  border-color: #245646;
  box-shadow: inset 0 0 0 1px #245646;
}
.start-links {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}

/* Quick answers */
.answer {
  border-top: 1px solid var(--line);
  padding: 2px 0;
}
.answer p {
  color: var(--muted);
  margin: 4px 0 12px 20px;
  line-height: 1.5;
}
.answer-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5d6f3d;
  background: #edf4dc;
  border-radius: 99px;
  padding: 1px 8px;
  margin-left: 4px;
  white-space: nowrap;
}
.answer-mark {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font: 750 1.3rem var(--title);
  color: #246254;
}

/* Confetti */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}
.confetti i {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 1.6s cubic-bezier(0.3, 0.6, 0.5, 1) forwards;
}
@keyframes confetti-fall {
  to {
    top: 105%;
    transform: rotate(540deg) translateX(40px);
    opacity: 0.9;
  }
}

@media (max-width: 640px) {
  .tama-form {
    grid-template-columns: 1fr;
  }
  .tama-card,
  .tama-panel {
    padding: 14px;
  }
  .tama-now h2 {
    font-size: 1.45rem;
  }
  .tama-now .portrait {
    width: 64px;
    height: 64px;
  }
  .tama-clock {
    font-size: 2.6rem;
  }
}
@media (max-width: 760px) {
  .topbar .navigation a {
    padding-inline: 1px;
  }
}
@media print {
  .tama-home-wrap,
  .collection-actions,
  .tama-row,
  .tama-foot,
  .confetti {
    display: none !important;
  }
}

.tama-page {
  max-width: 760px;
}
@media (max-width: 640px) {
  .footer {
    flex-direction: column;
    gap: 10px;
  }
  .footer-actions {
    gap: 6px 18px;
  }
}
@media (min-width: 761px) and (max-width: 1400px) {
  .topbar {
    gap: 14px;
  }
  .navigation {
    gap: 2px;
  }
  .navigation a {
    padding: 10px 11px;
  }
  .navigation .desktop-label {
    display: none;
  }
}
html[data-theme="dark"] .compact-model img,
html[data-theme="dark"] .model-card img,
html[data-theme="dark"] .mode-grid img,
html[data-theme="dark"] .edition-cover img {
  border-radius: 9px;
}

/* Today row, timer alerts, backup */
.tama-today {
  display: flex;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--muted);
  background: #fafbf6;
}
.tama-today:hover {
  background: #f0f5ea;
}
.tama-today > span:first-child {
  font-weight: 700;
  color: var(--ink);
  flex: none;
}
.tama-today b {
  color: #2c573b;
}
.tama-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tama-alert small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}
.tama-alert .bookmark {
  flex: none;
}
.tama-data {
  margin: 0 0 14px;
}
.tama-data p {
  color: var(--muted);
  margin: 8px 0 0;
}
.tama-file {
  cursor: pointer;
  padding: 11px 16px;
  font-size: 0.96rem;
}
.tama-file:focus-within {
  outline: 3px solid #256dad;
  outline-offset: 3px;
}
#backup-message:not(:empty) {
  margin-top: 10px;
}
/* Device sync */
.sync-head {
  margin: 18px 0 4px;
  font-size: 1rem;
}
.sync-form {
  margin-top: 8px;
}
.sync-input {
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px;
  border: 1px solid var(--line, #cdd9d6);
  border-radius: 10px;
  background: #fff;
  color: var(--ink, #17322e);
  width: 13em;
  max-width: 100%;
}
.sync-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
.tama-max {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
