:root {
  color-scheme: light;
  --ink: #533c42;
  --ink-soft: #8d6d72;
  --pink: #ee779d;
  --pink-deep: #d95784;
  --pink-pale: #fff0f5;
  --blue: #8ebedc;
  --cream: #fffaf1;
  --gold: #d89a36;
  --orange: #d37b34;
  --paper: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 50px rgba(118, 72, 83, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 255, 255, 0.96) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 18%, rgba(255, 255, 255, 0.86) 0 4px, transparent 5px),
    linear-gradient(145deg, #fff9f0 0%, #ffeef4 46%, #edf8ff 100%);
  background-size: 46px 46px, 62px 62px, auto;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.game-shell {
  width: min(950px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0 26px;
}

.title-area {
  position: relative;
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--pink-deep);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.eyebrow span {
  font-size: 1rem;
}

h1,
h2,
p {
  margin-top: 0;
}

.title-area h1 {
  margin-bottom: 8px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: 0.07em;
}

.title-area h1 span {
  color: var(--pink-deep);
}

.title-area p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.game-wrap {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(225, 150, 169, 0.28);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.score-row {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1.15fr;
  gap: 9px;
  margin-bottom: 11px;
}

.score-card,
.life-card {
  min-height: 58px;
  border: 1px solid rgba(230, 163, 181, 0.3);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-card {
  flex-direction: column;
  line-height: 1;
}

.score-card span {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.score-card strong {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.score-card--main {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #f18baa, #e66593);
  box-shadow: 0 8px 18px rgba(217, 87, 132, 0.22);
}

.score-card--main span {
  color: rgba(255, 255, 255, 0.82);
}

.life-card {
  gap: 5px;
  color: var(--pink-deep);
  font-size: 1.34rem;
}

.life-heart {
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease, color 180ms ease;
  filter: drop-shadow(0 2px 2px rgba(226, 83, 128, 0.16));
}

.life-heart.is-lost {
  color: #d9d0d2;
  opacity: 0.5;
  transform: scale(0.78);
}

.game-board {
  position: relative;
  height: clamp(485px, 67vh, 650px);
  min-height: 485px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  outline: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent 52%),
    linear-gradient(to bottom, #eaf8ff 0%, #f7fbff 48%, #fff5ed 76%, #f1d7aa 100%);
  box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.82);
  touch-action: none;
}

.game-board:focus-visible {
  box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.82), 0 0 0 4px rgba(238, 119, 157, 0.28);
}

.game-board::before,
.game-board::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(2px);
}

.game-board::before {
  top: 105px;
  left: -90px;
}

.game-board::after {
  top: 195px;
  right: -130px;
}

.sky-decor {
  position: absolute;
  z-index: 0;
  width: 120px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(1px);
  opacity: 0.75;
}

.sky-decor::before,
.sky-decor::after {
  content: "";
  position: absolute;
  bottom: 4px;
  border-radius: 50%;
  background: inherit;
}

.sky-decor::before {
  left: 22px;
  width: 48px;
  height: 48px;
}

.sky-decor::after {
  right: 18px;
  width: 36px;
  height: 36px;
}

.sky-decor--one {
  top: 82px;
  left: 24%;
  transform: scale(0.75);
}

.sky-decor--two {
  top: 155px;
  right: 9%;
  transform: scale(0.5);
  opacity: 0.55;
}

.petal-field i {
  position: absolute;
  z-index: 1;
  color: rgba(235, 127, 158, 0.23);
  font-style: normal;
  animation: ambientFloat 7s ease-in-out infinite;
}

.petal-field i:nth-child(1) { top: 22%; left: 8%; font-size: 1.3rem; }
.petal-field i:nth-child(2) { top: 39%; left: 34%; font-size: 0.7rem; animation-delay: -2s; }
.petal-field i:nth-child(3) { top: 16%; right: 6%; font-size: 1rem; animation-delay: -4s; }
.petal-field i:nth-child(4) { top: 55%; right: 23%; font-size: 1.5rem; animation-delay: -1s; }
.petal-field i:nth-child(5) { top: 68%; left: 12%; font-size: 0.85rem; animation-delay: -5s; }

.character-status {
  position: absolute;
  z-index: 8;
  top: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: 38px auto auto;
  align-items: center;
  gap: 9px;
  min-width: 224px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 18px rgba(85, 72, 84, 0.1);
  backdrop-filter: blur(8px);
}

.character-status img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 9%;
  background: linear-gradient(#fff2f7, #eef8ff);
}

.character-status div:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 76px;
}

.character-status span {
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 800;
}

.character-status strong {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.92rem;
}

.character-status .specialty {
  justify-self: end;
  padding: 5px 8px;
  border-radius: 999px;
  color: #cb5c83;
  background: #fff0f5;
  font-size: 0.7rem;
  font-weight: 900;
}

.falling-item {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  pointer-events: none;
  will-change: transform;
}

.falling-item__bubble {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 18px rgba(88, 67, 76, 0.13), inset 0 1px 8px rgba(255, 255, 255, 0.95);
}

.falling-item--pear .falling-item__bubble {
  background: rgba(255, 249, 210, 0.88);
}

.falling-item--sakura .falling-item__bubble {
  background: rgba(255, 234, 242, 0.9);
}

.falling-item__shine {
  position: absolute;
  top: 7px;
  left: 9px;
  width: 9px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-35deg);
}

.player {
  --player-x: 50%;
  --lean: 0deg;
  position: absolute;
  z-index: 5;
  bottom: 34px;
  left: 0;
  width: 240px;
  height: 255px;
  transform: translateX(calc(var(--player-x) - 50%));
  transform-origin: center bottom;
  pointer-events: none;
  will-change: transform;
}

.player__sprite {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16px;
  width: auto;
  max-width: 100%;
  height: 224px;
  object-fit: contain;
  transform: translateX(-50%) rotate(var(--lean));
  transform-origin: 50% 90%;
  filter: drop-shadow(0 9px 7px rgba(81, 62, 62, 0.2));
  transition: opacity 120ms ease, filter 120ms ease;
  animation: characterBreathe 2.5s ease-in-out infinite;
}

.player[data-character="minori"] .player__sprite {
  height: 205px;
}

.player.is-switching .player__sprite {
  opacity: 0;
  filter: blur(3px) drop-shadow(0 9px 7px rgba(81, 62, 62, 0.18));
}

.player.is-catching .player__sprite {
  animation: catchPop 220ms ease-out;
}

.player__glow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 10px;
  width: 155px;
  height: 34px;
  border-radius: 50%;
  background: rgba(238, 119, 157, 0.2);
  filter: blur(8px);
  transform: translateX(-50%);
}

