/* Экран «Статистик» — под планшет и телефон, всё крупное, под палец */
body.stat { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
body.stat .btn { touch-action: manipulation; }

.st-top {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 12px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(11, 13, 18, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.st-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-team.away { justify-content: flex-end; }
.st-team .nm { font: 700 20px/1 var(--cond); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 3px solid var(--tc); padding-bottom: 2px; }
.st-team .sc { font: 800 44px/1 var(--cond); font-variant-numeric: tabular-nums; }
.st-mid { display: flex; align-items: center; gap: 10px; }
.st-per { font: 700 15px/1 var(--cond); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.st-clk { font: 700 34px/1 var(--cond); font-variant-numeric: tabular-nums; min-width: 84px; text-align: center; }
.st-clk.running { color: var(--green); }
.st-shot { font: 800 26px/1 var(--cond); color: var(--accent); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.st-shot.off { opacity: .3; }
.st-tools { display: flex; gap: 6px; }
.st-undo { padding: 12px 16px; font-size: 15px; }
.st-menu { padding: 12px 14px; font-size: 16px; }

.st-clockbar { display: none; gap: 8px; padding: 8px 12px 0; }
.st-clockbar.on { display: grid; grid-template-columns: 2fr 1fr 1fr; }
.st-clockbar .btn { padding: 14px 0; font: 800 22px/1 var(--cond); letter-spacing: .06em; }
.st-go { background: var(--green); color: #04130a; }
.st-go.running { background: var(--red); color: #fff; }

.st-cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.st-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--tc); }
.st-head { display: flex; align-items: center; gap: 8px; }
.st-head h2 { margin: 0; flex: 1; font: 700 22px/1 var(--cond); text-transform: uppercase; letter-spacing: .03em; }
.st-head .fouls { font-size: 13px; color: var(--muted); font-weight: 600; }
.st-head .fouls b { color: var(--fg); font-size: 16px; }
.st-head .fouls.bonus b { color: var(--red); }
.st-head .btn { padding: 10px 14px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.st-tile {
  position: relative; border: 0; border-radius: 14px; background: var(--panel2); color: var(--fg); text-align: left; padding: 10px 12px 10px;
  min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; overflow: hidden;
}
.st-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tc); }
.st-tile:active { transform: scale(.97); background: #283048; }
.st-tile .n { font: 800 40px/1 var(--cond); }
.st-tile .p { font: 700 17px/1.05 var(--cond); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile .l { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile .ph { position: absolute; right: 0; top: 0; width: 64px; height: 64px; object-fit: cover; object-position: top; border-bottom-left-radius: 14px; opacity: .9; }
.st-tile.warn .l b.pf { color: var(--accent); }
.st-tile.out { opacity: .45; }
.st-tile.out .l b.pf { color: var(--red); }
.st-tile.team { background: transparent; border: 2px dashed var(--line); justify-content: center; align-items: center; text-align: center; min-height: 104px; }
.st-tile.team::before { display: none; }
.st-tile.team .p { font-size: 18px; }
.st-hint { color: var(--muted); font-size: 13px; }

.st-feed { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.st-feed .ev { flex: none; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.st-feed .ev i { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); }
.st-feed .ev:first-child { border-color: var(--accent); }

/* нижний лист с действиями */
.st-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: none; align-items: flex-end; justify-content: center; }
.st-sheet.on { display: flex; }
.st-panel {
  width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sh-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sh-head .n { font: 800 46px/1 var(--cond); color: var(--tc); }
.sh-head .t { flex: 1; min-width: 0; }
.sh-head .t b { display: block; font: 700 24px/1.05 var(--cond); text-transform: uppercase; }
.sh-head .t span { color: var(--muted); font-size: 13px; }
.sh-head .x { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
.sh-lbl { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-grid .btn { min-height: 76px; font: 800 26px/1 var(--cond); border-radius: 14px; flex-direction: column; gap: 4px; letter-spacing: .02em; }
.sh-grid .btn small { font: 600 12px/1 Inter, sans-serif; color: var(--muted); letter-spacing: 0; }
.sh-grid .btn.made { background: rgba(34, 197, 94, .16); color: #86efac; }
.sh-grid .btn.miss { background: #1a1f2d; color: #cbd5e1; }
.sh-grid .btn.foul { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.sh-grid .btn.skip { background: transparent; border-color: var(--line); font-size: 20px; }
.sh-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.sh-players .st-tile { min-height: 84px; }
.sh-players .st-tile .n { font-size: 34px; }
.sh-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sh-sub { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); background: var(--panel2); color: var(--fg); border-radius: 14px; padding: 12px 14px; min-height: 64px; cursor: pointer; text-align: left; }
.sh-sub .n { font: 800 30px/1 var(--cond); width: 44px; }
.sh-sub .p { flex: 1; font-weight: 600; }
.sh-sub .c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }
.sh-sub.on { border-color: var(--tc); }
.sh-sub.on .c { background: var(--tc); border-color: var(--tc); }
.sh-done { width: 100%; margin-top: 12px; padding: 18px; font-size: 18px; }
.sh-opts label { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.sh-opts input[type=checkbox] { width: 24px; height: 24px; }

@media (max-width: 760px) {
  .st-top { grid-template-columns: 1fr auto 1fr; }
  .st-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .st-cols { grid-template-columns: 1fr; }
  .st-team .sc { font-size: 36px; }
  .st-clk { font-size: 28px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* растянуть на весь экран (в control.css у main стоит max-width и auto-поля) */
main.st-cols { width: 100%; max-width: none; margin: 0; }
.st-tile .p, .st-tile .l { display: block; }
.st-tile .p { padding-right: 60px; }
.sh-players .st-tile .ph { width: 52px; height: 52px; }
.sh-players .st-tile .p { padding-right: 0; }
body.stat .toast { top: 84px; bottom: auto; }
@media (max-width: 760px) {
  .st-tile .ph { display: none; }
  .st-tile .p { padding-right: 0; }
  .st-per { display: none; }
}
