/* T26 bundle B4 — the one stylesheet of an announcement (announcements-view.js): the lobby's strip, the game page's bar, the
   list and the admin card's preview. Not scoped to New Theme, so the admin page and the game page draw the same component; a
   page may set the --kann-* tokens to fit its own theme. Controls are at least 44 px on phones (D7). */
.kann-strip, .kann-item, .kann-list, .kann-stack {
  --kann-bg: var(--kann-surface, #ffffff);
  --kann-ink: var(--kann-text, #1d2433);
  --kann-ink-2: var(--kann-text-2, #5a6478);
  --kann-line: var(--kann-border, rgba(29, 36, 51, 0.12));
  --kann-warn-bg: #fff4e0;
  --kann-warn-ink: #7a4300;
  --kann-warn-line: #f0b35a;
  --kann-act-bg: #2f6fdf;
  --kann-act-ink: #ffffff;
  font: inherit;
  color: var(--kann-ink);
  box-sizing: border-box;
}
/* Dark follows the page's own theme, never the system's (each page resolves its "System" choice before painting, into
   data-theme): the lobby and the admin page are dark unless data-theme="light"; the game page, which marks its html element
   data-kann-page="game", is light unless data-theme="dark". (The lobby maps these tokens to New Theme's own, which win.) */
:root:not([data-theme="light"]):not([data-kann-page="game"]) .kann-strip, :root:not([data-theme="light"]):not([data-kann-page="game"]) .kann-item,
:root:not([data-theme="light"]):not([data-kann-page="game"]) .kann-list, :root:not([data-theme="light"]):not([data-kann-page="game"]) .kann-stack,
:root[data-kann-page="game"][data-theme="dark"] .kann-strip, :root[data-kann-page="game"][data-theme="dark"] .kann-item,
:root[data-kann-page="game"][data-theme="dark"] .kann-list, :root[data-kann-page="game"][data-theme="dark"] .kann-stack {
  --kann-bg: var(--kann-surface, #1e2433);
  --kann-ink: var(--kann-text, #eef1f7);
  --kann-ink-2: var(--kann-text-2, #aab3c5);
  --kann-line: var(--kann-border, rgba(238, 241, 247, 0.14));
  --kann-warn-bg: #3a2a10;
  --kann-warn-ink: #ffd699;
  --kann-warn-line: #a86f1d;
}

/* ── the strip (and the game page's bar): one line ── */
.kann-strip {
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 4px 6px 4px 10px;
  background: var(--kann-bg); border: 1px solid var(--kann-line); border-radius: 12px;
  max-width: 100%; overflow: hidden;
}
.kann-strip.kann-important { background: var(--kann-warn-bg); border-color: var(--kann-warn-line); color: var(--kann-warn-ink); }
.kann-open {
  flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px;
  padding: 0 4px; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer;
  border-radius: 8px;
}
.kann-tx { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.kann-title { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.95rem; line-height: 1.25; margin: 0; min-width: 0; }
.kann-strip .kann-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.kann-strip .kann-title .kann-i { vertical-align: -2px; margin-inline-end: 4px; }
.kann-sub { font-size: 0.78rem; color: var(--kann-ink-2); line-height: 1.25; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kann-strip.kann-important .kann-sub { color: inherit; opacity: 0.85; }
.kann-more { flex: none; font-size: 0.8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; opacity: 0.8; }
.kann-act {
  flex: none; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--kann-act-bg); color: var(--kann-act-ink);
  font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.kann-close {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer;
}
.kann-open:focus-visible, .kann-act:focus-visible, .kann-close:focus-visible { outline: 2px solid var(--kann-act-bg); outline-offset: 2px; }
.kann-i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kann-f { fill: currentColor; stroke: none; }
.kann-ic { flex: none; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.kann-ic-blue { background: rgba(47, 111, 223, 0.14); color: #2f6fdf; }
.kann-ic-gold { background: rgba(214, 160, 20, 0.16); color: #b8860b; }
.kann-ic-amber { background: rgba(230, 126, 34, 0.16); color: #c76a16; }
.kann-ic-green { background: rgba(46, 160, 67, 0.15); color: #2e8f43; }
.kann-ic-brown { background: rgba(141, 96, 58, 0.16); color: #8d603a; }
.kann-ic-violet { background: rgba(130, 87, 229, 0.15); color: #7a4fd8; }
/* phones: the action goes to the list when the line is narrow, so the title keeps its room */
@media (max-width: 540px) {
  .kann-strip .kann-act { display: none; }
}

/* ── the lobby's stack (revisions 6 to 9, the owner's looks at step 3): the cards behind above the top card, the same width
   ("19. a"); the head card (the first announcement: its line and its body); the other cards. The folding parts are grids
   whose one row goes 0fr ↔ 1fr around an inner box that can shrink to nothing (min-height: 0; overflow: hidden), so the
   unfolding needs no measured height; the page flips .kann-expanded on a tap, a later drawing is the final state at once. ── */
.kann-stack { position: relative; display: flex; flex-direction: column; min-width: 0; transition: padding-top 0.22s ease-out; }
.kann-stack[data-ann-backs="1"] { padding-top: 7px; }
.kann-stack[data-ann-backs="2"] { padding-top: 14px; }
.kann-stack.kann-expanded { padding-top: 0; }
.kann-deck { position: absolute; inset: 0 0 auto 0; height: 48px; pointer-events: none; transition: opacity 0.22s ease-out; }
.kann-expanded .kann-deck { opacity: 0; }
.kann-back {
  position: absolute; left: 0; right: 0; height: 40px; box-sizing: border-box;
  background: var(--kann-bg); border: 1px solid var(--kann-line); border-radius: 12px;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.16);   /* each top edge casts a fine line on the card behind it */
}
.kann-back-2 { z-index: 0; }
.kann-back-1 { z-index: 1; }
.kann-stack[data-ann-backs="1"] .kann-back-1, .kann-stack[data-ann-backs="2"] .kann-back-2 { top: 0; }
.kann-stack[data-ann-backs="2"] .kann-back-1 { top: 7px; }
.kann-head { position: relative; z-index: 2; min-width: 0; background: var(--kann-bg); border: 1px solid var(--kann-line); border-radius: 12px; }
.kann-head.kann-tappable { cursor: pointer; }   /* the whole top card folds and unfolds on a tap */
.kann-head.kann-important { background: var(--kann-warn-bg); border-color: var(--kann-warn-line); color: var(--kann-warn-ink); }
.kann-head > .kann-strip { border: 0; background: transparent; border-radius: inherit; }
.kann-expanded .kann-head > .kann-strip .kann-act { display: none; }   /* unfolded, the body has the action */
.kann-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease-out; }
.kann-expanded .kann-fold { grid-template-rows: 1fr; }
.kann-fold[hidden] { display: none; }
.kann-fold-in { min-height: 0; overflow: hidden; opacity: 0; transition: opacity 0.22s ease-out; }
.kann-expanded .kann-fold-in { opacity: 1; }
.kann-head-body .kann-fold-in { padding-inline: 54px 16px; }
.kann-head-body .kann-body { margin: 0 0 4px; }
.kann-head-body .kann-sub { white-space: normal; margin: 0 0 12px; }
.kann-head-body .kann-act { min-height: 44px; margin: -4px 0 12px; }
.kann-cards > .kann-fold-in { display: flex; flex-direction: column; gap: 8px; }
.kann-cards > .kann-fold-in > .kann-item:first-child { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .kann-stack, .kann-deck, .kann-fold, .kann-fold-in { transition: none; }
}
.kann-item.kann-closable { position: relative; padding-inline-end: 52px; }
.kann-item .kann-close { position: absolute; top: 4px; inset-inline-end: 4px; }

/* ── the list ── */
.kann-list { display: flex; flex-direction: column; gap: 10px; }
.kann-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px;
  background: var(--kann-bg); border: 1px solid var(--kann-line); border-radius: 12px;
}
.kann-item.kann-important { background: var(--kann-warn-bg); border-color: var(--kann-warn-line); color: var(--kann-warn-ink); }
.kann-item .kann-title { flex-wrap: wrap; }
.kann-item .kann-sub { white-space: normal; }
.kann-body { margin: 4px 0; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; }
.kann-item .kann-act { margin-top: 6px; min-height: 44px; align-self: flex-start; }
.kann-tag { font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; display: inline-flex; align-items: center; gap: 3px; }
.kann-tag .kann-i { width: 12px; height: 12px; }
.kann-dismissed { opacity: 0.8; }
.kann-empty { margin: 8px 0; color: var(--kann-ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .kann-strip { transition: background-color 0.2s ease; }
}

/* ── the game page (step 4; revisions 10 to 22 of b4-game-page): the pill in the top bar, the bar in the flow, our megaphone, the
   count on ☰, and the menu's modal (announcements-game.js) ── */
#kann-game-pill { flex: 0 1 360px; min-width: 200px; max-width: 360px; display: flex; align-items: center; }
#kann-game-pill .kann-strip { flex: 1 1 auto; min-width: 0; min-height: 32px; height: 32px; padding: 0 0 0 8px; gap: 6px; border-radius: 999px; }
.kann-on-game-pill .kann-ic, .kann-on-game-pill .kann-sub, .kann-on-game-pill .kann-act { display: none; }
.kann-on-game-pill .kann-open { min-height: 30px; padding: 0 2px; }
.kann-on-game-pill .kann-title { font-size: 0.82rem; }
.kann-on-game-pill .kann-more { font-size: 0.7rem; padding: 0 6px; }
.kann-on-game-pill .kann-close { width: 40px; height: 32px; }
.kann-pill-i { flex: none; display: inline-flex; width: 20px; height: 20px; }
.kann-pill-i .kann-mega-i, .kann-mega .kann-mega-i { width: 100%; height: 100%; }
.kann-flow { display: grid; grid-template-rows: 1fr; padding: 0 8px; transition: grid-template-rows 0.2s ease-out; }
.kann-flow.kann-flow-closed { grid-template-rows: 0fr; }
.kann-flow-box { min-height: 0; overflow: hidden; }
.kann-flow-box > .kann-strip { margin: 6px 0; }
.kann-flow-stale { opacity: 0.55; }
@media (prefers-reduced-motion: reduce) { .kann-flow { transition: none; } }
.kann-mega {
  position: relative; flex: none; width: 40px; height: 40px; padding: 7px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer;
}
/* a 44 px target that adds nothing to the phone header's height (its 10 px padding takes the overhang), so the page never moves */
.kann-mega.kann-mega-phone { width: 44px; height: 44px; margin-block: -10px; }
.kann-mega.kann-mega-imp { background: #fff4e0; border-color: #f0b35a; }
:root[data-kann-page="game"][data-theme="dark"] .kann-mega.kann-mega-imp { background: #3a2a10; border-color: #a86f1d; }
.kann-mega:focus-visible { outline: 2px solid #2f6fdf; outline-offset: 2px; }
.kann-mega-count, .kann-menu-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #d12a34; color: #ffffff; font: 700 11px/18px system-ui, sans-serif; text-align: center; pointer-events: none;
}
#btn-menu-toggle { position: relative; }
#modal-ann .modal-ann { width: calc(100% - 32px); max-width: 560px; max-height: 80vh; overflow: auto; padding: 14px 16px 16px; }
#modal-ann .modal-ann-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
#modal-ann .modal-ann-head h2 { margin: 0; font-size: 1.05rem; }
#modal-ann .kann-modal-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
