/* Joy Dashboard - Family sharing hub */
/* OKLCH Color System with Fallbacks */

:root {
  /* Fallback colors (hex) for older browsers */
  --bg-primary: #fdf5e6;
  --bg-secondary: #f4e2dc;
  --bg-accent: #e8dccc;
  --text-primary: #4a402c;
  --text-secondary: #836f51;
  --text-light: #a89880;
  --accent-warm: #c9a86c;
  --accent-soft: #b8a088;
  
  /* Transitions */
  --transition-slow: 2s ease-in-out;
  --transition-medium: 1s ease-in-out;
  --transition-fast: 0.3s ease-in-out;
  
  /* Typography */
  --font-family: 'Georgia', 'Times New Roman', serif;
  --font-size-huge: clamp(2.5rem, 6vw, 4rem);
  --font-size-large: clamp(1.5rem, 4vw, 2.5rem);
  --font-size-medium: clamp(1.2rem, 3vw, 1.8rem);
  --font-size-small: clamp(1rem, 2vw, 1.2rem);
  
  /* Spacing */
  --spacing-large: clamp(2rem, 5vw, 4rem);
  --spacing-medium: clamp(1rem, 3vw, 2rem);
}

/* OKLCH colors for modern browsers - applied by colors.js */
@supports (color: oklch(0% 0 0)) {
  :root {
    /* Spring Morning defaults - will be overridden by JS */
    --bg-primary: oklch(96% 0.02 140);
    --bg-secondary: oklch(92% 0.03 340);
    --bg-accent: oklch(88% 0.04 80);
    --text-primary: oklch(30% 0.05 140);
    --text-secondary: oklch(45% 0.04 140);
    --text-light: oklch(55% 0.03 140);
    --accent-warm: oklch(65% 0.12 45);
    --accent-soft: oklch(70% 0.08 340);
  }
}

/* Season-specific accent colors as CSS hooks */
[data-season="spring"] {
  --season-accent: oklch(75% 0.15 340); /* Pink */
}
[data-season="summer"] {
  --season-accent: oklch(75% 0.15 200); /* Sky blue */
}
[data-season="fall"] {
  --season-accent: oklch(70% 0.15 50);  /* Gold */
}
[data-season="winter"] {
  --season-accent: oklch(70% 0.10 220); /* Cool blue */
}

/* Time of day overlays */
[data-time-of-day="morning"] #dashboard {
  background-image: linear-gradient(135deg, transparent 50%, oklch(95% 0.02 80 / 0.3));
}
[data-time-of-day="evening"] #dashboard {
  background-image: linear-gradient(180deg, transparent 30%, oklch(85% 0.06 30 / 0.2));
}
[data-time-of-day="night"] #dashboard {
  background-image: linear-gradient(180deg, transparent 20%, oklch(25% 0.03 250 / 0.15));
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background var(--transition-slow), color var(--transition-slow);
}

/* Dashboard */
#dashboard {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-large);
  position: relative;
}

#content-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Slides */
.slide {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn var(--transition-medium) forwards;
}

.slide.fade-out { animation: fadeOut var(--transition-medium) forwards; }

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

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.98); }
}

/* Photo slides */
.slide-photo img {
  max-width: 90%;
  max-height: 65vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.slide-photo .caption,
.slide-photo .from {
  margin-top: var(--spacing-medium);
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
}

.slide-photo .from {
  font-size: var(--font-size-small);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Message slides */
.slide-message .message-text {
  font-size: var(--font-size-huge);
  line-height: 1.4;
  max-width: 800px;
  color: var(--text-primary);
}

.slide-message .message-from {
  margin-top: var(--spacing-medium);
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
}

/* Affirmation slides */
.slide-affirmation .affirmation-text {
  font-size: var(--font-size-huge);
  line-height: 1.3;
  color: var(--accent-warm);
  max-width: 700px;
}

/* Audio slides */
.slide-audio .audio-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.slide-audio .audio-icon {
  font-size: 5rem;
}

.slide-audio .audio-label {
  font-size: var(--font-size-large);
  color: var(--text-secondary);
}

.slide-audio audio {
  margin-top: 1rem;
  width: 300px;
}

/* Nature slides */
.slide-nature .nature-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-medium);
}

.slide-nature .nature-text {
  font-size: var(--font-size-large);
  color: var(--text-secondary);
}

/* Weather slides */
.slide-weather .weather-display {
  width: 100%;
  max-width: 900px;
}

.slide-weather h2 {
  font-size: var(--font-size-large);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-medium);
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.weather-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
}

.weather-location {
  font-size: var(--font-size-medium);
  font-weight: bold;
  color: var(--text-primary);
}

