:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #161b26;
  --panel-2: #1d2433;
  --line: #2a3346;
  --text: #e6e9f0;
  --muted: #9aa4b8;
  --accent: #ffb13b;
  --accent-ink: #1a1203;
  --ok: #5fd38d;
  --warn: #f2c94c;
  --error: #ff7a6b;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1.05rem; }
small { color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 46em; }
.fine { font-size: .875rem; color: var(--muted); }

button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55em 1.1em;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
button.quiet { background: none; border-color: transparent; color: var(--muted); text-decoration: underline; padding-inline: .4em; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
button.small { padding: .2em .7em; font-size: .85rem; }
input[type=text], textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .5em .7em;
  width: 100%;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { font-family: var(--mono); font-size: .85rem; resize: vertical; }

header.site, footer.site { padding: 14px 24px; }
header.site { border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-family: var(--mono); font-size: 1.1rem; }
.brand .plug { color: var(--accent); }
.brand .tld { color: var(--muted); font-weight: 400; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; margin-top: auto; }
footer.site a { color: var(--muted); }

.layout { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px; flex: 1; }
.crumbs { margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.banner { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: .7em 1em; border-radius: var(--radius); }
.message { margin: .5em 0 0; color: var(--muted); }
.message.error { color: var(--error); }
.waiting::after { content: ''; display: inline-block; width: .6em; height: .6em; margin-left: .5em; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .2; } }
.notice { max-width: 40em; margin: 10vh auto; text-align: center; }

/* Home */
.hero { padding: 4vh 0 3vh; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 4rem); font-family: var(--mono); }
.game-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.game-grid a { color: inherit; text-decoration: none; }
.game-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%; transition: border-color .15s, transform .15s; }
.game-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.game-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #000; image-rendering: pixelated; }
.game-card > div { padding: 14px 16px 16px; }
.game-card .meta { color: var(--muted); font-size: .85rem; margin: 0 0 .5em; }

/* A game */
.game-detail { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 32px; align-items: start; }
.game-detail .cover, .game-detail .screenshot { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #000; image-rendering: pixelated; }
.game-detail .screenshot { max-width: 640px; display: block; margin: 0 0 1em; }
.edition { color: var(--muted); margin-top: -.3em; }
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: .15em .8em; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1.4em 0; }

