/* Fun extras: Tama of the day, Who's that Tama?, sticker book and badges */

/* Tama of the day (home card) */
.tama-daily {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--line);
}
.tama-daily-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tama-daily-main:hover {
  background: color-mix(in srgb, var(--line) 30%, transparent);
}
.tama-daily-main .portrait {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 10px;
  background: var(--tile, #f3eedf);
  display: grid;
  place-items: center;
}
.tama-daily-main .portrait img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
  animation: tama-bob 2.6s ease-in-out infinite;
}
.tama-daily-main small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.tama-daily-main strong {
  display: block;
  font: 750 1.02rem/1.2 var(--title);
  letter-spacing: -0.02em;
}
.tama-daily-line {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}
.tama-daily-quiz {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: 650 0.86rem var(--body);
  cursor: pointer;
  max-width: 9.5em;
  text-align: left;
}
.tama-daily-quiz:hover {
  background: color-mix(in srgb, var(--line) 30%, transparent);
}
.quiz-mini {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white, #fff);
  font: 800 0.95rem var(--title);
}
@keyframes tama-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Who's that Tama? */
.quiz {
  display: grid;
  gap: 12px;
}
.quiz-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.quiz-scope select {
  flex: 1;
  max-width: 16em;
}
.quiz-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 210px;
  border-radius: 18px;
  overflow: hidden;
  background: #eef1ec;
  transition: background 0.4s;
}
.quiz-stage.tinted {
  background: var(--tile);
}
.quiz-rays {
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(from 0deg, rgb(255 255 255 / 0.55) 0 10deg, transparent 10deg 20deg);
  opacity: 0.5;
  animation: quiz-spin 24s linear infinite;
}
.quiz-art {
  position: relative;
  width: 132px;
  height: 132px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: brightness(0);
  opacity: 0.86;
}
.quiz-stage.revealed .quiz-art {
  filter: none;
  opacity: 1;
  animation: quiz-reveal 0.55s cubic-bezier(0.3, 1.5, 0.5, 1);
}
html[data-theme='dark'] .quiz-stage:not(.revealed) .quiz-art {
  filter: brightness(0) invert(0.914);
}
html[data-theme='dark'] .quiz-stage.revealed .quiz-art {
  animation-name: quiz-pop;
}
@keyframes quiz-reveal {
  from {
    filter: brightness(0);
    transform: scale(0.82);
  }
  60% {
    filter: brightness(1.2);
    transform: scale(1.14);
  }
  to {
    filter: none;
    transform: scale(1);
  }
}
@keyframes quiz-pop {
  from {
    transform: scale(0.82);
  }
  60% {
    transform: scale(1.14);
  }
  to {
    transform: scale(1);
  }
}
@keyframes quiz-spin {
  to {
    transform: rotate(360deg);
  }
}
.quiz-prompt {
  margin: 0;
  text-align: center;
  font: 800 1.35rem/1.15 var(--title);
  letter-spacing: -0.03em;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quiz-option {
  min-height: 48px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white, #fff);
  color: var(--ink);
  font: 650 0.98rem/1.15 var(--body);
  cursor: pointer;
  overflow-wrap: break-word;
}
@media (hover: hover) and (pointer: fine) {
  .quiz-option:hover:not(:disabled) {
    border-color: var(--ink);
  }
}
.quiz-option:disabled {
  cursor: default;
  opacity: 0.55;
}
.quiz-option.is-right {
  opacity: 1;
  border-color: #3f8a5c;
  background: #dff2e3;
  color: #1d4a2e;
}
.quiz-option.is-wrong {
  opacity: 1;
  border-color: #b9566b;
  background: #fbe3e8;
  color: #6d2232;
  text-decoration: line-through;
}
.quiz-feedback:empty {
  display: none;
}
.quiz-feedback p {
  margin: 0;
}
.quiz-verdict {
  font-weight: 750;
  text-align: center;
}
.quiz-route {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.quiz-hint-text {
  text-align: center;
  color: var(--muted);
}
.quiz-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.quiz-score {
  font-size: 0.9rem;
  color: var(--muted);
}
.quiz-score b {
  color: var(--ink);
  font-size: 1.1rem;
}
.quiz-bar > button {
  margin-left: auto;
}

/* Growth strip: Baby → Kid → Young → adult */
.growth-strip {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  list-style: none;
  margin: 10px 0 6px;
  padding: 0;
}
.growth-strip li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 25%;
  max-width: 84px;
}
.growth-strip li + li::before {
  content: '→';
  position: absolute;
  left: -0.4em;
  top: 11px;
  color: var(--muted);
}
.growth-strip img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}
.growth-strip li:last-child img {
  width: 48px;
  height: 48px;
}
.growth-strip small {
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
}

/* Sticker book */
.sticker-total {
  margin: 6px 0 0;
  color: var(--muted);
}
.sticker-total b {
  font: 800 1.5rem var(--title);
  color: var(--ink);
}
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}
.badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.badge > span:last-child {
  min-width: 0;
}
.badge b {
  display: block;
  font-size: 0.88rem;
  line-height: 1.15;
  overflow-wrap: break-word;
}
@media (min-width: 560px) {
  .badges {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.badge small {
  display: block;
  font-size: 0.72rem;
  line-height: 1.2;
}
.badge-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ecefe9;
  font-size: 1.05rem;
  color: #9aa79f;
}
.badge.earned {
  border-style: solid;
  border-color: #e3c25a;
  background: #fff8df;
  color: var(--ink);
}
.badge.earned .badge-icon {
  background: linear-gradient(145deg, #ffd96a, #f0a93b);
  color: #5b3a05;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.12);
}
.sticker-group h3 {
  margin: 18px 0 4px;
}
.sticker-group h3 small {
  font: 500 0.82rem var(--body);
  color: var(--muted);
}
.sticker-track {
  height: 6px;
  border-radius: 6px;
  background: #e6ebe4;
  overflow: hidden;
  margin-bottom: 8px;
}
.sticker-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #79c3a9, #4f9f84);
  border-radius: inherit;
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}
.sticker {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 5px 3px 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.sticker:hover {
  background: color-mix(in srgb, var(--line) 35%, transparent);
}
.sticker-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #eef0ec;
  border: 2px dashed #cdd5cf;
}
.sticker-art img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: brightness(0);
  opacity: 0.16;
}
html[data-theme='dark'] .sticker-art img {
  filter: brightness(0) invert(0.914);
}
.sticker.got {
  color: var(--ink);
}
.sticker.got .sticker-art {
  background: var(--tile);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.14);
  transform: rotate(-3deg);
}
.sticker.got:nth-child(even) .sticker-art {
  transform: rotate(3deg);
}
.sticker.got .sticker-art img {
  filter: none;
  opacity: 1;
}
html[data-theme='dark'] .sticker.got .sticker-art img {
  filter: none;
}
.sticker-check {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3f8a5c;
  color: #fff;
  font-size: 0.72rem;
  border: 2px solid #fff;
}
.sticker-name {
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Badge toast */
.badge-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: #fff8df;
  border: 1px solid #e3c25a;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  color: var(--ink);
  transform: translateX(-50%);
  animation: toast-in 3.2s ease forwards;
}
.badge-toast .badge-icon {
  background: linear-gradient(145deg, #ffd96a, #f0a93b);
  color: #5b3a05;
}
.badge-toast small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  10%,
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tama-daily-main .portrait img,
  .quiz-rays,
  .quiz-stage.revealed .quiz-art,
  .badge-toast {
    animation: none;
  }
}
@media print {
  .tama-daily-quiz,
  .quiz-bar,
  .badge-toast {
    display: none !important;
  }
}