.weather-place {
  font-size: var(--font-size-small);
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.weather-temp {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
}

.weather-condition {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

/* Progress bar */
#progress-bar {
  position: absolute;
  bottom: var(--spacing-medium);
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: var(--bg-accent);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0.5;
}

#progress-fill {
  height: 100%;
  background: var(--accent-soft);
  width: 0%;
  transition: width 0.1s linear;
}

/* Ambient info */
#ambient-info {
  position: absolute;
  top: var(--spacing-medium);
  right: var(--spacing-medium);
  font-size: var(--font-size-small);
  color: var(--text-light);
  opacity: 0.6;
}

#ambient-info span { margin-left: 1rem; }

/* Wildlife decorations */
#wildlife-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.wildlife-decoration {
  position: absolute;
  width: 80px;
  opacity: 0.12;
  transition: opacity 0.5s;
}

/* FAB button */
.fab {
  position: absolute;
  bottom: var(--spacing-medium);
  right: var(--spacing-medium);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-warm);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0.6;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.fab:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 400px;
  padding: var(--spacing-large);
}

.login-container h1 {
  font-size: var(--font-size-huge);
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.login-container .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: var(--font-size-medium);
}

.login-form {
  width: 100%;
}

.login-form input {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--bg-accent);
  border-radius: 8px;
  font-size: var(--font-size-small);
  font-family: inherit;
  background: white;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-warm);
}

.login-form button {
  width: 100%;
  padding: 1rem;
  background: var(--accent-warm);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: var(--font-size-small);
  cursor: pointer;
  font-family: inherit;
}

.login-form button:hover {
  opacity: 0.9;
}

.login-error {
  color: #c97c6c;
  margin-top: 1rem;
  min-height: 1.5em;
}

.login-help {
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.login-help a {
  color: var(--accent-warm);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  color: var(--accent-warm);
  margin-bottom: 1.5rem;
  text-align: center;
}

.content-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.content-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.content-option:hover {
  border-color: var(--accent-warm);
}

.content-option .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

#content-form {
  margin-top: 1rem;
}

#content-form textarea,
#content-form input[type="text"],
#content-form input[type="file"] {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--bg-accent);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

#content-form textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent-warm);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.close-modal {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-accent);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  margin-top: 1rem;
  cursor: pointer;
  font-family: inherit;
}

/* Audio Recorder */
#audio-recorder {
  text-align: center;
}

.record-btn {
  width: 100%;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 3px solid var(--accent-warm);
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.record-btn.recording {
  background: #ffecec;
  border-color: #c97c6c;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

#recording-status {
  margin: 1rem 0;
  color: var(--text-secondary);
}

#audio-preview {
  width: 100%;
  margin: 1rem 0;
}

/* On This Day */
.slide-onthisday .onthisday-display {
  max-width: 700px;
  text-align: center;
}

.otd-header {
  font-size: var(--font-size-large);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.otd-date {
  font-size: var(--font-size-huge);
  color: var(--accent-warm);
  margin-bottom: var(--spacing-medium);
}

.otd-events {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.otd-event {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  text-align: left;
}

.otd-event.german {
  border-left: 4px solid #d4a574;
}

.otd-year {
  font-size: var(--font-size-medium);
  font-weight: bold;
  color: var(--accent-warm);
  min-width: 60px;
}

.otd-text {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  line-height: 1.4;
}

/* Good News */
.slide-goodnews .goodnews-display {
  max-width: 600px;
  text-align: center;
}

.goodnews-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.goodnews-label {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-medium);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.goodnews-headline {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
  line-height: 1.3;
}

/* Music Player */
#music-player {
  position: absolute;
  bottom: var(--spacing-medium);
  left: var(--spacing-medium);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

#music-player:hover {
  opacity: 0.9;
}

.music-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn.playing {
  background: var(--accent-warm);
}

.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--bg-accent);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

#music-player:hover .volume-slider {
  opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-warm);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  #dashboard { padding: var(--spacing-medium); }
  .slide-photo img { max-height: 55vh; }
  .weather-grid { grid-template-columns: 1fr; }
  .content-options { grid-template-columns: 1fr; }
}

/* Tennis Widget */
.tennis-widget {
  position: fixed;
  top: var(--spacing-medium);
  left: var(--spacing-medium);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 180px;
  font-size: 0.85rem;
  z-index: 100;
  opacity: 0.8;
}

.tennis-widget:hover {
  opacity: 1;
}

.widget-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.tennis-season {
  font-size: 0.8rem;
  color: var(--accent-warm);
  margin-bottom: 0.25rem;
}

.tennis-live {
  font-size: 0.7rem;
  color: #e74c3c;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.tennis-match {
  font-size: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--bg-accent);
}

.tennis-match .score {
  font-weight: bold;
  color: var(--text-primary);
}

