/* memoryGames — calm, dementia-friendly styling */
/* Design goals: large type, high contrast, soft colors, big touch targets,
   no flashing, gentle motion, no timers by default, generous spacing. */

:root {
  --bg: #f5f1e8;
  --bg-card: #ffffff;
  --primary: #4a90a4;
  --primary-dark: #356b7d;
  --accent: #e8a87c;
  --accent-dark: #c97a4a;
  --success: #7fb069;
  --success-dark: #5d8a4f;
  --text: #2c3e50;
  --text-soft: #5a6c7d;
  --border: #d8d2c4;
  --shadow: 0 4px 14px rgba(44, 62, 80, 0.08);
  --shadow-lift: 0 8px 24px rgba(44, 62, 80, 0.14);
  --radius: 18px;
  --radius-sm: 10px;
}

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

html {
  font-size: 18px;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header */
.site-header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.site-header h1 {
  font-size: 2.6rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.site-header p {
  font-size: 1.2rem;
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 auto;
}

/* Difficulty section header */
.difficulty-section {
  margin-top: 2.5rem;
}
.difficulty-section:first-of-type {
  margin-top: 1rem;
}

.difficulty-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.difficulty-header h2 {
  font-size: 1.6rem;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.difficulty-header .pill {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.difficulty-header .pill.easy { background: var(--success); }
.difficulty-header .pill.medium { background: var(--accent); }
.difficulty-header .pill.hard { background: #a07fb5; }

.difficulty-header p {
  color: var(--text-soft);
  flex-basis: 100%;
  font-size: 1rem;
  margin: 0;
}

/* Game grid on home page */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.game-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow);
  min-height: 220px;
}

.game-card:hover,
.game-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--primary);
  outline: none;
}

.game-card .icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}

.game-card h2 {
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.game-card p {
  color: var(--text-soft);
  font-size: 1rem;
}

/* Game page header */
.game-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--primary-dark);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 1.05rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.back-link:hover,
.back-link:focus {
  background: #ede8db;
  border-color: var(--primary);
  outline: none;
}

.game-title {
  font-size: 1.8rem;
  color: var(--primary-dark);
  flex: 1;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
  min-width: 120px;
}

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

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

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: var(--success-dark); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--primary-dark);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #ede8db;
  border-color: var(--primary);
}

.btn-large {
  font-size: 1.25rem;
  padding: 1.1rem 2rem;
}

/* Settings panel */
.settings {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.settings-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.5rem;
}

.option-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  min-height: 44px;
}

.chip:hover { border-color: var(--primary); }
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Game stage / shared containers */
.stage {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  min-height: 400px;
  box-shadow: var(--shadow);
}

.message {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  min-height: 2rem;
}

.message.success { color: var(--success-dark); }
.message.muted { color: var(--text-soft); font-size: 1.15rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ----------- Picture Match ----------- */
.card-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem auto;
  justify-content: center;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, 130px); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 130px); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 130px); }

@media (min-width: 600px) {
  .card-grid.cols-2 { grid-template-columns: repeat(2, 160px); }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 160px); }
  .card-grid.cols-4 { grid-template-columns: repeat(4, 160px); }
}

.card {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: 3px solid var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  user-select: none;
  transition: transform 0.25s ease, background 0.25s ease;
  position: relative;
}

.card.flipped {
  background: var(--bg-card);
  border-color: var(--border);
}

.card.matched {
  background: #e6f3dd;
  border-color: var(--success);
  cursor: default;
}

.card:not(.flipped):not(.matched):hover {
  transform: scale(1.03);
}

.card .face {
  opacity: 0;
  transition: opacity 0.2s;
}
.card.flipped .face,
.card.matched .face {
  opacity: 1;
}

/* ----------- What's Missing ----------- */
.item-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 2rem 0;
  min-height: 140px;
  align-items: center;
}

.item {
  width: 120px;
  height: 120px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
}

.item.choice {
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.item.choice:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.item.choice.correct {
  background: #e6f3dd;
  border-color: var(--success);
}
.item.choice.wrong {
  background: #fde9e0;
  border-color: var(--accent-dark);
}

.item-label {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--text-soft);
}

.item-with-label {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----------- Category Sorting ----------- */
.sort-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 720px) {
  .sort-area { grid-template-columns: 1fr 1fr; }
}

.tray {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 130px;
}

.tray h3 {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
  text-align: center;
}

