/* «Летний челлендж» (0.55 «Сезоны», summer; public/summer-challenge.js): a summer bingo card on warm paper — genres in
   coral, eras in sea-green, countries in sunflower; a marked cell gets a little sun stamped on it and the film's name; the
   finished lines are drawn across like a marker; the progress, the rules and the club beside it (below on a phone). */
.sbg-modal.stats-modal { padding: 20px; }
.sbg-page {
  position: relative; display: flex; flex-direction: column; width: min(980px, 100%); max-height: calc(100dvh - 40px); overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(255, 214, 140, .35); color: #fdf3df; box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  background: radial-gradient(120% 80% at 85% 0%, #5a3a2a 0%, #2c2a3e 45%, #18203a 100%);
}
.sbg-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 6px 22px; }
.sbg-head { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sbg-title { font: 700 24px/1.15 Georgia, 'Times New Roman', serif; color: #ffd27a; text-shadow: 0 1px 0 rgba(0, 0, 0, .7); }
.sbg-sub { margin-top: 3px; font-size: 13px; color: #e6c79a; min-height: 16px; }
.sbg-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .3);
  color: #fdf3df; font-size: 24px; line-height: 1; cursor: pointer;
}
.sbg-close:hover { border-color: rgba(255, 214, 140, .7); }
.sbg-body { display: grid; grid-template-columns: minmax(0, 560px) 300px; justify-content: center; gap: 12px 20px; padding: 6px 22px 22px; overflow: auto; min-height: 0; align-items: start; }
.sbg-note { grid-column: 1 / -1; padding: 60px 10px; text-align: center; color: #e6c79a; }
.sbg-flag { grid-column: 1 / -1; margin: 0; padding: 7px 11px; border-radius: 10px; border: 1px dashed rgba(255, 220, 160, .6); color: #ffe6b8; font-size: 13px; }

.sbg-card {
  position: relative; padding: 14px 14px 16px; border-radius: 16px; color: #3b2615;
  background: linear-gradient(170deg, #fff6e0 0%, #fbe8c4 100%);
  box-shadow: inset 0 0 0 3px #f0b44c, inset 0 0 0 6px #fff6e0, inset 0 0 0 7px rgba(240, 180, 76, .7), 0 12px 30px rgba(0, 0, 0, .4);
}
.sbg-legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 2px 10px; }
.sbg-k { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; }
.sbg-k.sbg-genre { background: #ffd6c4; color: #8a3418; }
.sbg-k.sbg-era { background: #cbeee6; color: #1d5c52; }
.sbg-k.sbg-country { background: #ffe79c; color: #6e4b07; }
.sbg-grid { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 7px; }
.sbg-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-width: 0;
  aspect-ratio: 4 / 3; min-height: 64px; padding: 8px 4px 6px; border-radius: 12px; border: 2px solid rgba(80, 50, 20, .14);
  font: inherit; color: #3b2615; cursor: pointer; text-align: center; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sbg-cell.sbg-genre { background: #ffe3d6; }
.sbg-cell.sbg-era { background: #dcf3ee; }
.sbg-cell.sbg-country { background: #fff0bd; }
.sbg-cell:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(80, 50, 20, .18); }
.sbg-cell:focus-visible { outline: 3px solid #ff8a3d; outline-offset: 2px; }
.sbg-cell[aria-pressed="true"] { border-color: #e2782f; box-shadow: 0 0 0 2px rgba(226, 120, 47, .35); }
.sbg-ico { font-size: 24px; line-height: 1.1; height: 28px; display: grid; place-items: center; }
.sbg-name { font-size: 12px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sbg-cell.on.sbg-genre { background: #ffc2a6; }
.sbg-cell.on.sbg-era { background: #a9e3d6; }
.sbg-cell.on.sbg-country { background: #ffdf72; }
.sbg-cell.line { border-color: #e9962f; }
.sbg-sun { flex: none; width: 28px; height: 28px; transform: rotate(-12deg); filter: drop-shadow(0 1px 0 rgba(122, 63, 12, .35)); }
.sbg-film {
  margin-top: auto; max-width: 100%; font-size: 10.5px; line-height: 1.15; font-style: italic; color: #5c3a1a;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.sbg-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sbg-lines { mix-blend-mode: multiply; } /* a marker over the cells: the names stay dark and readable */
.sbg-lines line { stroke: rgba(240, 140, 50, .55); stroke-width: .07; stroke-linecap: round; }
.sbg-card.full { box-shadow: inset 0 0 0 3px #f0b44c, inset 0 0 0 6px #fff6e0, inset 0 0 0 7px rgba(240, 180, 76, .7), 0 0 0 3px rgba(255, 200, 90, .5), 0 12px 30px rgba(0, 0, 0, .4); }
.sbg-full { margin: 12px 0 0; text-align: center; font: 700 16px/1.3 Georgia, 'Times New Roman', serif; color: #8a4a12; }

.sbg-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sbg-progress { display: flex; flex-wrap: wrap; gap: 6px; }
.sbg-progress > span { padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.sbg-progress > .sbg-stars { background: rgba(255, 196, 80, .18); border-color: rgba(255, 196, 80, .45); color: #ffd98a; font-weight: 700; }
.sbg-detail { margin: 0; min-height: 2.6em; padding: 9px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); font-size: 14px; color: #fff1d6; }
.sbg-rules { margin: 0; font-size: 13px; line-height: 1.4; color: #e9d6b4; }
.sbg-muted { margin: 0; font-size: 13px; color: #c9b693; }
.sbg-h { margin: 4px 0 0; font: 700 15px/1.2 Georgia, 'Times New Roman', serif; color: #ffd27a; }
.sbg-club { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sbg-club li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.sbg-face { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: #6c4a8a; color: #fff; font-size: 11px; font-weight: 700; }
.sbg-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sbg-who { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbg-count { flex: none; color: #e6c79a; font-variant-numeric: tabular-nums; }
.sbg-shop-acts { display: flex; gap: 8px; margin-top: 8px; }

@media (max-width: 760px) {
  .sbg-modal.stats-modal { padding: 0; align-items: stretch; }
  .sbg-page { width: 100%; max-height: 100dvh; border-radius: 0; border: 0; }
  .sbg-top { padding: max(10px, env(safe-area-inset-top, 0px)) 10px 4px 14px; }
  .sbg-title { font-size: 21px; }
  .sbg-body { grid-template-columns: minmax(0, 1fr); padding: 4px 10px max(16px, env(safe-area-inset-bottom, 0px)); }
  .sbg-card { padding: 10px 9px 12px; }
  .sbg-grid { gap: 5px; }
  .sbg-cell { padding: 6px 2px 5px; border-radius: 10px; aspect-ratio: auto; min-height: 70px; }
  .sbg-ico { font-size: 19px; height: 22px; }
  .sbg-name { font-size: 11px; }
  .sbg-sun { width: 22px; height: 22px; }
  .sbg-film { font-size: 9.5px; -webkit-line-clamp: 1; }
}
@media (max-width: 360px) {
  .sbg-name { font-size: 10px; }
  .sbg-ico { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .sbg-cell { transition: none; } .sbg-cell:hover { transform: none; } }
