* {
  box-sizing: border-box;
}

:root {
  --bg: #120d22;
  --bg2: #271643;
  --text: #fff8ff;
  --sub: #dbcce9;
  --pink: #ff7ab6;
  --purple: #9178ff;
  --blue: #6fc8ff;
  --gold: #ffd36a;
  --green: #90e6b1;
  --card: rgba(255, 255, 255, 0.12);
  --card2: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.2);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

html {
  scroll-behavior: smooth;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Hiragino Maru Gothic ProN",
    "Yu Gothic",
    system-ui,
    sans-serif;
  color: var(--text);
  background:
    linear-gradient(to bottom, rgba(255, 184, 117, 0.22), rgba(46, 24, 67, 0.78)),
    radial-gradient(circle at 18% 18%, rgba(255, 224, 148, 0.75), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(255, 132, 145, 0.35), transparent 32%),
    linear-gradient(160deg, #ffb36b 0%, #e86f8f 42%, #2a1748 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(255, 255, 255, 0.16) 12% 13%, transparent 13% 25%),
    linear-gradient(0deg, transparent 0 72%, rgba(255, 255, 255, 0.14) 72% 73%, transparent 73%),
    linear-gradient(to bottom, rgba(255, 245, 210, 0.18), transparent 46%, rgba(19, 12, 35, 0.65));
  background-size:
    220px 100%,
    100% 180px,
    100% 100%;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.game {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  min-height: 100vh;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 48px 0;
}

.screen.active {
  display: block;
}

.title-screen {
  text-align: center;
  align-content: center;
}

.title-inner {
  width: min(820px, 100%);
  margin: 0 auto;
}

.label {
  margin: 0;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1 {
  margin: 16px 0 0;
  font-size: clamp(3.5rem, 12vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  text-shadow:
    0 0 22px rgba(255, 122, 182, 0.58),
    0 0 60px rgba(145, 120, 255, 0.45);
}

h2 {
  margin: 12px 0 16px;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
}

.catch {
  margin: 22px 0 0;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 900;
}

.lead,
.select-lead {
  margin: 18px auto 0;
  width: min(760px, 100%);
  color: var(--sub);
  line-height: 1.9;
  font-weight: 800;
}

.title-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.main-btn,
.sub-btn,
.next-btn,
.choice-btn,
.mini-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.main-btn,
.next-btn {
  color: var(--text);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.main-btn:hover,
.sub-btn:hover,
.next-btn:hover,
.choice-btn:hover,
.mini-btn:hover {
  transform: translateY(-2px);
}

.main-btn,
.sub-btn {
  min-width: 170px;
  min-height: 54px;
  padding: 0 28px;
  font-size: 1.05rem;
}

.sub-btn,
.mini-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.sub-link {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
  color: rgba(255, 248, 255, 0.7);
  font-weight: 800;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 28px;
  margin: 24px 0;
}

.panel p,
.panel li {
  color: var(--sub);
  line-height: 1.9;
  font-weight: 800;
}

.panel ul {
  margin: 18px 0 0;
  padding-left: 1.3em;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.character-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: 0.2s;
  text-align: left;
}

.character-card:hover {
  transform: translateY(-4px);
  background: var(--card2);
}

.character-card img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: contain;
  object-position: bottom;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.18), transparent 40%),
    rgba(255, 255, 255, 0.05);
}

.character-card-body {
  padding: 18px;
}

.character-card-body h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.character-card-body p {
  margin: 0;
  color: var(--sub);
  line-height: 1.7;
  font-weight: 700;
}

.character-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.character-tags span {
  padding: 5px 9px;
  border-radius: 999px;
  color: rgba(255, 248, 255, 0.86);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 900;
}

.novel-screen {
  position: relative;
  display: none;
  align-content: end;
}

.novel-screen.active {
  display: grid;
}

.route-title {
  position: fixed;
  z-index: 2;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100% - 28px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(255, 248, 255, 0.78);
  background: rgba(18, 13, 34, 0.58);
  backdrop-filter: blur(14px);
  text-align: center;
  font-weight: 900;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding-bottom: 190px;
  pointer-events: none;

  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(18, 13, 34, 0.08),
      rgba(18, 13, 34, 0.35) 45%,
      rgba(18, 13, 34, 0.9) 100%
    );
}

.character-image {
  position: relative;
  z-index: 1;
  max-width: min(540px, 88vw);
  max-height: 72vh;
  object-fit: contain;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.45));
  animation: fadeIn 0.28s ease both;
}

.message-box {
  position: relative;
  z-index: 3;
  margin: auto auto 0;
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(20, 13, 38, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 22px;
}

.name-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.speaker-name {
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 900;
}

.love-point {
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 800;
}

.message-text {
  min-height: 108px;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.9;
  font-weight: 800;
  white-space: pre-line;
}

.message-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.next-btn,
.mini-btn {
  min-width: 120px;
  min-height: 44px;
  padding: 0 22px;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.choice-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@media (max-width: 820px) {
  .screen {
    width: min(100% - 20px, 1120px);
    padding: 34px 0;
  }

  .character-grid {
    grid-template-columns: 1fr 1fr;
  }

  .character-card img {
    height: 220px;
  }

  .character-card-body {
    padding: 14px;
  }

  .stage {
    padding-bottom: 245px;
  }

  .character-image {
    max-height: 60vh;
  }

  .message-box {
    border-radius: 22px;
    padding: 18px;
  }

  .message-text {
    font-size: 1rem;
    min-height: 118px;
  }

  .route-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  .character-grid {
    grid-template-columns: 1fr;
  }

  .character-card img {
    height: 260px;
  }

  .title-buttons,
  .message-actions {
    flex-direction: column;
  }

  .main-btn,
  .sub-btn,
  .next-btn,
  .mini-btn {
    width: 100%;
  }
}


/* iPhoneなどで連続タップした時の拡大・選択を防ぐ */
button,
a,
.character-card,
.message-box,
.stage,
.character-image {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
