/* STY-01 (24 Nov): UI styles + page changes + text effects (Maker › UI theme).
   A style dresses the page chrome only — pages, the Lobby, headers, cards, buttons. The VN stage, the dialogue box and
   the combat map keep their own look, so a style can never make the play area hard to read.
   body[data-uistyle] is set by THEME.area() from the GM's choice for the Lobby / pages / room. */

/* ================================================================ page changes (#page-fade) */
#page-fade.tx { opacity: 1; background: transparent; display: grid; place-items: center; overflow: hidden; }
#page-fade .tx-lab { position: relative; z-index: 3; font: 400 clamp(30px, 4.4vw, 60px)/1 var(--fr-disp, "Bebas Neue", sans-serif); letter-spacing: .1em; color: #fff;
  animation: tx-lab var(--tx-d) ease both; }
@keyframes tx-lab { 0%, 18% { opacity: 0; transform: translateY(12px); } 35%, 62% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; } }
/* slice: diagonal strips close in from both sides, then open the other way */
#page-fade .tx-slice { position: absolute; inset: -20% -30%; display: flex; flex-direction: column; transform: rotate(-14deg); }
#page-fade .tx-slice i { flex: 1; background: #0b0b0b; border-bottom: 2px solid var(--accent); animation: tx-sl var(--tx-d) cubic-bezier(.7,0,.2,1) both; animation-delay: calc(var(--i) * 18ms); }
#page-fade .tx-slice i:nth-child(odd) { --from: -110%; --to: 110%; } #page-fade .tx-slice i:nth-child(even) { --from: 110%; --to: -110%; }
@keyframes tx-sl { 0% { transform: translateX(var(--from)); } 38%, 58% { transform: none; } 100% { transform: translateX(var(--to)); } }
/* hazard: a black-yellow band sweeps across, the plate flashes */
#page-fade .tx-band { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, #ffc400 0 34px, #111 34px 68px); animation: tx-band var(--tx-d) cubic-bezier(.7,0,.2,1) both; }
@keyframes tx-band { 0% { clip-path: inset(0 100% 0 0); } 36%, 60% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
#page-fade .tx-plate { position: relative; z-index: 3; background: #111; border: 3px solid #ffc400; padding: 14px 34px; text-align: center; color: #ffc400;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); animation: tx-lab var(--tx-d) steps(6) both; }
#page-fade .tx-plate small { display: block; letter-spacing: .4em; font-size: 12px; } #page-fade .tx-plate b { font: 400 clamp(30px, 4vw, 54px) var(--fr-disp, sans-serif); letter-spacing: .1em; color: #fff; }
/* grid build: lines draw, blocks pop, numbers run */
#page-fade.tx-grid { background: #f1efe9; animation: tx-fadebox var(--tx-d) ease both; }
#page-fade .tx-grid { position: absolute; inset: 0; background-image: linear-gradient(#1d1d1d22 1px, transparent 1px), linear-gradient(90deg, #1d1d1d22 1px, transparent 1px);
  background-size: 48px 48px; animation: tx-gridd var(--tx-d) ease both; }