.tennis-message {
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

/* Webcam Slide */
.webcam-display {
  text-align: center;
  padding: 2rem;
}

.webcam-region {
  font-size: var(--font-size-huge);
  margin-bottom: 0.5rem;
}

.webcam-name {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.webcam-location {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
}

.webcam-time {
  font-size: var(--font-size-small);
  color: var(--text-light);
  margin: 1rem 0;
}

.webcam-description {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  margin: 1rem 0;
}

.webcam-link {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-warm);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: var(--font-size-medium);
  margin-top: 1rem;
}

/* Calendar Slide */
.calendar-display {
  text-align: center;
  padding: 2rem;
}

.calendar-season {
  font-size: var(--font-size-huge);
  margin-bottom: 1rem;
}

.calendar-date {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.calendar-occasions {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.calendar-occasions .occasion {
  font-size: var(--font-size-medium);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-accent);
}

.calendar-occasions .occasion:last-child {
  border-bottom: none;
}

/* Tennis Widget */
.tennis-widget {
  position: fixed;
  top: var(--spacing-medium);
  left: var(--spacing-medium);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 180px;
  font-size: 0.85rem;
  z-index: 100;
  opacity: 0.8;
}

.tennis-widget:hover { opacity: 1; }

.widget-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.tennis-season {
  font-size: 0.8rem;
  color: var(--accent-warm);
}

.tennis-live {
  font-size: 0.7rem;
  color: #e74c3c;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.tennis-match {
  font-size: 0.75rem;
  padding: 0.25rem 0;
}

.tennis-message {
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

/* Webcam Slide */
.webcam-display {
  text-align: center;
  padding: 2rem;
}

.webcam-region {
  font-size: var(--font-size-huge);
  margin-bottom: 0.5rem;
}

.webcam-name {
  font-size: var(--font-size-large);
  color: var(--text-primary);
}

.webcam-location, .webcam-time {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.webcam-description {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  margin: 1rem 0;
}

.webcam-link {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--accent-warm);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: var(--font-size-medium);
  margin-top: 1rem;
}

/* Calendar Slide */
.calendar-display {
  text-align: center;
  padding: 2rem;
}

.calendar-season {
  font-size: var(--font-size-huge);
  margin-bottom: 1rem;
}

.calendar-date {
  font-size: var(--font-size-large);
  color: var(--text-primary);
}

.calendar-occasions {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 500px;
  margin: 2rem auto 0;
}

.calendar-occasions .occasion {
  font-size: var(--font-size-medium);
  padding: 0.5rem 0;
}

/* ============== Zoom Mode ============== */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.zoom-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.zoom-content {
  background: var(--bg-primary);
  padding: 3rem 4rem;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.zoom-overlay.active .zoom-content {
  transform: scale(1);
}

.zoom-text {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.6;
  color: var(--text-primary);
}

.zoom-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  opacity: 0.7;
}

/* Zoomable text indicator */
.zoomable {
  cursor: zoom-in;
  position: relative;
}

.zoomable::after {
  content: '🔍';
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoomable:hover::after {
  opacity: 0.5;
}

/* ============== New Widget Slide Styles ============== */

/* Wikipedia */
.wikipedia-slide {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.wikipedia-slide h2 {
  font-size: var(--font-size-large);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wikipedia-thumbnail {
  float: right;
  max-width: 250px;
  margin: 0 0 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.wikipedia-extract {
  font-size: var(--font-size-medium);
  line-height: 1.7;
  color: var(--text-primary);
}

/* Trivia */
.trivia-slide {
  text-align: center;
  padding: 3rem;
}

.trivia-question {
  font-size: var(--font-size-large);
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.trivia-answer {
  font-size: var(--font-size-huge);
  color: var(--accent-warm);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.trivia-answer.revealed {
  opacity: 1;
  transform: translateY(0);
}

.trivia-reveal-btn {
  background: var(--accent-warm);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: var(--font-size-medium);
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.trivia-reveal-btn:hover {
  transform: scale(1.05);
}

/* German Word */
.german-word-slide {
  text-align: center;
  padding: 3rem;
}

.german-word {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.german-meaning {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  margin-bottom: 1.5rem;
}

.german-example {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-secondary);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  display: inline-block;
}

/* NASA APOD */
.nasa-slide {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.nasa-image {
  flex: 1;
  object-fit: cover;
  width: 100%;
  border-radius: 12px;
}

.nasa-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 3rem 2rem 2rem;
  color: white;
}

.nasa-title {
  font-size: var(--font-size-large);
  margin-bottom: 0.5rem;
}

.nasa-explanation {
  font-size: var(--font-size-small);
  opacity: 0.9;
  line-height: 1.5;
}

/* Bird of Day */
.bird-slide {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
}

.bird-image {
  flex: 1;
  max-width: 50%;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.bird-info {
  flex: 1;
  padding: 2rem;
}

.bird-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.bird-fact {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* National Parks */
.parks-slide {
  position: relative;
  height: 100%;
}

.parks-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parks-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 3rem 2rem 2rem;
  color: white;
}

.parks-name {
  font-size: var(--font-size-huge);
}

.parks-location {
  font-size: var(--font-size-medium);
  opacity: 0.9;
}

.parks-fact {
  font-size: var(--font-size-small);
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* Baby Animals */
.animal-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
}

.animal-image {
  max-width: 70%;
  max-height: 70vh;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.animal-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
  margin-top: 1.5rem;
}

/* Daily Poem */
.poem-slide {
  text-align: center;
  padding: 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.poem-title {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.poem-author {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.poem-text {
  font-size: var(--font-size-medium);
  line-height: 2;
  white-space: pre-line;
  color: var(--text-primary);
}

/* Prayer */
.prayer-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.prayer-icon {
  font-size: 4rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.prayer-text {
  font-size: var(--font-size-large);
  line-height: 1.8;
  max-width: 700px;
  color: var(--text-primary);
}

.prayer-source {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: 2rem;
  font-style: italic;
}

/* Gratitude */
.gratitude-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.gratitude-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.gratitude-text {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  font-style: italic;
}

.gratitude-from {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

/* Classic Art */
.art-slide {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
}

.art-image {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.art-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 2rem;
  color: white;
  text-align: center;
}

.art-title {
  font-size: var(--font-size-large);
}

.art-artist {
  font-size: var(--font-size-medium);
  opacity: 0.8;
}

.art-date {
  font-size: var(--font-size-small);
  opacity: 0.6;
}

/* This Day in Music */
.music-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.music-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.music-song {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.music-artist {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  margin: 0.5rem 0;
}

.music-year {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
}

/* Vintage Photos */
.vintage-slide {
  position: relative;
  height: 100%;
}

.vintage-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(20%);
}

.vintage-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 2rem;
  color: white;
}

.vintage-title {
  font-size: var(--font-size-large);
}

.vintage-description {
  font-size: var(--font-size-medium);
  opacity: 0.9;
}

/* Moon Phase */
.moon-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(to bottom, #0a1628, #1a2a48);
  color: white;
}

.moon-emoji {
  font-size: 10rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 50px rgba(255,255,200,0.5);
}

.moon-name {
  font-size: var(--font-size-huge);
}

.moon-description {
  font-size: var(--font-size-medium);
  opacity: 0.8;
  margin-top: 0.5rem;
}

.moon-date {
  font-size: var(--font-size-small);
  opacity: 0.6;
  margin-top: 1rem;
}

/* Sunrise/Sunset */
.sun-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(to bottom, #ff9966, #ff5e62, #3d1f5c);
  color: white;
}

.sun-location {
  font-size: var(--font-size-medium);
  opacity: 0.9;
  margin-bottom: 2rem;
}

.sun-times {
  display: flex;
  gap: 4rem;
  margin-bottom: 2rem;
}

.sun-time {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sun-time .emoji {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.sun-time .label {
  font-size: var(--font-size-small);
  opacity: 0.8;
}

.sun-time .time {
  font-size: var(--font-size-large);
  font-weight: bold;
}

.sun-daylength {
  font-size: var(--font-size-medium);
  opacity: 0.8;
}

/* Live Cam Embeds (Bird Feeder, Aquarium) */
.livecam-slide {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.livecam-frame {
  flex: 1;
  border: none;
  border-radius: 12px;
}

.livecam-info {
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.livecam-name {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
}

.livecam-location {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

/* Widget Admin Styles */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.widget-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s ease;
}

.widget-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.widget-card.disabled {
  opacity: 0.5;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: bold;
}

.widget-icon {
  font-size: 1.5rem;
}

.widget-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.widget-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.widget-toggle {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.widget-toggle.active {
  background: var(--accent-warm);
}

.widget-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.widget-toggle.active::after {
  transform: translateX(24px);
}

.weight-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.weight-control input {
  width: 60px;
  padding: 0.25rem;
  border: 1px solid var(--text-light);
  border-radius: 4px;
  text-align: center;
}

.category-section {
  margin-bottom: 2rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-warm);
}

/* ============== iOS Tablet Optimizations ============== */

/* Prevent text selection on touch */
.slide, .widget-card, .content-option {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Smooth touch feedback */
button, .zoomable, .content-option, .widget-toggle {
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* Prevent iOS zoom on double-tap */
button, input, select, textarea {
  touch-action: manipulation;
}

/* Larger touch targets for accessibility */
.widget-toggle {
  min-width: 48px;
  min-height: 48px;
}

.trivia-reveal-btn,
.webcam-link,
.close-modal {
  min-height: 48px;
  padding: 1rem 2rem;
}

/* Fullscreen PWA support */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Better image rendering on retina */
img {
  image-rendering: -webkit-optimize-contrast;
}

/* Prevent overscroll bounce */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Zoomable text - larger touch target */
.zoomable {
  padding: 0.5rem;
  margin: -0.5rem;
}

/* Slide transitions optimized for iOS */
.slide {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: opacity;
}

/* Loading state for images */
img.loading {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-primary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============== Older Safari Fallbacks ============== */

/* clamp() fallback */
@supports not (font-size: clamp(1rem, 2vw, 2rem)) {
  :root {
    --font-size-huge: 3rem;
    --font-size-large: 2rem;
    --font-size-medium: 1.5rem;
    --font-size-small: 1.1rem;
  }
}

/* gap fallback for flexbox */
@supports not (gap: 1rem) {
  .widget-grid > * {
    margin: 0.5rem;
  }
  .sun-times > * {
    margin: 0 2rem;
  }
}

/* Fallback gradients */
.moon-slide {
  background: #1a2a48; /* Fallback */
  background: linear-gradient(to bottom, #0a1628, #1a2a48);
}

.sun-slide {
  background: #ff5e62; /* Fallback */
  background: linear-gradient(to bottom, #ff9966, #ff5e62, #3d1f5c);
}

/* Safe area fallbacks */
@supports not (padding: env(safe-area-inset-top)) {
  body {
    padding-top: 20px;
  }
}

/* Aspect ratio fallback */
@supports not (aspect-ratio: 16/9) {
  .livecam-frame {
    height: 60vh;
  }
}

/* Philosophy Slide */
.philosophy-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.philosophy-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.philosophy-text {
  font-size: var(--font-size-large);
  line-height: 1.6;
  max-width: 800px;
  color: var(--text-primary);
  font-style: italic;
}

.philosophy-author {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-top: 1.5rem;
}

.philosophy-era {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Prayer tradition badge */
.prayer-tradition {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* World Proverbs Slide */
.proverb-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.proverb-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.proverb-text {
  font-size: var(--font-size-large);
  line-height: 1.6;
  max-width: 800px;
  color: var(--text-primary);
  font-style: italic;
}

.proverb-origin {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-top: 1.5rem;
}

/* Parables Slide */
.parable-slide {
  padding: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.parable-title {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parable-source {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.parable-story {
  font-size: var(--font-size-medium);
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.parable-moral {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border-left: 4px solid var(--accent-warm);
}

/* Vintage Products Slide */
.vintage-product-slide {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
  height: 100%;
}

.vintage-product-image {
  flex: 1;
  max-width: 45%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.vintage-product-info {
  flex: 1;
  padding: 1.5rem;
}

.vintage-product-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.vintage-product-era {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.vintage-product-description {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.vintage-product-memory {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.vintage-product-memory::before {
  content: '💭 ';
}

/* Defunct Brands Slide */
.brand-slide {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
  height: 100%;
}

.brand-image {
  flex: 1;
  max-width: 40%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 16px;
}

.brand-info {
  flex: 1;
  padding: 1.5rem;
}

.brand-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.brand-years {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.brand-description {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.brand-memory {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 768px) {
  .vintage-product-slide,
  .brand-slide,
  .bird-slide {
    flex-direction: column;
  }
  
  .vintage-product-image,
  .brand-image,
  .bird-image {
    max-width: 80%;
    max-height: 40vh;
  }
}

/* Recipe Slide */
.recipe-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.recipe-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.recipe-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.recipe-era {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.recipe-description {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.recipe-tip {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.recipe-tip::before {
  content: '👨‍🍳 ';
}

/* Joke Slide */
.joke-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.joke-setup {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.joke-punchline {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  font-weight: bold;
  max-width: 700px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.joke-punchline.revealed {
  opacity: 1;
  transform: translateY(0);
}

.joke-reveal-btn {
  background: var(--accent-warm);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: var(--font-size-medium);
  border-radius: 50px;
  cursor: pointer;
  margin-top: 1rem;
}

/* Classic TV Slide */
.tv-slide {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
  height: 100%;
}

.tv-image {
  flex: 1;
  max-width: 40%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.tv-info {
  flex: 1;
  padding: 1rem;
}

.tv-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.tv-years {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.tv-network {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.tv-description {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tv-memory {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
}

/* Movie Slide */
.movie-slide {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
  height: 100%;
}

.movie-poster {
  flex: 0 0 auto;
  max-width: 35%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.movie-info {
  flex: 1;
}

.movie-title {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.movie-year {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
}

.movie-stars {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.movie-quote {
  font-size: var(--font-size-large);
  font-style: italic;
  color: var(--text-primary);
  padding: 1rem 0;
  border-left: 4px solid var(--accent-warm);
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.movie-description {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
}

/* Song Lyrics Slide */
.lyrics-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.lyrics-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.lyrics-text {
  font-size: var(--font-size-large);
  line-height: 2;
  white-space: pre-line;
  color: var(--text-primary);
  font-style: italic;
  max-width: 700px;
}

.lyrics-title {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-top: 1.5rem;
}

.lyrics-artist {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

/* Space Milestone Slide */
.space-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(to bottom, #0a0a20, #1a1a40);
  color: white;
}

.space-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.space-event {
  font-size: var(--font-size-huge);
}

.space-date {
  font-size: var(--font-size-medium);
  opacity: 0.8;
  margin-bottom: 1rem;
}

.space-description {
  font-size: var(--font-size-medium);
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.space-impact {
  font-size: var(--font-size-medium);
  font-style: italic;
  opacity: 0.9;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
}

/* Garden Tips Slide */
.garden-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.garden-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.garden-tip {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  max-width: 700px;
  line-height: 1.6;
}

.garden-category {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-top: 1rem;
}

.garden-season {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Animal Facts Slide */
.animal-fact-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.animal-emoji {
  font-size: 6rem;
  margin-bottom: 1rem;
}

.animal-name {
  font-size: var(--font-size-large);
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.animal-fact {
  font-size: var(--font-size-large);
  color: var(--text-primary);
  max-width: 700px;
  line-height: 1.6;
}

.animal-extra {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  margin-top: 1rem;
  font-style: italic;
}

/* Book Quote Slide */
.book-quote-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.book-quote-text {
  font-size: var(--font-size-large);
  line-height: 1.8;
  max-width: 800px;
  color: var(--text-primary);
  font-style: italic;
}

.book-quote-text::before { content: '"'; }
.book-quote-text::after { content: '"'; }

.book-title {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-top: 1.5rem;
}

.book-author {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

/* Holiday Traditions Slide */
.holiday-slide {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.holiday-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.holiday-name {
  font-size: var(--font-size-huge);
  color: var(--text-primary);
}

.holiday-origin {
  font-size: var(--font-size-medium);
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.holiday-description {
  font-size: var(--font-size-medium);
  color: var(--text-primary);
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.holiday-tradition {
  font-size: var(--font-size-medium);
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  max-width: 600px;
}

/* ============== Reactions System ============== */

/* Reaction trigger button */
.reaction-trigger {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reaction-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.reaction-trigger:active {
  transform: scale(0.95);
}

/* Reaction panel */
.reaction-panel {
  position: fixed;
  bottom: 9rem;
  right: 2rem;
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 101;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s ease;
}

.reaction-panel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.reaction-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.reaction-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.reaction-close-btn:hover {
  background: var(--bg-accent);
  color: var(--text-primary);
}

.reaction-emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.reaction-emoji-btn {
  width: 56px;
  height: 56px;
  border: 2px solid transparent;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.reaction-emoji-btn:hover {
  background: var(--bg-accent);
  transform: scale(1.15);
}

.reaction-emoji-btn:active {
  transform: scale(0.9);
}

.reaction-emoji-btn.selected {
  border-color: var(--accent-warm);
  background: var(--bg-accent);
  box-shadow: 0 0 0 2px var(--accent-warm);
}

/* Reaction confirmation animation */
.reaction-confirmation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 6rem;
  opacity: 0;
  z-index: 200;
  pointer-events: none;
  transition: all 0.5s ease;
}

.reaction-confirmation.animate {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.5);
}

/* Reaction feed */
.reaction-feed {
  position: fixed;
  top: 5rem;
  right: 2rem;
  width: 280px;
  max-height: 300px;
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 50;
  overflow: hidden;
}

.feed-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.feed-items {
  max-height: 230px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-secondary);
  font-size: 0.85rem;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-emoji {
  font-size: 1.2rem;
}

.feed-user {
  font-weight: bold;
  color: var(--text-primary);
}

.feed-action {
  color: var(--text-light);
}

.feed-widget {
  color: var(--accent-warm);
}

.feed-time {
  color: var(--text-light);
  font-size: 0.75rem;
  margin-left: auto;
}

.feed-empty {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .reaction-feed {
    top: auto;
    bottom: 10rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-height: 200px;
  }
  
  .reaction-trigger {
    bottom: 5rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .reaction-panel {
    right: 1rem;
    left: 1rem;
    bottom: 7rem;
  }
  
  .reaction-emoji-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .reaction-emoji-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

/* Hide feed on smaller screens by default, show on tap */
@media (max-width: 600px) {
  .reaction-feed {
    display: none;
  }
}

/* ============== History Browser ============== */

.history-trigger {
  position: fixed;
  bottom: 6rem;
  left: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 100;
  transition: transform 0.2s ease;
}

.history-trigger:hover {
  transform: scale(1.1);
}

.history-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100%;
  background: white;
  box-shadow: 4px 0 30px rgba(0,0,0,0.2);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.history-panel.visible {
  transform: translateX(0);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.history-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.history-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.history-dates {
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--bg-accent);
  max-height: 200px;
  overflow-y: auto;
}

.history-date-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--bg-accent);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
}

.history-date-btn:hover {
  border-color: var(--accent-warm);
}

.history-date-btn.active {
  border-color: var(--accent-warm);
  background: var(--bg-secondary);
}

.history-date-btn.today {
  border-color: var(--accent-warm);
}

.history-date-btn .date-day {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.history-date-btn .date-month {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-primary);
}

.history-date-btn .date-count {
  font-size: 0.7rem;
  color: var(--text-light);
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.history-date-header {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.history-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.history-item:hover {
  background: var(--bg-accent);
}

.history-item-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-type {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-warm);
  font-weight: bold;
}

.history-item-preview {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

/* Mobile */
@media (max-width: 768px) {
  .history-panel {
    width: 100%;
  }
  
  .history-trigger {
    bottom: 5rem;
    left: 1rem;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}


/* ============== Grid View Mode ============== */

#grid-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
}

#grid-container.active {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
}

.grid-widget {
  background: var(--bg-secondary);
  border-radius: 1rem;
  padding: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
}

.grid-widget:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.grid-widget:active {
  transform: scale(0.98);
}

.grid-widget .widget-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.grid-widget .widget-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.grid-widget .widget-content {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
  max-height: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-widget .widget-content img {
  max-width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Widget type specific grid styles */
.grid-widget.type-classic-art .widget-content img,
.grid-widget.type-nasa-apod .widget-content img,
.grid-widget.type-vintage-photos .widget-content img {
  max-height: 150px;
}

.grid-widget.type-affirmation .widget-content,
.grid-widget.type-philosophy .widget-content,
.grid-widget.type-gratitude .widget-content {
  font-style: italic;
  font-size: 1.1rem;
}

.grid-widget.type-weather .widget-content {
  font-size: 1.5rem;
}

.grid-widget.type-this-day-music .widget-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.grid-widget .music-song {
  font-weight: 600;
  font-size: 1.1rem;
}

.grid-widget .music-artist {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* View Mode Toggle */
#view-mode-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.5rem;
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.view-mode-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.view-mode-btn.active {
  background: var(--accent-warm);
  color: white;
}

.view-mode-btn:hover:not(.active) {
  background: var(--bg-accent);
}

/* Mobile Grid - scrollable with variable heights */
@media (max-width: 768px) {
  #grid-container.active {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: minmax(150px, auto);
    overflow-y: auto;
    padding-bottom: 5rem;
  }
  
  .grid-widget {
    min-height: 120px;
  }
}

@media (max-width: 480px) {
  #grid-container.active {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .grid-widget {
    min-height: 100px;
    padding: 0.75rem;
  }
}

/* Family Weather Widget */

/* Widget Modal - Full view when tapped */
.widget-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.widget-modal.visible {
  opacity: 1;
}

.widget-modal-content {
  background: var(--bg-primary);
  border-radius: 1.5rem;
  max-width: 90%;
  max-height: 85%;
  overflow: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.widget-modal.visible .widget-modal-content {
  transform: scale(1);
}

.widget-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
}

.widget-modal-close:hover {
  background: var(--bg-accent);
}

.widget-modal-body {
  padding: 2rem;
}

/* Full widget styles */
.full-widget {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.full-widget img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.full-widget h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.full-widget .artist,
.full-widget .author,
.full-widget .era,
.full-widget .year {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.full-widget .description,
.full-widget .memory,
.full-widget .explanation {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-top: 1rem;
}

.full-widget .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.full-widget.quote .text,
.full-widget.poem .text {
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.full-widget.joke .setup {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.full-widget.joke .punchline {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-warm);
}

.full-widget.trivia .question {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.full-widget.trivia .answer {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-warm);
}

.full-widget.german h2 {
  font-size: 2rem;
}

.full-widget.german .meaning {
  font-size: 1.2rem;
  color: var(--text-primary);
}

.full-widget.german .example {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.grid-widget.type-family-weather .family-weather-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.grid-widget .weather-loc {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--bg-accent);
  border-radius: 0.5rem;
  min-width: 60px;
}

.grid-widget .loc-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.grid-widget .loc-temp {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}



/* Webcam widget - full bleed in grid */
.grid-widget .webcam-widget {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: -1rem; /* Counteract parent padding */
  overflow: hidden;
  border-radius: 1rem;
}

.grid-widget .webcam-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none !important;
}

.grid-widget .webcam-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
}

.grid-widget .webcam-region {
  font-size: 0.8rem;
  opacity: 0.9;
}

.grid-widget .webcam-name {
  font-size: 1rem;
  font-weight: 600;
}

/* Make webcam widgets span more space if possible */
.grid-widget.type-webcam,
.grid-widget.type-webcams,
.grid-widget.type-aquarium-cam,
.grid-widget.type-bird-feeder-cam {
  padding: 0;
  overflow: hidden;
}

.grid-widget.type-webcam .widget-content,
.grid-widget.type-webcams .widget-content,
.grid-widget.type-aquarium-cam .widget-content,
.grid-widget.type-bird-feeder-cam .widget-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
}


/* Clickable reaction feed items */
.feed-item.clickable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.feed-item.clickable:hover {
  background: var(--bg-accent);
  border-radius: 0.5rem;
}

.feed-content {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Reaction toast notification */
.reaction-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.reaction-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-emoji {
  font-size: 1.5rem;
}

.toast-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Reaction content modal */
.reaction-content-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reaction-content-modal.visible {
  opacity: 1;
}

.reaction-content-inner {
  background: var(--bg-primary);
  border-radius: 1.5rem;
  max-width: 90%;
  max-height: 80%;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.reaction-content-modal.visible .reaction-content-inner {
  transform: scale(1);
}

.reaction-content-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--bg-accent);
  font-size: 1rem;
  color: var(--text-secondary);
}

.reaction-content-emoji {
  font-size: 1.5rem;
}

.reaction-content-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reaction-content-close:hover {
  background: var(--bg-accent);
}

.reaction-content-body {
  padding: 1.5rem;
}

/* Content preview styles */
.preview-art,
.preview-nostalgia,
.preview-generic {
  text-align: center;
}

.preview-art img,
.preview-nostalgia img,
.preview-generic img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.preview-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.preview-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.preview-description {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.preview-quote,
.preview-poem {
  text-align: center;
  padding: 1rem;
}

.preview-quote .preview-text,
.preview-poem .preview-text {
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.preview-author {
  font-size: 1rem;
  color: var(--text-secondary);
}

.preview-joke {
  text-align: center;
  padding: 1rem;
}

.preview-setup {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.preview-punchline {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-warm);
}

.preview-music {
  text-align: center;
}

.preview-music .preview-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.preview-song {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.preview-artist {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Nostalgia Widgets (Vintage Products & Defunct Brands) */
.grid-widget.type-vintage-products .widget-content,
.grid-widget.type-defunct-brands .widget-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.grid-widget.type-vintage-products img,
.grid-widget.type-defunct-brands img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 0.5rem;
}

.grid-widget .nostalgia-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.grid-widget .nostalgia-era {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

  background: var(--bg-accent);
}

/* Music Player Enhanced Styles */
#music-player {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 200;
}

.music-btn {
  width: 40px;

/* ============== Favorites Panel ============== */

.favorites-trigger {
  position: fixed;
  bottom: 1rem;
  right: 6rem;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--accent-warm);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 200;
  transition: transform 0.2s ease;
}

.favorites-trigger:hover {
  transform: scale(1.1);
}

.favorites-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorites-panel.visible {
  opacity: 1;
  visibility: visible;
}

.favorites-panel > div:first-child {
  background: var(--bg-primary);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.favorites-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.favorites-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.favorites-close:hover {
  background: var(--bg-accent);
  color: var(--text-primary);
}

.favorites-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--bg-accent);
}

.favorites-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.favorites-tab:hover {
  background: var(--bg-accent);
}

.favorites-tab.active {
  background: var(--accent-warm);
  color: white;
}

.favorites-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.favorites-loading,
.favorites-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.favorites-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.favorites-empty .empty-text {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.favorites-empty .empty-hint {
  font-size: 0.9rem;
  opacity: 0.7;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.favorite-card {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.favorite-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.favorite-emoji {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.5rem;
  background: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1;
}

.favorite-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.favorite-card:not(:has(.favorite-image)) {
  padding-top: 3rem;
}

.favorite-info {
  padding: 0.75rem 1rem;
}

.favorite-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 640px) {
  .favorites-trigger {
    right: 4.5rem;
    width: 44px;
    height: 44px;
  }
  
  .favorites-panel > div:first-child {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .favorites-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

  height: 40px;
  border: none;
  background: var(--accent-warm);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.music-btn:hover {
  transform: scale(1.1);
}

.music-btn.playing {
  background: oklch(55% 0.15 150);
  animation: pulse 2s ease-in-out infinite;
}

.music-next {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  background: var(--bg-accent);
  color: var(--text-primary);
}

#music-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--bg-accent);
  border-radius: 2px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-warm);
  border-radius: 50%;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 160, 100, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(200, 160, 100, 0); }
}

/* Grid view hides slideshow elements */
.grid-mode #content-container,
.grid-mode #progress-bar {
  display: none;
}

.grid-mode #grid-container {
  display: grid;
}

/* Tablet: 2x3 grid */
@media (max-width: 1024px) {
  #grid-container.active {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
}

/* Mobile: vertical scroll, single column */
@media (max-width: 640px) {
  #grid-container.active {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
    max-height: 100%;
    gap: 0.75rem;
  }
  
  .grid-widget {
    min-height: 150px;
  }
  
  #music-player {
    flex-wrap: wrap;
    max-width: 200px;
  }
  
  #music-info {
    width: 100%;
    text-align: center;
  }
}