.player[data-character="minori"] .player__glow {
  background: rgba(216, 154, 54, 0.25);
}

.player__name {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0;
  min-width: 84px;
  padding: 4px 10px;
  border: 2px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #ef87a8, #d95c89);
  box-shadow: 0 4px 12px rgba(124, 80, 90, 0.2);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  transform: translateX(-50%);
}

.player[data-character="minori"] .player__name {
  background: linear-gradient(135deg, #dcac52, #c97932);
}

.ground {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 75px;
  border-top: 2px solid rgba(183, 126, 68, 0.12);
  background:
    radial-gradient(ellipse at 30% 100%, rgba(195, 129, 67, 0.12) 0 22%, transparent 23%),
    radial-gradient(ellipse at 73% 104%, rgba(209, 154, 92, 0.15) 0 24%, transparent 25%),
    linear-gradient(#f7e4bd, #e9c98e);
}

.ground span {
  position: absolute;
}

.ground__leaf {
  bottom: 18px;
  color: rgba(189, 93, 43, 0.65);
  transform: rotate(35deg) scaleX(0.65);
}

.ground__leaf--one { left: 10%; }
.ground__leaf--two { right: 13%; transform: rotate(-26deg) scaleX(0.65); }
.ground__flower { left: 73%; bottom: 24px; color: rgba(227, 113, 148, 0.55); }

.bonus-toast {
  position: absolute;
  z-index: 20;
  top: 34%;
  left: 50%;
  min-width: 120px;
  padding: 9px 14px;
  border: 2px solid white;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #f09ab5, #dc668f);
  box-shadow: 0 8px 20px rgba(135, 77, 93, 0.2);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.9);
  pointer-events: none;
}

.bonus-toast.is-visible {
  animation: toastRise 650ms ease-out;
}

.screen {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  opacity: 0;
  background: rgba(255, 249, 249, 0.48);
  backdrop-filter: blur(7px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.screen--visible {
  visibility: visible;
  opacity: 1;
}

.screen__card {
  width: min(430px, 100%);
  padding: 24px 26px 26px;
  border: 2px solid rgba(255, 255, 255, 0.98);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 55px rgba(104, 66, 77, 0.2);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 260ms ease;
}

.screen--visible .screen__card {
  transform: translateY(0) scale(1);
}

.start-portraits {
  height: 116px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin-top: -8px;
}

.portrait {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 3px solid white;
  border-radius: 50%;
  background: linear-gradient(#fff0f5, #f0f8ff);
  box-shadow: 0 6px 18px rgba(126, 78, 90, 0.14);
}

.portrait img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center top;
}

.portrait--hiyori {
  transform: translateX(10px) rotate(-5deg);
}

.portrait--minori {
  z-index: 1;
  transform: translateX(-10px) rotate(5deg);
}

.portrait--minori img {
  height: 135px;
}

.screen__kicker {
  margin: 10px 0 5px;
  color: var(--pink-deep);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.screen h2 {
  margin-bottom: 15px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  line-height: 1.25;
}

.how-to {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 12px;
}

.how-to span {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff2f6;
  font-size: 0.75rem;
  font-weight: 800;
}

.how-to b {
  color: var(--pink-deep);
}

.rule-note {
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.7;
}

.rule-note b {
  color: var(--orange);
}

.primary-button {
  min-width: 210px;
  padding: 13px 25px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #f18bab, #d95784);
  box-shadow: 0 10px 24px rgba(217, 87, 132, 0.28), inset 0 1px rgba(255, 255, 255, 0.35);
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 27px rgba(217, 87, 132, 0.32), inset 0 1px rgba(255, 255, 255, 0.35);
}

.primary-button:active {
  transform: translateY(1px) scale(0.98);
}

.primary-button:focus-visible,
.control-button:focus-visible {
  outline: 3px solid rgba(79, 137, 178, 0.5);
  outline-offset: 3px;
}

.result-score {
  width: min(260px, 100%);
  margin: 0 auto 14px;
  padding: 13px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #ef86a7, #d85c88);
}

.result-score span,
.result-score strong {
  display: block;
}

.result-score span {
  font-size: 0.7rem;
  font-weight: 800;
}

.result-score strong {
  margin-top: 4px;
  font-size: 2rem;
  letter-spacing: 0.12em;
}

.result-card > p:not(.screen__kicker) {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.control-button {
  min-height: 66px;
  border: 1px solid rgba(227, 156, 176, 0.28);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 7px 15px rgba(100, 68, 78, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 100ms ease, background 100ms ease;
}

.control-button:active,
.control-button.is-pressed {
  transform: translateY(2px) scale(0.98);
  background: #fff1f5;
}

.control-button span,
.control-button strong,
.control-button small {
  display: block;
}

.control-button--move span {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.control-button small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.control-button--switch {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #f08baa, #ce8144);
}

.control-button--switch:active {
  background: linear-gradient(135deg, #e47a9d, #c27437);
}

.control-button--switch small {
  color: rgba(255, 255, 255, 0.76);
}

.switch-icons {
  font-size: 0.72rem;
}

.switch-icons i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pink-dot { background: #ffd0df; }
.orange-dot { background: #ffd48a; }

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  padding: 15px 8px 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

footer i {
  color: var(--pink);
  font-style: normal;
}

footer b:first-child {
  color: var(--pink-deep);
}

.game-board.is-hit {
  animation: boardShake 240ms ease-out;
}

@keyframes characterBreathe {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(var(--lean)) scaleY(1); }
  50% { transform: translateX(-50%) translateY(-4px) rotate(var(--lean)) scaleY(1.012); }
}

@keyframes catchPop {
  0% { transform: translateX(-50%) rotate(var(--lean)) scale(1); }
  45% { transform: translateX(-50%) rotate(var(--lean)) scale(1.09, 0.95); }
  100% { transform: translateX(-50%) rotate(var(--lean)) scale(1); }
}

@keyframes toastRise {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.88); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  76% { opacity: 1; transform: translate(-50%, -8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(0.96); }
}

@keyframes boardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-2px); }
}

@keyframes ambientFloat {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  50% { transform: translate(9px, -12px) rotate(9deg); }
}

@media (max-width: 620px) {
  .game-shell {
    width: min(100% - 16px, 520px);
    padding-top: 18px;
  }

  .title-area {
    margin-bottom: 12px;
  }

  .title-area p {
    font-size: 0.78rem;
  }

  .game-wrap {
    padding: 9px;
    border-radius: 22px;
  }

  .score-row {
    grid-template-columns: 1.35fr 0.9fr 0.9fr 1.05fr;
    gap: 5px;
    margin-bottom: 7px;
  }

  .score-card,
  .life-card {
    min-height: 49px;
    border-radius: 13px;
  }

  .score-card span {
    margin-bottom: 5px;
    font-size: 0.52rem;
  }

  .score-card strong {
    font-size: 1rem;
  }

  .life-card {
    gap: 2px;
    font-size: 1rem;
  }

  .game-board {
    height: min(62vh, 545px);
    min-height: 455px;
    border-radius: 18px;
  }

  .character-status {
    top: 9px;
    left: 9px;
    grid-template-columns: 32px auto auto;
    min-width: 196px;
    gap: 6px;
    padding: 5px 7px;
  }

  .character-status img {
    width: 32px;
    height: 32px;
  }

  .character-status .specialty {
    padding: 4px 6px;
    font-size: 0.62rem;
  }

  .player {
    width: 205px;
    height: 225px;
    bottom: 26px;
  }

  .player__sprite {
    height: 198px;
  }

  .player[data-character="minori"] .player__sprite {
    height: 184px;
  }

  .falling-item {
    width: 48px;
    height: 48px;
  }

  .falling-item__bubble {
    width: 43px;
    height: 43px;
    font-size: 1.65rem;
  }

  .screen__card {
    padding: 19px 16px 21px;
  }

  .start-portraits {
    height: 96px;
  }

  .portrait {
    width: 94px;
    height: 94px;
  }

  .portrait img {
    height: 150px;
  }

  .portrait--minori img {
    height: 114px;
  }

  .how-to {
    gap: 5px;
  }

  .how-to span {
    padding: 6px 8px;
    font-size: 0.67rem;
  }

  .controls {
    gap: 6px;
    margin-top: 8px;
  }

  .control-button {
    min-height: 59px;
    border-radius: 15px;
  }

  footer {
    padding-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
.reward-button{width:100%;margin:0 0 9px;padding:12px 14px;border:1px solid rgba(118,73,90,.22);border-radius:14px;background:#fff7fa;color:#72475a;font:700 .78rem/1.35 inherit;cursor:pointer;box-shadow:0 5px 14px rgba(110,65,82,.08)}.reward-button:hover{background:#fff0f5}.reward-button:disabled{cursor:wait;opacity:.55}.reward-button[hidden]{display:none}.reward-status{display:block;min-height:1.35em;margin:-2px 0 8px;color:#876b76;font-size:.66rem;line-height:1.35}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
