/* ============================================================
   Zgraja Radzi - PWA Game Stylesheet
   Mobile-first, child-friendly design for ages 6-12
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------- */

:root {
  /* Inherited from main site */
  --gold: #c8a45c;
  --gold-light: #f5e6c8;
  --gold-dark: #8b6f3a;
  --green: #5a7a52;
  --green-light: #e8f0e4;
  --green-dark: #3d5436;
  --cream: #fdf8f0;
  --cream-dark: #f0e8d8;
  --brown: #6b4c3b;
  --brown-light: #8b6b56;
  --text: #2c2416;
  --text-soft: #5c4f3d;
  --text-muted: #8a7d6b;
  --white: #ffffff;
  --shadow-soft: 0 4px 20px rgba(44, 36, 22, 0.08);
  --shadow-medium: 0 8px 40px rgba(44, 36, 22, 0.12);
  --shadow-strong: 0 16px 60px rgba(44, 36, 22, 0.16);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Game-specific character colors */
  --zagaj-color: #e8944a;
  --bajzel-color: #e85d8a;
  --lean-color: #4a90d9;
  --data-color: #9bb5d9;
  --kaizen-color: #d4a44a;
  --stoik-color: #4a5568;
  --edek-color: #e88a4a;

  /* Card sizes */
  --card-width: min(90vw, 400px);
  --card-padding: 24px;
}


/* ----------------------------------------------------------
   2. Base & Reset
   ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--cream);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  line-height: 1.3;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ----------------------------------------------------------
   3. App Container
   ---------------------------------------------------------- */

.app {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  background-color: var(--cream);
}

.screen-container {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}


/* ----------------------------------------------------------
   4. Screen Layout
   ---------------------------------------------------------- */

.screen {
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


/* ----------------------------------------------------------
   5. Top Bar
   ---------------------------------------------------------- */

.top-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--transition);
}

.back-btn:hover {
  background-color: var(--cream-dark);
}

.top-bar-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--brown);
  flex: 1;
  text-align: center;
}

.top-bar-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 44px;
  text-align: right;
}


/* ----------------------------------------------------------
   6. Progress Bar (Character Avatars)
   ---------------------------------------------------------- */

.progress-bar {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  background-color: var(--cream);
  position: sticky;
  top: 68px;
  z-index: 9;
}

.progress-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid transparent;
  filter: grayscale(100%);
  opacity: 0.4;
  transition: all var(--transition);
  flex-shrink: 0;
}

.progress-avatar.completed {
  filter: none;
  opacity: 1;
  border-color: var(--gold);
}

.progress-avatar.active {
  filter: none;
  opacity: 1;
  transform: scale(1.25);
  animation: gentle-bounce 2s ease-in-out infinite;
}

.progress-avatar.active[data-character="zagaj"] {
  border-color: var(--zagaj-color);
}

.progress-avatar.active[data-character="bajzel"] {
  border-color: var(--bajzel-color);
}

.progress-avatar.active[data-character="lean"] {
  border-color: var(--lean-color);
}

.progress-avatar.active[data-character="data"] {
  border-color: var(--data-color);
}

.progress-avatar.active[data-character="kaizen"] {
  border-color: var(--kaizen-color);
}

.progress-avatar.active[data-character="stoik"] {
  border-color: var(--stoik-color);
}

.progress-avatar.active[data-character="edek"] {
  border-color: var(--edek-color);
}

.stoik-placeholder {
  border-style: dashed;
  border-color: var(--stoik-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--stoik-color);
  background-color: var(--cream-dark);
}

.progress-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes gentle-bounce {
  0%, 100% {
    transform: scale(1.25) translateY(0);
  }
  50% {
    transform: scale(1.25) translateY(-4px);
  }
}


/* ----------------------------------------------------------
   7. Cards & Buttons
   ---------------------------------------------------------- */

/* --- Game Card --- */

.game-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.game-card.selected {
  border-color: var(--green);
  box-shadow: var(--shadow-medium);
}

.game-card.absurd {
  border-style: dashed;
  border-color: var(--bajzel-color);
}

.game-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Option Card --- */

.option-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 48px;
  transition: transform 100ms ease, border-color var(--transition), box-shadow var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.option-card:active {
  transform: scale(0.97);
}

.option-card.selected {
  border-color: var(--green);
  box-shadow: var(--shadow-medium);
}

.option-card.absurd {
  border-style: dashed;
  border-color: var(--bajzel-color);
}

.option-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Buttons --- */

