/* ПОКЕР ФЕЙС — телефоны. Подключается последним (сайт и админка): ничего не должно быть шире экрана. */

/* страховка: содержимое не раздвигает страницу (clip не ломает «липкую» шапку, в отличие от hidden) */
main.wrap,main.awrap,.sfoot{overflow-x:clip}
img,svg,video,canvas,iframe{max-width:100%}
.leaflet-container img,.leaflet-container svg{max-width:none}
h1,h2,h3,p,li,b,small,dd,td,.flash,.review,.arow span,.w-row-main{overflow-wrap:break-word}
.nowrap,.num{overflow-wrap:normal}
pre,code{white-space:pre-wrap;overflow-wrap:anywhere}

/* шапка: логотип сжимается, правая часть всегда помещается */
.top{max-width:100vw}
.top .logo{min-width:0;flex:0 1 auto}
.top-right{flex:none;min-width:0}
@media (max-width:560px){
  .top{gap:8px;padding-left:12px;padding-right:12px}
  .top .logo{font-size:13px;gap:7px;letter-spacing:.02em}
  .top .mark{width:34px;height:34px}
  .top-right{gap:6px}
  .top .live-pill,.top .live-pill.site{padding:6px 9px;gap:5px}
  .top .live-pill[data-static] .lp-txt>span::after{content:" ждут"}
  .chip-link{padding:8px 11px}
}
@media (max-width:374px){
  .top .live-pill,.top .live-pill.site{padding:6px 8px}
  .top .live-pill .lp-txt>span::after,.top .live-pill[data-static] .lp-txt>span::after{content:""}
}
@media (max-width:339px){.top .logo>span:not(.mark-wrap){font-size:12px;letter-spacing:0}}

/* «Сыграли за одним столом»: длинное имя не раздвигает сетку */
.mates{grid-template-columns:repeat(3,minmax(0,1fr))}
.mate{min-width:0}
/* админка: формы в строку и карточки не шире экрана */
.agrid>*,.card,.inline-form>*,.ahead>*{min-width:0}
.inline-form{flex-wrap:wrap}
.inline-form input[type=date]{flex:1 1 130px;max-width:170px}
.ahead .actions,.stat-per{flex-wrap:wrap}
.arow>span{min-width:0}

/* касса */
.cash-find .field{margin:0 0 10px}
.cash-btns{display:flex;gap:8px;flex-wrap:wrap}
.cash-btns .btn{flex:1 1 90px}
.cash-btns [data-cash-scan]{flex:2 1 200px}
[data-cash-res]:empty{display:none}
[data-cash-res]{margin:-4px 0 10px}
.akpis+.sheet{margin:0}
.cash-btns .i{width:20px;height:20px}
.cash-row{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:4px}
.cash-row:last-child{border-bottom:0;padding-bottom:0}
.cash-row .arow{border-bottom:0}
.cash-acts{display:flex;gap:8px}
.cash-acts .btn{flex:1}
.linklike.danger{color:var(--red)}
.chips-pick{display:flex;flex-wrap:wrap;gap:8px}
.chips-pick input{position:absolute;opacity:0;pointer-events:none}
.chips-pick label{position:relative;cursor:pointer}
.chips-pick span{display:block;padding:10px 14px;border:1px solid var(--line2);border-radius:99px;font-size:13px;font-weight:600;color:var(--text)}
.chips-pick input:checked+span{border-color:var(--acc);background:var(--accbg);color:var(--acc2)}
.chips-pick input:focus-visible+span{outline:2px solid var(--acc);outline-offset:2px}

