/* 今日の碁運 (v1.7.0) — /fortune/ only. Uses MIRUGO tokens from main.css. */

.fortune-page {
  background: var(--color-bg);
}

/* Stones */
.fortune-stone {
  display: inline-block;
  flex: none;
  border-radius: 50%;
}

.fortune-stone--black {
  background: radial-gradient(circle at 34% 28%, #7a7f78 0, #2b2e2b 24%, #0a0b0a 62%, #000 100%);
  box-shadow: 0 6px 14px rgb(0 0 0 / 38%), inset 0 -3px 6px rgb(0 0 0 / 45%);
}

.fortune-stone--white {
  background: radial-gradient(circle at 34% 28%, #fff 0, #f6f7f3 30%, #dfe2da 72%, #c6cabf 100%);
  box-shadow: 0 6px 14px rgb(0 0 0 / 24%), inset 0 -3px 6px rgb(0 0 0 / 10%);
}

/* Hero */
.fortune-hero {
  overflow: hidden;
  padding: clamp(116px, 15vw, 170px) 0 clamp(48px, 8vw, 88px);
  background:
    radial-gradient(circle at 50% 62%, rgb(184 255 53 / 12%), transparent 36%),
    repeating-radial-gradient(circle at 50% 62%, transparent 0 92px, rgb(184 255 53 / 7%) 94px 96px),
    var(--color-dark);
  color: #fff;
  text-align: center;
}

.fortune-hero__inner {
  display: grid;
  justify-items: center;
}

.fortune-hero .eyebrow {
  color: var(--color-lime);
}

.fortune-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(3rem, 13vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.fortune-hero__lead {
  margin: 18px 0 0;
  color: rgb(255 255 255 / 72%);
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  line-height: 1.9;
}

/* Go bowls (碁笥) */
.fortune-bowls {
  --bowl: clamp(104px, 28vw, 136px);
  --gap: clamp(24px, 7vw, 44px);
  position: relative;
  display: flex;
  gap: var(--gap);
  justify-content: center;
  margin-top: 30px;
  padding-top: 70px;
}

.fortune-bowl {
  position: relative;
  display: grid;
  width: var(--bowl);
  justify-items: center;
  transform-origin: 50% 90%;
}

.fortune-bowl__lid {
  position: relative;
  z-index: 1;
  width: 104%;
  height: calc(var(--bowl) * 0.2);
  margin-bottom: calc(var(--bowl) * -0.1);
  border-radius: 50%;
}

.fortune-bowl__body {
  width: 100%;
  height: calc(var(--bowl) * 0.66);
  border-radius: 46% 46% 50% 50% / 30% 30% 70% 70%;
}

.fortune-bowl small {
  margin-top: 10px;
  color: rgb(255 255 255 / 48%);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.fortune-bowl--black .fortune-bowl__lid,
.fortune-bowl--black .fortune-bowl__body {
  background: linear-gradient(180deg, #3a3e3a 0, #141614 55%, #050605 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 0 0 1px rgb(255 255 255 / 12%);
}

.fortune-bowl--white .fortune-bowl__lid,
.fortune-bowl--white .fortune-bowl__body {
  background: linear-gradient(180deg, #fff 0, #eef0ea 50%, #c9cdc3 100%);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgb(0 0 0 / 30%);
}

.fortune-bowls__stone {
  --from-x: calc((var(--bowl) + var(--gap)) / -2);
  position: absolute;
  top: 6px;
  left: 50%;
  width: 48px;
  height: 48px;
  opacity: 0;
  transform: translate(-50%, 0);
}

.fortune-bowls.is-white .fortune-bowls__stone {
  --from-x: calc((var(--bowl) + var(--gap)) / 2);
}

.fortune-bowls.is-drawn .fortune-bowls__stone {
  opacity: 1;
}

.fortune-bowls.is-drawn.is-black .fortune-bowl--white,
.fortune-bowls.is-drawn.is-white .fortune-bowl--black {
  opacity: 0.55;
}

.fortune-bowls.is-shaking .fortune-bowl--black {
  animation: fortune-shake 0.62s ease-in-out;
}

.fortune-bowls.is-shaking .fortune-bowl--white {
  animation: fortune-shake 0.62s ease-in-out 0.06s reverse;
}

.fortune-bowls.is-dropping .fortune-bowls__stone {
  animation: fortune-stone-out 0.62s cubic-bezier(0.2, 0.8, 0.3, 1.15) forwards;
}

@keyframes fortune-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-5deg); }
  40% { transform: rotate(4deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(2deg); }
}

@keyframes fortune-stone-out {
  0% { opacity: 0; transform: translate(calc(-50% + var(--from-x)), 64px) scale(0.55); }
  50% { opacity: 1; transform: translate(calc(-50% + (var(--from-x) * 0.45)), -16px) scale(1.04); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.fortune-hero__action {
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-top: 30px;
}

.fortune-draw {
  min-width: min(100%, 280px);
  font-size: 0.95rem;
}

.fortune-draw[hidden],
.fortune-hero__done[hidden],
.fortune-hero__note[hidden] {
  display: none;
}

.fortune-draw:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.fortune-hero__done {
  margin: 0;
  font-weight: 800;
}

.fortune-hero__done a {
  margin-left: 10px;
  color: var(--color-lime);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.fortune-hero__note {
  margin: 0;
  color: rgb(255 255 255 / 55%);
  font-size: 0.76rem;
}

/* Result */
.fortune-result {
  padding-block: clamp(40px, 7vw, 80px) clamp(64px, 9vw, 110px);
  scroll-margin-top: 76px;
}

.fortune-result[hidden] {
  display: none;
}

.fortune-result__inner {
  display: grid;
  max-width: calc(760px + (var(--gutter) * 2));
  gap: 18px;
}

.js .fortune-step {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .fortune-step.is-shown {
  opacity: 1;
  transform: none;
}

/* Stone card */
.fortune-stone-card {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.is-black .fortune-stone-card {
  background: var(--color-dark);
  box-shadow: none;
  color: #fff;
}

.fortune-stone--large {
  width: 68px;
  height: 68px;
}

.fortune-stone-card__label {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.fortune-stone-card__mode {
  display: inline-block;
  margin: 8px 0 0;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-lime);
  color: var(--color-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

/* Omikuji */
.fortune-omikuji {
  position: relative;
  padding: clamp(26px, 5vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

.fortune-omikuji__index {
  margin: 0;
  color: #426300;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.fortune-omikuji__name {
  margin: 10px 0 0;
  font-size: clamp(3rem, 14vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.fortune-omikuji__name:focus {
  outline: none;
}

.fortune-omikuji__catch {
  margin: 20px 0 0;
  font-size: clamp(1.2rem, 4.6vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.fortune-omikuji__body {
  margin: 12px 0 0;
  color: var(--color-muted);
  line-height: 1.95;
  white-space: pre-line;
}

.fortune-omikuji__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
}

.fortune-omikuji__details > div {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.fortune-omikuji__details dt {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.fortune-omikuji__details dd {
  margin: 6px 0 0;
  font-size: clamp(1.15rem, 4.4vw, 1.45rem);
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Player */
.fortune-player {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.fortune-player__intro {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}

.fortune-player-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.fortune-player-card[hidden],
.fortune-player__empty[hidden],
.fortune-oshi[hidden] {
  display: none;
}

.is-oshi .fortune-player-card {
  box-shadow: 0 0 0 2px var(--color-lime-strong), var(--shadow);
}

.fortune-player-card__visual {
  display: grid;
  min-height: 100%;
  place-items: center;
  background: #e9ece5;
}

.fortune-player-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.fortune-player-card__visual b {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.fortune-player-card__body {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 20px;
}

.fortune-player-card__body small {
  color: #426300;
  font-size: 0.72rem;
  font-weight: 900;
}

.fortune-player-card__body h3 {
  margin: 0;
  font-size: clamp(1.4rem, 5.6vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.fortune-player-card__body h3 b {
  margin-left: 8px;
  color: var(--color-muted);
  font-size: 0.55em;
  letter-spacing: 0;
}

.fortune-player-card__body p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.fortune-player-card__body p:empty {
  display: none;
}

.fortune-player-card__body .button {
  justify-self: start;
  margin-top: 8px;
  min-height: 46px;
}

.fortune-player__empty {
  margin: 0;
  color: var(--color-muted);
  text-align: center;
}

.fortune-player__empty a {
  text-decoration: underline;
}

/* 推し降臨 */
.fortune-oshi {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0, rgb(184 255 53 / 30%), transparent 60%),
    var(--color-dark);
  color: #fff;
  text-align: center;
  animation: fortune-oshi-glow 2.4s ease-in-out 3;
}

.fortune-oshi__label {
  margin: 0;
  color: var(--color-lime);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.fortune-oshi__title {
  margin: 8px 0 0;
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.fortune-oshi__text {
  margin: 10px 0 0;
  color: rgb(255 255 255 / 76%);
  font-size: 0.92rem;
  line-height: 1.8;
}

.fortune-oshi__stones {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.fortune-oshi__stones i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0, #e3e6de 60%, #b9bdb3 100%);
  animation: fortune-hop 1.2s ease-in-out infinite;
}

.fortune-oshi__stones i:nth-child(2) {
  background: var(--color-lime);
  animation-delay: 0.15s;
}

.fortune-oshi__stones i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fortune-hop {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

@keyframes fortune-oshi-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(184 255 53 / 0%); }
  50% { box-shadow: 0 0 32px 2px rgb(184 255 53 / 32%); }
}

/* Share */
.fortune-share {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.fortune-share__button {
  min-width: min(100%, 260px);
}

.fortune-share__copy {
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.fortune-share__status {
  flex-basis: 100%;
  min-height: 1.4em;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Streak */
.fortune-streak {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  background: var(--color-dark);
  color: #fff;
  text-align: center;
}

.fortune-streak__day {
  margin: 0;
  color: rgb(255 255 255 / 70%);
  font-weight: 800;
}

.fortune-streak__day strong {
  color: var(--color-lime);
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.fortune-streak__stones {
  display: flex;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.fortune-streak__slot {
  width: 26px;
  height: 26px;
}

.fortune-streak__slot.is-empty {
  border: 1px dashed rgb(255 255 255 / 30%);
  border-radius: 50%;
}

.fortune-streak__slot.is-today {
  outline: 2px solid var(--color-lime);
  outline-offset: 3px;
}

.fortune-streak__text {
  margin: 0;
  font-size: 0.9rem;
}

.fortune-streak__bye {
  margin: 6px 0 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

@media (min-width: 600px) {
  .fortune-player-card {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .fortune-player-card__body {
    padding: 26px 28px;
  }
}

@media (max-width: 380px) {
  .fortune-omikuji__details {
    grid-template-columns: 1fr;
  }

  .fortune-streak__stones {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .fortune-step {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fortune-bowls.is-shaking .fortune-bowl,
  .fortune-bowls.is-dropping .fortune-bowls__stone,
  .fortune-oshi,
  .fortune-oshi__stones i {
    animation: none;
  }
}
