/* 自分のFIRE人生 - shared MVP UI */

:root {
  --fire-life-ink: #241f28;
  --fire-life-muted: #756d78;
  --fire-life-red: #ea3e31;
  --fire-life-red-dark: #b92835;
  --fire-life-yellow: #ffcf45;
  --fire-life-yellow-soft: #fff5c9;
  --fire-life-cream: #fffaf0;
  --fire-life-paper: #ffffff;
  --fire-life-line: rgba(36, 31, 40, 0.12);
}

/* Top-entry block */
.fire-life-entry-section {
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  background:
    radial-gradient(circle at 7% 50%, rgba(255, 207, 69, 0.22), transparent 17rem),
    var(--fire-life-cream);
}

.fire-life-entry {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.85rem, 2.4vw, 1.5rem);
  min-height: 7rem;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 4vw, 2rem);
  overflow: hidden;
  color: var(--fire-life-ink);
  text-decoration: none;
  background: var(--fire-life-paper);
  border: 1px solid rgba(234, 62, 49, 0.13);
  border-radius: 1.5rem;
  box-shadow: 0 0.75rem 2rem rgba(104, 60, 35, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.fire-life-entry::after {
  position: absolute;
  right: -1.5rem;
  bottom: -4rem;
  width: 9rem;
  height: 9rem;
  content: "";
  pointer-events: none;
  background: rgba(255, 207, 69, 0.25);
  border-radius: 50%;
}

.fire-life-entry:hover,
.fire-life-entry:focus-visible {
  border-color: rgba(234, 62, 49, 0.34);
  box-shadow: 0 1rem 2.25rem rgba(104, 60, 35, 0.14);
  transform: translateY(-2px);
}

.fire-life-entry:focus-visible {
  outline: 3px solid rgba(255, 207, 69, 0.9);
  outline-offset: 3px;
}

.fire-life-entry__icon {
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  font-size: 1.65rem;
  background: linear-gradient(145deg, #fff3ba, #ffe084);
  border: 1px solid rgba(224, 154, 19, 0.24);
  border-radius: 1.1rem;
  box-shadow: inset 0 -0.25rem 0 rgba(255, 255, 255, 0.42);
}

.fire-life-entry__copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.fire-life-entry__eyebrow,
.fire-life-entry__meta-label {
  color: var(--fire-life-red-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.fire-life-entry__copy strong {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.2;
}

.fire-life-entry__copy small {
  color: var(--fire-life-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.fire-life-entry__meta {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 0.15rem;
  min-width: 7.25rem;
  text-align: right;
}

.fire-life-entry__meta strong {
  color: var(--fire-life-red);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1;
}

.fire-life-entry__meta span {
  color: var(--fire-life-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.fire-life-entry__meta b {
  margin-top: 0.15rem;
  color: var(--fire-life-red-dark);
  font-size: 1.2rem;
}

/* Hero entry: keep the FIRE life visible from the first screen */
.hero__fire-life-link {
  color: var(--fire-life-red-dark);
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(234, 62, 49, 0.42);
  box-shadow: 0 4px 0 rgba(185, 40, 53, 0.15);
}

.hero__fire-life-link:hover,
.hero__fire-life-link:focus-visible {
  color: var(--fire-life-paper);
  background: var(--fire-life-red);
  border-color: var(--fire-life-red);
  box-shadow: 0 6px 0 var(--fire-life-red-dark);
}

.hero__fire-life-link strong {
  color: var(--fire-life-red);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.hero__fire-life-link:hover strong,
.hero__fire-life-link:focus-visible strong {
  color: inherit;
}

/* Article reading hint */
.fire-life-article-hint {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1.2rem 0 1.4rem;
  padding: 0.85rem 1rem;
  color: var(--fire-life-ink);
  background: linear-gradient(135deg, rgba(255, 245, 201, 0.78), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(224, 154, 19, 0.2);
  border-radius: 1rem;
}

.fire-life-article-hint__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  font-size: 1rem;
  background: rgba(255, 207, 69, 0.3);
  border-radius: 0.7rem;
}

.fire-life-article-hint__copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  line-height: 1.45;
}

.fire-life-article-hint__copy strong {
  color: var(--fire-life-red-dark);
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

.fire-life-article-hint__copy span {
  font-size: 0.82rem;
  font-weight: 700;
}

.fire-life-article-hint__copy small {
  color: var(--fire-life-muted);
  font-size: 0.68rem;
}

/* Shared toast notifications */
.fire-life-toast-layer {
  position: fixed;
  z-index: 1200;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  gap: 0.6rem;
  width: min(calc(100% - 1.5rem), 26rem);
  pointer-events: none;
  isolation: isolate;
  transform: translateX(-50%);
}

.fire-life-toast {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 1rem;
  color: #fff;
  background: rgba(36, 31, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.15rem;
  box-shadow: 0 0.9rem 2rem rgba(36, 31, 40, 0.22);
  animation: fire-life-toast-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.fire-life-toast.is-leaving {
  animation: fire-life-toast-out 280ms ease both;
}

.fire-life-toast--level-up {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 207, 69, 0.42), transparent 5rem),
    linear-gradient(135deg, #b92835, #ea3e31);
  border-color: rgba(255, 223, 123, 0.64);
}

.fire-life-toast--badge {
  --fire-life-toast-accent: #ffd447;
  --fire-life-toast-accent-soft: rgba(255, 212, 71, 0.34);
  overflow: visible;
  isolation: isolate;
  background:
    radial-gradient(circle at 86% 10%, var(--fire-life-toast-accent-soft), transparent 5rem),
    #302735;
}

.fire-life-toast--badge[data-category="level"] {
  --fire-life-toast-accent: #ffd447;
  --fire-life-toast-accent-soft: rgba(255, 212, 71, 0.38);
}

.fire-life-toast--badge[data-category="discovery"] {
  --fire-life-toast-accent: #79d5df;
  --fire-life-toast-accent-soft: rgba(121, 213, 223, 0.32);
}

.fire-life-toast--badge[data-category="streak"] {
  --fire-life-toast-accent: #ff7043;
  --fire-life-toast-accent-soft: rgba(255, 112, 67, 0.34);
}

.fire-life-toast--badge[data-category="visit"] {
  --fire-life-toast-accent: #9ad27d;
  --fire-life-toast-accent-soft: rgba(154, 210, 125, 0.3);
}

.fire-life-toast--badge::before {
  position: absolute;
  z-index: -1;
  inset: -0.28rem;
  content: "";
  pointer-events: none;
  border: 1px solid var(--fire-life-toast-accent);
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--fire-life-toast-accent-soft), 0 0 1rem var(--fire-life-toast-accent-soft);
  opacity: 0;
  animation: fire-life-badge-ring 1500ms ease-out 120ms both;
}

.fire-life-toast--badge {
  animation: fire-life-badge-toast-in 480ms cubic-bezier(0.16, 0.9, 0.25, 1.08) both;
}

.fire-life-toast--badge .fire-life-toast__mark {
  animation: fire-life-badge-seal-pop 720ms cubic-bezier(0.18, 0.9, 0.25, 1.15) 100ms both;
}

.fire-life-toast--badge .fire-life-toast__title {
  color: var(--fire-life-toast-accent);
}

.fire-life-toast--preview .fire-life-toast__kicker {
  color: var(--fire-life-toast-accent);
}

.fire-life-toast__mark {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.8rem;
}

.fire-life-toast--level-up .fire-life-toast__mark,
.fire-life-toast--badge .fire-life-toast__mark {
  background: rgba(255, 207, 69, 0.2);
}

.fire-life-toast__body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.fire-life-toast__kicker {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.fire-life-toast__title {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fire-life-toast--level-up .fire-life-toast__title {
  color: var(--fire-life-yellow);
  font-size: 1.25rem;
}

.fire-life-toast__detail {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes fire-life-toast-in {
  from {
    opacity: 0;
    transform: translateY(-130%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fire-life-badge-toast-in {
  0% {
    opacity: 0;
    transform: translateY(-140%) scale(0.78) rotate(-1deg);
  }

  68% {
    opacity: 1;
    transform: translateY(0.12rem) scale(1.025) rotate(0.2deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes fire-life-badge-seal-pop {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(-28deg);
  }

  58% {
    opacity: 1;
    transform: scale(1.18) rotate(8deg);
  }

  82% {
    transform: scale(0.94) rotate(-2deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes fire-life-badge-ring {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  24% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

@keyframes fire-life-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -0.75rem, 0) rotate(0) scale(0.35);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-x), var(--confetti-y), 0) rotate(var(--confetti-rotate)) scale(var(--confetti-scale));
  }
}

@keyframes fire-life-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-120%);
  }
}

@media (max-width: 640px) {
  .fire-life-entry {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fire-life-entry__meta {
    grid-column: 2;
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    text-align: left;
  }

  .fire-life-entry__meta strong {
    font-size: 1.25rem;
  }

  .fire-life-entry__meta b {
    margin: 0 0 0 auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  .fire-life-entry {
    transition: none;
  }

  .fire-life-toast {
    animation-duration: 1ms;
  }

  .fire-life-toast--badge::before,
  .fire-life-toast--badge .fire-life-toast__mark {
    animation: none;
  }
}


/* 通知トーストも絵文字ではなく、FIRE QUESTの小さな紋章で統一します。 */
.fire-life-toast__mark {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0.22rem;
  font-size: 0;
  background: rgba(255, 207, 69, 0.18);
  border: 1px solid rgba(255, 221, 123, 0.46);
  border-radius: 50%;
}

.fire-life-toast--level-up .fire-life-toast__mark,
.fire-life-toast--badge .fire-life-toast__mark {
  background: rgba(255, 207, 69, 0.2);
}

.fire-life-toast__emblem {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0.16rem 0.16rem rgba(0, 0, 0, 0.24));
}

.fire-life-toast__badge-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.fire-life-confetti {
  position: absolute;
  z-index: 3;
  top: -0.75rem;
  left: 50%;
  width: 100%;
  height: 10rem;
  pointer-events: none;
  overflow: visible;
  transform: translateX(-50%);
}

.fire-life-confetti__piece {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: 0.32rem;
  height: 0.68rem;
  background: var(--confetti-color);
  border-radius: 0.15rem;
  box-shadow: 0 0 0.35rem color-mix(in srgb, var(--confetti-color) 55%, transparent);
  opacity: 0;
  animation: fire-life-confetti-fall var(--confetti-duration) cubic-bezier(0.15, 0.7, 0.3, 1) var(--confetti-delay) both;
}

.fire-life-confetti__piece--1 {
  width: 0.62rem;
  height: 0.28rem;
  border-radius: 0.12rem;
}

.fire-life-confetti__piece--2 {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 0.05rem;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.fire-life-confetti__piece--3 {
  width: 0.28rem;
  height: 0.5rem;
  border-radius: 50%;
}

.fire-life-toast__emblem-rim {
  fill: #161825;
  stroke: #d6a555;
  stroke-width: 1.4;
}

.fire-life-toast__emblem-face {
  fill: #302239;
  stroke: #ed684d;
  stroke-width: 1;
}

.fire-life-toast__emblem .fire-life-toast__art {
  fill: none;
  stroke: #ffd166;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.fire-life-toast__emblem .fire-life-toast__art-fill {
  fill: #ffd166;
  stroke: #a33235;
  stroke-width: 0.65;
}

.fire-life-toast__emblem .fire-life-toast__art-ring {
  fill: none;
  stroke: #ffd166;
  stroke-width: 1.8;
}

.fire-life-toast__emblem .fire-life-toast__art-dot {
  fill: #ffd166;
}


