/* Player windows share a dense layout; window headers retain their own controls. */
body[data-app-mode="player"] :is(.vtt-window-content, .player-side-panel, dialog) {
  font-size: 12px;
}
body[data-app-mode="player"] :is(.vtt-window-content, .player-side-panel, dialog) :is(button, .control-button, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea) {
  box-sizing: border-box;
  min-height: 24px;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.25;
}
body[data-app-mode="player"] :is(.vtt-window-content, .player-side-panel, dialog) :is(input, select, textarea) {
  min-width: 0;
}
body[data-app-mode="player"] :is(.vtt-window-content, .player-side-panel, dialog) input[type="number"] {
  width: 6rem;
  max-width: 100%;
}
body[data-app-mode="player"] :is(.vtt-window-content, .player-side-panel, dialog) :is(.field-label, .field-help, .control-label) {
  font-size: 11px;
  gap: 3px;
}
body[data-app-mode="player"] .player-topbar-actions { gap: 4px; }
body[data-app-mode="player"] .player-topbar-actions .control-button { min-height: 26px; padding: 4px 7px; font-size: 12px; }
body[data-app-mode="player"] :is(.combat-window-content, .roll-panel-content) { padding: 7px; gap: 6px; }
body[data-app-mode="player"] :is(.combat-quick-actions, .combat-summary-actions, .combat-token-tabs, .combat-skill-rolls) { gap: 4px; }
body[data-app-mode="player"] .resource-row-heading { padding: 6px 4px; gap: 5px; }
body[data-app-mode="player"] .resource-values { gap: 8px; font-size: 11px; }
body[data-app-mode="player"] .resource-row-actions { gap: 4px; }
body[data-app-mode="player"] .resource-list-tools { padding: 5px 2px; gap: 4px; }
body[data-app-mode="player"] .resource-list-tools input { min-width: 80px; }
body[data-app-mode="player"] .resource-row-details { padding: 8px; }
body[data-app-mode="player"] :is(.player-token-spells, .player-token-inventory, .player-token-attacks) { margin-top: 6px; padding-top: 6px; gap: 4px; }
body[data-app-mode="player"] .spell-rank-navigation { margin: 6px 0; gap: 4px; }
body[data-app-mode="player"] :is(.player-token-info-content, .player-token-info-card, .combat-column) { padding: 7px; gap: 5px; }
body[data-app-mode="player"] :is(.player-token-skills, .player-token-facing, .player-token-range) { margin-top: 6px; padding-top: 6px; gap: 4px; }
body[data-app-mode="player"] .combat-columns { gap: 6px; }
body[data-app-mode="player"] .player-token-spell-row .resource-row { padding: 0; }
body[data-app-mode="player"] :is(.combat-window, .player-token-spell-row) .resource-row { margin-bottom: 4px; }
.player-quick-dock { position:fixed; bottom:24px; left:24px; display:flex; gap:12px; z-index:8000; }
.player-quick-button { position:relative; display:grid; place-items:center; width:48px; height:48px; padding:11px; border:1px solid #697383; border-radius:50%; color:#edf2fa; background:#1c2633; box-shadow:0 4px 14px #0006; cursor:pointer; }
.player-quick-button:hover, .player-quick-button:focus-visible { background:#30435b; border-color:#a8c9f3; }
.player-quick-button.is-active { color:#fff; background:#34577c; border-color:#9acbff; box-shadow:0 0 0 2px #9acbff55, 0 4px 14px #0006; }
.player-quick-button:focus-visible { outline:2px solid #a8c9f3; outline-offset:3px; }
.player-quick-button svg { width:24px; height:24px; }
body[data-app-mode="player"] :is(#player-dice-button, .vtt-window:has(> .player-dice-window-content)) { --window-tone:#434746; --window-tone-active:#626966; --window-tone-edge:#afb7b2; }
body[data-app-mode="player"] :is(#player-combat-button, .combat-window) { --window-tone:#4b2025; --window-tone-active:#75313a; --window-tone-edge:#c77982; }
body[data-app-mode="player"] :is(#player-inventory-window-button, .vtt-window:has(> .player-inventory-window-content), .vtt-window:has(> .player-item-picker-content)) { --window-tone:#443024; --window-tone-active:#674a34; --window-tone-edge:#bc936e; }
body[data-app-mode="player"] .player-quick-button { background:var(--window-tone); border-color:var(--window-tone-edge); }
body[data-app-mode="player"] .player-quick-button:is(:hover, :focus-visible, .is-active) { background:var(--window-tone-active); border-color:var(--window-tone-edge); }
body[data-app-mode="player"] .player-quick-button.is-active { box-shadow:0 0 0 2px color-mix(in srgb, var(--window-tone-edge) 45%, transparent), 0 4px 14px #0006; }
body[data-app-mode="player"] .player-quick-button:focus-visible { outline-color:var(--window-tone-edge); }
body[data-app-mode="player"] .vtt-window:has(> :is(.player-dice-window-content, .combat-window-content, .player-inventory-window-content, .player-item-picker-content)) > .vtt-window-header { background:var(--window-tone); border-bottom:1px solid var(--window-tone-edge); }
body[data-app-mode="player"] .vtt-window:has(> :is(.player-dice-window-content, .combat-window-content, .player-inventory-window-content, .player-item-picker-content)) .vtt-window-title { color:#f0ede8; }
body[data-app-mode="player"] .vtt-window:has(> :is(.player-dice-window-content, .combat-window-content, .player-inventory-window-content, .player-item-picker-content)) > .vtt-window-header > button:is(:hover, :focus-visible) { background:var(--window-tone-active); border-color:var(--window-tone-edge); }
.player-dice-unread { position:absolute; top:-5px; right:-6px; min-width:19px; height:19px; padding:0 4px; box-sizing:border-box; border-radius:12px; background:#d52c3d; color:white; font:700 11px/19px system-ui; text-align:center; }
.player-dice-unread[hidden] { display:none; }
.combat-player-sheet { margin-left:auto; }
.combat-ability-summary { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; margin:5px 0; }
.combat-ability-card { padding:5px; border:1px solid var(--color-border); background:#11161d; font-size:12px; }
.combat-ability-card > span { display:flex; align-items:center; justify-content:center; gap:6px; }
.combat-ability-card > div { display:flex; justify-content:center; flex-wrap:wrap; gap:3px; margin-top:4px; }
body[data-app-mode="player"] .combat-ability-card button { padding:3px 4px; font-size:10px; }
body[data-app-mode="player"] .combat-columns-player { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); }
.combat-ability-summary small { color:var(--color-text-muted); font-size:10px; }
@media(max-width:600px) { .combat-ability-summary { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.player-inventory-window-content { padding:8px; }
.player-inventory-toolbar { display:flex; align-items:center; gap:6px; margin-bottom:5px; }
.player-inventory-toolbar .combat-token-tabs { flex:1; min-width:0; }
body[data-app-mode="player"] .player-token-inventory .resource-values .control-input { width:60px; padding:3px 4px; }
.player-item-picker-content { display:flex; flex-direction:column; padding:8px; gap:7px; }
.picker-quantity { display:flex; align-items:center; gap:7px; font-size:11px; }
.player-item-picker-results { flex:1; min-height:0; overflow:auto; }
.player-item-picker-row { display:flex; align-items:center; gap:8px; padding:6px 2px; border-bottom:1px solid var(--color-border); }
.player-item-picker-row > span { flex:1; min-width:0; overflow-wrap:anywhere; font-size:12px; }
.player-item-picker-content > p { margin:0; min-height:16px; }
.player-inventory-window-content .player-token-info-card > summary { display:none; }
.player-inventory-window-content .player-token-info-card { border:0; margin:0; padding:0; }
.player-inventory-window-content .player-token-resource-body { padding:0; }
.player-inventory-window-content .player-token-inventory { border:0; margin:0; padding:0; }
body[data-app-mode="player"] .player-token-inventory .resource-row-heading { display:flex; flex-wrap:wrap; gap:5px; padding:5px 2px; }
body[data-app-mode="player"] .player-token-inventory .resource-values { order:0; flex:0 0 60px; margin:0; gap:0; }
body[data-app-mode="player"] .player-token-inventory .resource-values > span { display:block; min-width:0; }
body[data-app-mode="player"] .player-token-inventory .resource-values small { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
body[data-app-mode="player"] .player-token-inventory .resource-name { order:1; flex:1 1 90px; min-width:70px; font-size:12px; }
body[data-app-mode="player"] .player-token-inventory .resource-expand { order:2; }
body[data-app-mode="player"] .player-token-inventory .resource-row-actions { order:3; flex:0 0 auto; margin:0; }
body[data-app-mode="player"] .resource-table > tbody.resource-row { margin:0; padding:0; }
.player-dice-window-content { display:flex; flex-direction:column; overflow:hidden; padding:8px; gap:6px; }
.player-dice-form { flex:0 0 auto; }
.player-dice-window-content .roll-form { gap:6px; padding-bottom:8px; }
.player-dice-window-content .roll-dice-buttons { gap:3px; }
.dice-skill-panel { display:flex; flex-direction:column; flex:0 1 auto; max-height:190px; min-height:70px; min-width:0; }
.dice-skill-panel[hidden] { display:none; }
.dice-skill-heading { display:flex; align-items:center; flex:0 0 auto; gap:5px; margin-bottom:4px; }
.dice-skill-heading h3 { flex:1; margin:0; font-size:12px; }
.dice-skill-heading select { max-width:140px; }
.dice-skill-controls { min-height:0; overflow:auto; }
.dice-skill-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
body[data-app-mode="player"] .dice-skill-grid > button { display:flex; align-items:center; justify-content:space-between; gap:4px; min-width:0; padding:4px 5px; font-size:11px; text-align:left; }
.dice-skill-grid > button > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-dice-window-content > h3 { flex:0 0 auto; margin:2px 0; font-size:12px; }
.player-dice-history { flex:1; min-height:0; overflow:auto; display:grid; grid-auto-rows:64px; gap:6px; align-content:start; }
.roll-entry-mini { box-sizing:border-box; display:grid; grid-template-rows:16px 20px 14px; padding:6px 8px; border:1px solid var(--color-border); background:#11161d; }
.roll-mini-name, .roll-mini-result code { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.roll-mini-name { font-size:11px; }
.roll-mini-result { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.roll-entry-mini small { color:var(--color-text-muted); font-size:10px; }
@media(max-width:600px) { .player-quick-dock { bottom:16px; left:16px; gap:8px; } }

/* A second player surface keeps the table and table controls only. */
body.table-only .player-main { grid-template-rows:minmax(0, 1fr); }
body.table-only :is(.player-activity-copy, #world-date-output, #app-status, .player-quick-dock) { display:none; }
body.table-only .player-activity-bar { position:fixed; top:12px; left:12px; z-index:8000; padding:4px; min-height:0; width:auto; gap:4px; border:0; box-shadow:none; border-radius:6px; background:#10161fe8; }
body.table-only .player-topbar-actions > :not(#player-ping-panel-button) { display:none; }
body.table-only .player-panel-stack { display:none; }
body.table-only .player-side-panel:not(#player-ping-panel) { display:none; }
body.table-only .overlay-window:not(.table-scene-surface) { display:none; }
body.table-only .table-scene-surface:not(.overlay-window-expanded) { display:none; }
body.table-only.table-spectator :is(.player-activity-bar, .player-panel-stack) { display:none; }
body[data-app-mode="player"] .signalruf-stack { left:24px; bottom:84px; z-index:8100; }
@media(max-width:600px) { body[data-app-mode="player"] .signalruf-stack { left:16px; bottom:76px; } }
body.table-only .signalruf-stack { left:16px; bottom:16px; }