.btn {
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  min-height: 48px;
  min-width: 48px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 100ms ease, opacity var(--transition), background-color var(--transition);
  -webkit-user-select: none;
  user-select: none;
  line-height: 1.2;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--green);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--green-dark);
}

.btn-ghost {
  background-color: transparent;
  border: 2px solid var(--gold-light);
  color: var(--brown);
}

.btn-ghost:hover {
  background-color: var(--gold-light);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 100px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-free {
  background-color: var(--green-light);
  color: var(--green-dark);
}

.badge-absurd {
  background-color: rgba(232, 93, 138, 0.15);
  color: var(--bajzel-color);
}


/* ----------------------------------------------------------
   8. Character Header & Speech Bubble
   ---------------------------------------------------------- */

.character-header {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.character-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  flex-shrink: 0;
}

.character-avatar[data-character="zagaj"] {
  border-color: var(--zagaj-color);
}

.character-avatar[data-character="bajzel"] {
  border-color: var(--bajzel-color);
}

.character-avatar[data-character="lean"] {
  border-color: var(--lean-color);
}

.character-avatar[data-character="data"] {
  border-color: var(--data-color);
}

.character-avatar[data-character="kaizen"] {
  border-color: var(--kaizen-color);
}

.character-avatar[data-character="stoik"] {
  border-color: var(--stoik-color);
}

.character-avatar[data-character="edek"] {
  border-color: var(--edek-color);
}

.character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 2px;
}

.character-intro {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: var(--text-soft);
  line-height: 1.3;
}

/* Speech Bubble */

.speech-bubble {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  margin-left: 12px;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid var(--white);
  filter: drop-shadow(-2px 0 2px rgba(44, 36, 22, 0.04));
}


/* ----------------------------------------------------------
   9. Home Screen
   ---------------------------------------------------------- */

.home-screen {
  text-align: center;
  justify-content: center;
  gap: 16px;
  align-items: center;
}

.home-title {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 2.5rem;
  color: var(--brown);
  line-height: 1.2;
}

.home-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.home-characters {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.home-character-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  filter: grayscale(100%);
  opacity: 0.5;
  transition: filter var(--transition), opacity var(--transition);
}

.home-character-thumb.met {
  filter: none;
  opacity: 1;
}

.home-character-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-quote {
  font-family: 'Caveat', cursive;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 24px;
  line-height: 1.4;
}


/* ----------------------------------------------------------
   10. Deck Screen
   ---------------------------------------------------------- */

.deck-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.deck-card {
  aspect-ratio: 3 / 4;
  background-color: var(--cream);
  border-radius: var(--radius);
  border: 2px solid var(--gold-light);
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: transform 100ms ease, border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.deck-card:active {
  transform: scale(0.97);
}

.deck-card-number {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--green);
}

.deck-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--brown);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.deck-card.completed {
  border-color: var(--gold);
}

.deck-card.completed::after {
  content: '\2713';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.deck-card.locked {
  opacity: 0.5;
  cursor: default;
}

.deck-card.locked::before {
  content: '\1F512';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  z-index: 2;
}

.deck-card.free .badge-free {
  position: absolute;
  top: 8px;
  right: 8px;
}


/* ----------------------------------------------------------
   11. Lean Results
   ---------------------------------------------------------- */

.lean-result {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid var(--lean-color);
}

.lean-emoji {
  font-size: 2rem;
  float: right;
  line-height: 1;
}

.lean-note {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--lean-color);
  text-align: center;
  margin-top: 16px;
  clear: both;
}


/* ----------------------------------------------------------
   12. Data Report
   ---------------------------------------------------------- */

.data-report {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.data-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--cream-dark);
}

.data-row:last-child {
  border-bottom: none;
}

.data-icon {
  font-size: 1.5rem;
  width: 32px;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.data-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 80px;
  flex-shrink: 0;
}

.data-value {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.data-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--data-color);
  margin-top: 20px;
  text-align: center;
  line-height: 1.5;
}


/* ----------------------------------------------------------
   13. Kaizen Rules
   ---------------------------------------------------------- */

.rule-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.rule-card:active {
  transform: scale(0.97);
}

.rule-icon {
  font-size: 1.5rem;
  width: 40px;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.rule-text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.rule-card.selected {
  border-color: var(--kaizen-color);
  background-color: rgba(245, 230, 200, 0.3);
  box-shadow: 0 0 20px rgba(212, 164, 74, 0.2);
}


/* ----------------------------------------------------------
   14. Stoik Screen
   ---------------------------------------------------------- */

.stoik-screen {
  text-align: center;
  justify-content: center;
  min-height: 80vh;
  align-items: center;
}

.stoik-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  border: 3px solid var(--stoik-color);
}

