:root {
  --green: #1a8f4c;
  --green-dark: #0f6a37;
  --bg: #f4f6f5;
  --text: #1a1a1a;
  --card-bg: #ffffff;
  --border: #e0e4e2;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 16px 32px;
  background: var(--green);
  color: white;
}

.navbar .logo {
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.nav-links {
  flex: 0 1 auto;
}

.nav-links a {
  display: inline-block;
  color: white;
  text-decoration: none;
  opacity: 0.9;
  margin-right: 18px;
}

.nav-links a:last-child {
  margin-right: 0;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.hero {
  text-align: center;
  padding: 48px 20px;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.hero p {
  color: #555;
}

@media (max-width: 600px) {
  .navbar {
    padding: 14px 20px;
  }

  .container {
    padding: 24px 16px;
  }

  .hero {
    padding: 32px 12px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .nav-links {
    flex-basis: 100%;
  }

  .nav-links a {
    margin-right: 14px;
    font-size: 0.92rem;
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-logo {
  height: 64px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
}

.page-intro {
  color: #555;
  margin-top: -8px;
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  color: var(--green);
  text-decoration: none;
  margin-bottom: 16px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.team-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.team-detail-logo {
  height: 120px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  margin-bottom: 16px;
}

.team-detail h1 {
  margin-bottom: 20px;
}

.team-history {
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
  color: #333;
}

.section-title {
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.player-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}

.player-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  background: #eee;
}

.player-name {
  padding: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.stadium-figure {
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.stadium-photo {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.stadium-figure figcaption {
  padding: 14px 20px;
  font-weight: 600;
  color: #333;
}

.footer {
  text-align: center;
  padding: 24px;
  color: #888;
  font-size: 0.9rem;
}

.tournament-card {
  cursor: default;
  padding: 28px 20px;
}

.tournament-card .card-logo {
  height: 110px;
  max-width: 130px;
}

.tournament-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  font-size: 2.2rem;
  margin: 0 auto 12px;
}

.tournament-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #777;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.stat-card-name {
  margin: 0 0 16px;
  color: var(--green-dark);
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.stat-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.stat-table td {
  padding: 8px 0;
}

.stat-table td:last-child {
  text-align: right;
  font-weight: 700;
}

.trophy-heading {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #555;
}

.no-trophies {
  color: #999;
  font-size: 0.9rem;
  margin: 0;
}

.trophy-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trophy-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.trophy-list li:last-child {
  border-bottom: none;
}

.h2h-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.h2h-summary-item {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.h2h-result-badge {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 8px;
  color: #fff;
}

.h2h-result-win {
  background: var(--green);
}

.h2h-result-loss {
  background: #c0392b;
}

.h2h-result-draw {
  background: #999;
}

.trophy-date {
  display: block;
  color: #999;
  font-size: 0.8rem;
  margin-top: 2px;
}

.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-link {
  color: #888;
  font-size: 0.85rem;
  text-decoration: none;
}

.switch-link:hover {
  text-decoration: underline;
}

.my-stats-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .my-stats-layout {
    grid-template-columns: 1fr;
  }
}

.favorite-club {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.favorite-club-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
}

.placeholder-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 50%;
  color: #aaa;
  font-weight: 700;
  font-size: 1.3rem;
}

.club-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.club-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.club-list li:last-child {
  border-bottom: none;
}

.club-list-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.club-list-name {
  flex: 1;
  font-weight: 500;
}

.club-list-count {
  color: #888;
  font-size: 0.85rem;
}

.whoami-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.whoami-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  width: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
}

.tournament-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tournament-header-logo {
  height: 56px;
  width: 56px;
  object-fit: contain;
}

.tournament-description {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  color: #333;
  white-space: pre-line;
  line-height: 1.6;
}

.tournament-description p {
  margin: 0 0 12px;
}

.tournament-description p:last-child {
  margin-bottom: 0;
}

.tournament-description h3 {
  margin: 22px 0 10px;
  font-size: 1.15rem;
}

.edition-card {
  cursor: default;
  padding: 28px 20px;
}

.edition-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.edition-locked {
  opacity: 0.6;
}

.edition-lock {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #888;
}

.edition-note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #888;
}

.nav-cards {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.nav-card {
  padding: 24px 16px;
}

.nav-card-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.nav-card-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #777;
}

.favorite-mini-card {
  cursor: default;
}

.hero-banner-card {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.favorites-grid {
  grid-template-columns: repeat(3, 1fr) 1.6fr;
}

@media (max-width: 720px) {
  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.hero-banner-card img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.group-table th {
  text-align: left;
  font-size: 0.78rem;
  color: #999;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.group-table th:not(:first-child),
.group-table td:not(:first-child) {
  text-align: center;
  width: 26px;
}

.group-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.group-table tr:last-child td {
  border-bottom: none;
}

.group-table a {
  color: inherit;
  text-decoration: none;
}

.group-table a:hover {
  text-decoration: underline;
}

.group-row-human td:first-child {
  font-weight: 700;
}

.group-player-tag {
  display: inline-block;
  margin-left: 6px;
  background: var(--green);
  color: white;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

.show-audio-player {
  width: 100%;
  margin: 4px 0 24px;
  border-radius: 10px;
}

.commentary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commentary-item {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 18px;
}

.commentary-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.commentary-speaker {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.commentary-text {
  color: #333;
  line-height: 1.6;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.news-card {
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.news-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #eee;
}

.news-card-body {
  padding: 16px 18px;
}

.news-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.news-card-excerpt {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.news-card-meta {
  color: #999;
  font-size: 0.8rem;
}

.news-detail-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}

.news-body {
  font-size: 1rem;
}

/* берём под контроль размер картинок, которые бот вставляет прямо в текст
   статьи (inline <img>, иногда с собственным width:100%) — на широких
   экранах такое фото иначе растягивается на всю ширину колонки и выглядит
   огромным, хотя на телефоне то же самое смотрится нормально */
.news-body img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 420px !important;
  margin: 16px auto !important;
  border-radius: 12px !important;
}

/* блок "автор в конце статьи" (фото комментатора + реплика) — общий
   `.news-body img` выше форсит крупные блочные картинки и на круглом
   96px-аватаре ломает вёрстку (аватар растягивался на всю ширину и
   наезжал на текст на мобильном). Своя, более специфичная пара правил
   с !important, чтобы гарантированно перебить общее. flex-wrap чтобы
   на узких экранах текст уходил под фото, а не наезжал на него. */
.news-body .article-author {
  display: flex !important;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-body .article-author img {
  display: block !important;
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.news-body .article-author div {
  flex: 1 1 200px;
  min-width: 0;
}

.epl-preview {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.epl-preview .group-table {
  flex: 1 1 260px;
}

.epl-crest-box {
  flex: 0 0 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.epl-crest-box-title {
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.epl-crest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.epl-crest-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.review-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.review-submit {
  align-self: flex-start;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.review-submit:hover {
  background: var(--green-dark);
}

/* ===== Раздел «Игры» ===== */
.game-card {
  padding: 24px 16px;
}

.game-card-record {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--green-dark);
  font-weight: 600;
}

.game-card-soon {
  opacity: 0.55;
  cursor: default;
}

.game-card-soon:hover {
  transform: none;
  box-shadow: none;
}

.quiz {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.quiz-title {
  margin: 0 0 16px;
  text-align: center;
}

.quiz-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.quiz-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.quiz-mode-btn:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.quiz-mode-icon {
  font-size: 2rem;
}

.quiz-mode-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.quiz-mode-desc {
  font-size: 0.85rem;
  color: #777;
}

.quiz-guest-note {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: #777;
  text-align: center;
}

.quiz-guest-note a {
  color: var(--green);
}

.quiz-topbar {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
}

.quiz-timer {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.quiz-timer-bar {
  height: 100%;
  width: 100%;
  background: var(--green);
}

.quiz-timer-bar.low {
  background: #d93b3b;
}

.quiz-crest-wrap {
  text-align: center;
  padding: 24px 0 12px;
}

.quiz-crest {
  height: 160px;
  width: 160px;
  object-fit: contain;
}

/* размытие включается мгновенно (без transition), плавно — только
   раскрытие после ответа, иначе новый герб на долю секунды виден чётко */
.quiz-crest.revealed {
  transition: filter 0.3s ease;
}

.quiz-crest.loading {
  visibility: hidden;
}

.quiz-reveal {
  margin-top: 12px;
  min-height: 1.5em;
  font-weight: 700;
}

.quiz-reveal.good {
  color: var(--green-dark);
}

.quiz-reveal.bad {
  color: #c22f2f;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-option,
.quiz-btn {
  padding: 14px 10px;
  min-height: 56px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

/* только для мыши: на телефоне :hover «залипает» на месте пальца,
   и кнопка следующего вопроса сразу горела зелёной рамкой */
@media (hover: hover) {
  .quiz-option:hover:not(:disabled),
  .quiz-btn:hover {
    border-color: var(--green);
  }
}

.quiz-option:focus:not(:focus-visible) {
  outline: none;
}

.quiz-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.quiz-option.right {
  background: #dff3e7;
  border-color: var(--green);
  opacity: 1;
}

.quiz-option.wrong {
  background: #fbe2e2;
  border-color: #d93b3b;
  opacity: 1;
}

.quiz-final-score {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--green-dark);
}

.quiz-final-line,
.quiz-save-status {
  text-align: center;
  margin: 8px 0;
}

.quiz-save-status {
  color: #777;
  font-size: 0.9rem;
}

.quiz-end-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.quiz-btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

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

.quiz-misses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.quiz-miss {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.85rem;
}

.quiz-miss img {
  height: 56px;
  width: 56px;
  object-fit: contain;
}

.quiz-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.quiz-tab {
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.quiz-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.quiz-board {
  margin: 0;
  padding-left: 24px;
}

.quiz-board li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.quiz-board li:last-child {
  border-bottom: none;
}

.quiz-board li span {
  display: inline-block;
  min-width: 60%;
}

.quiz-board-empty {
  list-style: none;
  margin-left: -24px;
  color: #777;
}

@media (max-width: 600px) {
  .quiz {
    padding: 16px;
  }

  .quiz-crest {
    height: 130px;
    width: 130px;
  }

  .quiz-option {
    font-size: 0.92rem;
  }
}

/* ---------- Игра «Серия пенальти» ---------- */
.pen-club-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  margin: 0 auto 18px;
  font-weight: 600;
  font-size: 0.95rem;
}
.pen-club-pick select {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
}
.pen-board {
  background: #0b132b;
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 8px 12px;
  display: grid;
  gap: 6px;
}
.pen-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pen-crest { width: 26px; height: 26px; object-fit: contain; flex: none; }
.pen-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.pen-dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 55%; }
.pen-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.pen-dot-goal { background: #40c057; border-color: #40c057; }
.pen-dot-miss { background: #fa5252; border-color: #fa5252; }
.pen-goals { min-width: 1.4em; text-align: right; font-size: 1.15rem; }
.pen-stage { position: relative; }
#pen-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 0 12px 12px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.pen-banner {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(11, 19, 43, 0.85);
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.1rem, 4.5vw, 1.7rem);
  white-space: nowrap;
  pointer-events: none;
  animation: pen-pop 0.25s ease-out;
}
.pen-banner-good { background: rgba(26, 143, 76, 0.92); }
.pen-banner-bad { background: rgba(201, 42, 42, 0.9); }
@keyframes pen-pop { from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; } }
.pen-hint { text-align: center; font-weight: 600; margin: 10px 0 2px; min-height: 1.5em; }
.pen-score-line { text-align: center; color: #555; margin: 0 0 6px; }
.pen-end-result { text-align: center; font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
/* на ноутбуке поле не должно быть выше экрана: ширина по доступной высоте (4:3) */
.pen-board, .pen-stage { max-width: max(320px, calc((100vh - 340px) * 4 / 3)); margin-left: auto; margin-right: auto; }

/* ---------- Игра «Мини-футбол 1 на 1» ---------- */
.mf-modes { grid-template-columns: repeat(3, 1fr); }
.mf-modes .quiz-mode-btn { padding: 16px 6px; }
.mf-points-note { text-align: center; color: #555; font-size: 0.9rem; margin: 14px 0 0; }
.mf-board {
  background: #0b132b;
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.mf-team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mf-team-cpu { justify-content: flex-end; text-align: right; }
.mf-score { display: flex; flex-direction: column; align-items: center; font-size: 1.35rem; line-height: 1.1; }
.mf-score small { font-size: 0.8rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
#mf-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 0 12px 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.mf-controls-hint { display: flex; justify-content: space-between; color: #777; font-size: 0.85rem; margin: 6px 4px 0; }
/* поле 2:3 — по высоте экрана, чтобы влезло целиком вместе с табло */
.mf-board, .mf-stage { max-width: max(280px, calc((100vh - 150px) * 2 / 3)); margin-left: auto; margin-right: auto; }
@media (max-width: 480px) { .mf-modes .quiz-mode-desc { font-size: 0.75rem; } }

/* сохранение результата гостем — поле имени на экране итога игры */
.guest-save {
  margin: 4px auto 0;
  max-width: 360px;
}
.guest-save-label {
  margin: 0 0 8px;
  color: var(--text);
}
.guest-save-row {
  display: flex;
  gap: 8px;
}
.guest-save-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.guest-save-row input:focus {
  outline: 2px solid var(--green);
  border-color: transparent;
}
.guest-save-msg {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: #b42318;
}
.quiz-guest-tag {
  font-size: 0.75rem;
  color: #888;
  font-weight: normal;
}

/* «Кубок страны»: розыгрыши сгруппированы по странам */
.country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 8px;
}
.country-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.country-chip span {
  color: #888;
  margin-left: 2px;
}
.country-section {
  margin-top: 28px;
  scroll-margin-top: 16px;
}
.country-heading {
  margin: 0 0 4px;
  font-size: 1.3rem;
}
.country-meta {
  margin: 0 0 14px;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}
.edition-card-country {
  padding: 18px 14px;
  text-align: center;
}
.edition-number {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 10px;
}
.edition-winner-crest {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 8px;
}
.edition-winner-player {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}
@media (max-width: 520px) {
  .edition-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ===== Прогнозы (ИИ-комментаторы) ===== */
.forecast-faces {
  display: flex;
  height: 160px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
}

.forecast-faces img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* у Генича лицо внизу широкого кадра — по верху обрезался подбородок */
.forecast-faces img.face-genich {
  object-position: center 80%;
}

.forecast-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.forecast-voice {
  text-align: left;
  line-height: 1.6;
}

.forecast-voice p {
  margin: 0 0 12px;
}

.forecast-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.forecast-who small {
  color: #777;
}

.forecast-name {
  font-weight: 700;
  font-size: 1.15em;
}

.forecast-avatar {
  position: relative;
  flex-shrink: 0;
}

.forecast-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--green);
  display: block;
}

.forecast-avatar b,
.bot-ai-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  background: #6c3bd1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 6px;
  border: 1.5px solid #fff;
}

.forecast-verdict {
  background: var(--bg);
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
}

.forecast-note {
  color: #777;
  font-size: 0.9em;
  margin-top: 24px;
  line-height: 1.5;
}
