/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Duolingo-inspired dark palette */
  --bg-primary: #131f24;
  --bg-secondary: #1a2b33;
  --bg-card: #1f3640;
  --bg-elevated: #253d49;

  --green: #58cc02;
  --green-dark: #46a302;
  --green-light: #89e219;
  --yellow: #ffc800;
  --yellow-dark: #e5b400;
  --orange: #ff9600;
  --red: #ff4b4b;
  --blue: #49c0f8;
  --purple: #ce82ff;

  --text-primary: #ffffff;
  --text-secondary: #afafbf;
  --text-muted: #6b7a84;

  --border: #2a4150;
  --border-light: #35536a;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);

  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#screen-container {
  flex: 1;
  padding: 20px 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* Utility */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Typography */
h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Screen transitions */
.screen-enter {
  animation: screenIn 0.3s ease forwards;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
