﻿:root {
  --sky-1: #d7e5f7;
  --sky-2: #f7e8dc;
  --sky-3: #f0d9e6;
  --ink: #2b2c31;
  --ink-soft: #5b606d;
  --accent: #ff7bbf;
  --accent-2: #8fb7ff;
  --glass: rgba(255, 255, 255, 0.75);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow: 0 24px 60px rgba(30, 35, 45, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(800px 540px at 100% 0%, rgba(255, 214, 228, 0.6), transparent 50%),
    linear-gradient(135deg, var(--sky-1), var(--sky-2) 50%, var(--sky-3));
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS Mincho", serif;
}

#app {
  min-height: 100vh;
}

.scene {
  position: relative;
  min-height: 100vh;
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(520px 320px at 20% 20%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(600px 320px at 80% 35%, rgba(168, 196, 255, 0.35), transparent 60%),
    linear-gradient(170deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
  overflow: hidden;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 12% 10% 40% 10%;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05)),
    radial-gradient(180px 120px at 20% 30%, rgba(120, 170, 255, 0.25), transparent 65%),
    radial-gradient(220px 140px at 80% 20%, rgba(255, 163, 210, 0.25), transparent 70%);
  border-radius: 32px;
  filter: blur(18px);
  opacity: 0.9;
  z-index: 0;
}

.scene > * {
  position: relative;
  z-index: 1;
}

.scene-dim {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.7);
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
  z-index: 2;
}

.scene.is-dimmed .scene-dim {
  opacity: 1;
}

.chapter-pill {
  align-self: flex-start;
  padding: 14px 22px;
  border-radius: 0 999px 999px 0;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  letter-spacing: 0.08em;
  width: 250px;
  opacity: 1;
  transform: translateX(0);
}

.chapter-pill.is-animate {
  animation: titleSlideIn 520ms ease;
}

.chapter-title {
  font-size: 12px;
  color: #ffffff;
}

.chapter-ep {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.spacer {
  flex: 1;
}

.message-window {
  position: relative;
  padding: 26px 26px 32px;
  border-radius: 6px 24px 6px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  min-height: 200px;
}

.name-tag {
  position: absolute;
  top: 0;
  left: -2px;
  transform: translateY(-100%);
  padding: 8px 18px;
  border-radius: 18px 18px 18px 0;
  background: linear-gradient(135deg, #ff86c6, #ffb3da);
  color: #1f1f24;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  width: 250px;
  min-width: 250px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  text-align: left;
}

.name-tag.is-kotone {
  background: linear-gradient(135deg, #ffe37a, #ffd24f);
  color: #2a2a24;
}

.name-tag.theme-kotone {
  background: #f9c112;
  color: #2a2a24;
}

.name-tag.theme-saki {
  background: #e30f25;
  color: #ffffff;
}

.name-tag.theme-temari {
  background: #0b7bbb;
  color: #ffffff;
}

.name-tag.theme-kiyoka {
  background: #7dfb01;
  color: #2a2a24;
}

.name-tag.theme-misuzu {
  background: #7a99cf;
  color: #ffffff;
}

.name-tag.theme-sena {
  background: #f5ae54;
  color: #2a2a24;
}

.name-tag:empty {
  opacity: 0;
  pointer-events: none;
}

.text {
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.caret {
  position: absolute;
  right: 22px;
  bottom: 14px;
  color: var(--accent);
  font-size: 18px;
  animation: caretPulse 1.4s ease-in-out infinite;
}

@keyframes caretPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(4px);
    opacity: 1;
  }
}

@keyframes titleSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-28px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

.hud-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.hud-btn.primary {
  background: linear-gradient(135deg, #ff8cc6, #ffd1e8);
  border-color: rgba(255, 255, 255, 0.9);
  color: #2b2c31;
  font-weight: 600;
}

.hud-btn.ghost {
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink-soft);
}

.hud-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(30, 35, 45, 0.12);
}

.hud-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.progress {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.slot-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 16, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 50;
}

.slot-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.log-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 16, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 60;
}

.log-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.slot-panel {
  width: min(720px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

.log-panel {
  width: min(760px, 92vw);
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  display: flex;
  flex-direction: column;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.slot-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.log-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.slot-close {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.log-entry {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.log-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.log-text {
  font-size: 14px;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.6;
}

.slot-card {
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.slot-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(20, 24, 36, 0.12);
}

.slot-card.is-empty {
  opacity: 0.6;
}

.slot-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.slot-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .scene {
    padding: 20px 18px;
  }

  .message-window {
    padding: 22px 18px 28px;
  }

  .hud {
    justify-content: center;
  }

  .progress {
    margin-left: 0;
  }
}