.stoik-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stoik-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.8;
  max-width: 320px;
  margin: 0 auto;
}

.stoik-word {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stoik-word.visible {
  opacity: 1;
}

/* Breathing Circle */

.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: rgba(74, 85, 104, 0.2);
  margin: 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 4s ease-in-out, height 4s ease-in-out;
}

.breathing-circle.inhale {
  width: 160px;
  height: 160px;
}

.breathing-circle.exhale {
  width: 80px;
  height: 80px;
}

.breathing-label {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--stoik-color);
}


/* ----------------------------------------------------------
   15. Ending / Discovery Card
   ---------------------------------------------------------- */

.discovery-card {
  perspective: 1000px;
  margin: 20px auto;
  max-width: 340px;
  width: 100%;
}

.discovery-card-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.discovery-card.flipped .discovery-card-inner {
  transform: rotateY(180deg);
}

.discovery-front,
.discovery-back {
  position: absolute;
  width: 100%;
  min-height: 280px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.discovery-front {
  background-color: var(--gold-light);
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold-dark);
  cursor: pointer;
}

.discovery-front-number {
  font-size: 1rem;
  color: var(--gold);
  margin-top: 8px;
}

.discovery-back {
  background-color: var(--white);
  border: 3px solid var(--gold);
  padding: 24px;
  transform: rotateY(180deg);
  justify-content: flex-start;
  align-items: stretch;
}

.discovery-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--brown);
  margin-bottom: 16px;
  line-height: 1.5;
  text-align: center;
}

.discovery-stoik {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.discovery-edek {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
}

.discovery-rule {
  border-top: 1px solid var(--cream-dark);
  padding-top: 12px;
  margin-top: 12px;
}

.end-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.end-buttons .btn {
  flex: 1;
}


/* ----------------------------------------------------------
   16. Collection Screen
   ---------------------------------------------------------- */

.collection-progress {
  height: 8px;
  background-color: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px;
}

.collection-progress-fill {
  height: 100%;
  background-color: var(--gold);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px;
}

.collection-card {
  aspect-ratio: 3 / 4;
  background-color: var(--cream);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color var(--transition), background-color var(--transition);
}

.collection-card.completed {
  border: 2px solid var(--gold);
  background-color: var(--white);
}

.collection-card.locked {
  opacity: 0.4;
}

.collection-rules {
  padding: 16px;
  margin-top: 24px;
}

.collection-rule-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--cream-dark);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.4;
}

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

.collection-rule-number {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--gold-dark);
  min-width: 24px;
}

.collection-rule-text {
  flex: 1;
  color: var(--text);
}

.collection-rule-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}


/* ----------------------------------------------------------
   17. Unlock Modal
   ---------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background-color: var(--cream);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 340px;
  width: 90%;
  box-shadow: var(--shadow-strong);
  text-align: center;
  animation: modal-enter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brown);
}

.modal-text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-soft);
  margin: 12px 0;
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--gold-light);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  text-align: center;
  margin: 12px 0;
  background-color: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.modal-input:focus {
  border-color: var(--gold);
}

.modal-error {
  color: #d9534f;
  font-size: 0.85rem;
  margin-top: 4px;
  min-height: 1.2em;
}


/* ----------------------------------------------------------
   18. Utility Classes
   ---------------------------------------------------------- */

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

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}


/* ----------------------------------------------------------
   19. Accessibility
   ---------------------------------------------------------- */

/* Focus visible ring */
*:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

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

  .discovery-card-inner {
    transition: none;
  }

  .breathing-circle {
    transition: none;
  }

  .stoik-word {
    transition: none;
    opacity: 1;
  }
}


/* ----------------------------------------------------------
   20. Responsive Breakpoints
   ---------------------------------------------------------- */

/* Tablet: 768px+ */
@media (min-width: 768px) {
  .deck-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .progress-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  :root {
    --card-padding: 32px;
  }

  .game-card {
    padding: var(--card-padding);
  }

  .option-card {
    padding: var(--card-padding);
  }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  .app {
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-strong);
    border-radius: 24px;
    overflow: hidden;
    min-height: 100vh;
  }

  body {
    background-color: var(--cream-dark);
  }
}
