/* The Community tab (js/community.js, docs/online/community.md) and the Gear tab's Locker | Armory switch.
   Build 188 (Gage 11-25: "make the community area look a lot better" and "It needs to look more like a feed"): the tab is a
   social feed. A sticky top bar on the red rule (title, Ranks, Chat, Discord), Newest | Top underline tabs, a share row,
   then full-width posts: author row with dog tag and creator stamp, caption, big poster/video, Like / Comment / Watch, and
   the comment thread under the post. Field-journal touches stay small: dog tags, rubber stamps, the Discord slip, the
   brass plaque on Rankings, the radio log in Chat. Red, black, white, paper and brass only; hard shadows; the like star's
   slam and the Chat lamp stop under reduced motion. */

/* ---- the tab bar: five tabs, Community's longer word fits ---- */
/* The Community tab's word is the same size as the other four: UI.fitTabs fits all five together (css/field-ui.css). */

/* ---- Gear: Locker | Armory ---- */
.gear-switch.subtabs { grid-template-columns: 1fr 1fr; margin-bottom: 2px; }
.gear-switch button { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.gear-switch button .wi { width: 22px; height: 22px; }

/* The feed runs edge to edge: it reaches back over the page's own side padding (style.css .page, field-ui.css at 350 and
   under, none on the desktop layout). */
#tab-community { --cmy-bleed: 16px; --cmy-top: 8px; }
@media (max-width: 350px) { #tab-community { --cmy-bleed: 12px; } }
body.pc-menu #tab-community { --cmy-bleed: 0px; --cmy-top: 0px; }
.cmy-root { display: flex; flex-direction: column; gap: 12px; --ink: #15120e; --paper: #eadbc3; --brass: #d9bd8b; }
.cmy-root .wi { flex: none; }
/* The menus' card: warm gunmetal, a hairline inside, a hard shadow under. */
.cmy-signin {
  position: relative; background: linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18;
  border: 1px solid #b49b7238; border-radius: 3px; box-shadow: 0 3px 0 #080908, 0 0 0 2px #151410, inset 0 1px #eddbc012;
}

/* ---- the top bar: sticky, on the red rule ---- */
.cmy-top { position: sticky; top: 0; z-index: 4; display: flex; flex-direction: column; align-items: stretch; gap: 7px;
  margin: calc(-1 * var(--cmy-top)) calc(-1 * var(--cmy-bleed)) 0; padding: 8px var(--cmy-bleed) 9px; border-bottom: 2px solid #c8202a;
  background: linear-gradient(#1a1814, #121110); box-shadow: 0 3px 0 #080908; }
body.pc-menu .cmy-top { padding-left: 10px; padding-right: 10px; }
.cmy-top h2 { margin: 0; text-align: center; font: 400 26px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: #fff; text-shadow: 2px 2px #791d20; white-space: nowrap; }
/* Gage 12-01: the views are one centred, full-width row (Feed, Ranks, Chat, Discord), every plate the same width. */
.cmy-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 560px; margin: 0 auto; }
/* The steel plate (the Normal dock's tile, docs/ui/theme.md build 180): brushed gunmetal, a red rule along the top, two
   rivets, a hard shadow; the open one is lit red. Icon over a stencil label. */
.cmy-plate { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; height: 52px; padding: 5px 4px 3px;
  color: #cfc5b4; font: 400 14px/1 var(--display); text-transform: uppercase; letter-spacing: .07em;
  background: repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 3px), linear-gradient(170deg, #34302a, #1a1916 70%);
  border: 1px solid #5a4d40; border-top: 2px solid #c8202a; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a91c; }
.cmy-plate::before, .cmy-plate::after { content: ''; position: absolute; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: #8c7a5e; box-shadow: 0 1px 0 #000; }
.cmy-plate::before { left: 3px; } .cmy-plate::after { right: 3px; }
.cmy-plate .wi { width: 22px; height: 22px; }
.cmy-plate span { max-width: 100%; }
.cmy-plate span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmy-plate.on { color: #fff; background: linear-gradient(170deg, #c13238, #6e1d22 75%); border-color: #ed987f; border-top-color: #ffb39a; }
.cmy-plate.on::before, .cmy-plate.on::after { background: #ffd2bf; }
.cmy-plate em { position: absolute; top: 1px; right: 1px; padding: 2px 3px 1px; font: 400 10px/1 var(--display); font-style: normal; color: #fff; background: #c8202a;
  box-shadow: 0 1px 0 #070807; transform: rotate(8deg); }
.cmy-plate.wide { width: auto; height: 40px; padding: 4px 14px 2px; font-size: 16px; }
.cmy-plate:active { transform: translateY(2px); box-shadow: 0 0 0 #070807; }

/* ---- the Discord dispatch slip ---- */
.cmy-discord { position: relative; display: flex; align-items: center; gap: 12px; width: calc(100% - 28px); margin: 4px 14px; min-height: 64px; padding: 9px 12px 9px 18px; text-align: left;
  color: #241c14; background: repeating-linear-gradient(180deg, transparent 0 17px, #a8916b22 17px 18px), linear-gradient(170deg, #f1e4cc, #dccaa9);
  box-shadow: 0 3px 0 #070807, 0 0 0 1px #15120e; transform: rotate(-.4deg); }
.cmy-discord::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 4px; /* the tear-off holes */
  background: radial-gradient(circle, #15120e 1.6px, transparent 2px) 0 0 / 4px 8px repeat-y; }
.cmy-discord-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; background: var(--ink); border-radius: 3px; box-shadow: 0 2px 0 #00000055, inset 0 0 0 1px #c8202a; }
.cmy-discord-ic .wi { width: 26px; height: 26px; }
.cmy-discord > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cmy-discord > span small { font: 400 12px/1 var(--display); text-transform: uppercase; letter-spacing: .16em; color: #a52628; }
.cmy-discord > span b { font: 400 22px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cmy-discord > span em { font-style: normal; font-size: 13px; line-height: 1.2; color: #5a4a38; }
.cmy-age { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 54px; font-style: normal;
  color: #fff; background: #c8202a; outline: 2px dotted #f1e4cc; outline-offset: -5px; box-shadow: 0 0 0 3px #c8202a, 0 2px 0 3px #00000044; transform: rotate(4deg); }
.cmy-age b { font: 400 21px/1 var(--display); }
.cmy-age small { font: 400 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; }
.cmy-discord:active { transform: rotate(-.4deg) translateY(2px); }

/* ---- names, tags and stamps ---- */
.cmy-name { font: 400 18px/1 var(--display); letter-spacing: .03em; color: #f2eee6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cmy-creator { flex: none; font: 400 12px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: #2a1d05;
  background: linear-gradient(160deg, #ffe08a, #d9a441 55%, #a8741f); border: 1px solid #6e4a12; border-radius: 2px; padding: 3px 5px 2px;
  box-shadow: 0 1px 0 #070807, inset 0 1px 0 #fff3c4; transform: rotate(-2deg); }
.cmy-tag { --a: #8d969c; --b: #4d5a63; position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 40px;
  /* a stepped pixel outline (12-01): the corners are cut in 3 px steps instead of rounded */
  clip-path: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px,
    100% calc(100% - 9px), calc(100% - 3px) calc(100% - 9px), calc(100% - 3px) calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) calc(100% - 3px), calc(100% - 9px) calc(100% - 3px), calc(100% - 9px) 100%,
    9px 100%, 9px calc(100% - 3px), 6px calc(100% - 3px), 6px calc(100% - 6px), 3px calc(100% - 6px), 3px calc(100% - 9px), 0 calc(100% - 9px));
  background: linear-gradient(160deg, var(--a), var(--b) 80%);
  border: 1.5px solid var(--ink); box-shadow: 0 2px 0 #070807, inset 0 1px 0 #ffffff40, inset 0 -2px 0 #00000030; }
.cmy-tag::before { content: ''; position: absolute; top: 4px; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  background: #0d0c0b; box-shadow: 0 1px 0 #ffffff33; }
.cmy-tag b { margin-top: 7px; font: 400 19px/1 var(--display); color: #f6efe2; text-shadow: 1px 1px 0 #15120e, -1px 0 0 #15120e88; }
.cmy-tag.t1 { --a: #a3b06a; --b: #4b5a2b; } .cmy-tag.t2 { --a: #e2bf74; --b: #8a6a2c; } .cmy-tag.t3 { --a: #c4684d; --b: #6e2e22; } .cmy-tag.t4 { --a: #e0483f; --b: #7d1c22; }
.cmy-chip { flex: none; font: 400 12px/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); border: 1px solid #d9bd8b66; border-radius: 2px; padding: 3px 5px 2px; }
.cmy-root time, .cmy-sheet time { flex: none; color: var(--muted); font-size: 12px; }
.cmy-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.cmy-wait, .cmy-empty-row { color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; list-style: none; }
.cmy-menu { flex: none; display: grid; place-items: center; width: 44px; height: 40px; margin: -6px -8px -6px 0; color: var(--muted); align-self: flex-start; }
.cmy-menu .wi { width: 24px; height: 24px; } /* the pixel "more" studs (ICONS.more), Gage 12-01 */
.cmy-menu:active .wi { transform: translateY(1px); }

/* ---- the feed ---- */
.cmy-clips { display: flex; flex-direction: column; gap: 10px; }
.cmy-feedhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-top: 2px; }
.cmy-feedhead b { font: 400 18px/1 var(--display); text-transform: uppercase; letter-spacing: .065em; color: #f27661; padding-bottom: 3px; border-bottom: 2px solid #c8202a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* New | Top: a two-stamp switch, small. */
.cmy-sort { flex: none; display: flex; border: 1px solid #84705788; border-radius: 2px; box-shadow: 0 2px 0 #070807; }
.cmy-sort button { min-width: 52px; height: 32px; padding: 2px 10px 0; color: var(--muted); font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .08em; background: #15140f; }
.cmy-sort button + button { border-left: 1px solid #84705788; }
.cmy-sort button.on { color: #fff; background: linear-gradient(170deg, #b93135, #7d2027); box-shadow: inset 0 1px #fa9a79; }
/* Post: a round red seal over the feed, above the tab bar; it takes no row of its own. */
.cmy-fab { position: fixed; z-index: 6; right: 14px; bottom: calc(var(--safe-b, 0px) + 86px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 62px; height: 62px; border-radius: 50%; color: #fff; font: 400 11px/1 var(--display); text-transform: uppercase; letter-spacing: .1em;
  background: radial-gradient(circle at 35% 30%, #e0483f, #a8242a 60%, #7d1c22); border: 2px solid #15120e;
  box-shadow: 0 0 0 3px #f1e4cc, 0 0 0 5px #15120e, 0 5px 0 4px #00000088; }
.cmy-fab .wi { width: 26px; height: 26px; }
.cmy-fab:active { transform: translateY(2px); }
body.pc-menu .cmy-fab { bottom: 24px; right: 24px; }
.cmy-feed { display: flex; flex-direction: column; gap: 12px; margin: 0 calc(-1 * var(--cmy-bleed)); }
.cmy-clip { display: flex; flex-direction: column; padding: 10px 0 0; background: #191816; border-top: 1px solid #3a332b; border-bottom: 1px solid #3a332b; box-shadow: 0 3px 0 #080908; }
.cmy-clip header { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 0 14px 10px; }
.cmy-byline { flex: 1; min-width: 0; display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 6px; row-gap: 5px; }
.cmy-byline > small { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.cmy-caption { margin: 0; padding: 0 14px 11px; font-size: 15.5px; line-height: 1.45; color: #f0ebe1; overflow-wrap: anywhere; }
.cmy-player { position: relative; background: #070807; border-top: 1px solid #000; border-bottom: 1px solid #000; display: grid; place-items: center; min-height: 200px; max-height: 72vh; overflow: hidden; }
.cmy-player > img, .cmy-player video { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #070807; }
.cmy-play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 60%, #0009); }
/* The play seal is pixel art since 12-01 (ICONS.playseal: red disc, cream ring, white wedge) at a whole 3x of its 24 px bake. */
.cmy-play .wi { width: 72px; height: 72px; filter: drop-shadow(0 4px 0 #00000088); }
.cmy-play:active .wi { transform: translateY(2px); }
.cmy-len { position: absolute; right: 8px; bottom: 8px; font: 400 14px/1 var(--display); letter-spacing: .06em; color: var(--paper); background: var(--ink); padding: 4px 6px 3px; border: 1px solid #d9bd8b55; pointer-events: none; }
.cmy-rankno { position: absolute; left: 8px; top: 8px; padding: 5px 8px 3px; font: 400 22px/1 var(--display); font-style: normal; color: #fff;
  background: #c8202a; box-shadow: 0 2px 0 #070807, inset 0 1px #fa9a79; transform: rotate(-3deg); pointer-events: none; }
.cmy-rankno::before { content: '#'; font-size: 15px; vertical-align: 3px; margin-right: 1px; }
.cmy-waitstamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-4deg); font: 400 20px/1 var(--display); text-transform: uppercase;
  letter-spacing: .06em; font-style: normal; color: #f2c84b; border: 3px double #f2c84b; padding: 6px 10px 4px; background: #000c; white-space: nowrap; }
.cmy-clip.waiting .cmy-player img { filter: grayscale(.7) brightness(.65); }
.cmy-acts { display: flex; align-items: center; gap: 10px; padding: 9px 14px 11px; }
.cmy-acts > .cmy-note { padding: 2px 0; }
/* Like and Comment: two small steel plates with the count, the like lit red once given. */
.cmy-act { display: flex; align-items: center; gap: 6px; height: 40px; min-width: 64px; padding: 2px 12px 0 10px; color: #e2d8c6; font: 400 17px/1 var(--display); letter-spacing: .04em;
  background: linear-gradient(170deg, #2e2a25, #191816 70%); border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a91c; }
.cmy-act .wi { width: 20px; height: 20px; margin-top: -2px; }
.cmy-act.on { color: #fff; background: linear-gradient(170deg, #b93135, #6e1d22 75%); border-color: #ed987f; }
.cmy-like:not(.on) .wi { filter: grayscale(1) brightness(1.1); }
.cmy-like.slam .wi { animation: cmy-slam 280ms steps(3); }
.cmy-act:active { transform: translateY(2px); box-shadow: 0 0 0 #070807; }
.cmy-acts-note { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@keyframes cmy-slam { from { transform: scale(1.8) rotate(-12deg); } to { transform: none; } }
.cmy-thread { padding: 2px 14px 12px; background: #121110; border-top: 1px dashed #3a332b; }
.cmy-cmts { list-style: none; margin: 0; padding: 4px 0 8px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.cmy-cmt { display: flex; gap: 10px; padding: 7px 0; }
.cmy-cmt + .cmy-cmt { border-top: 1px dashed #2a251f; }
.cmy-cmt > div { flex: 1; min-width: 0; }
.cmy-cmt .cmy-tag { width: 28px; height: 33px; }
.cmy-cmt .cmy-tag b { font-size: 15px; margin-top: 6px; }
.cmy-cmt .cmy-name { font-size: 15px; }
.cmy-cmt.mine .cmy-name { color: #f27661; }
.cmy-cmt p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.42; color: #ece6da; overflow-wrap: anywhere; }
.cmy-thread .cmy-note .linkbtn { color: var(--brass); }
.cmy-more { align-self: center; }
.cmy-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 0 16px; padding: 26px 16px 22px; text-align: center;
  background: url('../assets/ui/command-etch.svg') center 30% / 520px auto no-repeat, linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18; }
.cmy-empty-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #c8202a, 0 0 0 5px #15120e; transform: rotate(-6deg); }
.cmy-empty-ic .wi { width: 34px; height: 34px; }
.cmy-empty b { margin-top: 4px; font: 400 24px/1 var(--display); text-transform: uppercase; color: #f27661; letter-spacing: .065em; }
.cmy-empty p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; max-width: 30ch; }

/* ---- Rankings: the leaderboard card on a brass plaque with four rivets ---- */
.cmy-rank { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.cmy-plaque { position: relative; padding: 5px; border-radius: 4px; background: linear-gradient(160deg, #7a6447, #3a3026 60%, #5a4a36);
  box-shadow: 0 3px 0 #070807, 0 0 0 1px #15120e, inset 0 1px #f2d9a955; }
.cmy-plaque::before { content: ''; position: absolute; inset: 3px; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 3px 3px, #f2d9a9 1.5px, #15120e 2.5px, transparent 3px) top left / 7px 7px no-repeat,
    radial-gradient(circle at 4px 3px, #f2d9a9 1.5px, #15120e 2.5px, transparent 3px) top right / 7px 7px no-repeat,
    radial-gradient(circle at 3px 4px, #f2d9a9 1.5px, #15120e 2.5px, transparent 3px) bottom left / 7px 7px no-repeat,
    radial-gradient(circle at 4px 4px, #f2d9a9 1.5px, #15120e 2.5px, transparent 3px) bottom right / 7px 7px no-repeat; }
.cmy-rank .td-board { margin: 0; padding: 10px 12px; border: 1px solid #15120e; background: linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18; }
.cmy-rank .td-board-fold { display: none; }

/* ---- Chat: a radio log ---- */
.cmy-chan { display: flex; flex-direction: column; gap: 0; margin: 0 calc(-1 * var(--cmy-bleed)); }
/* One strip of channel tabs: the open one is lit red and carries the live lamp. */
.cmy-chans { display: flex; gap: 5px; padding: 2px var(--cmy-bleed) 10px; overflow-x: auto; scrollbar-width: none; }
.cmy-chans::-webkit-scrollbar { display: none; }
.cmy-chans button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 5px; height: 36px; padding: 2px 8px 0; color: var(--muted);
  font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
  background: linear-gradient(170deg, #2e2a25, #191816 70%); border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807; }
.cmy-chans button.on { color: #fff; background: linear-gradient(170deg, #b93135, #6e1d22 75%); border-color: #ed987f; }
.cmy-chans .wi { width: 20px; height: 20px; margin-top: -2px; }
/* the live lamp: a square pixel bulb in an ink ring (12-01: no round CSS shapes in the Community's symbols) */
.cmy-lamp { flex: none; width: 6px; height: 6px; margin-top: -2px; background: #ffd2bf; box-shadow: 0 0 0 2px #5e171b, 0 0 0 3px #15120e; animation: cmy-lamp 2.4s steps(2) infinite; }
@keyframes cmy-lamp { 50% { background: #ff6b5b; } }
/* The page: dark paper with the journal's red margin line, edge to edge. */
.cmy-msgs { list-style: none; margin: 0; padding: 4px 0; display: flex; flex-direction: column; height: clamp(220px, calc(100dvh - 430px), 520px);
  overflow-y: auto; overscroll-behavior: contain; border-top: 2px solid #c8202a; border-bottom: 1px solid #2c2721;
  background: linear-gradient(90deg, transparent 53px, #c8202a40 53px 54px, transparent 54px), #0d0c0b; }
.cmy-msg { display: flex; gap: 14px; padding: 8px 10px 8px 14px; }
.cmy-msg + .cmy-msg { border-top: 1px dashed #2a251f; }
.cmy-msg .cmy-tag { width: 28px; height: 33px; }
.cmy-msg .cmy-tag b { font-size: 15px; margin-top: 6px; }
.cmy-msg-b { flex: 1; min-width: 0; }
.cmy-msg-h { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cmy-msg-h time { margin-left: auto; }
.cmy-msg-h .cmy-menu { width: 36px; height: 32px; margin: -6px -8px -6px 0; }
.cmy-msg-h .cmy-name { font-size: 16px; }
.cmy-msg.mine { background: linear-gradient(90deg, #2a1416, transparent 80%); }
.cmy-msg.mine .cmy-name { color: #f27661; }
.cmy-msg p { margin: 3px 0 0; font-size: 15px; line-height: 1.42; color: #ece6da; overflow-wrap: anywhere; white-space: pre-wrap; }
/* The compose bar (chat and comments): one inked frame, the field, and the send plate set into its right end. */
.cmy-compose { display: flex; align-items: stretch; height: 46px; background: #0d0c0b; border: 1px solid #84705788; border-radius: 2px; box-shadow: inset 0 2px 0 #000, 0 2px 0 #070807; }
.cmy-chan .cmy-compose { margin: 10px var(--cmy-bleed) 0; }
.cmy-compose:focus-within { border-color: #c8202a; }
.cmy-compose input { flex: 1; min-width: 0; padding: 0 12px; font-size: 16px; color: #fff; background: transparent; border: 0; outline: none; }
.cmy-send { flex: none; position: relative; width: 50px; margin: 4px; border-radius: 2px; background: linear-gradient(170deg, #c13238, #7d2027); box-shadow: inset 0 1px #fa9a79, 0 1px 0 #000; }
.cmy-send { display: grid; place-items: center; }
.cmy-send .wi { width: 24px; height: 24px; }
.cmy-send:active { transform: translateY(1px); }
.cmy-rule { margin: 6px var(--cmy-bleed) 0; font-size: 11px; letter-spacing: .02em; color: #8d8577; text-align: center; }
.cmy-signin { display: flex; align-items: center; gap: 10px; margin: 10px var(--cmy-bleed) 0; padding: 10px 12px; }
.cmy-signin p { margin: 0; flex: 1; color: var(--muted); font-size: 14px; }

/* ---- the foot: rules, blocks, contact (App Store 1.2) ---- */
.cmy-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; padding: 10px 0 8px; border-top: 1px dashed #5a4d40;
  color: var(--muted); font-size: 13px; }
.cmy-foot .linkbtn { display: inline-flex; align-items: center; gap: 5px; margin: 0; min-height: 36px; color: var(--brass); }
.cmy-foot p { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; flex-basis: 100%; margin: 0; text-align: center; }
.cmy-foot .wi { width: 16px; height: 16px; }
.cmy-foot a, .cmy-rules a, .cmy-sheet a:not(.btn) { color: var(--brass); }

/* ---- sheets ---- */
.cmy-sheet h2 { display: flex; align-items: center; gap: 8px; }
.cmy-actions { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.cmy-actions .btn { width: 100%; justify-content: center; text-decoration: none; }
.cmy-rules ol { margin: 6px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.35; }
.cmy-blocks { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cmy-blocks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmy-postposter { display: block; max-width: 100%; max-height: 32vh; margin: 4px auto 8px; border: 6px solid var(--paper, #eadbc3); box-shadow: 0 3px 0 #070807; transform: rotate(-.6deg); }
.cmy-label { display: block; margin: 4px 0; font: 400 16px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: #f27661; }
.cmy-label small { color: var(--muted); text-transform: none; letter-spacing: 0; }
#cmy-caption { width: 100%; box-sizing: border-box; padding: 8px 10px; font: 700 15px/1.35 "Courier New", ui-monospace, Menlo, monospace; color: #2a2118; background: #eadbc3; border: 1px solid #5a4d40; border-radius: 2px; resize: none; }
.clip-panel .clip-post { width: 100%; justify-content: center; display: flex; gap: 6px; align-items: center; }

/* ---- small phones (320 wide) ---- */
@media (max-width: 360px) {
  .cmy-top h2 { font-size: 23px; }
  .cmy-tabs { gap: 4px; }
  .cmy-plate { font-size: 13px; letter-spacing: .04em; }
  .cmy-plate .wi { width: 20px; height: 20px; }
  .cmy-discord { gap: 9px; padding-left: 16px; }
  .cmy-discord-ic { width: 36px; height: 36px; }
  .cmy-discord > span b { font-size: 19px; }
  .cmy-feedhead b { font-size: 16px; }
  .cmy-acts-note { display: none; }
  .cmy-fab { width: 52px; height: 52px; right: 10px; }
  .cmy-fab .wi { width: 22px; height: 22px; }
  .cmy-fab span { font-size: 10px; }
  .cmy-chans { gap: 4px; }
  .cmy-chans button { padding: 2px 5px 0; font-size: 13px; gap: 3px; letter-spacing: .03em; }
  .cmy-chans .wi { width: 18px; height: 18px; }
  .cmy-msgs { background: linear-gradient(90deg, transparent 49px, #c8202a40 49px 50px, transparent 50px), #0d0c0b; }
  .cmy-msg { gap: 12px; padding-left: 12px; }
  .cmy-msg-h .cmy-name, .cmy-cmt .cmy-name { flex: 0 1 auto; max-width: 45%; }
  .cmy-msg-h > .cw-stamp, .cmy-msg-h > .cmy-creator { flex: none; }
  .cmy-rule { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
}

/* ---- short phones (568 to 700 tall): a lower top bar and a shorter player so a whole post fits ---- */
@media (max-height: 700px) {
  .cmy-top { gap: 5px; padding-top: 6px; padding-bottom: 7px; }
  .cmy-top h2 { font-size: 22px; }
  .cmy-plate { height: 46px; gap: 2px; }
  .cmy-plate .wi { width: 18px; height: 18px; }
  .cmy-player, .cmy-player > img, .cmy-player video { max-height: 60vh; }
  .cmy-discord > span em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cmy-lamp, .cmy-like.slam .wi { animation: none; }
  .cmy-discord:active, .cmy-plate:active, .cmy-play:active .wi, .cmy-act:active, .cmy-fab:active, .cmy-send:active { transform: none; }
  .cmy-discord:active { transform: rotate(-.4deg); }
}

/* ==== 2026-11-28 (Gage: "better formats for the posting area", a real upload bar, polls, "make sure everything in the chat
   area looks good"). Same palette: red, black, paper, brass; hard shadows; motion stops under reduced motion. ==== */

/* ---- the "start a post" strip and the format filter ---- */
/* Your picture (a tap changes it, js/profile-pic.js) and the "start a post" strip beside it. */
.cmy-startrow { display: flex; align-items: stretch; gap: 6px; }
.cmy-me { position: relative; flex: none; display: grid; place-items: center; width: 54px; min-height: 54px; padding: 0;
  background: linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18; border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a914; }
.cmy-me-pen { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 20px; height: 20px; background: #15120e; border: 1px solid #5a4d40; }
.cmy-me-pen .wi { width: 16px; height: 16px; }
.cmy-me:active { transform: translateY(1px); }
.cmy-start { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 54px; padding: 7px 10px; text-align: left;
  background: linear-gradient(115deg, #322c2345, transparent 45%), #1b1a18; border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a914; }
.cmy-start em { flex: 1; min-width: 0; font-style: normal; font-size: 15px; color: #a99f8e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 9px 10px; background: #0d0c0b; border: 1px solid #84705755; box-shadow: inset 0 2px 0 #000; }
.cmy-start-fmts { display: flex; gap: 2px; font-style: normal; }
.cmy-start-fmts .wi { width: 26px; height: 26px; padding: 2px; border-radius: 2px; }
.cmy-start:active { transform: translateY(1px); }
.cmy-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cmy-types button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; padding: 3px 4px 1px; color: #cfc5b4;
  font: 400 14px/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
  background: linear-gradient(170deg, #2c2924, #171613 70%); border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807; }
.cmy-types button .wi { width: 20px; height: 20px; }
.cmy-types button.on { color: #fff; background: linear-gradient(170deg, #c13238, #6e1d22 75%); border-color: #ed987f; }
.cmy-stats { display: flex; flex-wrap: wrap; gap: 0 8px; margin: -4px 2px -6px; color: #a99f8e; font-size: 12px; line-height: 1.25; }
.cmy-stats:empty { display: none; }
.cmy-stats span + span::before { content: '·'; margin-right: 8px; color: #5a4d40; }
@media (max-width: 370px) { .cmy-types button span { font-size: 12px; } .cmy-types button .wi { width: 18px; height: 18px; } .cmy-types button { gap: 3px; } }

/* ---- the Post sheet: three formats ---- */
.cmy-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 12px; }
.cmy-formats button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 6px 4px 4px;
  color: #cfc5b4; font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .08em;
  background: repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 3px), linear-gradient(170deg, #34302a, #1a1916 70%);
  border: 1px solid #5a4d40; border-top: 2px solid #c8202a; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a91c; }
.cmy-formats button .wi { width: 30px; height: 30px; }
.cmy-formats button.on { color: #fff; background: linear-gradient(170deg, #c13238, #6e1d22 75%); border-color: #ed987f; border-top-color: #ffb39a; }
.cmy-formats button::before, .cmy-formats button::after { content: ''; position: absolute; top: 4px; width: 3px; height: 3px; border-radius: 50%; background: #8c7a5e; }
.cmy-formats button::before { left: 4px; } .cmy-formats button::after { right: 4px; }
.cmy-howto ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cmy-howto li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #ece6da; }
.cmy-howto li b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font: 400 17px/1 var(--display); color: #fff; background: #c8202a; border-radius: 50%; box-shadow: 0 2px 0 #070807, 0 0 0 2px #15120e; }
.cmy-howto em { font-style: normal; color: #f27661; }
/* The picture slot: a dashed drop frame, then the picture on a paper mount. */
.cmy-drop { display: grid; place-items: center; min-height: 150px; margin: 0 0 10px; padding: 10px; cursor: pointer; text-align: center;
  background: #0d0c0b; border: 2px dashed #84705799; border-radius: 3px; }
.cmy-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cmy-drop-empty .wi { width: 44px; height: 44px; }
.cmy-drop-empty b { font: 400 20px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: #fff; }
.cmy-drop-empty small { color: #a99f8e; font-size: 13px; }
.cmy-drop.has { border-style: solid; border-color: #5a4d40; padding: 8px; }
.cmy-drop img { display: block; max-width: 100%; max-height: 34vh; border: 6px solid var(--paper, #eadbc3); box-shadow: 0 3px 0 #070807; transform: rotate(-.6deg); }
.cmy-check { display: flex; gap: 8px; align-items: flex-start; }
.cmy-check .wi { flex: none; width: 20px; height: 20px; margin-top: 1px; }
/* The poll form. */
#modal #cmy-q, #modal .cmy-opts input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 10px; font: 700 15px/1.2 "Courier New", ui-monospace, Menlo, monospace; color: #2a2118; background: #eadbc3; border: 1px solid #5a4d40; border-radius: 2px; }
.cmy-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: opt; }
.cmy-opts li { display: flex; gap: 6px; align-items: center; }
.cmy-opt-x { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 44px; background: #1b1a18; border: 1px solid #5a4d40; border-radius: 2px; }
.cmy-opt-x .wi { width: 20px; height: 20px; }
.cmy-opt-add { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 4px; min-height: 36px; color: var(--brass, #d9bd8b); }
.cmy-opt-add .wi { width: 18px; height: 18px; }
.cmy-days { display: flex; gap: 6px; margin-bottom: 4px; }
.cmy-days button { flex: 1; min-height: 40px; font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: #cfc5b4; background: #15140f; border: 1px solid #84705788; border-radius: 2px; box-shadow: 0 2px 0 #070807; }
.cmy-days button.on { color: #fff; background: linear-gradient(170deg, #b93135, #7d2027); box-shadow: inset 0 1px #fa9a79, 0 2px 0 #070807; }

/* ---- the upload bar: an ammo-belt gauge on gunmetal, red fill, a moving stripe while the server works ---- */
.cmy-progress { margin: 10px 0 2px; }
.cmy-bar { position: relative; height: 14px; overflow: hidden; background: repeating-linear-gradient(90deg, #0b0a09 0 9px, #15130f 9px 10px); border: 1px solid #5a4d40; border-radius: 2px; box-shadow: inset 0 2px 0 #000, 0 2px 0 #070807; }
.cmy-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: repeating-linear-gradient(90deg, #d23a3c 0 8px, #b02a2f 8px 10px); box-shadow: inset 0 1px #ff9b82; transition: width .25s linear; }
.cmy-progress.busy .cmy-bar i { background: repeating-linear-gradient(115deg, #b02a2f 0 10px, #d23a3c 10px 20px); background-size: 28px 100%; animation: cmy-belt .7s linear infinite; }
.cmy-progress.good .cmy-bar i { background: #d9bd8b; box-shadow: inset 0 1px #fff3c4; }
.cmy-progress span { display: block; margin-top: 6px; font: 400 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: .06em; color: #f2eee6; }
.cmy-progress.bad span { font: 14px/1.35 inherit; text-transform: none; letter-spacing: 0; color: #ff9b82; }
@keyframes cmy-belt { to { background-position: 28px 0; } }
.cmy-postposter { position: relative; display: block; width: fit-content; max-width: 100%; margin: 4px auto 8px; border: 6px solid var(--paper, #eadbc3); box-shadow: 0 3px 0 #070807; transform: rotate(-.6deg); }
.cmy-postposter img { display: block; max-width: 100%; max-height: 30vh; }
.cmy-postplay { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; filter: drop-shadow(0 3px 0 #070807); }
.cmy-postplay .wi { width: 48px; height: 48px; }

/* ---- picture posts ---- */
.cmy-photo { position: relative; display: grid; place-items: center; overflow: hidden; background: #070807; border-top: 1px solid #000; border-bottom: 1px solid #000; max-height: 72vh; cursor: zoom-in; }
.cmy-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmy-clip.waiting .cmy-photo img { filter: grayscale(.7) brightness(.65); }
.cmy-lightbox img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #070807; border: 6px solid var(--paper, #eadbc3); box-sizing: border-box; }
.cmy-lightbox p { margin: 8px 0 0; }

/* ---- polls: a ballot with tally bars ---- */
.cmy-poll { margin: 2px 14px 4px; padding: 12px 12px 8px; color: #241c14; background: repeating-linear-gradient(180deg, transparent 0 21px, #a8916b22 21px 22px), linear-gradient(170deg, #f1e4cc, #dccaa9);
  box-shadow: 0 3px 0 #070807, 0 0 0 1px #15120e; }
.cmy-poll-q { margin: 0 0 10px; font: 400 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--ink, #15120e); }
.cmy-votes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.cmy-vote { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; overflow: hidden; text-align: left;
  color: #241c14; background: #fbf4e6; border: 1.5px solid #15120e; border-radius: 2px; box-shadow: 0 2px 0 #15120e; }
.cmy-vote:disabled { cursor: default; }
.cmy-vote-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #e3c99a; transition: width .4s ease-out; }
.cmy-vote.lead .cmy-vote-fill { background: #e9a48f; }
.cmy-vote.mine .cmy-vote-fill { background: #d9665b; }
.cmy-vote > :not(.cmy-vote-fill) { position: relative; }
.cmy-vote-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #15120e; background: #fff;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px); } /* a pixel box, not a CSS circle (12-01) */
.cmy-vote-mark .wi { width: 16px; height: 16px; }
.cmy-vote.mine .cmy-vote-mark { background: #c8202a; }
.cmy-vote-text { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.cmy-vote b { font: 400 18px/1 var(--display); }
.cmy-vote:not(:disabled):active { transform: translateY(2px); box-shadow: 0 0 0 #15120e; }
.cmy-vote.slam .cmy-vote-mark { animation: cmy-stamp .28s steps(3); }
@keyframes cmy-stamp { 0% { transform: scale(1.6) rotate(-12deg); } 100% { transform: none; } }
.cmy-poll-foot { margin: 8px 0 0; font-size: 12px; color: #5a4a38; }
/* The weekly poll: Frontline Command's pinned order sheet with a brass edge. */
.cmy-weekly { box-shadow: inset 0 3px 0 #d9bd8b, 0 3px 0 #070807; background: linear-gradient(115deg, #3a2f1d55, transparent 50%), #1b1a18; }
.cmy-hq { flex: none; display: grid; place-items: center; width: 34px; height: 40px; background: #c8202a; border: 1.5px solid #15120e; border-radius: 3px; box-shadow: 0 2px 0 #070807, inset 0 0 0 2px #d9bd8b; }
.cmy-hq .wi { width: 22px; height: 22px; }
.cmy-lastweek { margin: 8px 14px 0; font-size: 13px; color: #a99f8e; }
.cmy-lastweek i { font-style: normal; color: #ece6da; }
.cmy-lastweek b { color: #d9bd8b; font-weight: 700; }

/* ---- chat: day lines, grouped runs, the menu at the message's corner, the counter, "new messages" ---- */
.cmy-day { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; color: #8d8577; font: 400 13px/1 var(--display); text-transform: uppercase; letter-spacing: .12em; }
.cmy-day::before, .cmy-day::after { content: ''; flex: 1; height: 1px; background: #3a332b; }
.cmy-day + .cmy-msg { border-top: 0; }
.cmy-msg { position: relative; }
.cmy-msg.run { padding-top: 0; border-top: 0 !important; }
.cmy-msg.run p { margin-top: 0; }
.cmy-tag-gap { flex: none; width: 28px; }
.cmy-msg-b > .cmy-menu { position: absolute; right: 2px; top: 2px; width: 36px; height: 32px; opacity: .55; }
.cmy-msg-b > .cmy-menu:focus-visible, .cmy-msg:hover .cmy-msg-b > .cmy-menu { opacity: 1; }
.cmy-msg-h { padding-right: 30px; }
.cmy-msg.run .cmy-msg-b { padding-right: 30px; }
.cmy-msg-h time { font-size: 12px; color: #8d8577; }
.cmy-count { align-self: center; padding: 0 4px; font: 400 13px/1 var(--display); color: #a99f8e; }
.cmy-count.low { color: #ff9b82; }
.cmy-chan { position: relative; }
.cmy-jump { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); z-index: 2; padding: 8px 14px 6px; color: #fff; font: 400 14px/1 var(--display); text-transform: uppercase; letter-spacing: .08em;
  background: linear-gradient(170deg, #c13238, #7d2027); border: 1px solid #ed987f; border-radius: 2px; box-shadow: 0 2px 0 #070807; }
@media (max-width: 360px) { .cmy-tag-gap { width: 28px; } }
@media (prefers-reduced-motion: reduce) {
  .cmy-progress.busy .cmy-bar i, .cmy-vote.slam .cmy-vote-mark { animation: none; }
  .cmy-bar i, .cmy-vote-fill { transition: none; }
  .cmy-start:active, .cmy-vote:not(:disabled):active { transform: none; }
}
/* Room under the page while the keyboard is up (UI.keepFieldsVisible sets html.kb-open and --kb), so a text box at the foot of
   a tab can scroll clear of the keyboard (Gage 11-28). */
html.kb-open .pages::after { content: ''; display: block; height: var(--kb, 0px); }

/* ---- loadout profile pictures (Gage 12-01, js/profile-pic.js) ----
   The piece is pixel art (32 art pixels, an ink outline) drawn in the player's own look, on a ground of the player's colour
   (--pfp, falling to --pfp-d). Same box as the dog tag it replaces, so no row moves. */
.pfp { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 40px; box-sizing: border-box; padding: 2px;
  background: linear-gradient(170deg, var(--pfp, #798791), var(--pfp-d, #2e3338) 78%); border: 1.5px solid var(--ink, #0b0b0b);
  box-shadow: 0 2px 0 #070807, inset 0 1px 0 #ffffff33, inset 0 -2px 0 #00000055; }
.pfp img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; image-rendering: crisp-edges; }
.pfp.pfp-emblem, .pfp.pfp-flag { padding: 1px; }
.cmy-cmt .pfp, .cmy-msg .pfp { width: 30px; height: 33px; }
.cmy-me .pfp, .cmy-me .cmy-tag { width: 40px; height: 42px; }
.pfp.pfp-lg { width: 72px; height: 72px; }
.cmy-sheet-who { display: flex; align-items: center; gap: 10px; }
.cmy-sheet h2 > .wi, .cmy-sheet .cmy-actions .btn .wi { width: 20px; height: 20px; margin-right: 6px; vertical-align: -3px; }
.cmy-sheet .cmy-actions .btn { display: flex; align-items: center; }
/* the picker */
.pfp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.pfp-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; padding: 8px 4px 6px; color: #cfc5b4;
  background: linear-gradient(170deg, #211f1b, #121113 72%); border: 1px solid #5a4d40; border-radius: 2px; box-shadow: 0 2px 0 #070807, inset 0 1px 0 #f2d9a914; }
.pfp-pick b { font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: #f2eee6; }
.pfp-pick small { max-width: 100%; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfp-pick .cmy-tag { width: 60px; height: 72px; }
.pfp-pick .cmy-tag b { font-size: 32px; margin-top: 10px; }
.pfp-pick.on { background: linear-gradient(170deg, #b93135, #6e1d22 75%); border-color: #ed987f; }
.pfp-pick.on small { color: #f2d0c4; }
.pfp-pick:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .pfp-pick:active, .cmy-me:active, .cmy-menu:active .wi { transform: none; } }
