/* Kings & Kaisers — multiplayer chrome. Uses the game's own steel/brass
   palette and Georgia display type so the war room reads as part of it. */
/* Owner report 2026-11-18: the bar (WAR ROOM, REPORT BUG, ...) stays on screen even if the page scrolls. */
#mp-bar {
  position: sticky; top: 0; z-index: 150;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 7px 18px;
  background: linear-gradient(180deg, #2a2418, #16140f);
  border-bottom: 1px solid #6b5a38;
  color: #d9d1c1; font: 12px/1.3 Arial, Helvetica, sans-serif;
}
#mp-bar[hidden] { display: none; }
#mp-bar.mp-pulse { animation: mpPulse .9s ease; }
@keyframes mpPulse { 30% { background: linear-gradient(180deg, #5a3b22, #2a1b12); box-shadow: 0 0 0 2px #d4a95a inset; } }
.mp-bar-main, .mp-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.mp-bar-main strong { font: 700 14px Georgia, serif; color: #f0e6d2; letter-spacing: .02em; }
.mp-bar-main small { color: #9d9582; font-size: 11px; }
.mp-bar-roundel { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.7); }
.mp-chip { padding: 3px 7px; border: 1px solid #8a7447; color: #e2c98c; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.mp-chip-muted { border-color: #4b504a; color: #9aa096; }
.mp-status { color: #bdb49f; }
.mp-status b { color: #f0e6d2; }
.mp-status-yours { padding: 3px 9px; background: #7e2f28; border: 1px solid #d08a6e; color: #ffe6c2; }
.mp-status-yours b { color: #fff3d6; letter-spacing: .12em; }
/* Teammate cover: "Your team's turn – you can cover for <name>" */
.mp-status-team { padding: 3px 9px; background: #3d4529; border: 1px solid #a3ae6c; color: #eef0d2; }
.mp-status-team b { color: #fbfde6; letter-spacing: .12em; }
.mp-notice { flex-basis: 100%; color: #f0b889 !important; }
.mp-you { color: #a99f87; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.mp-btn { padding: 6px 10px; border: 1px solid #4a4e48; background: #1d211e; color: #cfc7b5; font: 800 10px Arial, sans-serif; letter-spacing: .13em; cursor: pointer; }
.mp-btn:hover { border-color: #b4995d; color: #fff0c9; }
.mp-btn-brass { border-color: #9c8350; color: #f0d898; background: #2a2518; }
/* Owner request 2026-10-27: ASSIGN PLAYERS glows and pulses until the game
   starts, like the front page's IT'S YOUR TURN button. */
.mp-btn-pulse { border-color: #e8c25a; color: #ffe9a8; background: #3a3017; box-shadow: 0 0 10px 2px rgba(240, 200, 80, .55); animation: mp-assign-glow 2.4s ease-in-out infinite; }
@keyframes mp-assign-glow { 50% { box-shadow: 0 0 16px 4px rgba(240, 200, 80, .8); } }
@media (prefers-reduced-motion: reduce) { .mp-btn-pulse { animation: none; } }
.mp-assign-note { margin: 0 0 14px; padding: 8px 11px; border: 1px solid #9c8350; background: #2a2518; color: #f0d898; font-size: 12px; max-width: 62ch; }
.mp-btn:focus-visible, .mp-primary:focus-visible, .mp-secondary:focus-visible, .mp-danger:focus-visible, .mp-link:focus-visible { outline: 2px solid #e6c47a; outline-offset: 2px; }

/* While it is someone else's turn the command controls are dimmed and inert
   (clicks are intercepted); the map can still be panned and zoomed. */
/* Owner request 2026-11-18: the panels stay usable on someone else's turn; only the controls that still are locked
   (current phase's module, Diplomacy window, PROCEED, PREVIOUS PHASE) are dimmed. */
html[data-mp-turn="waiting"] #kk-root .command-panel > .kk-module-main > :not(.kk-module-head),
html[data-mp-turn="waiting"] #kk-root .command-panel > [data-module="diplomacy"] > :not(.kk-module-head),
html[data-mp-turn="waiting"] #kk-root .main-command-bar > button,
html[data-mp-turn="waiting"] #kk-root .kk-actions > button.phase-back,
html[data-mp-turn="waiting"] #kk-root .modal-screen:not(.convoy-report-screen):not(.diplomatic-report-screen) .battle-next,
html[data-mp-turn="waiting"] #kk-root .modal-screen .dialog-actions { opacity: .5; filter: grayscale(.35); cursor: not-allowed; }
html[data-mp-turn="waiting"] #kk-root .map-region,
html[data-mp-turn="waiting"] #kk-root .map-unit { cursor: default; }
/* Owner request 2026-10-12: the site admin's ADMIN EDITOR works on any
   player's turn, so it is never dimmed (kk-host.js lets it through). */
html[data-mp-turn="waiting"] #kk-root .kk-actions > button[data-admin-editor],
html[data-mp-turn="waiting"] #kk-root [data-admin-editor-window] .dialog-actions { opacity: 1; filter: none; cursor: pointer; }
/* Only the admin may reset the shared board or load a local save into it. */
html[data-mp-role="player"] #kk-root .kk-actions .danger-outline,
html[data-mp-role="player"] #kk-root .kk-actions .saved-action,
html[data-mp-role="player"] #kk-root .mobile-game-menu .danger { display: none; }

/* Full-screen war room (connecting, registration, lobby). */
#mp-overlay { display: none; }
#mp-overlay.open {
  display: block; position: fixed; inset: 0; z-index: 200; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 45% -30%, #333a35, #0b0e0d 62%);
}
.mp-screen { min-height: 100%; display: grid; place-items: center; }
.mp-panel {
  width: min(880px, 100%); position: relative; padding: 30px;
  background: linear-gradient(145deg, #252a26, #101312 68%);
  border: 1px solid #806c49; box-shadow: 0 28px 90px #000; color: #ddd5c4;
  font: 13px/1.5 Arial, Helvetica, sans-serif;
}
.mp-panel::before, .mp-dialog::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(172,149,98,.16); pointer-events: none; }
.mp-narrow { width: min(520px, 100%); }
.mp-center { text-align: center; }
.mp-center .mp-brand { justify-content: center; }
.mp-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.mp-brand > div { display: flex; flex-direction: column; }
.mp-brand strong { font: 700 21px Georgia, serif; letter-spacing: .09em; color: #f0eadf; white-space: nowrap; }
.mp-brand strong i { color: #b0443c; font-style: normal; }
.mp-brand small { color: #ac9562; font-size: 9px; letter-spacing: .3em; margin-top: 3px; }
.mp-eyebrow { display: block; color: #c46a5f; font-size: 10px; font-weight: 800; letter-spacing: .24em; }
.mp-panel h2, .mp-dialog h2 { margin: 6px 0 10px; color: #f1e8d9; font: 700 26px/1.15 Georgia, serif; text-wrap: balance; }
.mp-panel h3 { margin: 26px 0 10px; color: #c9b27b; font: 700 15px Georgia, serif; letter-spacing: .03em; }
.mp-lede { color: #a8a291; max-width: 62ch; margin-bottom: 14px; }
.mp-field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.mp-field > span { color: #ac9562; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.mp-field input, .mp-field select, .mp-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #4b4a3e; background: #121513; color: #efe6d4;
  font: 15px Arial, sans-serif; outline: none;
}
.mp-field textarea { font-size: 13px; resize: none; }
.mp-field input:focus, .mp-field select:focus, .mp-field textarea:focus { border-color: #c8a75d; box-shadow: 0 0 0 3px rgba(200,167,93,.16); }
.mp-error { color: #f09a86; font-size: 12px; margin: -4px 0 8px; }
.mp-error[hidden] { display: none; }
.mp-warning { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #7a5a37; background: rgba(122,90,55,.18); color: #f1cf9c; }
.mp-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.mp-primary, .mp-secondary, .mp-danger {
  min-height: 42px; padding: 0 18px; cursor: pointer; font: 800 11px Arial, sans-serif; letter-spacing: .14em;
}
.mp-primary { border: 1px solid #b0705f; background: linear-gradient(180deg, #8d3830, #62231f); color: #fff0d8; box-shadow: inset 0 0 0 2px rgba(0,0,0,.24); }
.mp-primary:hover:not(:disabled) { filter: brightness(1.15); }
.mp-primary:disabled { opacity: .5; cursor: not-allowed; }
.mp-secondary { border: 1px solid #5a5a4c; background: #1c201d; color: #d9cfb8; }
.mp-secondary:hover { border-color: #b4995d; color: #fff0c9; }
.mp-danger { border: 1px solid #8e4a40; background: transparent; color: #f0a597; }
.mp-danger:hover { background: rgba(142,74,64,.2); }
.mp-small { min-height: 32px; padding: 0 12px; font-size: 10px; }
.mp-link { border: 0; background: none; color: #d8bd7c; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.mp-muted { color: #7f857e; font-size: 11px; }

.mp-lobby-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mp-lobby-head .mp-brand { margin-bottom: 8px; }
.mp-lobby-who { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mp-lobby-who > span { color: #7f857e; font-size: 9px; letter-spacing: .2em; }
.mp-lobby-who strong { font: 700 16px Georgia, serif; color: #efe5d1; }
.mp-lobby-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }
.mp-game-list { display: grid; gap: 8px; }
.mp-game-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid #353b36; background: #141816;
}
.mp-game-card.mp-your-turn { border-color: #b0705f; background: linear-gradient(90deg, rgba(141,56,48,.22), #141816 60%); }
.mp-game-card img, .mp-card-dot { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.mp-card-dot { display: block; background: #3a3f3a; }
.mp-game-card > div { min-width: 0; display: flex; flex-direction: column; }
.mp-game-card strong { font: 700 15px Georgia, serif; color: #f0e6d2; overflow-wrap: anywhere; }
.mp-game-card small { color: #b2a98f; font-size: 12px; }
.mp-game-card em { color: #7f877f; font-size: 11px; font-style: normal; overflow-wrap: anywhere; }
.mp-turn-tag { padding: 3px 7px; background: #7e2f28; border: 1px solid #d08a6e; color: #ffe6c2; font-size: 9px; letter-spacing: .14em; white-space: nowrap; }
.mp-empty { color: #8b8f86; padding: 14px; border: 1px dashed #3d433e; }

/* Dialogs (seats, invite, create) layered over the live board. */
#mp-dialog-layer { display: none; }
#mp-dialog-layer.open { display: block; }
.mp-scrim {
  position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 16px;
  background: rgba(4,7,6,.86); backdrop-filter: blur(4px); overflow-y: auto;
}
.mp-dialog {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; position: relative; padding: 30px;
  background: linear-gradient(145deg, #252a26, #101312 68%); border: 1px solid #806c49; box-shadow: 0 28px 90px #000;
  color: #ddd5c4; font: 13px/1.5 Arial, Helvetica, sans-serif;
}
.mp-dialog.mp-wide { width: min(720px, 100%); }
.mp-x { position: absolute; right: 12px; top: 10px; z-index: 2; width: 34px; height: 34px; border: 1px solid #4a4e48; background: #171b19; color: #d9cfb8; font-size: 20px; cursor: pointer; }
.mp-seat-list { display: grid; gap: 6px; }
.mp-seat {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid #323833; background: #131715;
}
.mp-seat img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.mp-seat > div { min-width: 0; display: flex; flex-direction: column; }
.mp-seat strong { font: 700 14px Georgia, serif; color: #efe5d1; }
.mp-seat small { color: #978f7c; font-size: 11px; overflow-wrap: anywhere; }
/* Wide enough for "Open to any Allied Power Player" (owner request 2026-10-27). */
.mp-seat select { max-width: 240px; padding: 7px; border: 1px solid #4b4a3e; background: #121513; color: #efe6d4; font-size: 12px; }
.mp-seat-current { border-color: #8a5a44; }
.mp-seat-mine { background: linear-gradient(90deg, rgba(172,149,98,.14), #131715 55%); }
.mp-seat-team { border-style: dashed; }
.mp-seat .mp-cover-seat { align-self: flex-start; margin-top: 5px; }
.mp-admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #343a36; }
.mp-admin-tools .mp-eyebrow { flex-basis: 100%; }
.mp-steps { margin: 4px 0 8px; padding-left: 20px; list-style: decimal; color: #b9b19c; }
.mp-steps li { margin: 8px 0; }
.mp-steps strong { color: #efe5d1; }
.mp-copy-row { display: flex; gap: 8px; }
.mp-copy-row input { flex: 1; min-width: 0; font-size: 13px; }
.mp-fineprint { color: #7f857e; font-size: 11px; }

.mp-turn-flash {
  position: fixed; left: 50%; top: 18%; z-index: 205; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 16px 26px;
  background: linear-gradient(180deg, #8d3830, #5a211d); border: 1px solid #e0a080; box-shadow: 0 20px 60px rgba(0,0,0,.7);
  color: #fff1d9; transition: opacity .5s ease, transform .5s ease;
}
.mp-turn-flash img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.mp-turn-flash div { display: flex; flex-direction: column; }
.mp-turn-flash span { font: 800 11px Arial, sans-serif; letter-spacing: .24em; color: #ffd8a8; }
.mp-turn-flash strong { font: 700 24px Georgia, serif; }
.mp-turn-flash.mp-out { opacity: 0; transform: translate(-50%, -12px); }
@media (prefers-reduced-motion: reduce) { #mp-bar.mp-pulse { animation: none; } .mp-turn-flash { transition: none; } }

@media (max-width: 900px) {
  #mp-bar { padding: 6px 12px; }
  .mp-you { display: none; }
  .mp-panel, .mp-dialog { padding: 22px 18px; }
  .mp-panel h2, .mp-dialog h2 { font-size: 22px; }
  .mp-game-card { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .mp-game-card .mp-turn-tag { grid-column: 2; justify-self: start; }
  .mp-seat { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .mp-seat .mp-turn-tag { display: none; }
  .mp-lobby-who { align-items: flex-start; }
}

/* Give the game its full screen back by subtracting the bar's height. */
html[data-mp-bar] .kk-grid { height: calc(100vh - var(--kk-grid-top, calc(214px + var(--mp-bar-h, 0px)))); }
/* Desktop: the game's windows (ADMIN EDITOR, battle window, manuals, dialogs)
   open below the bar. They are up to 92-94vh tall and centred, so their top
   edge and ✕ sat under the bar (z-index 150) and could not be clicked, e.g.
   the admin editor's close button in admin view. Phones: the game's own rule. */
@media (min-width: 901px) and (min-height: 521px), (min-width: 901px) and (pointer: fine) {
  html[data-mp-bar] #kk-root .modal-screen { top: var(--mp-bar-h, 0px); }
  html[data-mp-bar] #kk-root .modal-screen > .campaign-dialog,
  html[data-mp-bar] #kk-root .modal-screen > .unit-manual,
  html[data-mp-bar] #kk-root .modal-screen > .help-manual { max-height: calc(100vh - var(--mp-bar-h, 0px) - 40px); }
}
@media (max-width: 900px) {
  html[data-mp-bar] .kk-shell { height: calc(100dvh - var(--mp-bar-h, 0px)); }
  html[data-mp-bar] .kk-grid { height: calc(100dvh - 226px - var(--mp-bar-h, 0px)); }
  html[data-mp-bar] .mobile-game-menu { top: calc(62px + var(--mp-bar-h, 0px)); }
  #mp-bar { gap: 5px 8px; padding: 6px 10px; font-size: 11px; }
  .mp-bar-main { flex-wrap: nowrap; gap: 6px; min-width: 0; flex: 1 1 100%; }
  .mp-bar-main .mp-chip, .mp-bar-main strong { display: none; }
  .mp-bar-main small:not(.mp-notice) { display: none; }
  .mp-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .mp-bar-actions { flex: 1 1 100%; flex-wrap: nowrap; }
  .mp-bar-actions .mp-btn { flex: 1; padding: 6px 4px; font-size: 9px; }
}

/* ---- web host additions ---- */
#mp-bar a.mp-btn { text-decoration: none; display: inline-flex; align-items: center; }
#mp-bar .mp-notice { color: #f0b889; }
.mp-form .mp-actions { justify-content: flex-start; }
.cookie-note { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300; max-width: 560px; margin: 0 auto; padding: 10px 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #1b1f1c; border: 1px solid #6b5a38; box-shadow: 0 16px 40px #000; color: #ddd5c4; font: 12px Arial, sans-serif; }
.cookie-note a { color: #e2c98c; }
.cookie-note .btn { padding: 6px 12px; border: 1px solid #5a5a4c; background: #1c201d; color: #d9cfb8; font: 800 10px Arial, sans-serif; letter-spacing: .14em; cursor: pointer; }

/* Free preview paywall (solo games): full-screen, above the board and every
   game dialog; only SUBSCRIBE and SAVE & EXIT. */
#mp-paywall { display: none; }
#mp-paywall.open {
  display: block; position: fixed; inset: 0; z-index: 400; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 45% -30%, rgba(51,58,53,.97), rgba(11,14,13,.97) 62%);
  backdrop-filter: blur(5px);
}
#mp-paywall .mp-panel { width: min(600px, 100%); }
#mp-paywall h2 { font-size: 30px; }
#mp-paywall .mp-lede { margin-left: auto; margin-right: auto; font-size: 15px; color: #d6cdb8; }
#mp-paywall .mp-paywall-actions { justify-content: center; }
#mp-paywall .mp-primary { min-width: 180px; }
#mp-paywall .mp-fineprint { margin-top: 16px; }
html[data-mp-paywall] body { overflow: hidden; }
.mp-free-notice { color: #e9cf8e !important; }
@media (max-width: 560px) { #mp-paywall h2 { font-size: 23px; } #mp-paywall .mp-paywall-actions > button { flex: 1 1 100%; } }

/* Campaign Log: subscribers only (owner rule 2026-10-04). Hidden until the plan is known. */
html[data-kk-plan="free"] .kk-module[data-module="campaign-log"],
html[data-kk-plan="free"] .campaign-log,
html[data-kk-plan="unknown"] .kk-module[data-module="campaign-log"],
html[data-kk-plan="unknown"] .campaign-log { display: none !important; }
html[data-kk-plan="free"] .campaign-log-button,
html[data-kk-plan="unknown"] .campaign-log-button { display: none !important; }

/* ---- Factions (seats dialog, side picker) ---- */
.mp-faction { margin: 16px 0 0; padding: 12px; border: 1px solid #323833; background: rgba(12,15,13,.55); }
.mp-faction-mine { border-color: #806c49; }
.mp-faction-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.mp-faction-head h3 { margin: 0; font: 700 16px Georgia, serif; color: #e2c98c; }
.mp-faction[data-faction="central"] .mp-faction-head h3 { color: #f0c99a; }
.mp-faction[data-faction="allied"] .mp-faction-head h3 { color: #bcd6ea; }
.mp-faction-head small { color: #978f7c; font-size: 11px; }
.mp-roster .mp-faction-head h3 { color: #e2c98c; }
.mp-member { grid-template-columns: 14px minmax(0, 1fr) auto auto; }
.mp-member-dot { width: 10px; height: 10px; border-radius: 50%; background: #4b504a; }
.mp-member-dot[data-faction="central"] { background: #c98a4b; }
.mp-member-dot[data-faction="allied"] { background: #5f89aa; }
.mp-actions-left { justify-content: flex-start; margin-top: 4px; }
.mp-faction-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mp-faction-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; border: 1px solid #5a5a4c; background: #141816; color: #ddd5c4; font: 13px/1.4 Arial, sans-serif; cursor: pointer; }
.mp-faction-card:hover, .mp-faction-card:focus-visible { border-color: #e2c98c; outline: none; box-shadow: 0 0 0 1px #e2c98c inset; }
.mp-faction-card strong { font: 700 18px Georgia, serif; color: #f1e8d9; }
.mp-faction-card[data-faction="central"] strong { color: #f0c99a; }
.mp-faction-card[data-faction="allied"] strong { color: #bcd6ea; }
.mp-faction-card small { color: #978f7c; font-size: 11px; }
.mp-faction-nations { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 12px; }
.mp-faction-nations > span { display: flex; align-items: center; gap: 7px; }
.mp-faction-nations img { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.mp-faction-notice { color: #e9cf8e !important; }
/* The "Leave the game?" prompt also sits above the solo paywall. */
.mp-scrim.mp-scrim-top { z-index: 450; }

/* ---- Phones: one compact row ("☰ GAME" · name · status) + the GAME sheet ---- */
.mp-bar-compact { display: none; }
#mp-sheet-layer { display: none; }
#mp-sheet-layer.open { display: block; }
.mp-sheet-scrim {
  position: fixed; inset: 0; z-index: 220; display: flex; align-items: flex-start; justify-content: flex-start;
  padding-top: var(--mp-bar-h, 0px); background: rgba(4,7,6,.72);
}
.mp-sheet {
  position: relative; width: min(420px, 100%); max-height: calc(100vh - var(--mp-bar-h, 0px)); max-height: calc(100dvh - var(--mp-bar-h, 0px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px max(14px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: linear-gradient(160deg, #252a26, #101312 70%); border: 1px solid #806c49; border-top: 0; box-shadow: 0 24px 60px #000;
  color: #ddd5c4; font: 13px/1.45 Arial, Helvetica, sans-serif;
}
.mp-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mp-sheet-head > div { min-width: 0; display: flex; flex-direction: column; }
.mp-sheet-head strong { font: 700 17px Georgia, serif; color: #f1e8d9; overflow-wrap: anywhere; }
.mp-sheet-x { flex: none; width: 44px; height: 44px; border: 1px solid #4a4e48; background: #171b19; color: #d9cfb8; font-size: 18px; cursor: pointer; }
.mp-sheet-status { margin: 0 0 8px; }
.mp-sheet-status .mp-status { display: inline-block; }
.mp-sheet-notice { margin: 0 0 8px; color: #f0b889; font-size: 12px; }
.mp-sheet-you { margin: 0 0 10px; color: #a99f87; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.mp-sheet-actions { display: grid; gap: 8px; }
.mp-sheet-btn { min-height: 46px; padding: 0 14px; text-align: left; border: 1px solid #4a4e48; background: #1d211e; color: #e3dbc8; font: 800 12px Arial, sans-serif; letter-spacing: .13em; cursor: pointer; }
.mp-sheet-btn-brass { border-color: #9c8350; background: #2a2518; color: #f0d898; }
.mp-sheet-btn-leave { margin-top: 6px; border-color: #6b4a40; color: #f0b3a3; }
.mp-sheet-btn:focus-visible, .mp-sheet-x:focus-visible, .mp-menu-btn:focus-visible { outline: 2px solid #e6c47a; outline-offset: 2px; }
.mp-menu-btn {
  position: relative; flex: none; min-height: 34px; padding: 0 12px; border: 1px solid #9c8350; background: #2a2518; color: #f0d898;
  font: 800 11px Arial, sans-serif; letter-spacing: .14em; cursor: pointer; touch-action: manipulation;
}
.mp-menu-btn span { font-size: 14px; margin-right: 2px; }
.mp-badge { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #d4553f; box-shadow: 0 0 0 2px #16140f; }
.mp-compact-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px Georgia, serif; color: #f0e6d2; }
.mp-compact-status { flex: 0 0 auto; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 7px; border: 1px solid #4b504a; color: #bdb49f; font: 800 9px Arial, sans-serif; letter-spacing: .12em; }
.mp-compact-status[data-tone="yours"] { background: #7e2f28; border-color: #d08a6e; color: #ffe6c2; }
.mp-compact-status[data-tone="team"] { background: #3d4529; border-color: #a3ae6c; color: #eef0d2; }

@media (max-width: 760px), (max-height: 500px) and (max-width: 1100px) {
  #mp-bar { flex-wrap: nowrap; gap: 8px; min-height: 42px; padding: 4px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px)); }
  #mp-bar > .mp-bar-main:not(.mp-bar-plain), #mp-bar > .mp-bar-actions:not(.mp-bar-plain) { display: none; }
  #mp-bar > .mp-bar-plain { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
  #mp-bar > .mp-bar-plain small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mp-bar > .mp-bar-actions.mp-bar-plain { flex: none; }
  .mp-bar-compact { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; }
  /* Dialogs: full-height scroll and roomier tap targets on phones. */
  .mp-scrim { padding: 8px; align-items: start; }
  .mp-dialog { max-height: calc(100dvh - 16px); padding: 20px 14px 16px; }
  .mp-x { width: 44px; height: 44px; right: 6px; top: 6px; }
  .mp-seat select { max-width: 170px; min-height: 40px; }
  .mp-faction { padding: 10px 8px; }
}

/* Admin editor (wave 14): the notice players see after a site-admin edit, and the admin's own observer view. */
.mp-admin-notice { color: #f6d27a !important; font-weight: 600; }
#mp-bar .mp-admin-notice { color: #f6d27a; }
.mp-admin-view-notice { color: #b9d7f0 !important; }
.mp-turn-flash.mp-admin-flash { border-color: #f6d27a; max-width: min(560px, calc(100vw - 32px)); }
.mp-turn-flash.mp-admin-flash strong { font-size: 15px; white-space: normal; }
.mp-sheet-notice.mp-admin-notice { color: #f6d27a; }

/* Owner request 2026-10-21: END GAME (private request to the campaign's players). */
.mp-endgame p { font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
.mp-endgame-rules { list-style: disc; margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: #d9cfb8; }
.mp-endgame-warning { padding: 8px 10px; border: 1px solid #9b5d50; background: rgba(90,30,24,.35); color: #f2c3b8; }
.mp-endgame-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 0 0 10px; }
.mp-endgame-side { padding: 8px 10px; border: 1px solid #4a4434; background: #141713; }
.mp-endgame-side > b { display: block; margin-bottom: 6px; font: 900 10px Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.mp-endgame-central > b { color: #f4b2a8; }
.mp-endgame-allied > b { color: #b9d2f2; }
.mp-endgame-player { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.mp-endgame-player em { font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .06em; color: #a9a291; }
.mp-endgame-player.agree em { color: #9fd49a; }
.mp-endgame-player.decline em { color: #f09a86; }
.mp-endgame-deadline { color: #a9a291; font-size: 12px !important; }
.mp-endgame-notice { color: #ffd9a8; font-weight: 700; }
.mp-endgame-banner { display: flex; flex: 1 1 100%; order: -1; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; margin: 0; border-radius: 3px; padding: 9px 14px; border: 0; border-bottom: 2px solid #ff6a5a; background: linear-gradient(180deg, #b3261e, #7d1712); color: #fff3ef; font: 600 13px/1.35 Arial, sans-serif; text-align: center; cursor: pointer; animation: mp-endgame-pulse 2.4s ease-in-out infinite; }
.mp-endgame-banner b { font-weight: 900; letter-spacing: .12em; }
.mp-endgame-banner { cursor: default; }
.mp-endgame-banner-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; flex: 1 1 360px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.mp-endgame-banner-text:hover span { text-decoration: underline; }
.mp-endgame-banner-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mp-endgame-agree, .mp-endgame-decline { padding: 7px 12px; border: 1px solid #fff; font: 900 11px Arial, sans-serif; letter-spacing: .1em; cursor: pointer; }
.mp-endgame-agree { background: #fff3ef; color: #7d1712; }
.mp-endgame-decline { background: rgba(0,0,0,.35); color: #fff3ef; }
.mp-endgame-agree:hover, .mp-endgame-decline:hover { filter: brightness(1.12); }
.mp-endgame-agree:disabled, .mp-endgame-decline:disabled { opacity: .5; cursor: wait; }
.mp-endgame-banner:hover, .mp-endgame-banner:focus-visible { filter: brightness(1.15); outline: none; }
@keyframes mp-endgame-pulse { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); } 50% { box-shadow: inset 0 0 18px 0 rgba(255,210,200,.35); } }
@media (prefers-reduced-motion: reduce) { .mp-endgame-banner { animation: none; } }
/* Phone bar is one row: the END GAME banner takes its own full-width row on top. */
@media (max-width: 760px), (max-height: 500px) and (max-width: 1100px) {
  #mp-bar:has(> .mp-endgame-banner) { flex-wrap: wrap; }
  .mp-endgame-banner { padding: 7px 10px; font-size: 12px; }
  .mp-endgame-banner-text span { flex-basis: 100%; }
  .mp-endgame-banner-buttons { flex-basis: 100%; }
  .mp-endgame-agree, .mp-endgame-decline { flex: 1 1 0; padding: 8px 6px; }
}

/* Owner request 2026-10-22: SWITCH SIDES in SEATS before the game starts. */
.mp-switch-side { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #9c8350; background: #221d14; }
.mp-switch-side strong { display: block; color: #f0d898; font-size: 13px; }
.mp-switch-side small { color: #c9bfa8; font-size: 12px; }
.mp-removal-request { border-color: #8f4a3c; background: #251612; }
.mp-removal-list strong { display: block; margin: 16px 0 6px; color: #f0d898; font-size: 12px; letter-spacing: .12em; }
.mp-removal-item { margin: 4px 0; padding: 6px 10px; border-left: 3px solid #9c8350; background: #1d1912; color: #d8cfb8; font-size: 12px; }
.mp-removal-item[data-removal-status="remove"] { border-left-color: #b8483a; }
.mp-removal-item[data-removal-status="decline"] { border-left-color: #6d6a62; }

/* Owner request 2026-10-23: invite players from the roster inside the invite window. */
.mp-invite-roster { margin-top: 16px; padding-top: 14px; border-top: 1px solid #4a3f2c; }
.mp-roster-list { max-height: 210px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; padding: 6px; border: 1px solid #3c3426; background: #15130f; }
.mp-roster-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #3c3426; background: #1d1a14; color: #e9dfc6; font-size: 13px; cursor: pointer; }
.mp-roster-row:hover { border-color: #9c8350; }
.mp-roster-row input { accent-color: #b8483a; }

/* Owner request 2026-11-08: REPORT BUG (red button in the top bar, form with a red SUBMIT at the bottom). */
.mp-btn.mp-btn-bug { border-color: #e0574a; background: linear-gradient(180deg, #b8231b, #7d140f); color: #fff; }
.mp-btn.mp-btn-bug:hover { background: linear-gradient(180deg, #d22b21, #8f1812); }
.mp-bug-form textarea { width: 100%; min-height: 140px; }
.mp-bug-form input[readonly] { width: 100%; opacity: .85; cursor: default; }
.mp-bug-shots { margin: 10px 0 4px; font-size: 12px; }
.mp-bug-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 6px; }
.mp-bug-thumbs figure { margin: 0; }
.mp-bug-thumbs img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid #4a4e48; }
.mp-bug-thumbs figcaption { font-size: 10px; opacity: .75; text-align: center; }
.mp-bug-actions { justify-content: center; }
.mp-bug-submit { min-width: 220px; padding: 12px 28px; border: 1px solid #e0574a; background: linear-gradient(180deg, #c42a20, #7d140f); color: #fff; font: 800 15px Arial, sans-serif; letter-spacing: .16em; cursor: pointer; }
.mp-bug-submit:disabled { opacity: .6; cursor: wait; }

/* TRY THE GAME (owner request 2026-11-19): the trial's chip, welcome window and end screen use the Field Advisor's steel
   blue (the in-game tutorial tips), so the trial reads as one guided experience. */
.mp-chip-trial { border-color: #6f9fcf; color: #e6f1ff; background: #1d3550; }
#mp-dialog-layer[data-open="trial-welcome"] .mp-dialog { width: min(760px, 100%); border-color: #6f9fcf; background: linear-gradient(160deg, #1c2c3c, #111a23 70%); box-shadow: 0 28px 90px #000, 0 0 24px rgba(111, 159, 207, .25); }
#mp-dialog-layer[data-open="trial-welcome"] .mp-eyebrow { color: #f2c94c; }
#mp-dialog-layer[data-open="trial-welcome"] h2 { color: #fff4d6; }
.mp-trial-welcome .mp-lede { color: #d6e2ef; max-width: 66ch; }
.mp-trial-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0 6px; }
.mp-trial-example { margin: 0; display: grid; gap: 6px; }
.mp-trial-example img { display: block; width: 100%; height: auto; border: 1px solid #3d5770; background: #0c1218; }
.mp-trial-example figcaption { color: #9fb7cf; font-size: 12px; }
.mp-trial-facts { margin: 10px 0 0; color: #9fb7cf; font-size: 12px; letter-spacing: .06em; }
.mp-trial-facts b { color: #f2c94c; }
.mp-primary.mp-trial-start, .mp-trial-end .mp-primary { background: linear-gradient(180deg, #3a6f9f, #22476a); border-color: #8fb8e0; color: #f2f8ff; }
.mp-primary.mp-trial-start:hover, .mp-trial-end .mp-primary:hover { filter: brightness(1.1); }
.mp-trial-end { border-color: #6f9fcf; }
.mp-trial-end .mp-eyebrow { color: #f2c94c; }
.mp-trial-end a.mp-primary, .mp-trial-end a.mp-secondary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.mp-trial-end .mp-fineprint a { color: #9fb7cf; }

/* Owner request 2026-11-20: PRIVATE GAME checkbox in the bar (any player of a group campaign). */
.mp-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #4a4e48; background: #1d211e; color: #cfc7b5; font: 800 10px Arial, sans-serif; letter-spacing: .13em; cursor: pointer; user-select: none; }
.mp-toggle input { width: 14px; height: 14px; margin: 0; accent-color: #d9b45a; cursor: pointer; }
.mp-toggle:hover { border-color: #8f8a78; color: #fff; }
.mp-toggle.mp-toggle-on { border-color: #d9b45a; background: linear-gradient(180deg, #3b3220, #241e12); color: #f3dc9a; box-shadow: 0 0 8px rgba(217, 180, 90, .35); }

/* Owner rule 2026-11-28: watchers never see the game log (only the campaign's players and admins). */
html[data-mp-spectator] #kk-root [data-module="campaign-log"],
html[data-mp-spectator] #kk-root .mobile-info-tab[data-info-tab="log"] { display: none !important; }
