@property --hue {
  syntax: '<number>';
  inherits: true;
  initial-value: 265;
}

:root {
  --hue: 265;
  --bg-dark: hsl(var(--hue) 45% 8%);
  --bg-glow: hsl(var(--hue) 70% 35%);
  --card-bg: hsla(var(--hue) 30% 15% / 0.55);
  --border: hsla(var(--hue) 60% 70% / 0.25);
  --accent: hsl(var(--hue) 85% 70%);
  --text: #f5f3ff;
  --muted: hsla(0 0% 100% / 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, var(--bg-glow) 0%, transparent 45%),
    radial-gradient(circle at 80% 75%, var(--bg-glow) 0%, transparent 45%),
    var(--bg-dark);
  background-attachment: fixed;
  transition: background 1.1s ease, --hue 1.1s ease;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.card {
  position: relative;
  width: 100%;
  border-radius: 20px;
  padding: 56px 48px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 30px 80px -20px hsla(var(--hue) 60% 20% / 0.6);
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: box-shadow 1.1s ease, border-color 1.1s ease;
}

.quote-text {
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  line-height: 1.65;
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}

.quote-text::before {
  content: "\201C";
  opacity: 0.5;
}
.quote-text::after {
  content: "\201D";
  opacity: 0.5;
}

.quote-author {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.quote-author::before {
  content: "— ";
}

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: hsla(0 0% 100% / 0.06);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.fav-btn:hover {
  transform: scale(1.1);
  background: hsla(0 0% 100% / 0.12);
}

.fav-btn.active {
  color: #ffd166;
  border-color: hsla(45 90% 65% / 0.5);
}

.controls {
  display: flex;
  gap: 14px;
  align-items: center;
}

button.primary {
  padding: 13px 28px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), hsl(calc(var(--hue) + 60) 85% 65%));
  color: #1a1225;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px hsla(var(--hue) 80% 55% / 0.7);
  transition: transform 0.15s ease, box-shadow 1.1s ease;
}

button.primary:hover {
  transform: translateY(-2px) scale(1.02);
}

button.primary:active {
  transform: translateY(0) scale(0.98);
}

button.ghost {
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

button.ghost:hover {
  background: hsla(0 0% 100% / 0.08);
  color: var(--text);
}

.fav-panel {
  width: 100%;
  max-width: 720px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.fav-panel.open {
  display: flex;
}

.fav-panel h2 {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fav-item {
  padding: 14px 18px;
  border-radius: 12px;
  background: hsla(0 0% 100% / 0.05);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.fav-item span.author {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.8rem;
}

.fav-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px 0;
}

footer {
  color: var(--muted);
  font-size: 0.75rem;
  opacity: 0.6;
}
