/* ==============================================
   Лол, куда? — Сборник историй
   Уютный, сказочный, ламповый дизайн
   ============================================== */

/* --- Кастомные свойства (Design Tokens) --- */
:root {
  --bg-deep:    #1a120b;
  --bg-main:     #2c1e0f;
  --bg-card:     #3b2a1a;
  --bg-card-alt: #4a3422;
  --bg-hover:    #5a4330;

  --border-subtle:  rgba(255, 220, 180, 0.12);
  --border-accent:  rgba(255, 200, 140, 0.35);
  --border-glow:    rgba(255, 200, 140, 0.6);

  --text-primary:   #fef3e2;
  --text-secondary: #e8d5b8;
  --text-muted:     #b89b78;
  --text-accent:    #ffcb85;
  --text-accent-soft: #ffddaa;
  --text-green:     #6dd6a0;
  --text-red:       #f8877a;
  --text-yellow:    #f7d070;

  --accent-warm:    #e8a85c;
  --accent-gold:    #f5c842;
  --accent-green:   #6dd6a0;
  --accent-red:     #f8877a;

  --glow-warm:  0 0 30px rgba(232, 168, 92, 0.08);
  --glow-strong: 0 0 40px rgba(232, 168, 92, 0.15);

  --font-display: 'Literata', 'Georgia', 'Times New Roman', serif;
  --font-sans:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

  --transition-fast: 0.2s ease;
  --transition:      0.3s ease;
  --transition-slow: 0.5s ease;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --max-width: 1100px;
  --max-width-reading: 720px;
  --padding-page: 20px;
}

/* --- Сброс и базовые стили --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-deep);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Тёплый фон с мягкими градиентами --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(232, 168, 92, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(245, 200, 66, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(109, 214, 160, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-main) 50%, var(--bg-deep) 100%);
  z-index: -1;
  animation: bgGlow 25s ease-in-out infinite alternate;
}

@keyframes bgGlow {
  0%   { opacity: 1; }
  50%  { opacity: 0.75; }
  100% { opacity: 1; }
}

/* --- Основной контейнер --- */
#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--padding-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Контент историй (игра, интро, концовки) — ýже */
.story-intro-screen,
#game-screen,
.ending-screen,
.endings-list-screen {
  max-width: var(--max-width-reading);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* --- Экраны --- */
.screen {
  display: none;
  animation: screenFadeIn 0.5s ease forwards;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* ========== БИБЛИОТЕКА (Главный экран) ========== */
.library-screen {
  text-align: center;
  gap: 16px;
  padding: 30px 0 40px;
}

.library-header {
  margin-bottom: 16px;
}

.library-title {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-warm) 50%, var(--accent-green) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  margin-bottom: 4px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.library-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 28px;
}

.library-decoration {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 36px;
  opacity: 0.7;
}

/* --- Сетка историй --- */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 36px;
}

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: cardAppear 0.5s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.story-card:nth-child(1) { animation-delay: 0.05s; }
.story-card:nth-child(2) { animation-delay: 0.10s; }
.story-card:nth-child(3) { animation-delay: 0.15s; }
.story-card:nth-child(4) { animation-delay: 0.20s; }
.story-card:nth-child(5) { animation-delay: 0.25s; }
.story-card:nth-child(6) { animation-delay: 0.30s; }
.story-card:nth-child(7) { animation-delay: 0.35s; }
.story-card:nth-child(8) { animation-delay: 0.40s; }
.story-card:nth-child(9) { animation-delay: 0.45s; }

@keyframes cardAppear {
  to { opacity: 1; transform: translateY(0); }
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--card-accent, var(--accent-warm));
  opacity: 0.7;
}

.story-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  box-shadow: var(--glow-warm);
  transform: translateY(-3px);
}

.story-card-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.story-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.story-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  margin-bottom: 8px;
}

.story-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.story-card-progress {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-card-progress .progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}

/* ========== ИНТРО ИСТОРИИ ========== */
.story-intro-screen {
  text-align: center;
  gap: 16px;
  padding: 30px 0 40px;
  width: 100%;
}

.story-intro-header {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  width: 100%;
  margin-bottom: 24px;
}

.story-intro-emoji {
  font-size: 3.5rem;
  flex-shrink: 0;
}