@keyframes tx-gridd { 0% { background-size: 48px 0, 0 48px; } 40%, 100% { background-size: 48px 48px; } }
#page-fade .tx-blk { position: absolute; width: 9vw; height: 6vw; background: #d62828; animation: tx-pop var(--tx-d) steps(3) both; animation-delay: calc(var(--i) * 40ms); }
#page-fade .tx-blk:nth-of-type(even) { background: #1d1d1d; width: 5vw; height: 9vw; }
@keyframes tx-pop { 0%, 10% { transform: scale(0); } 30%, 70% { transform: scale(1); } 100% { transform: scale(0); } }
#page-fade.tx-grid .tx-lab { color: #1d1d1d; } #page-fade .tx-coord { position: absolute; left: 24px; bottom: 20px; font: 12px ui-monospace, monospace; color: #1d1d1d; letter-spacing: .2em; }
@keyframes tx-fadebox { 0% { opacity: 0; } 22%, 70% { opacity: 1; } 100% { opacity: 0; } }
/* glitch: RGB split, torn slices, scan line */
#page-fade.tx-glitch { background: #050505; animation: tx-fadebox var(--tx-d) steps(5) both; }
#page-fade .tx-gl { text-shadow: 3px 0 #ff1744, -3px 0 #00e5ff; animation: tx-lab var(--tx-d) ease both, tx-jit .1s steps(2) infinite; }
#page-fade .tx-gl::before, #page-fade .tx-gl::after { content: attr(data-t); position: absolute; left: 0; top: 0; width: 100%; }
#page-fade .tx-gl::before { color: #ff1744; clip-path: inset(10% 0 60% 0); transform: translateX(-6px); }
#page-fade .tx-gl::after { color: #00e5ff; clip-path: inset(55% 0 15% 0); transform: translateX(6px); }
#page-fade .tx-scan { position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 3px, rgba(255,255,255,.05) 3px 4px); }
@keyframes tx-jit { 0% { transform: translate(2px, 0); } 50% { transform: translate(-3px, 1px) skewX(3deg); } 100% { transform: translate(1px, -1px); } }
/* shutter: two colour blocks slam shut and open */
#page-fade .tx-sh { position: absolute; left: 0; right: 0; height: 50%; background: var(--accent); animation: tx-shut var(--tx-d) cubic-bezier(.8,0,.2,1) both; }
#page-fade .tx-top { top: 0; --y: -100%; border-bottom: 6px solid #111; } #page-fade .tx-bot { bottom: 0; --y: 100%; background: #111; border-top: 6px solid var(--accent); }
@keyframes tx-shut { 0% { transform: translateY(var(--y)); } 35%, 62% { transform: none; } 100% { transform: translateY(var(--y)); } }
body.reduce-motion #page-fade.tx { display: none; }

/* ================================================================ text effects */
.tf-stroke { color: transparent !important; -webkit-text-stroke: 1px currentColor; animation: tf-fill 1.4s ease forwards; }
.pg-head > b.tf-stroke { -webkit-text-stroke-color: var(--accent); }
@keyframes tf-fill { 0% { color: transparent; background-size: 0 100%; } 60% { color: transparent; } 100% { color: inherit; -webkit-text-stroke-color: transparent; } }
.tf-stencil { -webkit-mask-image: repeating-linear-gradient(-45deg, #000 0 6px, transparent 6px 12px); mask-image: repeating-linear-gradient(-45deg, #000 0 6px, transparent 6px 12px);
  -webkit-mask-size: 200% 200%; mask-size: 200% 200%; animation: tf-sten 1.4s ease forwards; }
@keyframes tf-sten { 0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: .3; } 80% { opacity: 1; } 100% { -webkit-mask-image: none; mask-image: none; } }

/* ================================================================ styles: shared hooks */
body[data-uistyle] .page .pg-vert { display: none; }

