Files
Twungeon/apps/stream-view/public/styles.css
T

147 lines
11 KiB
CSS

:root {
--ink: #f5ecd8;
--muted: #b8ad98;
--gold: #e8b04b;
--red: #db604c;
--panel: #171a1d;
--line: #34383b;
--floor: #3a3832;
--wall: #111315;
/* Normalized to the matching control panel in the 16:9 broadcast layout. */
--controls-left: 0.95%;
--controls-top: 1.7%;
--controls-width: 27.1%;
--controls-height: 65.8%;
--controls-padding: clamp(8px, 1.15vw, 22px);
}
* { box-sizing: border-box; }
html:not(.extension-mode) { color-scheme: dark; }
html.extension-mode { color-scheme: normal; }
body { margin: 0; background: #0d0f10; color: var(--ink); font: 15px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background-image: radial-gradient(#252017 1px, transparent 1px); background-size: 20px 20px; }
.shell { height: 100vh; min-height: 650px; padding: 18px; display: grid; grid-template-columns: minmax(260px, 28%) 1fr; grid-template-rows: minmax(0, 1fr) 31%; gap: 14px; }
.panel { background: linear-gradient(145deg, #191c1f, #111315); border: 1px solid var(--line); box-shadow: 0 18px 60px #0008, inset 0 1px #ffffff0d; border-radius: 5px; }
.status { padding: 22px; display: flex; flex-direction: column; gap: 20px; overflow: auto; }
.game { padding: 20px; display: flex; flex-direction: column; min-width: 0; position: relative; }
.log { grid-column: 1/-1; padding: 15px 20px; overflow: hidden; display: flex; flex-direction: column; }
h1, h2, p { margin: 0; }
h1 { font: 800 31px/1 system-ui; letter-spacing: .08em; }
h1 span { color: var(--gold); }
h2 { font: 700 18px/1.2 system-ui; }
.eyebrow { text-transform: uppercase; color: var(--gold); font-size: 11px; letter-spacing: .16em; margin-bottom: 6px; }
.game-head, .log-head { display: flex; align-items: center; justify-content: space-between; }
.phase { padding: 6px 10px; border: 1px solid var(--gold); color: var(--gold); border-radius: 2px; text-transform: uppercase; font-size: 12px; }
#banner { position: absolute; z-index: 3; inset: 45% auto auto 50%; transform: translate(-50%, -50%); padding: 16px 22px; background: #111e; border: 1px solid var(--gold); box-shadow: 0 0 40px #000; text-align: center; color: var(--gold); font-weight: bold; white-space: nowrap; }
#banner .banner-note { display: block; margin-top: 6px; color: #fff; font-size: .78em; font-weight: 600; }
#map { flex: 1; display: grid; align-content: center; justify-content: center; margin: 12px 0; min-height: 0; }
.tile { width: min(3.6vw, 42px); aspect-ratio: 1; border: 1px solid #222; display: grid; place-items: center; position: relative; font-size: min(1.6vw, 18px); }
.tile.wall { background: var(--wall); box-shadow: inset 0 0 0 2px #1b1f21; }
.tile.floor { background: var(--floor); }
.tile.exit { background: #68491b; color: #ffd77e; }
.entity { position: absolute; inset: 12%; border-radius: 50%; display: grid; place-items: center; font-weight: bold; text-shadow: 0 1px 2px #000; }
.entity.player { background: var(--player-color, #3f8cff); border: 2px solid #fff; color: #111; }
.entity.player.stacked { inset: auto; width: 40%; height: 40%; }
.entity.player.stacked.slot-1 { left: 6%; top: 6%; }
.entity.player.stacked.slot-2 { right: 6%; top: 6%; }
.entity.player.stacked.slot-3 { left: 6%; bottom: 6%; }
.entity.player.stacked.slot-4 { right: 6%; bottom: 6%; }
.entity-name { position: absolute; top: 100%; left: 50%; z-index: 2; transform: translate(-50%, 2px); padding: 1px 3px; border-radius: 2px; background: #000c; color: var(--player-color, #fff); font-size: 9px; line-height: 1.1; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.entity.goblin { background: var(--red); border: 2px solid #ffb2a6; border-radius: 20%; }
.legend { display: flex; gap: 18px; justify-content: center; color: var(--muted); font-size: 12px; }
.party-name { color: var(--player-color); white-space: nowrap; }
#status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { border: 1px solid var(--line); padding: 9px; }
.stat b { display: block; color: var(--gold); font-size: 18px; }
.dpad { display: grid; grid-template-columns: repeat(3, 42px); gap: 5px; margin: 10px 0; }
.dpad button:nth-child(1) { grid-column: 2; }
.dpad button:nth-child(2) { grid-column: 1; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; }
button, input { font: inherit; }
button { background: #292d2f; color: var(--ink); border: 1px solid #53595c; padding: 8px 10px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button:disabled { opacity: .35; cursor: not-allowed; }
#disabled { color: var(--muted); font-size: 12px; margin-top: 8px; }
details { margin-top: auto; color: var(--muted); }
details label { display: block; margin: 8px 0; }
input { display: block; width: 100%; background: #0d0f10; border: 1px solid var(--line); color: var(--ink); padding: 6px; }
#log { margin: 8px 0 0; padding: 0; list-style: none; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
#log li { padding: 4px 8px; border-left: 2px solid var(--player-color, var(--line)); color: var(--muted); }
#log li:last-child { color: var(--ink); border-color: var(--gold); }
#connection { font-size: 12px; color: var(--muted); }
/* Twitch Video Overlay mode: the stream supplies every noninteractive surface. */
html.extension-mode, html.extension-mode body { width: 100%; height: 100%; overflow: hidden; background: transparent; background-image: none; pointer-events: none; }
html.extension-mode .shell { position: fixed; inset: 0; display: block; min-height: 0; padding: 0; pointer-events: none; }
html.extension-mode .game, html.extension-mode .log, html.extension-mode .branding, html.extension-mode #status, html.extension-mode details { display: none; }
html.extension-mode .status {
position: absolute;
left: var(--controls-left);
top: var(--controls-top);
width: var(--controls-width);
height: var(--controls-height);
padding: var(--controls-padding);
display: grid;
place-items: center;
overflow: hidden;
container: overlay-controls / size;
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
pointer-events: none;
}
html.extension-mode #controller { width: min(100%, 18rem); pointer-events: none; }
html.extension-mode #controller h2 { font-size: clamp(11px, 5cqw, 18px); margin-bottom: clamp(4px, 2cqh, 12px); text-shadow: 0 1px 3px #000; }
html.extension-mode #viewerStatus { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(3px, 1.4cqw, 7px); margin-bottom: clamp(5px, 2cqh, 10px); color: var(--ink); text-shadow: 0 1px 3px #000; }
html.extension-mode #viewerStatus[hidden] { display: none; }
html.extension-mode #viewerStatus > div { padding: clamp(3px, 1cqw, 6px); background: #080a0bd9; border: 1px solid #ffffff2b; font-size: clamp(8px, 3.3cqw, 12px); }
html.extension-mode #viewerStatus > div > span, html.extension-mode #viewerStatus > div > b { display: block; }
html.extension-mode #viewerStatus .viewer-identity { grid-column: 1/-1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; }
html.extension-mode #viewerStatus .viewer-identity > span, html.extension-mode #viewerStatus .viewer-identity > b { display: initial; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--player-color); border: 1px solid #fff; }
html.extension-mode #controller button { pointer-events: auto; touch-action: manipulation; }
html.extension-mode .dpad { grid-template-columns: repeat(3, minmax(28px, 1fr)); gap: clamp(3px, 1.8cqw, 7px); margin: 0 0 clamp(6px, 2.5cqh, 14px); }
html.extension-mode .dpad button { aspect-ratio: 1; padding: 0; font-size: clamp(13px, 6cqw, 24px); }
html.extension-mode .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(3px, 1.8cqw, 7px); }
html.extension-mode .actions button { padding: clamp(5px, 1.7cqh, 10px) clamp(2px, 1cqw, 8px); font-size: clamp(9px, 4.3cqw, 15px); }
html.extension-mode #spawnExtension, html.extension-mode #shareIdentity { width: 100%; margin-bottom: clamp(5px, 2cqh, 12px); font-size: clamp(9px, 4.3cqw, 15px); }
html.extension-mode #disabled { min-height: 2.8em; margin-top: clamp(5px, 2cqh, 10px); color: var(--ink); font-size: clamp(9px, 3.7cqw, 13px); text-shadow: 0 1px 3px #000, 0 0 8px #000; }
/* Opt-in local diagnostics. These classes are never enabled by production URLs. */
html.extension-mode.overlay-debug .status { outline: 2px dashed #00e5ff; outline-offset: -2px; background: #00e5ff0d; }
html.extension-mode.overlay-debug #controller { outline: 1px dashed #ff4fd8; }
html.extension-mode.overlay-dev details { display: block; width: 100%; margin-top: clamp(8px, 3cqh, 16px); pointer-events: auto; font-size: clamp(9px, 3.7cqw, 13px); }
html.extension-mode.overlay-dev .status { place-items: start center; overflow: auto; }
@media (max-width: 760px) {
html:not(.extension-mode) .shell { height: auto; grid-template-columns: 1fr; grid-template-rows: auto minmax(500px, 70vh) 360px; }
html:not(.extension-mode) .log { grid-column: 1; }
html:not(.extension-mode) .tile { width: min(5vw, 28px); }
html:not(.extension-mode) #banner { white-space: normal; width: 75%; }
}
@media (max-width: 600px) {
html.extension-mode .status { left: 3%; top: 3%; width: 94%; height: 94%; padding: 12px; place-items: center; overflow: auto; }
html.extension-mode #controller { width: min(100%, 24rem); }
html.extension-mode #controller h2 { font-size: 17px; }
html.extension-mode #viewerStatus { gap: 7px; margin-bottom: 10px; }
html.extension-mode #viewerStatus > div { min-height: 44px; padding: 7px 9px; font-size: 13px; }
html.extension-mode .dpad { grid-template-columns: repeat(3, minmax(56px, 1fr)); gap: 8px; margin-bottom: 10px; }
html.extension-mode .dpad button { min-height: 56px; font-size: 24px; }
html.extension-mode .actions { gap: 8px; }
html.extension-mode .actions button, html.extension-mode #spawnExtension, html.extension-mode #shareIdentity { min-height: 52px; padding: 10px 6px; font-size: 15px; }
html.extension-mode #disabled { font-size: 13px; }
}
html.extension-mode.extension-mobile .status { left: 3%; top: 3%; width: 94%; height: 94%; padding: 12px; place-items: center; overflow: auto; }
html.extension-mode.extension-mobile #controller { width: min(100%, 24rem); }
html.extension-mode.extension-mobile .dpad { grid-template-columns: repeat(3, minmax(56px, 1fr)); gap: 8px; }
html.extension-mode.extension-mobile .dpad button { min-height: 56px; font-size: 24px; }
html.extension-mode.extension-mobile .actions button, html.extension-mode.extension-mobile #spawnExtension, html.extension-mode.extension-mobile #shareIdentity { min-height: 52px; font-size: 15px; }
@media (max-aspect-ratio: 4/3) {
html.extension-mode { --controls-width: 31%; --controls-height: 62%; }
}