/* Hit Point & Click: party chat (js/chat.js). Colours come from the theme variables. */

/* ---------- the button and the docked window ---------- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff; border: 1px solid var(--crimson3);
  background: linear-gradient(180deg, var(--crimson2), var(--crimson)); box-shadow: 0 6px 20px rgba(0, 0, 0, .45); transition: transform .15s; }
.chat-fab:hover { transform: translateY(-2px); filter: brightness(1.1); }
.chat-fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab.popped::after { content: '↗'; position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; background: var(--panel2); color: var(--gold); border: 1px solid var(--line2); }
.chat-dock.is-open .chat-fab { transform: scale(.88); }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  font: 700 12px/22px var(--sans); text-align: center; background: var(--gold); color: #1a120b; box-shadow: 0 0 0 2px var(--bg); }
.chat-badge.at { background: #ff5a6e; color: #fff; animation: chat-pulse 1.6s ease-in-out infinite; }
@keyframes chat-pulse { 50% { transform: scale(1.15); } }

.chat-win { position: fixed; right: 18px; bottom: 84px; z-index: 45; width: 390px; height: min(720px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line2);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
/* The pop-out window: chat fills it */
.chat-only .banner, .chat-only .subbar, .chat-only .foot { display: none; }
.chat-only main { max-width: none; padding: 0; }
.chat-win.chat-full { position: relative; right: auto; bottom: auto; width: auto; height: calc(100vh / var(--cz, 1)); height: calc(100dvh / var(--cz, 1)); border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 900px) {
  .on-sheet .chat-fab { bottom: 84px; }                 /* above the sheet's bottom Roll bar */
  .on-sheet .chat-win { bottom: 150px; height: min(720px, calc(100vh - 170px)); }
}
@media (max-width: 600px) {
  .chat-fab { width: 50px; height: 50px; right: 14px; bottom: 14px; }
  .chat-win:not(.chat-full), .on-sheet .chat-win:not(.chat-full) { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; z-index: 46; }
  .chat-dock.is-open .chat-fab { display: none; }
  .chat-hint { display: none; }
}

/* ---------- header ---------- */
.chat-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel2), var(--panel)); }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.chat-title b { font-family: var(--serif); color: var(--gold2); font-size: 16px; letter-spacing: .03em; }
.chat-online { display: flex; align-items: center; min-height: 18px; margin-top: 2px; }
.chat-online .cav { margin-right: -5px; box-shadow: 0 0 0 2px var(--panel); }
.chat-online small { margin-left: 10px; color: var(--muted); font-size: 11px; }
.chat-online small::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 5px; vertical-align: 1px; }
.chat-me { display: flex; align-items: center; gap: 6px; max-width: 130px; padding: 4px 8px 4px 4px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--well); font-size: 13px; font-weight: 600; }
.chat-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-me i { font-style: normal; color: var(--muted); font-size: 10px; }
.chat-me:hover, .chat-hb:hover { border-color: var(--gold-dim); background: var(--hover); }
.chat-hb { width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 15px; }
.chat-hb svg { width: 18px; height: 18px; }

/* ---------- avatars ---------- */
.cav { flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font: 700 14px var(--serif); color: #fff; background: hsl(var(--h, 30) 45% 38%); border: 1px solid rgba(255, 255, 255, .12); }
.cav img { width: 100%; height: 100%; object-fit: cover; }
.cav.dm { background: linear-gradient(180deg, var(--crimson2), var(--crimson)); color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold-dim); }
.cav.dm svg { width: 64%; height: 64%; }
.cav.sm { width: 24px; height: 24px; font-size: 11px; }
.cav.xs { width: 18px; height: 18px; font-size: 9px; }

/* ---------- message list ---------- */
.chat-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 10px; background: var(--bg2); }
.chat-older { display: block; margin: 6px auto 8px; padding: 4px 12px; border-radius: 14px; border: 1px solid var(--line2);
  background: var(--panel); color: var(--muted); font-size: 12px; cursor: pointer; }