/* ---------------- HAZARD: black, yellow / red warning plates, diagonal stripes */
body[data-uistyle=hazard] { --accent: #ffc400; --soft: #ffc40024; }
body[data-uistyle=hazard] .page, body[data-uistyle=hazard] #lobby {
  background: repeating-linear-gradient(-45deg, rgba(255,196,0,.025) 0 22px, transparent 22px 44px), #0b0b0b !important; }
body[data-uistyle=hazard] .pg-head { background: #0b0b0b !important; border-bottom: 0 !important; box-shadow: 0 6px 0 -0 transparent; }
body[data-uistyle=hazard] .pg-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: repeating-linear-gradient(-45deg, #ffc400 0 12px, #111 12px 24px); }
body[data-uistyle=hazard] .pg-head > b { color: #ffc400 !important; }
body[data-uistyle=hazard] .pg-head > b::before { content: "⚠ " !important; color: #ffc400 !important; }
body[data-uistyle=hazard] .page .card, body[data-uistyle=hazard] .rm-card, body[data-uistyle=hazard] .lb-go {
  border-radius: 0 !important; border: 1px solid #3b2f00 !important; border-left: 4px solid #ffc400 !important; background: #121212 !important;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
body[data-uistyle=hazard] .page button.primary, body[data-uistyle=hazard] #lobby button.primary, body[data-uistyle=hazard] #app > header button.primary {
  background: #ffc400 !important; color: #111 !important; border: 0 !important; border-radius: 0 !important; font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
body[data-uistyle=hazard] .page .label, body[data-uistyle=hazard] .page h3 { color: #ffc400; }
body[data-uistyle=hazard] #app > header { border-bottom: 3px solid transparent !important; border-image: repeating-linear-gradient(-45deg, #ffc400 0 8px, #111 8px 16px) 3 !important; }

/* ---------------- TECH PAPER: off-white grid paper, red / black blocks, crosshair marks (pages + Lobby only) */
body[data-uistyle=techpaper] .page, body[data-uistyle=techpaper] #lobby {
  --text: #1d1d1d; --muted: #6b6b6b; --line: #1d1d1d33; --panel: #ffffff; --panel2: #f4f2ee; --glass: #ffffffee; --bg2: #ebe8e1; --accent: #d62828; --soft: #d6282818;
  color: #1d1d1d; background: linear-gradient(#1d1d1d10 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, #1d1d1d10 1px, transparent 1px) 0 0 / 32px 32px, #f3f1ec !important; }
body[data-uistyle=techpaper] .pg-head { background: #f3f1ecf2 !important; border-bottom: 2px solid #1d1d1d !important; }
body[data-uistyle=techpaper] .pg-head > b { color: #1d1d1d !important; background: linear-gradient(90deg, #d62828 0 10px, transparent 10px); padding-left: 18px; }
body[data-uistyle=techpaper] .pg-head > b::before { content: "" !important; }
body[data-uistyle=techpaper] .page .card, body[data-uistyle=techpaper] .rm-card, body[data-uistyle=techpaper] .lb-go {
  background: #fff !important; border: 1px solid #1d1d1d !important; border-radius: 0 !important; color: #1d1d1d; position: relative;
  box-shadow: 4px 4px 0 #1d1d1d14; }
body[data-uistyle=techpaper] .page .card::before, body[data-uistyle=techpaper] .rm-card::before {
  content: "+"; position: absolute; right: 6px; top: 2px; color: #d62828; font: 14px ui-monospace, monospace; }
body[data-uistyle=techpaper] .page input, body[data-uistyle=techpaper] .page select, body[data-uistyle=techpaper] .page textarea { background: #fff; color: #1d1d1d; border-color: #1d1d1d55; }
body[data-uistyle=techpaper] .page button, body[data-uistyle=techpaper] #lobby button { background: #fff; color: #1d1d1d; border-color: #1d1d1d; border-radius: 0; }
body[data-uistyle=techpaper] .page button.primary, body[data-uistyle=techpaper] #lobby button.primary { background: #1d1d1d !important; color: #fff !important; border-color: #1d1d1d; }
body[data-uistyle=techpaper] .page .label, body[data-uistyle=techpaper] .page h3 { color: #d62828; letter-spacing: .2em; }
body[data-uistyle=techpaper] .page .muted { color: #6b6b6b; }
body[data-uistyle=techpaper][data-route=room] #app > header { background: #f3f1ec !important; border-bottom: 2px solid #1d1d1d !important; }
body[data-uistyle=techpaper][data-route=room] #app > header, body[data-uistyle=techpaper][data-route=room] #app > header button { color: #1d1d1d !important; }

/* ---------------- SLICED MONO: grayscale, thin white lines, diagonal cuts, vertical labels */
body[data-uistyle=sliced] { --accent: #f2f2f2; --soft: #ffffff14; }
body[data-uistyle=sliced] .page, body[data-uistyle=sliced] #lobby {
  background: linear-gradient(115deg, transparent 0 62%, #ffffff06 62% 70%, transparent 70%), #0d0d0d !important; }
body[data-uistyle=sliced] .pg-head { background: #0d0d0df2 !important; border-bottom: 1px solid #f2f2f2 !important; }
body[data-uistyle=sliced] .pg-head > b { letter-spacing: .32em !important; font-weight: 300; color: #f2f2f2 !important; }
body[data-uistyle=sliced] .pg-head > b::before { content: "— " !important; color: #f2f2f2 !important; }
body[data-uistyle=sliced] .page .card, body[data-uistyle=sliced] .rm-card, body[data-uistyle=sliced] .lb-go {
  background: #131313 !important; border: 1px solid #f2f2f233 !important; border-radius: 0 !important;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%); }
body[data-uistyle=sliced] .rm-pic, body[data-uistyle=sliced] .lb-bg, body[data-uistyle=sliced] .page img { filter: grayscale(1) contrast(1.1); transition: filter .4s; }
body[data-uistyle=sliced] .rm-card:hover .rm-pic, body[data-uistyle=sliced] .page img:hover { filter: none; }
body[data-uistyle=sliced] .page button.primary, body[data-uistyle=sliced] #lobby button.primary { background: #f2f2f2 !important; color: #0d0d0d !important; border: 0 !important; border-radius: 0 !important; }
body[data-uistyle=sliced] .page .pg-vert { display: block; position: fixed; right: 10px; top: 120px; writing-mode: vertical-rl; letter-spacing: .5em; font-size: 11px; color: #f2f2f266; pointer-events: none; }

/* ---------------- NEON PROJECT: dark grain, red + amber neon lines, triangles, glitchy titles */
body[data-uistyle=neon] { --accent: #ff3b5c; --soft: #ff3b5c22; }
body[data-uistyle=neon] .page, body[data-uistyle=neon] #lobby {
  background: radial-gradient(ellipse at 80% 100%, #ff3b5c14, transparent 50%), radial-gradient(ellipse at 0% 0%, #ffb02012, transparent 45%),
    repeating-radial-gradient(circle at 30% 40%, #ffffff05 0 1px, transparent 1px 3px), #0a0a0c !important; }
body[data-uistyle=neon] .pg-head { background: #0a0a0cf0 !important; border-bottom: 1px solid #ff3b5c !important; box-shadow: 0 0 14px #ff3b5c55; }
body[data-uistyle=neon] .pg-head > b { color: #ff3b5c !important; text-shadow: 0 0 10px #ff3b5c99, 2px 0 #ffb02066; }
body[data-uistyle=neon] .pg-head > b::before { content: "▲ " !important; color: #ffb020 !important; font-size: 14px !important; }
body[data-uistyle=neon] .page .card, body[data-uistyle=neon] .rm-card, body[data-uistyle=neon] .lb-go {
  background: #0f0f13 !important; border: 1px solid #ff3b5c66 !important; border-radius: 0 !important; box-shadow: inset 0 0 0 1px #ffb02012, 0 0 12px #ff3b5c22; }
body[data-uistyle=neon] .page .card:hover, body[data-uistyle=neon] .rm-card:hover, body[data-uistyle=neon] .lb-go:hover { box-shadow: 0 0 18px #ff3b5c66; border-color: #ff3b5c !important; }
body[data-uistyle=neon] .page button.primary, body[data-uistyle=neon] #lobby button.primary { background: transparent !important; color: #ff3b5c !important; border: 1px solid #ff3b5c !important;
  border-radius: 0 !important; box-shadow: 0 0 10px #ff3b5c66, inset 0 0 8px #ff3b5c33; text-shadow: 0 0 6px #ff3b5c; }
body[data-uistyle=neon] .page .label, body[data-uistyle=neon] .page h3 { color: #ffb020; }
body[data-uistyle=neon] #app > header { border-bottom: 1px solid #ff3b5c !important; box-shadow: 0 0 12px #ff3b5c44; }
body[data-uistyle=techpaper] .rm-acc { background: #1d1d1d !important; color: #fff !important; }
body[data-uistyle=techpaper] .rm-acc.gm { background: #d62828 !important; }
body #bell-float { z-index: 59; }

/* ================================================================ STY-02 (24 Nov): UI styles B */
/* ---------------- BADGE / LANYARD: navy strap, cards as ID badges with a punch slot and a colour header strip */
body[data-uistyle=badge] { --accent: #3d7bff; --soft: #3d7bff22; }
body[data-uistyle=badge] .page, body[data-uistyle=badge] #lobby {
  background: radial-gradient(ellipse at 50% -10%, #23345e, transparent 60%), #0e1424 !important; }
body[data-uistyle=badge] .pg-head { background: #0e1424f2 !important; border-bottom: 0 !important; }
body[data-uistyle=badge] .pg-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: repeating-linear-gradient(90deg, #3d7bff 0 64px, #ffcc33 64px 70px, #3d7bff 70px 134px, #0e1424 134px 140px); }
body[data-uistyle=badge] .pg-head > b::before { content: "🪪 " !important; }
body[data-uistyle=badge] .page .card, body[data-uistyle=badge] .rm-card, body[data-uistyle=badge] .lb-go {
  position: relative; background: #f5f7fb !important; color: #1a2238 !important; border: 0 !important; border-radius: 12px !important;
  border-top: 10px solid #3d7bff !important; box-shadow: 0 8px 20px #0007; padding-top: 18px; }
body[data-uistyle=badge] .page .card::before, body[data-uistyle=badge] .rm-card::before, body[data-uistyle=badge] .lb-go::before {
  content: ""; position: absolute; top: 4px; left: 50%; width: 40px; height: 7px; margin-left: -20px; border-radius: 5px; background: #0e1424; box-shadow: inset 0 1px 2px #000; }
body[data-uistyle=badge] .page .card .muted, body[data-uistyle=badge] .rm-card .muted, body[data-uistyle=badge] .lb-go .muted, body[data-uistyle=badge] .lb-go small { color: #5b6684 !important; }
body[data-uistyle=badge] .page .card input, body[data-uistyle=badge] .page .card select, body[data-uistyle=badge] .page .card textarea { background: #fff; color: #1a2238; border-color: #c5cde0; }
body[data-uistyle=badge] .page .card button:not(.primary) { background: #e6ebf5; color: #1a2238; border-color: #c5cde0; }
body[data-uistyle=badge] .page button.primary, body[data-uistyle=badge] #lobby button.primary { background: #3d7bff !important; color: #fff !important; border: 0 !important; border-radius: 20px !important; }
body[data-uistyle=badge] .page .label, body[data-uistyle=badge] .page h3 { color: #ffcc33; letter-spacing: .14em; }
body[data-uistyle=badge] .page .card .label, body[data-uistyle=badge] .page .card h3 { color: #3d7bff; }
body[data-uistyle=badge] #app > header { border-bottom: 4px solid #3d7bff !important; }

/* ---------------- CYBER POP: dark purple, halftone dots, white cards with thick black outlines + offset cyan shadow */
body[data-uistyle=cyberpop] { --accent: #ff2bd6; --soft: #ff2bd622; }
body[data-uistyle=cyberpop] .page, body[data-uistyle=cyberpop] #lobby {
  background: radial-gradient(circle, #ff2bd633 1.5px, transparent 1.6px) 0 0 / 14px 14px, linear-gradient(135deg, #2a0f4a, #13072a 60%, #0a2a3a) !important; }
body[data-uistyle=cyberpop] .pg-head { background: #ffe93b !important; border-bottom: 4px solid #111 !important; }
body[data-uistyle=cyberpop] .pg-head > b { color: #111 !important; font-style: italic; text-shadow: 3px 3px 0 #ff2bd6; }
body[data-uistyle=cyberpop] .pg-head > b::before { content: "★ " !important; color: #111 !important; }
body[data-uistyle=cyberpop] .pg-head, body[data-uistyle=cyberpop] .pg-head button { color: #111 !important; }
body[data-uistyle=cyberpop] .page .card, body[data-uistyle=cyberpop] .rm-card, body[data-uistyle=cyberpop] .lb-go {
  background: #fff !important; color: #111 !important; border: 3px solid #111 !important; border-radius: 14px !important; box-shadow: 6px 6px 0 #00e5ff !important; }
body[data-uistyle=cyberpop] .page .card:hover, body[data-uistyle=cyberpop] .rm-card:hover, body[data-uistyle=cyberpop] .lb-go:hover { box-shadow: 8px 8px 0 #ff2bd6 !important; transform: translate(-2px, -2px); }
body[data-uistyle=cyberpop] .page .card .muted, body[data-uistyle=cyberpop] .rm-card .muted, body[data-uistyle=cyberpop] .lb-go .muted, body[data-uistyle=cyberpop] .lb-go small { color: #555 !important; }
body[data-uistyle=cyberpop] .page .card input, body[data-uistyle=cyberpop] .page .card select, body[data-uistyle=cyberpop] .page .card textarea { background: #fff; color: #111; border: 2px solid #111; }
body[data-uistyle=cyberpop] .page .card button:not(.primary) { background: #fff; color: #111; border: 2px solid #111; }
body[data-uistyle=cyberpop] .page button.primary, body[data-uistyle=cyberpop] #lobby button.primary { background: #ffe93b !important; color: #111 !important; border: 3px solid #111 !important;
  border-radius: 999px !important; box-shadow: 3px 3px 0 #111; font-weight: 800; }
body[data-uistyle=cyberpop] .page .label, body[data-uistyle=cyberpop] .page h3 { color: #00e5ff; font-style: italic; }
body[data-uistyle=cyberpop] .page .card .label, body[data-uistyle=cyberpop] .page .card h3 { color: #ff2bd6; }
body[data-uistyle=cyberpop] #app > header { border-bottom: 4px solid #ff2bd6 !important; box-shadow: 0 4px 0 #00e5ff; }

/* ---------------- RED BRAND: red pages with dark slashes, black header bar, white cards, bold italic caps */
body[data-uistyle=redbrand] { --accent: #e10600; --soft: #e1060022; }
body[data-uistyle=redbrand] .page, body[data-uistyle=redbrand] #lobby {
  background: linear-gradient(115deg, transparent 0 55%, #0000002a 55% 63%, transparent 63% 70%, #00000018 70% 73%, transparent 73%), #c80500 !important; }
body[data-uistyle=redbrand] .pg-head { background: #0b0b0b !important; border-bottom: 6px solid #fff !important; }
body[data-uistyle=redbrand] .pg-head > b { color: #fff !important; font-style: italic; font-weight: 800; letter-spacing: .02em !important; text-transform: uppercase; }
body[data-uistyle=redbrand] .pg-head > b::before { content: "■ " !important; color: #e10600 !important; }
body[data-uistyle=redbrand] .page .card, body[data-uistyle=redbrand] .rm-card, body[data-uistyle=redbrand] .lb-go {
  background: #fff !important; color: #111 !important; border: 0 !important; border-radius: 0 !important; border-left: 10px solid #0b0b0b !important;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%); }
body[data-uistyle=redbrand] .page .card .muted, body[data-uistyle=redbrand] .rm-card .muted, body[data-uistyle=redbrand] .lb-go .muted, body[data-uistyle=redbrand] .lb-go small { color: #555 !important; }
body[data-uistyle=redbrand] .page .card input, body[data-uistyle=redbrand] .page .card select, body[data-uistyle=redbrand] .page .card textarea { background: #fff; color: #111; border-color: #999; }
body[data-uistyle=redbrand] .page .card button:not(.primary) { background: #f1f1f1; color: #111; border-color: #bbb; border-radius: 0; }
body[data-uistyle=redbrand] .page button.primary, body[data-uistyle=redbrand] #lobby button.primary { background: #0b0b0b !important; color: #fff !important; border: 0 !important; border-radius: 0 !important;
  font-style: italic; font-weight: 800; text-transform: uppercase; }
body[data-uistyle=redbrand] .page .label, body[data-uistyle=redbrand] .page h3 { color: #fff; font-style: italic; font-weight: 800; text-transform: uppercase; }
body[data-uistyle=redbrand] .page .card .label, body[data-uistyle=redbrand] .page .card h3 { color: #e10600; }
body[data-uistyle=redbrand] .page > :not(.card):not(.pg-head) .muted { color: #ffd7d5; }
body[data-uistyle=redbrand] #app > header { background: #0b0b0b !important; border-bottom: 4px solid #e10600 !important; }

/* ---------------- CUSTOM: the GM's own styles (variables come from THEME; parts are data attributes) */
body[data-uistyle=custom] { --accent: var(--cs-ac, #4fc3f7); --soft: color-mix(in srgb, var(--cs-ac, #4fc3f7) 18%, transparent); }
body[data-uistyle=custom] .page, body[data-uistyle=custom] #lobby { background-color: var(--cs-bg, #0d1117) !important; color: var(--cs-text, inherit);
  --text: var(--cs-text, #e6edf3); --muted: var(--cs-muted, #8b949e); --panel: var(--cs-panel, #161b22); --panel2: var(--cs-panel, #161b22); }
body[data-uistyle=custom] .page, body[data-uistyle=custom] .page button, body[data-uistyle=custom] .page input, body[data-uistyle=custom] #lobby { font-family: var(--cs-font, var(--body)); }
body[data-uistyle=custom] .pg-head > b { font-family: var(--cs-font, var(--head)); color: var(--cs-ac) !important; }
body[data-uistyle=custom] .page .card, body[data-uistyle=custom] .rm-card, body[data-uistyle=custom] .lb-go { background: var(--cs-panel, #161b22) !important; color: var(--cs-text, inherit) !important; }
body[data-uistyle=custom][data-ulight] .page input, body[data-uistyle=custom][data-ulight] .page select, body[data-uistyle=custom][data-ulight] .page textarea,
body[data-uistyle=custom][data-ulight] .page button:not(.primary) { background: #fff; color: var(--cs-text, #111); border-color: color-mix(in srgb, var(--cs-text, #111) 30%, transparent); }
body[data-uistyle=custom] .page button.primary, body[data-uistyle=custom] #lobby button.primary { background: var(--cs-ac) !important; color: var(--cs-bg, #000) !important; border-color: var(--cs-ac) !important; }
body[data-uistyle=custom] .page .label, body[data-uistyle=custom] .page h3 { color: var(--cs-ac2, var(--cs-ac)); }
body[data-uistyle=custom] .page .muted { color: var(--cs-muted, inherit); }
/* corners */
body[data-uistyle=custom][data-ucorner=round] :is(.page .card, .rm-card, .lb-go, .page button) { border-radius: 14px !important; }
body[data-uistyle=custom][data-ucorner=square] :is(.page .card, .rm-card, .lb-go, .page button) { border-radius: 0 !important; }
body[data-uistyle=custom][data-ucorner=notch] :is(.page .card, .rm-card, .lb-go) { border-radius: 0 !important; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
body[data-uistyle=custom][data-ucorner=cut] :is(.page .card, .rm-card, .lb-go) { border-radius: 0 !important; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
/* borders */
body[data-uistyle=custom][data-uborder=none] :is(.page .card, .rm-card, .lb-go) { border: 0 !important; }
body[data-uistyle=custom][data-uborder=thin] :is(.page .card, .rm-card, .lb-go) { border: 1px solid color-mix(in srgb, var(--cs-ac) 45%, transparent) !important; }
body[data-uistyle=custom][data-uborder=thick] :is(.page .card, .rm-card, .lb-go) { border: 3px solid var(--cs-text, #fff) !important; box-shadow: 5px 5px 0 var(--cs-ac2, var(--cs-ac)); }
body[data-uistyle=custom][data-uborder=glow] :is(.page .card, .rm-card, .lb-go) { border: 1px solid var(--cs-ac) !important; box-shadow: 0 0 14px color-mix(in srgb, var(--cs-ac) 45%, transparent); }
body[data-uistyle=custom][data-uborder=left] :is(.page .card, .rm-card, .lb-go) { border: 0 !important; border-left: 5px solid var(--cs-ac) !important; }
/* patterns */
body[data-uistyle=custom][data-upattern=stripes] :is(.page, #lobby) { background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--cs-ac) 7%, transparent) 0 18px, transparent 18px 36px) !important; }
body[data-uistyle=custom][data-upattern=grid] :is(.page, #lobby) { background-image: linear-gradient(color-mix(in srgb, var(--cs-text, #fff) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--cs-text, #fff) 8%, transparent) 1px, transparent 1px) !important; background-size: 32px 32px !important; }
body[data-uistyle=custom][data-upattern=dots] :is(.page, #lobby) { background-image: radial-gradient(circle, color-mix(in srgb, var(--cs-ac) 25%, transparent) 1px, transparent 1.5px) !important; background-size: 18px 18px !important; }
body[data-uistyle=custom][data-upattern=halftone] :is(.page, #lobby) { background-image: radial-gradient(circle, color-mix(in srgb, var(--cs-ac2, var(--cs-ac)) 35%, transparent) 2px, transparent 2.2px) !important; background-size: 12px 12px !important; }
body[data-uistyle=custom][data-upattern=grain] :is(.page, #lobby) { background-image: repeating-radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--cs-text, #fff) 5%, transparent) 0 1px, transparent 1px 3px) !important; }
/* header */
body[data-uistyle=custom] .pg-head { background: var(--cs-bg, #0d1117) !important; }
body[data-uistyle=custom][data-uhead=stripe] .pg-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: repeating-linear-gradient(-45deg, var(--cs-ac) 0 10px, var(--cs-ac2, transparent) 10px 20px); }
body[data-uistyle=custom][data-uhead=glow] .pg-head { border-bottom: 1px solid var(--cs-ac) !important; box-shadow: 0 0 14px color-mix(in srgb, var(--cs-ac) 50%, transparent); }
body[data-uistyle=custom][data-uhead=block] .pg-head { background: var(--cs-ac) !important; } body[data-uistyle=custom][data-uhead=block] .pg-head > b { color: var(--cs-bg, #000) !important; }
body[data-uistyle=custom] #app > header { border-bottom: 2px solid var(--cs-ac) !important; }