.story-intro-titles {
  flex: 1;
}

.story-intro-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

.story-intro-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.story-intro-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
  width: 100%;
  margin-bottom: 8px;
}

.story-intro-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
}

/* ========== КНОПКИ ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  background: rgba(232, 168, 92, 0.08);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 180, 0.06), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before { left: 100%; }

.btn:hover {
  background: rgba(232, 168, 92, 0.15);
  border-color: var(--border-glow);
  box-shadow: var(--glow-warm);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, rgba(232, 168, 92, 0.2), rgba(245, 200, 66, 0.12));
  border-color: var(--accent-warm);
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(232, 168, 92, 0.3), rgba(245, 200, 66, 0.18));
  box-shadow: var(--glow-strong);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--text-red);
  background: rgba(248, 113, 113, 0.05);
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.08);
}

.btn-back {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 14px;
  margin-bottom: 12px;
}

.btn-back:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.03);
}

.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-small { padding: 10px 18px; font-size: 0.9rem; }

/* ========== ИГРОВОЙ ЭКРАН ========== */
.story-header {
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
}

.story-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.story-title {
  font-size: 1.2rem;
  color: var(--text-accent);
  font-weight: 600;
  margin-top: 2px;
}

/* --- Карточка сцены --- */
.scene-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  box-shadow: var(--glow-warm);
  position: relative;
}

.scene-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-warm), transparent);
  opacity: 0.4;
}

.scene-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 28px;
}

/* --- Абзацы текста сцены (рендерятся через JS) --- */
.scene-paragraph {
  margin-bottom: 0.6em;
  opacity: 0;
  transform: translateY(8px);
  animation: paragraphFadeIn 0.5s ease forwards;
}

.scene-paragraph:last-child { margin-bottom: 0; }

@keyframes paragraphFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Терминальные строки ($ команды) --- */
.scene-terminal {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 200, 140, 0.08);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0;
  color: var(--text-green);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.scene-terminal .term-prompt {
  color: var(--text-accent);
  user-select: none;
}

.scene-terminal .term-output {
  color: var(--text-secondary);
}

.scene-terminal .term-error {
  color: var(--text-red);
}

.scene-terminal .term-warn {
  color: var(--text-yellow);
}

.scene-terminal .term-info {
  color: var(--text-muted);
}

/* --- Диалоговые строки (👻 ⚔️ и т.д.) --- */
.scene-dialog {
  padding: 8px 14px;
  margin: 6px 0;
  border-left: 3px solid var(--accent-warm);
  border-radius: 0 8px 8px 0;
  background: rgba(232, 168, 92, 0.04);
  font-style: italic;
  color: var(--text-accent-soft);
  line-height: 1.7;
}

.scene-dialog.dialog-ghost {
  border-left-color: #c084fc;
  background: rgba(192, 132, 252, 0.04);
  color: #e2d0fa;
}

.scene-dialog.dialog-knight {
  border-left-color: #60a5fa;
  background: rgba(96, 165, 250, 0.04);
  color: #bfdbfe;
}

/* --- Кнопки выбора --- */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  padding-right: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(232, 168, 92, 0.05);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
  animation: choiceSlideIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}

.choice-btn:nth-child(1) { animation-delay: 0.15s; }
.choice-btn:nth-child(2) { animation-delay: 0.25s; }
.choice-btn:nth-child(3) { animation-delay: 0.35s; }
.choice-btn:nth-child(4) { animation-delay: 0.45s; }
.choice-btn:nth-child(5) { animation-delay: 0.55s; }

@keyframes choiceSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Клавиатурная подсказка */
.choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 200, 140, 0.1);
  border: 1px solid rgba(255, 200, 140, 0.2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.choice-btn:hover .choice-key {
  background: rgba(255, 200, 140, 0.2);
  border-color: var(--border-accent);
  color: var(--text-accent);
}

.choice-btn::after {
  content: '→';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  color: var(--text-accent);
  transition: all var(--transition);
  font-size: 1.1rem;
}

.choice-btn:hover {
  background: rgba(232, 168, 92, 0.12);
  border-color: var(--border-accent);
  padding-left: 24px;
  box-shadow: var(--glow-warm);
}

.choice-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.choice-btn:active {
  background: rgba(232, 168, 92, 0.18);
  transform: translateY(1px);
}

/* --- Футер игрового экрана --- */
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
  padding-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.endings-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.endings-status span {
  color: var(--text-accent);
}

/* ========== ЭКРАН КОНЦОВКИ ========== */
.ending-screen {
  text-align: center;
  gap: 20px;
  padding: 40px 0;
}

.ending-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(109, 214, 160, 0.1);
  border: 1px solid rgba(109, 214, 160, 0.3);
  color: var(--text-green);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(109, 214, 160, 0.2); }
  50%      { box-shadow: 0 0 20px 4px rgba(109, 214, 160, 0.1); }
}