/* места за столом, плитки, строки: длинное имя обрезается, а не раздвигает экран */
.w-seat,.w-row,.w-row-main,.me-tiles>*,.today-grid>*,.akpis>*,.stats-row>*,.more-grid>*{min-width:0}
.w-seat b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.w-row-main b{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.w-chip{max-width:100%}
.rname,.goer b{min-width:0;overflow-wrap:break-word}

/* таблицы админки на телефоне: карточки вместо прокрутки вбок */
@media (max-width:700px){
  .table-wrap:has(.atable.stack){overflow-x:visible}
  .atable.stack,.atable.stack tbody{display:block;width:100%}
  .atable.stack thead{display:none}
  .atable.stack tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;padding:14px 0;border-bottom:1px solid var(--line)}
  .atable.stack tr:last-child{border-bottom:0}
  .atable.stack td{display:block;grid-column:1/-1;padding:0 12px;border:0;min-width:0;overflow-wrap:anywhere}
  .atable.stack td.num{grid-column:auto;text-align:left}
  .atable.stack td.num::before{content:attr(data-l);display:block;color:var(--muted);font-size:12px;font-weight:500;line-height:1.3}
  .atable.stack td.void{display:none}
  .atable.stack td input,.atable.stack td input.sm{width:100%;min-width:0}
  .atable.stack td.logins{display:flex;flex-wrap:wrap;gap:4px 10px}
  /* итоги турнира: галочка и игрок в одной строке, место и очки под ними */
  .results .atable.stack tr{grid-template-columns:32px repeat(2,minmax(0,1fr))}
  .results .atable.stack td:first-child{grid-column:1;align-self:center}
  .results .atable.stack td:nth-child(2){grid-column:2/-1}
  .results .atable.stack td:nth-child(3){grid-column:2}
  .results .atable.stack td:nth-child(4){grid-column:3}
}
.who-cell>span:last-child{min-width:0}
@media (max-width:700px){.who-cell>span:last-child{overflow-wrap:anywhere}.atable.stack td.num input{text-align:left}}
h1,h2,.who-cell>span,.who-cell b,.who-cell small{overflow-wrap:anywhere;min-width:0}
.atable:not(.stack) .who-cell>span,.atable:not(.stack) .who-cell b{overflow-wrap:break-word}
.arow .who-cell,.arow>a{min-width:0}
h1{max-width:100%}
@media (max-width:700px){
  .stat-per .inline-form{grid-column:1/-1;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .stat-per .inline-form input[type=date]{max-width:none;width:100%;flex:none}
  .stat-per .inline-form .btn{grid-column:1/-1}
  .inline-form .btn{white-space:nowrap}
}
.msg{min-width:0}
.msg .bub{overflow-wrap:anywhere}
.arow>form{flex:none}
@media (max-width:700px){.atable.stack td.num{white-space:normal}}
@media (max-width:420px){.route-tabs{grid-template-columns:auto auto auto!important}.route-tabs button{font-size:12px!important;padding:9px 6px!important;white-space:nowrap}}

/* шапка на компьютере: логотип не сжимается и не заходит на меню */
@media (min-width:1000px){
  .top .logo{flex:none}
  .topnav{margin-left:18px;min-width:0}
  .topnav a{padding:8px 9px}
  .top .live-pill em{display:none}
  .top:has(.staff-link) .chip-link.dim{display:none}
}
@media (min-width:1000px) and (max-width:1139px){
  .top .chip-link.dim{display:none}
  .topnav{margin-left:10px}
  .topnav a{padding:8px 6px;font-size:14px}
  .top .live-pill[data-static] .lp-txt>span::after{content:" ждут"}
  body:not(.admin) .top .logo{font-size:13px}
}
/* На главной статус и значение помещаются в две строки. */
.live-pill[data-live-home] .lp-txt{display:flex!important;flex-direction:column!important;gap:0}
.live-pill[data-live-home] .lp-txt small.lp-now{display:block!important}
.top .live-pill[data-live-home] .lp-txt>span::after{content:""}
.top .live-pill[data-live-home] em{display:inline}

/* кабинет: кнопка рабочего места (только у сотрудника) */
.staff-go{margin:0 0 16px}
