/* Daily Quote — arcade game styles */

@font-face {
  font-family: 'Playfair';
  font-style: normal;
  font-weight: 400 700;
  src: local('Playfair Display'), local('Georgia'), local('Times New Roman');
}

:root {
  --bg: #0b0d12;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.95);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.35);
  --accent: #e9d5a4;
  --accent-dim: rgba(233, 213, 164, 0.3);
  --heart-active: #ff5a7a;
  --streak: #ffc764;
}

#game-root {
  position: relative;
}
#game-root::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../daily-quote-background.webp');
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}
#game-root::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.35) 0%, rgba(11, 13, 18, 0.55) 50%, rgba(11, 13, 18, 0.7) 100%);
  z-index: 0;
  pointer-events: none;
}
#game-root > * { position: relative; z-index: 1; }

#app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: 'Playfair', Georgia, 'Times New Roman', serif;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#app.ready { opacity: 1; }

/* Header */
.header {
  padding: calc(16px + var(--sat)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.header-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}
.header-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--streak);
  padding: 7px 14px;
  border-radius: 16px;
  background: rgba(255, 199, 100, 0.1);
  border: 1px solid rgba(255, 199, 100, 0.22);
}
.header-streak .streak-num {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1;
}
.header-streak svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

/* Content area */
.content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Today view */
.today-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 28px;
  justify-content: center;
  align-items: stretch;
  text-align: center;
}

.ornament {
  color: var(--accent);
  font-size: 20px;
  letter-spacing: 8px;
  margin-bottom: 28px;
  opacity: 0.7;
}

.quote-text {
  font-size: 28px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: 0.2px;
  font-style: italic;
}
.quote-text.long { font-size: 24px; line-height: 1.45; }
.quote-text.very-long { font-size: 20px; line-height: 1.5; }

.quote-author {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.quote-author::before { content: '— '; }

/* Actions */
.actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 20px 28px 8px;
}
.action-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-dim);
}
.action-btn:active { transform: scale(0.92); background: var(--bg-card-hover); }
.action-btn svg { width: 26px; height: 26px; fill: currentColor; }
.action-btn.favorited {
  color: var(--heart-active);
  background: rgba(255, 90, 122, 0.1);
  border-color: rgba(255, 90, 122, 0.25);
}
.action-btn.share { color: var(--text-dim); }

/* Bottom nav */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 12px 0 calc(16px + var(--sab));
  border-top: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.95);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-faint);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s;
  min-height: 44px;
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item.active { color: var(--accent); }
.nav-item:active { opacity: 0.6; }

/* Favorites view */
.favorites-view {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.favorites-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 4px 18px;
  font-weight: 600;
}
.fav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px 20px 20px;
  padding-right: 60px;
  margin-bottom: 12px;
  position: relative;
}
.fav-quote {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
  margin-bottom: 12px;
}
.fav-author {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.fav-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 90, 122, 0.12);
  color: var(--heart-active);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fav-remove:active { transform: scale(0.9); }
.fav-remove svg { width: 18px; height: 18px; fill: currentColor; }

.history-card { padding-top: 18px; }
.history-date {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  font-weight: 600;
}
.hist-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hist-fav svg { width: 18px; height: 18px; fill: currentColor; }
.hist-fav:active { transform: scale(0.9); }
.hist-fav.favorited {
  color: var(--heart-active);
  background: rgba(255, 90, 122, 0.12);
  border-color: rgba(255, 90, 122, 0.25);
}

.empty-state {
  text-align: center;
  padding: 80px 24px 40px;
  color: var(--text-faint);
  font-family: 'Inter', system-ui, sans-serif;
}
.empty-state .ornament {
  font-size: 32px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Toast */
.toast {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 24px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Fade transitions for quote changes */
.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Start screen */
.start-view {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1733 0%, #2d1c44 50%, #2a1828 100%);
  animation: fadeIn 0.45s ease;
}
.start-poster {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.start-content {
  position: absolute;
  inset: 0;
  padding: calc(40px + var(--sat)) 32px calc(44px + var(--sab));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}
.start-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #0b0d12;
  background: var(--accent);
  border: none;
  padding: 20px 0;
  width: 100%;
  max-width: 300px;
  min-height: 56px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(233, 213, 164, 0.2);
}
.start-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(233, 213, 164, 0.15);
}