.ending-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0;
  line-height: 1.3;
}

.ending-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  text-align: left;
  box-shadow: var(--glow-warm);
}

.ending-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-line;
}

.ending-epilogue {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
  font-style: italic;
}

.ending-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
}

/* ========== СПИСОК КОНЦОВОК ========== */
.endings-list-screen {
  text-align: center;
  gap: 16px;
  padding: 30px 0 40px;
  width: 100%;
}

.endings-list-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.endings-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.endings-counter span {
  color: var(--text-accent);
}

.endings-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 24px;
}

.ending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.ending-item.found {
  border-color: rgba(109, 214, 160, 0.3);
}

.ending-item.locked {
  opacity: 0.5;
}

.ending-icon {
  font-size: 1rem;
}

.ending-name {
  color: var(--text-primary);
}

.ending-item.locked .ending-name {
  color: var(--text-muted);
}

.endings-list-footer {
  display: flex;
  gap: 10px;
}

/* ========== ВСПОМОГАТЕЛЬНОЕ ========== */
.hidden { display: none !important; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 0; }
.loading-sparkle { font-size: 2.5rem; animation: sparkle 1.5s ease infinite; }
@keyframes sparkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } }

.error-screen { text-align: center; gap: 12px; padding: 60px 0; }
.error-icon { font-size: 3rem; }
.error-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text-red); }
.error-text { color: var(--text-secondary); font-size: 0.95rem; }
.error-code { display: block; margin-top: 8px; padding: 8px 12px; background: var(--bg-card); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.library-footer { margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }
.library-footer a { color: var(--text-accent); text-decoration: none; }
.library-footer a:hover { text-decoration: underline; }

.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

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

/* ========== СЧЁТЧИК ШАГОВ ========== */
.steps-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.steps-counter span {
  color: var(--text-accent);
}

/* ========== ПАРЯЩИЕ ЧАСТИЦЫ ========== */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* ========== НОВАЯ КОНЦОВКА — ИСКРЫ ========== */
.ending-badge.new-ending {
  animation: badgeNewPulse 0.8s ease;
}

@keyframes badgeNewPulse {
  0%   { transform: scale(0.5); opacity: 0; }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.ending-sparkles {
  position: relative;
  display: inline-block;
}

.ending-sparkle-particle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleFloat 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes sparkleFloat {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0.3); }
}

/* ========== ПРОГРЕСС-БАР ИСТОРИЙ (карточки) ========== */
.story-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.story-card-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.story-card-stats .stat-icon {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ========== АДАПТИВ ========== */

/* Мобилки */
@media (max-width: 640px) {
  .library-title { font-size: 2.4rem; }
  .stories-grid { grid-template-columns: 1fr; gap: 12px; }
  .story-intro-header { flex-direction: column; text-align: center; }
  .story-intro-emoji { font-size: 2.8rem; }
  .story-intro-title { font-size: 1.5rem; }
  .scene-card { padding: 24px 18px; }
  .choice-btn { padding: 12px 16px; font-size: 0.95rem; }
  .choice-key { width: 20px; height: 20px; font-size: 0.68rem; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
  .scene-terminal { font-size: 0.8rem; padding: 8px 10px; }
}

/* Планшет */
@media (min-width: 641px) and (max-width: 960px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
  .story-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
  }
}

/* Десктоп — 3 колонки (9 карточек = 3×3) */
@media (min-width: 961px) {
  .stories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* ========== FOОТЕР ========== */
#site-footer {
  text-align: center;
  padding: 12px 0 16px;
}

.footer-feedback-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.4;
  text-decoration: none;
  transition: opacity var(--transition);
}

.footer-feedback-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}