.tray .tray-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 600px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
}

.category {
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-dark);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.2s, transform 0.1s;
}
.category:hover { border-color: var(--primary); }
.category.target { border-color: var(--accent); background: #fff7f0; }
.category.flash-correct { border-color: var(--success); background: #f1f9eb; }

.category .cat-icon { font-size: 2.5rem; }

.movable {
  width: 90px;
  height: 90px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.movable:hover { transform: translateY(-2px); }
.movable.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 168, 124, 0.25);
}

/* ----------- Exact Change ----------- */
.target-amount {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin: 1rem 0;
  font-weight: 700;
}

.tray-display {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 110px;
  margin-bottom: 1rem;
}

.tray-display h3 {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
  text-align: center;
}

.tray-coins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  min-height: 70px;
}

.running-total {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.coin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0;
}

.coin {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: transform 0.1s;
}
.coin:active { transform: scale(0.95); }
.coin .coin-face {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  border: 3px solid;
  flex-direction: column;
  line-height: 1.1;
}
.coin .bill-face {
  width: 110px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  border: 3px solid;
}

.coin-face.coin-penny { background: #d97e4d; color: white; border-color: #a85a30; }
.coin-face.coin-nickel { background: #b8b8b8; color: #333; border-color: #888; }
.coin-face.coin-dime { background: #d0d0d0; color: #333; border-color: #999; font-size: 0.95rem; }
.coin-face.coin-quarter { background: #c0c0c0; color: #333; border-color: #888; }
.bill-face.coin-bill { background: #b3d9a3; color: #2d5016; border-color: #5d8a4f; }

.tray-coins .coin-tag {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.tray-coins .coin-tag:hover { border-color: var(--accent-dark); }
.tray-coins .coin-tag .x { color: var(--accent-dark); font-weight: 700; }

/* ----------- Shopping List ----------- */
.shopping-list {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  max-width: 380px;
  margin: 1.5rem auto;
  text-align: left;
}
.shopping-list h3 {
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  text-align: center;
}
.shopping-list ul {
  list-style: none;
  padding: 0;
}
.shopping-list li {
  font-size: 1.4rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.shopping-list li:last-child { border-bottom: none; }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.shelf-item {
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s, background 0.2s;
}
.shelf-item:hover { border-color: var(--primary); }
.shelf-item.picked {
  border-color: var(--accent);
  background: #fff7f0;
}
.shelf-item .shelf-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.25rem;
}
.shelf-item .shelf-label {
  font-size: 1rem;
  color: var(--text-soft);
}

.distraction-box {
  text-align: center;
  margin: 2rem 0;
}
.distraction-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid var(--primary-dark);
  margin: 1.5rem auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  transition: transform 0.1s;
}
.distraction-circle:active { transform: scale(0.95); }

/* Utility */
.hidden { display: none !important; }
.center { text-align: center; }
.muted-text { color: var(--text-soft); }
.spacer-md { height: 1rem; }
.spacer-lg { height: 2rem; }

/* ----------- Sequence Recall (Hard) ----------- */
.sr-study-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 2rem;
}

.sr-study-item {
  font-size: 7rem;
  margin-bottom: 0.75rem;
  animation: sr-fade-in 0.35s ease-out;
}
.sr-study-label {
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 600;
}

@keyframes sr-fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.sr-progress {
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.sr-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.sr-slot {
  width: 110px;
  height: 130px;
  border: 3px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
}

.sr-slot.active { border-color: var(--accent); border-style: solid; background: #fff7f0; }
.sr-slot.filled { border-style: solid; border-color: var(--success); background: #f1f9eb; }

.sr-slot-num {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}
.sr-slot-emoji { font-size: 3.2rem; }

.sr-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.sr-bank-item {
  width: 100px;
  height: 100px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 3.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, border-color 0.2s, opacity 0.2s;
}
.sr-bank-item:hover { transform: translateY(-2px); border-color: var(--primary); }
.sr-bank-item.used { opacity: 0.25; pointer-events: none; }

/* ----------- Recipe Steps (Hard) ----------- */
.rs-task-title {
  text-align: center;
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin: 0.5rem 0 1.5rem;
  font-weight: 700;
}

.rs-ordered {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  min-height: 90px;
}
.rs-ordered h4 {
  font-size: 1rem;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.rs-ordered ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: step;
}
.rs-ordered li {
  counter-increment: step;
  background: var(--bg-card);
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.rs-ordered li::before {
  content: counter(step);
  background: var(--success);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.rs-ordered li .step-icon { font-size: 1.6rem; }

.rs-ordered.empty ol { display: none; }
.rs-ordered.empty::after {
  content: attr(data-empty);
  display: block;
  text-align: center;
  color: var(--text-soft);
  padding: 1rem;
  font-style: italic;
}

.rs-bank {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rs-step-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: start;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  font-family: inherit;
  width: 100%;
}
.rs-step-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.rs-step-card .step-icon { font-size: 2rem; flex-shrink: 0; }
.rs-step-card.used { opacity: 0; pointer-events: none; height: 0; padding: 0; border: 0; margin: 0; }

/* ----------- Odd One Out (Hard) ----------- */
.oo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.oo-item {
  background: var(--bg);
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.oo-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.oo-item.correct { background: #e6f3dd; border-color: var(--success); cursor: default; }
.oo-item.wrong { background: #fde9e0; border-color: var(--accent-dark); }

/* ----------- Bubble Pop ----------- */
.bubble-stage {
  position: relative;
  height: 70vh;
  min-height: 480px;
  background: linear-gradient(180deg, #e8f4f8 0%, #f5f1e8 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(255,255,255,0.2) 60%, transparent 70%),
              radial-gradient(circle, var(--bubble-color, #b8d8e8) 0%, var(--bubble-color, #8fb8cc) 100%);
  box-shadow: 0 4px 12px rgba(74,144,164,0.12), inset 0 0 8px rgba(255,255,255,0.2);
  bottom: -160px;
  cursor: pointer;
  user-select: none;
  animation: bubble-rise linear forwards;
  border: none;
  padding: 0;
  font-size: 0;
}

.bubble.popping {
  animation: bubble-pop 350ms ease-out forwards !important;
}

@keyframes bubble-rise {
  to { transform: translateY(calc(-70vh - 240px)) translateX(var(--bubble-drift, 0px)); }
}

@keyframes bubble-pop {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ----------- Color Tap ----------- */
.color-stage {
  position: relative;
  height: 70vh;
  min-height: 480px;
  background: var(--ct-bg, #cfe7ee);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-stage .ct-hint {
  font-size: 1.4rem;
  color: rgba(44,62,80,0.55);
  pointer-events: none;
  transition: opacity 0.4s;
  user-select: none;
}

.color-stage.tapped .ct-hint { opacity: 0; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: ripple-out 900ms ease-out forwards;
}

@keyframes ripple-out {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

/* ----------- Shape Glow ----------- */
.glow-stage {
  position: relative;
  height: 60vh;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8f4ea 0%, #ede8db 100%);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.glow-shape {
  width: 260px;
  height: 260px;
  background: var(--shape-color, #4a90a4);
  cursor: pointer;
  border: none;
  transition: background 0.6s ease, box-shadow 0.4s ease, transform 0.2s ease;
  box-shadow: 0 0 30px rgba(74,144,164,0.3);
}

.glow-shape.shape-circle { border-radius: 50%; }
.glow-shape.shape-square { border-radius: 24px; }
.glow-shape.shape-star {
  background: var(--shape-color, #4a90a4);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 0;
}

.glow-shape.glowing {
  animation: shape-pulse 1.4s ease-out;
  box-shadow: 0 0 80px var(--shape-color, #4a90a4), 0 0 160px var(--shape-color, #4a90a4);
}

@keyframes shape-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ----------- Language toggle ----------- */
.lang-toggle-host {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem 0;
  max-width: 1100px;
  margin: 0 auto;
}

.lang-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow);
}

.lang-btn {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 600;
  min-height: 40px;
  min-width: 80px;
  transition: background 0.2s, color 0.2s;
}

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

.lang-btn.active {
  background: var(--primary);
  color: white;
}

/* RTL adjustments — most flex/grid layouts auto-mirror, so these are
   only for explicit directional polish. */
html[dir="rtl"] body {
  /* Persian benefits from a slightly larger size for emoji + script balance. */
  font-family: 'Vazirmatn', 'Tahoma', 'Helvetica Neue', Arial, sans-serif;
}

html[dir="rtl"] .lang-toggle-host {
  justify-content: flex-start;
}

/* In RTL the back-link's arrow points the other way for visual "back" */
html[dir="rtl"] .back-link {
  flex-direction: row-reverse;
}