/* Playing with friends */
.party-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--mono); }
.step.current .num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.done .num { background: var(--ok); color: #062512; border-color: var(--ok); }
.step.upcoming { opacity: .5; }
.step.upcoming h3 { margin: .35em 0 0; }
.step p { margin: 0 0 .8em; }
.step h3 { margin-top: .35em; }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
form.inline label { flex: 1 1 260px; display: grid; gap: 6px; }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox input { font-family: var(--mono); font-size: .8rem; }
.invites { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.invites li { background: var(--panel-2); border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; }
.invites li.connecting { border-color: var(--warn); }
.invites li.connected { border-color: var(--ok); }
.invites li.connected .who { color: var(--ok); font-weight: 600; }
.invites li.closed .who { color: var(--muted); }
form.reply { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
form.reply .message { grid-column: 1 / -1; }
.party-panel, .lobby-groups, .lobby-people, .lobby-chat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.party-panel { position: sticky; top: 16px; }
.players { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 8px; }
.players .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.players .connecting .dot { background: var(--warn); animation: pulse 1.2s infinite; }
button.start { width: 100%; padding: .8em; font-size: 1.05rem; }

/* Lobby */
.lobby-intro { max-width: 46em; }
.lobby { display: grid; grid-template-columns: 260px 1fr 220px; gap: 16px; align-items: stretch; min-height: 60vh; }
.lobby-chat { display: flex; flex-direction: column; min-height: 0; }
.chat-log { list-style: none; padding: 0; margin: 0 0 12px; flex: 1; overflow-y: auto; max-height: 60vh; min-height: 300px; font-size: .95rem; }
.chat-log li { padding: 2px 0; overflow-wrap: anywhere; }
.chat-log time { color: var(--muted); font-family: var(--mono); font-size: .75rem; margin-right: .6em; }
.chat-log .info, .chat-log .action { color: var(--muted); }
.chat-log .error { color: var(--error); }
.chat-log .private b { color: var(--accent); }
.chat-log .mine b { color: var(--ok); }
.chat-say { display: flex; gap: 8px; }
.groups, .people { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.groups li, .people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.invitation, .busy { background: var(--panel-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.invitation p, .busy p { margin: 0 0 8px; }
.my-group { display: grid; gap: 4px; }

/* Playing: the machine on the left (#stage), the view as a side panel */
#stage { display: none; }
#stage emularity-network { display: none; }
#stage emularity-network.current { display: block; }
body[data-view=play] .layout { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
body[data-view=play] #stage { display: block; }
#stage emularity-x86 { display: block; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; max-height: calc(100vh - 140px); margin: 0 auto; }
/* DOS modes (320x200, 640x400, 720x400 text...) all filled a 4:3 monitor */
#stage emularity-x86 .v86-screen { width: 100%; height: 100%; }
#stage emularity-x86 canvas { width: 100% !important; height: 100% !important; object-fit: fill; image-rendering: pixelated; display: block; }
#stage emularity-x86:fullscreen { aspect-ratio: auto; max-height: none; border-radius: 0; }
#stage emularity-x86 { position: relative; }
#stage emularity-x86:fullscreen canvas { object-fit: contain; }
/* Touchscreens (body.console, see app.js): the machine fills the screen, the picture
   letterboxed (4:3) with the game's touch controls over it; in portrait the picture
   sits near the top, below the controls' top strip, the thumbs below it */
body.console { overflow: hidden; overscroll-behavior: none; touch-action: none; }
body.console #stage emularity-x86 { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh;
  max-height: none; aspect-ratio: auto; border-radius: 0; margin: 0; }
body.console #stage emularity-x86 canvas { object-fit: contain; object-position: 50% 50%; }
@media (orientation: portrait) {
  body.console #stage emularity-x86 canvas { object-position: 50% 48px; }
}
/* Back on the page (the controls' ✕): no controls over the small screen there */
body:not(.console) #stage emularity-keyboard[data-gamepad] { display: none; }
.howto { padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.howto li { margin-bottom: .5em; }

@media (max-width: 900px) {
  .game-detail, .party-layout { grid-template-columns: 1fr; }
  .party-panel { position: static; }
  .lobby { grid-template-columns: 1fr; }
  body[data-view=play] .layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .layout { padding: 16px; }
  header.site, footer.site { padding-inline: 16px; }
  form.reply { grid-template-columns: 1fr; }
}
.new-group { display: flex; flex-wrap: wrap; gap: 8px; }
/* A party (one link for everyone): the link, then the chat */
.party-room { display: grid; gap: 16px; min-width: 0; }
.party-room h1 { margin-bottom: 0; }
.party-invite p { margin: 0; }
.party-invite .linkbox input { flex: 1; min-width: 0; }
.party-room .chat-log { min-height: 220px; max-height: 50vh; }
.party-panel .people { margin-bottom: 16px; }
.party-panel .start { width: 100%; }
.party-steps .lobby-chat { margin-top: 12px; padding: 12px; }
.more-invites { margin-top: 12px; }
.more-invites summary { cursor: pointer; color: var(--muted); }
.linkbox button { white-space: nowrap; }
/* Sharing a link: QR code, the link, Share… (Web Share API) and Copy */
.share-box { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 10px; }
.share-box .qr { width: 132px; height: 132px; image-rendering: pixelated; border-radius: 8px; flex: none; }
.share-main { flex: 1 1 260px; display: grid; gap: 8px; min-width: 0; }
.share-main input { font-family: var(--mono); font-size: .8rem; width: 100%; box-sizing: border-box; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-buttons button { white-space: nowrap; }
.share-status { color: var(--muted); font-size: .9rem; }
.share-main .qr-hint { margin: 0; }
body[data-view=play] .lobby-chat { padding: 12px; margin-bottom: 8px; }
body[data-view=play] .lobby-chat .chat-log { min-height: 120px; max-height: 40vh; font-size: .88rem; }
body[data-view=play] .chat-say input { min-width: 0; flex: 1; }
/* Playing: on wide screens the side panel is a column as tall as the window, pinned
   beside the machine: the chat takes what's left and scrolls inside, How to play
   folds away (and scrolls inside when it's open) */
.howto-box summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; padding: 6px 0; }
.howto-box .howto { margin-top: 8px; }
@media (min-width: 901px) {
  /* the window, less the site's header (--header-h, measured in app.js) and padding */
  body[data-view=play] #view { height: calc(100vh - var(--header-h, 57px) - 48px); height: calc(100dvh - var(--header-h, 57px) - 48px);
    display: flex; flex-direction: column; overflow: hidden; }
  body[data-view=play] footer.site { display: none; }
  body[data-view=play] #view > * { flex: none; }
  body[data-view=play] #view h1 { margin: .2em 0; }
  body[data-view=play] #view > .lobby-chat { flex: 1 1 0; min-height: 280px; display: flex; flex-direction: column; }
  body[data-view=play] #view > .lobby-chat .chat-log { flex: 1 1 0; min-height: 0; max-height: none; }
  body[data-view=play] #view > .howto-box[open] { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
  body[data-view=play] #view > .actions { margin: 12px 0 0; }
}
/* A party room's games: ones waiting for players first, with a big Join */
.games { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.games li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.games li.big { background: var(--panel-2); border: 1px solid var(--accent); border-radius: 10px; padding: 12px; }
.games li.big b { font-size: 1.05rem; }
.games li.big button { padding-inline: 18px; }
.games li.playing b { color: var(--muted); }
.games .fine { margin: 2px 0 0; }
.party-panel .or { margin: 4px 0 14px; }
.party-panel .or button { padding: 2px 4px; }

/* ----- Chat, as an old terminal IRC client (irssi): a blue title bar, the log on
   black, a blue status bar, the input line; a party's games and who's in them down
   the right, like a nick list ----- */
.party-layout.single { grid-template-columns: minmax(0, 1fr); }
.lobby-chat.irc, body[data-view=play] .lobby-chat.irc {
  --irc-bg: #070908; --irc-fg: #c9d1c9; --irc-dim: #6d776d; --irc-bar: #1b3a8c; --irc-bar-fg: #dfe7ff; --irc-line: #1f2a22;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "title" "log" "status" "input";
  padding: 0; overflow: hidden; background: var(--irc-bg); color: var(--irc-fg);
  border: 1px solid #263226; border-radius: 6px; font-family: var(--mono); font-size: .88rem; line-height: 1.4;
  box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(0, 0, 0, .35);
}
.lobby-chat.irc.with-side { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "title title" "log side" "status status" "input input"; }
.irc-title, .irc-status { background: var(--irc-bar); color: var(--irc-bar-fg); padding: 2px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.irc-title { grid-area: title; font-weight: 700; }
.irc-status { grid-area: status; font-size: .85em; }
.irc .chat-log { grid-area: log; margin: 0; padding: 8px 10px; min-height: 260px; max-height: 55vh; overflow-y: auto; font-size: inherit; }
.irc .chat-log li { padding: 0 0 0 6ch; text-indent: -6ch; margin: 0; color: var(--irc-fg); white-space: pre-wrap; overflow-wrap: anywhere; }
/* (a long line wraps under its text, not under the time: "12:34 " is 6 characters) */
.irc .chat-log time { color: var(--irc-dim); font-family: inherit; font-size: inherit; margin: 0; }
.irc .chat-log .nick i { font-style: normal; color: var(--irc-dim); }
.irc .chat-log .mine .nick { font-weight: 700; }
.irc .chat-log .bang { color: #4f7fe8; font-weight: 700; }
.irc .chat-log .info .text { color: #8db3bd; }
.irc .chat-log .error .text { color: #ff6b6b; }
.irc .chat-log .action .star, .irc .chat-log .action .text { color: #d79bf0; }
.irc .chat-log .private .text { color: #ffd166; }
.irc .nc0 { color: #5fd7ff; } .irc .nc1 { color: #87d75f; } .irc .nc2 { color: #ffaf5f; } .irc .nc3 { color: #d787ff; }
.irc .nc4 { color: #ff8787; } .irc .nc5 { color: #5fd7af; } .irc .nc6 { color: #e0d264; } .irc .nc7 { color: #87afff; }
.irc .chat-say { grid-area: input; display: flex; gap: 0; align-items: center; padding: 3px 6px 4px 10px; }
.irc-prompt { color: var(--irc-fg); white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; margin-right: .6em; }
.irc .chat-say input { flex: 1; min-width: 0; background: transparent; border: none; border-radius: 0; color: var(--irc-fg); font-family: inherit; font-size: inherit; padding: 4px 0; outline: none; caret-color: #87d75f; }
.irc .chat-say input::placeholder { color: #3e463e; }
.irc .chat-say button { font-family: inherit; font-size: .85em; background: transparent; border: 1px solid #2f3a2f; color: var(--irc-dim); padding: 2px 10px; border-radius: 3px; }
/* The nick list: the games, who's in them, who's here */
.irc .party-panel { grid-area: side; position: static; background: #0b0e0c; border: none; border-left: 1px solid var(--irc-line); border-radius: 0;
  padding: 10px 12px; font-size: .9em; overflow-y: auto; max-height: calc(55vh + 30px); min-height: 0; color: var(--irc-fg); }
.irc .party-panel h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--irc-dim); margin: 6px 0 8px; font-weight: 700; }
.irc .party-panel h2::before { content: '── '; }
.irc .party-panel h2::after { content: ' ──'; }
.irc .party-panel .fine, .irc .party-panel small { color: var(--irc-dim); }
.irc .party-panel .players li, .irc .party-panel .people li { gap: 6px; }
.irc .party-panel .games li.big { background: #10170f; border-color: var(--accent); }
.irc .party-panel button.quiet { color: var(--irc-dim); }
.irc .party-panel button { font-family: var(--mono); }
.party-steps .lobby-chat.irc { margin-top: 12px; }
@media (max-width: 760px) {
  /* The games under the input line */
  .lobby-chat.irc.with-side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "log" "status" "input" "side"; }
  .irc .party-panel { border-left: none; border-top: 1px solid var(--irc-line); max-height: none; }
  .irc .chat-log { min-height: 200px; max-height: 45vh; }
}
@media (min-width: 901px) {
  /* Playing: the chat fills what's left of the side panel */
  body[data-view=play] #view > .lobby-chat.irc { display: grid; flex: 1 1 0; min-height: 280px; }
  body[data-view=play] #view > .lobby-chat.irc .chat-log { min-height: 0; max-height: none; }
}
body[data-view=play] .lobby-chat.irc { margin-bottom: 8px; }
@media (max-width: 600px) {
  /* Phones: the steps' numbers sit beside their titles (no column of their own), and
     the chat runs the screen's full width, edge to edge, like a terminal app */
  .party-steps .step { display: block; padding: 14px; }
  .party-steps .step .num { float: left; width: 28px; height: 28px; margin: 0 10px 0 0; font-size: .9rem; }
  .party-steps .step h3 { margin: 0 0 8px; line-height: 28px; }
  .party-steps .step > div::after { content: ''; display: block; clear: both; }
  .party-steps .lobby-chat.irc { width: 100vw; margin-left: calc(50% - 50vw); border-radius: 0; border-left: none; border-right: none; font-size: .84rem; }
  .irc .chat-log { min-height: 240px; max-height: 55vh; padding: 6px 8px; }
  .irc .chat-say { padding: 3px 6px 5px 8px; }
  .irc-prompt { max-width: 30%; }
  .irc .party-panel { padding: 10px 8px 12px; }
}

/* ----- A party in a post (body.card: an X player card's frame, see renderCard in
   app.js): the frame is the page, about 480x360 to 600x450 ----- */
body.card { min-height: 0; height: 100vh; height: 100dvh; overflow: hidden; font-size: 14px; }
body.card header.site, body.card footer.site { display: none; }
body.card .layout { flex: 1; min-height: 0; max-width: none; width: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; }
body.card #view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Before Join: the game's screen behind who invited you, and Join */
.card-splash { flex: 1; position: relative; display: flex; align-items: flex-end; overflow: hidden; background: #000; }
.card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: .6; }
.card-intro { position: relative; width: 100%; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .88) 40%); }
.card-intro h1 { font-size: 1.35rem; margin: 0 0 4px; }
.card-intro .fine { margin: 0 0 10px; }
.card-intro .fine:last-child { margin: 10px 0 0; }
.card-intro button.big { font-size: 1.1rem; padding: 10px 24px; }
.card-intro form.inline { margin: 0; }
/* In the party: the chat fills the card, the games beside it */
body.card .lobby-chat.irc { flex: 1; min-height: 0; margin: 0; border: none; border-radius: 0; box-shadow: none; font-size: 12px; }
body.card .lobby-chat.irc.with-side { grid-template-columns: minmax(0, 1fr) 210px; grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "title title" "log side" "status status" "input input"; }
body.card .irc .chat-log { min-height: 0; max-height: none; padding: 6px 8px; }
body.card .irc .party-panel { max-height: none; padding: 8px; border-top: none; border-left: 1px solid var(--irc-line); }
@media (max-width: 440px) {
  /* Narrow (a phone): the games above the chat */
  body.card .lobby-chat.irc.with-side { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
    grid-template-areas: "title" "side" "log" "status" "input"; }
  body.card .irc .party-panel { border-left: none; border-bottom: 1px solid var(--irc-line); }
}
/* Playing: the PC fills the card above a bar */
body.card-playing #stage { display: block; position: fixed; inset: 0 0 34px 0; background: #000; }
body.card-playing #stage emularity-x86 { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; }
body.card-playing #stage emularity-x86 canvas { object-fit: contain; }
.card-bar { position: fixed; left: 0; right: 0; bottom: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; }
.card-bar .play-players { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.card-bar .players { display: flex; gap: 12px; margin: 0; padding: 0; list-style: none; }
.card-bar button { padding: 3px 10px; font-size: 12px; }
/* Chat lines over the game (cardToast in app.js), above the players' bar */
.card-overlay { position: fixed; left: 8px; bottom: 42px; z-index: 1001; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: min(80%, 420px); pointer-events: none; font-family: var(--mono); font-size: 12px; line-height: 1.35; }
.card-toasts { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.card-say { pointer-events: auto; width: 100%; font-family: inherit; font-size: inherit; padding: 5px 8px; border-radius: 4px;
  background: rgba(7, 9, 8, .92); color: #c9d1c9; border: 1px solid var(--accent); caret-color: #87d75f; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.card-say[hidden] { display: none; }
.card-toast { pointer-events: auto; cursor: pointer; background: rgba(7, 9, 8, .84); color: #c9d1c9; border: 1px solid #263226; border-radius: 4px;
  padding: 3px 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); overflow-wrap: anywhere; animation: toast-in .2s ease-out; transition: opacity .7s; }
.card-toast.private .text { color: #ffd166; }
.card-toast.gone { opacity: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* The next step (a game's Join, Start the game): a gentle glow and pulse */
@keyframes join-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 177, 59, .45), 0 0 8px 1px rgba(255, 177, 59, .35); transform: scale(1); }
  50% { box-shadow: 0 0 0 4px rgba(255, 177, 59, 0), 0 0 14px 3px rgba(255, 177, 59, .55); transform: scale(1.03); }
}
button.pulse:not(:disabled) { animation: join-pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  button.pulse:not(:disabled) { animation: none; box-shadow: 0 0 12px 3px rgba(255, 177, 59, .5); }
}
/* The card's first screen: the name and Join on one line */
.card-intro form.inline { align-items: center; gap: 10px; }
.card-intro form.inline label { flex: 0 1 220px; display: block; }
.card-intro form.inline label { font-size: 0; } /* (the prompt is the field's placeholder) */
.card-intro form.inline input { font-size: 1rem; width: 100%; padding: 9px 12px; }

/* A game's standing: shareware or freeware (badge() in app.js; card.html has its own) */
.badge { display: inline-block; vertical-align: .1em; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  line-height: 1; padding: .35em .6em; border-radius: 4px; border: 1px solid; white-space: nowrap; cursor: help; }
.badge.shareware { color: #8fc0ff; border-color: #345f9c; background: rgba(52, 95, 156, .2); }
.badge.freeware { color: var(--ok); border-color: #2f7a4f; background: rgba(95, 211, 141, .14); }
.facts li.badge-item { background: none; border: none; padding: 0; display: flex; align-items: center; }
/* A publisher's own words on giving a game away (a game's page, games.json "licenseQuote") */
.license-quote { position: relative; margin: 28px 0 12px; padding: 18px 22px 16px 70px; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 0 var(--radius) var(--radius) 0; }
.license-quote::before { content: '“'; position: absolute; left: 16px; top: 4px; font: 700 76px/1 Georgia, "Times New Roman", serif; color: var(--ok); }
.license-quote .label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin-bottom: 8px; }
.license-quote blockquote { margin: 0; font: italic 1.08rem/1.6 Georgia, "Times New Roman", serif; color: var(--text); }
.license-quote blockquote::after { content: '”'; }
.license-quote figcaption { margin-top: 10px; font-size: .875rem; color: var(--muted); }
/* A game started, in the chat: its Join, inline */
.irc .chat-log button.chat-join { font: inherit; font-size: .85em; padding: 0 .7em; margin-left: .4em; line-height: 1.5; border-radius: 3px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 700; text-indent: 0; vertical-align: baseline; }
.irc .chat-log button.chat-join:disabled { background: transparent; color: var(--irc-dim); border-color: #2f3a2f; }
.irc .chat-log .game .text { color: #8db3bd; }
/* The automatic setup's note over the game's screen (session.js pressMenuKeys) */
emularity-x86 .setup-note { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 24px);
  background: rgba(10, 11, 15, .88); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px;
  font: 600 14px/1.4 system-ui, sans-serif; text-align: center; pointer-events: none; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); }
/* A player's ping (ping() in app.js) */
.ping { margin-left: .5em; font: 600 .78em/1 var(--mono); padding: .15em .45em; border-radius: 4px; white-space: nowrap; }
.ping.good { color: var(--ok); background: rgba(95, 211, 141, .12); }
.ping.fair { color: var(--warn); background: rgba(242, 201, 76, .12); }
.ping.poor, .ping.lost { color: var(--error); background: rgba(255, 122, 107, .14); }
.card-toast.error .text { color: #ff8a7a; }
