* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #FAF6F0;
  --text-color: #8A8FA8;
  --accent-color: #388697;
  --blob-color: #5BA3B3;
  --particle-color: #388697;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  position: relative;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Landing Screen */
.landing-content {
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
}

.logo-image {
  max-width: 300px;
  width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 300;
  margin-bottom: 1rem;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 3rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.6;
}

.time-picker {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.time-btn {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  min-width: 80px;
}

.time-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

.time-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.start-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 1rem 3rem;
  border-radius: 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.start-btn:active {
  transform: translateY(0);
}

.privacy-note {
  font-size: 0.875rem;
  opacity: 1;
  color: var(--text-color);
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  display: flex;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 0;
  align-items: center;
}

.footer-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.875rem;
  opacity: 1;
  transition: opacity 0.2s ease;
  border-bottom: 1px solid transparent;
}

.footer-separator {
  color: var(--text-color);
  opacity: 1;
  margin: 0 0.5rem;
  font-size: 0.875rem;
}

.footer-link:hover {
  opacity: 1;
  border-bottom-color: var(--accent-color);
}

/* Session Screen */
#session-screen {
  flex-direction: column;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.session-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem 2rem;
}

.session-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.stop-session-btn {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 1rem;
  flex-shrink: 0;
}

.stop-session-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

.stop-session-btn:active {
  transform: translateY(0);
}

.blob-container {
  width: 200px;
  height: 200px;
  margin-bottom: 3rem;
  position: relative;
  flex-shrink: 0;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: white;
  opacity: 0.9;
  font-weight: 300;
  pointer-events: none;
  z-index: 3;
}

#blob-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.input-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.text-input {
  flex: 1;
  max-width: 400px;
}

.input-hint {
  font-size: 1rem;
  color: var(--text-color);
  opacity: 0.9;
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  font-weight: 400;
}

.send-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.7;
}

.send-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.send-btn:active {
  transform: translateY(0);
}

/* Timer End Overlay */
.timer-end-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(250, 246, 240, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.timer-end-content {
  text-align: center;
  padding: 2rem;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-end-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
}

.timer-end-message {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  color: var(--text-color);
  line-height: 1.6;
}

.timer-end-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-end-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timer-end-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.timer-end-btn:active {
  transform: translateY(0);
}

.text-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent-color);
  color: var(--text-color);
  font-size: 1.25rem;
  padding: 0.75rem 0;
  font-family: inherit;
  text-align: left;
  outline: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.text-input:focus {
  opacity: 1;
}

.text-input::placeholder {
  color: var(--text-color);
  opacity: 0.4;
}

/* End Screen */
.end-content {
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.end-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.end-message {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 3rem;
  color: var(--text-color);
  line-height: 1.6;
  opacity: 0.9;
}

.restart-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 1rem 3rem;
  border-radius: 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.restart-btn:active {
  transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .landing-content,
  .end-content {
    padding: 1.5rem;
  }

  .logo-image {
    max-width: 250px;
    margin-bottom: 1rem;
  }

  .time-picker {
    gap: 0.75rem;
  }

  .time-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    min-width: 70px;
  }

  .blob-container {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
  }

  .text-input {
    font-size: 1.1rem;
  }

  .session-logo {
    max-width: 180px;
  }

  .stop-session-btn {
    padding: 0.4rem 1.25rem;
    font-size: 0.85rem;
  }

  .input-container {
    flex-direction: column;
    max-width: 100%;
  }

  .text-input {
    max-width: 100%;
    width: 100%;
  }

  .input-hint {
    font-size: 0.9rem;
  }

  .timer-end-logo {
    max-width: 150px;
  }

  .timer-end-buttons {
    flex-direction: column;
  }

  .timer-end-btn {
    width: 100%;
    max-width: 300px;
  }

  .footer {
    gap: 1rem;
    font-size: 0.8rem;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-color);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
}

.modal-content h2 {
  color: var(--text-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  padding-right: 2rem;
}

.modal-content p {
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  opacity: 1;
}

.modal-content a {
  color: var(--accent-color);
  text-decoration: none;
}

.modal-content a:hover {
  text-decoration: underline;
}

.modal-content ol {
  margin-left: 1.5rem;
  margin-top: 1rem;
}

.modal-content li {
  margin-bottom: 0.5rem;
  color: var(--text-color);
  opacity: 0.9;
}

.install-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .screen {
    transition: none;
  }

  .time-btn,
  .start-btn,
  .restart-btn,
  .send-btn {
    transition: none;
  }

  .modal {
    transition: none;
  }

  .modal-content {
    transition: none;
  }
}
