/* Shared compact header and status on every game page. */
body.game-body.game-compact-header>.game-topbar{
  display:flex!important;flex-direction:row!important;flex-wrap:wrap;align-items:center!important;
  height:auto!important;max-height:none!important;min-height:0!important;padding:4px 8px!important;
  gap:3px 8px!important;box-sizing:border-box;width:100%;max-width:100%;
}
body.game-body.game-compact-header .game-topbar>.back{min-height:30px;padding:5px 7px;font-size:12px}
body.game-body.game-compact-header .game-topbar>div:first-of-type{min-width:0;max-width:340px}
body.game-body.game-compact-header .game-topbar h1{font-size:15px;line-height:1.1;margin:0;max-width:340px;white-space:normal;overflow-wrap:anywhere}
body.game-body.game-compact-header #gameSubline{font-size:11px;line-height:1.1;min-height:0;margin:2px 0 0;white-space:normal;overflow:visible}
body.game-body.game-compact-header .tiny-version{display:none}
body.game-body.game-compact-header .game-id-chip{
  order:0;flex:0 0 auto;width:auto;min-width:0;min-height:0!important;
  padding:2px 7px;gap:0;align-self:center;
}
body.game-body.game-compact-header .game-id-chip span{font-size:8px;line-height:1}
body.game-body.game-compact-header .game-id-chip strong{font-size:22px;line-height:1}
body.game-body.game-compact-header .top-actions{
  display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;align-items:center;
  gap:4px;margin-left:auto;min-width:0;max-width:100%;
}
body.game-body.game-compact-header .top-actions .button,
body.game-body.game-compact-header .game-qr-button{
  flex:0 0 auto;min-height:30px!important;height:auto!important;max-height:none!important;
  padding:5px 7px!important;font-size:12px!important;line-height:1.1;border-radius:7px;
}
body.game-body.game-compact-header .game-topbar svg{width:14px;height:14px}
/* Match fonts are unchanged; remove only the surrounding space. */
body.game-body.game-compact-header #matchCenterScore{
  order:6;flex:0 0 100%;width:100%;max-width:none;margin:0;
  min-height:0!important;max-width:none!important;height:auto!important;padding:2px 6px!important;gap:2px 10px!important;
}
body.game-body.game-compact-header .match-score-row{min-height:0!important;gap:4px}
body.game-body.game-compact-header .match-score-kind,
body.game-body.game-compact-header .match-score-player{padding-top:0;padding-bottom:0;gap:1px}
body.game-body.game-compact-header .match-score-player strong{min-height:0}
body.game-body.game-compact-header.chalk-display #matchCenterScore{display:none!important}
body.game-body.game-compact-header.chalk-display #gameSubline{display:none!important}
.game-input-qr-dialog{position:fixed;inset:0;margin:auto;width:min(94vw,480px);max-width:94vw;max-height:96dvh;box-sizing:border-box;padding:16px;border:3px solid #c5a154;border-radius:16px;background:#fff;color:#111;text-align:center;box-shadow:0 12px 60px #0009}
.game-input-qr-dialog::backdrop{background:#000c}
.game-input-qr-dialog h2{font-size:20px;line-height:1.15;margin:0 0 12px;color:#111}
.game-input-qr-dialog img{display:block;width:min(65vmin,400px);height:auto;max-width:100%;margin:0 auto;aspect-ratio:1;background:#fff}
.game-input-qr-dialog p{font-size:14px;line-height:1.2;margin:12px 0;color:#333}
.game-input-qr-dialog button{min-height:32px;padding:5px 14px;font-size:14px}
/* One source/status strip; warnings keep the saved source and reload action. */
body.game-body.game-compact-header #dartSourceSelection{
  display:flex;align-items:center;flex-wrap:wrap;gap:2px 10px;
  min-height:0;margin:0 0 4px;padding:3px 7px;font-size:12px;line-height:1.2;
  overflow-wrap:anywhere;
}
body.game-body.game-compact-header #dartSourceActive[hidden]{display:none!important}
body.game-body.game-compact-header #dartSourceSelectionFeedback:empty{display:none}
body.game-body.game-compact-header #dartSourceSelection #autodartsHint{
  margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;
  min-height:0;max-width:100%;font:inherit;
}
body.game-body.game-compact-header #dartSourceSelection .button{
  min-height:26px;padding:3px 6px;font-size:12px;
}
body.game-body.game-compact-status .game-status-stack{
  display:grid;grid-template-columns:minmax(0,1fr);gap:3px;
  flex:0 0 auto;min-width:0;margin:0 0 5px;padding:0;
}
body.game-body.game-compact-status .game-status-stack>.autodarts-hint{
  grid-column:1/-1;min-height:0;margin:0!important;padding:2px 6px;
  font-size:12px;line-height:1.2;overflow-wrap:anywhere;
}
body.game-body.game-compact-status #dartSourceSelection{grid-column:1;grid-row:1}
body.game-body.game-compact-status .game-status-stack>.game-message-shell{
  grid-column:1/-1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;
  gap:3px 6px;min-width:0;min-height:0;margin:0;height:auto!important;overflow:visible;
}
body.game-body.game-compact-status .game-message-shell .game-message{
  position:static!important;inset:auto;transform:none;max-width:100%;
  flex:1 1 240px;width:auto;height:auto!important;min-height:36px!important;max-height:none!important;
  display:flex;align-items:center;justify-content:center;gap:7px;
  margin:0!important;padding:4px 8px!important;box-sizing:border-box;
  font-size:clamp(16px,1.3vw,24px)!important;line-height:1.15;
  overflow:visible;white-space:normal;overflow-wrap:anywhere;border-radius:7px;
}
body.game-body.game-compact-status .autodarts-status-icon{
  flex:0 0 26px;width:26px;height:26px;font-size:18px;
}
body.game-body.game-compact-status .autodarts-status-icon svg{width:20px;height:20px;max-width:100%;max-height:100%}
body.game-body.game-compact-status .autodarts-status-text{
  min-width:0;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.15;
}
body.game-body.game-compact-status .autodarts-hit-list{gap:8px;flex-wrap:wrap}
body.game-body.game-compact-status .autodarts-hit .autodarts-dart-icon{width:24px;height:24px}
body.game-body.game-compact-status .autodarts-takeout-prompt{margin:0;min-width:160px;width:auto}
body.game-body.game-compact-status .autodarts-permanent-actions{
  position:static;inset:auto;transform:none;width:auto;max-width:100%;
  flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;gap:4px;margin:0;
}
body.game-body.game-compact-status .autodarts-permanent-actions button{
  flex:0 0 auto;min-height:32px;padding:4px 9px;font-size:14px;line-height:1.15;border-radius:7px;
}
body.game-body.game-compact-status .autodarts-permanent-actions svg{width:15px;height:15px}
body.game-body.game-compact-status .speech-activation-button{position:static;inset:auto;transform:none;min-height:32px;padding:4px 8px;font-size:13px}
@media(max-width:700px){
  body.game-body.game-compact-header>.game-topbar{padding:3px 5px!important;gap:3px 5px!important}
  body.game-body.game-compact-header .game-topbar>div:first-of-type{max-width:180px}
  body.game-body.game-compact-header .game-topbar h1{font-size:13px}
  body.game-body.game-compact-header #gameSubline{font-size:10px}
  body.game-body.game-compact-header .top-actions{flex-basis:100%;margin-left:0;justify-content:flex-start}
  body.game-body.game-compact-header .top-actions .button,
  body.game-body.game-compact-header .game-qr-button{min-height:26px!important;font-size:11px!important;padding:3px 5px!important}
  body.game-body.game-compact-status .game-status-stack{grid-template-columns:minmax(0,1fr)}
  body.game-body.game-compact-status #dartSourceSelection{grid-column:1;grid-row:1}
  body.game-body.game-compact-status .game-status-stack>.game-message-shell{grid-row:2}
  body.game-body.game-compact-status .game-message-shell .game-message{flex-basis:100%;font-size:16px!important;min-height:34px!important}
  body.game-body.game-compact-status .autodarts-permanent-actions{flex:1 1 auto;justify-content:flex-end}
  body.game-body.game-compact-status .autodarts-permanent-actions button{min-height:28px;padding:3px 8px;font-size:12px}
}