.chat-loading { text-align: center; color: var(--muted); font-size: 13px; margin: 30px 0; }
.chat-empty { text-align: center; color: var(--muted); padding: 40px 24px; }
.chat-empty svg { width: 46px; height: 46px; color: var(--gold-dim); }
.chat-empty p { margin: 6px 0; }
.cm-day { display: flex; align-items: center; gap: 10px; margin: 12px 14px 4px; color: var(--faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; }
.cm-day::before, .cm-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.cm { position: relative; display: flex; gap: 10px; padding: 6px 14px 2px; }
.cm.cont { padding-top: 1px; }
.cm:hover, .cm.acts-on { background: var(--hover2); }
.cm.mention { background: color-mix(in srgb, var(--gold) 9%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
.cm.pending { opacity: .55; }
.cm.flash { animation: chat-flash 1.4s ease-out; }
@keyframes chat-flash { 0%, 30% { background: color-mix(in srgb, var(--gold) 28%, transparent); } }
.cm-side { flex: none; width: 34px; padding-top: 3px; text-align: center; font-size: 10px; color: var(--faint); visibility: hidden; white-space: nowrap; }
.cm:hover .cm-side, .cm.acts-on .cm-side { visibility: visible; }
.cm-body { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: baseline; gap: 8px; }
.cm-who { color: var(--gold2); font-size: 14px; }
.cm.mine .cm-who { color: var(--gold); }
.cm-head time { color: var(--faint); font-size: 11px; }
.cm-text { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.cm-text a { color: var(--gold); }
.cm-text code { font: 12.5px var(--mono); background: var(--well); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.cm-text .jumbo { font-size: 32px; line-height: 1.2; }
.cm-at { color: var(--gold2); background: color-mix(in srgb, var(--gold) 14%, transparent); border-radius: 4px; padding: 0 2px; font-weight: 600; }
.cm-at.me { color: #1a120b; background: var(--gold); }
.cm-edited { margin-left: 6px; color: var(--faint); font-size: 11px; }
.cm-gone { color: var(--faint); font-style: italic; }
.cm-action { font-style: italic; color: var(--acc-text); }
.cm-roll { display: inline-block; padding: 4px 10px; margin: 2px 0; border-radius: 8px; background: var(--well); border: 1px solid var(--line2); }
.cr-dice { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.cm-rolls { display: inline-flex; flex-direction: column; gap: 2px; }
.cm-rolls .cr-row { display: block; padding-left: 1.4em; }
.cm-rolls .cr-lab { color: var(--gold2); font-weight: 600; }
.cr-dice i { font-style: normal; }
.cr-dice .nat20 { color: var(--up); font-weight: 700; }
.cr-dice .nat1 { color: var(--down); font-weight: 700; }
.cr-total { color: var(--gold2); font-family: var(--serif); font-size: 17px; }
.cm-quote { display: block; max-width: 100%; margin: 2px 0 3px; padding: 2px 8px; border: 0; border-left: 3px solid var(--line2);
  border-radius: 0 6px 6px 0; background: var(--well); color: var(--muted); font-size: 12px; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-quote b { color: var(--text); }
.cm-quote:hover { border-left-color: var(--gold-dim); }

.cm-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.cr { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 12px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--line2); background: var(--panel); }
.cr b { font: 600 12px var(--sans); color: var(--muted); }
.cr.mine { border-color: var(--gold-dim); background: color-mix(in srgb, var(--gold) 16%, var(--panel)); }
.cr.mine b { color: var(--gold2); }
.cr:hover { border-color: var(--gold-dim); }

/* Message buttons: on hover (or a tap on touch screens) */
.cm-acts { position: absolute; top: -12px; right: 10px; display: none; gap: 1px; padding: 2px; border-radius: 8px; z-index: 2;
  background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.cm:hover .cm-acts, .cm.acts-on .cm-acts { display: flex; }
.cm:first-child .cm-acts, .cm-day + .cm .cm-acts { top: 2px; }
.cm-acts button { width: 30px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); cursor: pointer; font-size: 14px; }
.cm-acts button:hover { background: var(--hover); }
.cm-acts [data-act="del"]:hover { background: #5a1f24; }

.chat-jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 118px; z-index: 3; padding: 5px 14px; border-radius: 16px;
  border: 1px solid var(--gold-dim); background: var(--panel2); color: var(--gold2); font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.chat-typing { min-height: 20px; padding: 2px 14px 0; font-size: 12px; color: var(--muted); background: var(--bg2); }
.chat-typing .dots { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: 2px; }
.chat-typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: chat-dot 1.2s infinite; }
.chat-typing .dots i:nth-child(2) { animation-delay: .15s; }
.chat-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-err { margin: 0; padding: 5px 14px; font-size: 12px; color: var(--down); background: var(--bg2); }

/* ---------- writing ---------- */
.chat-compose { position: relative; padding: 8px 10px 6px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-compose.editing { box-shadow: inset 0 2px 0 var(--gold-dim); }
.chat-ctx { display: flex; align-items: center; gap: 8px; margin: -2px 0 6px; padding: 4px 4px 4px 10px; border-radius: 8px;
  background: var(--well); border-left: 3px solid var(--gold-dim); font-size: 12px; color: var(--muted); }
.chat-ctx > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ctx b { color: var(--text); }
.chat-x { width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.chat-x:hover { background: var(--hover); color: var(--text); }
.chat-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-ta { flex: 1; min-width: 0; resize: none; max-height: 160px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--well); font-size: 14px; line-height: 1.4; }
.chat-ta:focus { outline: none; border-color: var(--gold-dim); }
.chat-emo-btn, .chat-send { flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--panel2); font-size: 19px; }
.chat-emo-btn:hover { background: var(--hover); }
.chat-send { color: #fff; border-color: var(--crimson3); background: linear-gradient(180deg, var(--crimson2), var(--crimson)); }
.chat-send svg { width: 20px; height: 20px; }
.chat-send:hover { filter: brightness(1.12); }
.chat-hint { margin: 5px 2px 0; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-hint code { font: 10px var(--mono); }

.chat-sugg { position: absolute; left: 10px; right: 10px; bottom: 100%; margin-bottom: 4px; z-index: 4; padding: 4px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 -6px 18px rgba(0, 0, 0, .35); }
.chat-sugg button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 6px;
  background: transparent; text-align: left; font-size: 13px; cursor: pointer; }
.chat-sugg button.on, .chat-sugg button:hover { background: var(--hover); color: var(--gold2); }
.sg-emo { font-size: 18px; width: 22px; text-align: center; }

/* ---------- emoji picker ---------- */
.chat-emoji { position: absolute; left: 8px; right: 8px; bottom: 96px; z-index: 5; display: flex; flex-direction: column; max-height: 300px;
  border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 -8px 26px rgba(0, 0, 0, .45); }
.chat-full .chat-emoji { left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw / var(--cz, 1) - 16px)); }
.ce-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ce-top > span:first-child { flex: 1; }
.ce-quick { display: flex; gap: 2px; }
.ce-quick button { font-size: 20px; }
.ce-tabs { display: flex; gap: 2px; padding: 0 6px 4px; border-bottom: 1px solid var(--line); }
.ce-tabs button { flex: 1; padding: 4px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 17px; cursor: pointer; opacity: .6; }
.ce-tabs button.on { opacity: 1; border-bottom-color: var(--gold); }
.ce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); padding: 6px; overflow-y: auto; }
.ce-grid button, .ce-quick button { height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 22px; cursor: pointer; }
.ce-grid button:hover, .ce-quick button:hover { background: var(--hover); transform: scale(1.12); }

/* ---------- "Who are you?" ---------- */
.chat-pick { position: absolute; inset: 52px 0 0; z-index: 6; overflow-y: auto; background: color-mix(in srgb, var(--panel) 96%, transparent);
  backdrop-filter: blur(4px); }
.cp-form { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.cp-form h3 { color: var(--gold2); font-size: 18px; }
.cp-form .fine { margin: 0; }
.cp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.cp-ch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--panel2); font-weight: 600; font-size: 13px; }
.cp-ch .cav { width: 46px; height: 46px; font-size: 18px; }
.cp-ch:hover { border-color: var(--gold-dim); background: var(--hover); }
.cp-ch.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.cp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.cp-form input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--well); }
.cp-form .acts { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 3D dice (js/dice.js): a see-through layer over the whole page; clicks go through ---------- */
.chat-dice { position: relative; }
.chat-dice.off { opacity: .45; }
.chat-dice.off::after { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: currentColor; transform: rotate(-40deg); }
.chat-dice i { position: absolute; right: -2px; bottom: -3px; font-size: 10px; font-style: normal; }
.cm-roll.rolling { color: var(--muted); }
.dice-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2147483000; pointer-events: none; }
.dice-badges { position: fixed; inset: 0; z-index: 2147483001; pointer-events: none; }
.dice-badge { position: absolute; transform: translate(-50%, -50%) scale(.85); opacity: 0; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 14px; border-radius: 999px; white-space: nowrap; max-width: 90vw;
  background: rgba(16, 12, 9, .88); border: 1px solid rgba(214, 178, 106, .55); box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  color: #efe6d6; font: 600 14px/1.2 Inter, system-ui, sans-serif; transition: transform .18s ease-out, opacity .18s; }
.dice-badge.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dice-badge span { overflow: hidden; text-overflow: ellipsis; }
.dice-badge b { min-width: 34px; padding: 3px 10px; border-radius: 999px; text-align: center; background: #d6b26a; color: #1a120b;
  font: 700 20px/1.1 Cinzel, Georgia, serif; }
.dice-badge.nat20 { border-color: #ffc23d; box-shadow: 0 0 0 2px rgba(255, 194, 61, .35), 0 6px 28px rgba(255, 194, 61, .35); }
.dice-badge.nat20 b { background: #ffc23d; }
.dice-badge.nat1 { border-color: #ff4a4a; box-shadow: 0 0 0 2px rgba(255, 74, 74, .3), 0 6px 28px rgba(255, 60, 60, .3); }
.dice-badge.nat1 b { background: #e04848; color: #fff; }

/* ---------- 3D dice window (⋯ menu → 3D dice): on / no sound / off, and your dice set ---------- */
dialog.dice-dlg { --pic: 100px; width: min(1560px, calc(100vw - 32px)); height: calc(100vh - 32px); height: calc(100dvh - 32px); max-width: none; max-height: none; padding: 0; overflow: hidden; }
/* dvh: on phones 100vh includes the strip behind the browser's toolbar, which hid Close / Save */
/* the close-up of the chosen set on the left, everything to pick from on the right */
.dice-dlg .cd-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.cd-view { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 12px; border-radius: 14px;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .07), transparent 62%), var(--well); border: 1px solid var(--line2); align-self: start; }
.cd-big { width: 260px; height: 260px; display: grid; place-items: center; }
.cd-big { position: relative; }
.cd-big .cd-ph, .cd-big canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cd-big .cd-pic { width: 100%; height: 100%; display: block; }
.cd-big canvas { opacity: 0; transition: opacity .25s; }
.cd-big.live canvas { opacity: 1; }
.cd-big.live .cd-ph { visibility: hidden; }
.cd-bname { color: var(--gold2); font-size: 20px; font-family: var(--display, inherit); margin-top: 4px; }
.cd-bfam { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.cd-main { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.dice-dlg .cd-in { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px 16px; height: 100%; box-sizing: border-box; }
.cd-top { display: flex; align-items: center; justify-content: space-between; }
.cd-top h2 { color: var(--gold2); font-size: 22px; margin: 0; }
.cd-close { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.cd-close:hover { background: var(--hover); color: inherit; }
.cd-modes { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-in .fine { margin: 0; }
.cd-search { width: 100%; max-width: 460px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--well); color: var(--text); font: inherit; font-size: 15px; }
.cd-search:focus { outline: 2px solid var(--gold-dim); outline-offset: 1px; border-color: var(--gold-dim); }
.cd-set[hidden] { display: none; }
.cd-none { grid-column: 1 / -1; padding: 20px 4px; }
.cd-fams { display: flex; gap: 5px; flex-wrap: wrap; }
.cd-fams button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--well); color: var(--muted); font-size: 13.5px; cursor: pointer; }
.cd-fams button:hover { color: inherit; border-color: var(--gold-dim); }
.cd-fams button.on { color: #1a120b; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.cd-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(114px, 1fr)); gap: 6px; align-content: start; padding: 2px; }
.cd-set { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 7px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--muted); font-size: 13px; line-height: 1.2; text-align: center; }
.cd-set img { width: var(--pic); height: var(--pic); display: block; }
.cd-pic { width: var(--pic); height: var(--pic); display: block; background: url(../images/dice-sets.webp?v=4) no-repeat; }
.cd-set img:not([src]) { visibility: hidden; }
.cd-set:hover { background: var(--hover); color: inherit; }
.cd-set.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; color: var(--gold2); }
.cd-set { position: relative; }
.cd-set.saved::after { content: '✓'; position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); color: #1a120b; font-size: 12px; font-weight: 700; line-height: 20px; }   /* your dice */
.cd-bstate { font-size: 13px; color: var(--gold2); }
.cd-bstate.unsaved { color: var(--muted); font-style: italic; }
.dice-dlg .acts { display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (max-width: 860px) {   /* the close-up goes on top, smaller, beside its name */
  dialog.dice-dlg { width: calc(100vw - 16px); height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  .dice-dlg .cd-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 12px; }
  .cd-view { flex-direction: row; text-align: left; padding: 8px 12px; gap: 12px; align-self: stretch; flex-wrap: wrap; }
  .cd-big { width: 110px; height: 110px; }
  .cd-bname { font-size: 18px; }
}
@media (max-width: 600px) {
  .dice-dlg .cd-in { padding: 14px 12px 12px; }
  .cd-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  dialog.dice-dlg { --pic: 80px; }
}
