body {
  background-color: black;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  margin: 0;
}

#game-container {
  width: 100%;
  height: 100%;
}

#input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #555;
}

#input-container {
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: content-box;
}

#send {
  width: 56px;
  font-size: 22px;
  background: #777;
  color: #fff;
  border: none;
}

#input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-family: inherit;
  padding: 0 10px;
  box-sizing: border-box;
  height: 100%;
  color: #fff;
  background-color: transparent;
  border: none;
  outline: none;
}

#output-container {
  position: absolute;
  top: 50px;
  bottom: calc(50px + env(safe-area-inset-bottom) + var(--bar-h, 0px));
  width: 100%;
  overflow: auto;
  padding: 10px;
  box-sizing: border-box;
  word-wrap: break-word;
  line-height: 1.3;
}

#info-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  background-color: #555;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  overflow: hidden;
}

#info-container.collapsed {
  height: 20px;
  line-height: 20px;
}
#info-container.collapsed .label {
  display: none;
}

#info-container.collapsed .abbreviation {
  display: inline-block;
  font-size: 15px;
  margin-left: 5px;
}

#info-container.collapsed .value {
  display: inline-block;
  font-size: 15px;
}

#info-container .value {
  font-size: 20px;
  display: inline-block;
}

#info-container .label {
  font-size: 20px;
  display: inline-block;
}

#info-container .nl {
  display: block;
}

#info-container .abbreviation {
  display: none;
}

#info-container.collapsed .hide {
  display: none !important;
}

#info-container.collapsed .hideopen {
  display: inline-block;
}

#info-container .hideopen {
  display: none;
}

.userInput {
  color: #add8e6;
}

.unlock {
  color: #00a67d;
  font-weight: bold;
}

.narration {
  color: #A29BFE;
}

.help {
  color: #7FC7A6;
}

.draw {
  color: #2e95d3;
}

.whiteChess {
  color: #e8e8e8;
}
.blackChess {
  color: #59c2ff; /* blue: matches the blue pieces on the tappable board */
}

@media (max-width: 600px) {
  #output-container { font-size: 15px; }
  #info-container .value, #info-container .label { font-size: 16px; }
}

/* Occasional graphical text effects (effects.js, row #49) */
@keyframes fx-glitch {
  0%, 100% { text-shadow: none; transform: none; }
  15% { text-shadow: -2px 0 #ff2a6d, 2px 0 #05d9e8; transform: translateX(2px); }
  35% { text-shadow: 3px 0 #ff2a6d, -3px 0 #05d9e8; transform: translateX(-3px) skewX(-2deg); }
  55% { text-shadow: -1px 0 #ff2a6d, 1px 0 #05d9e8; transform: translateX(1px); }
  75% { text-shadow: 2px 0 #ff2a6d, -2px 0 #05d9e8; transform: translateX(-1px) skewX(1deg); }
}
@keyframes fx-flicker {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.35; }
  40% { opacity: 0.9; }
  60% { opacity: 0.5; }
  80% { opacity: 1; }
}
@keyframes fx-scan {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}
#output-container.fx-glitch { animation: fx-glitch 0.9s steps(2, end); }
#output-container.fx-flicker { animation: fx-flicker 0.7s linear; }
#output-container.fx-scan {
  background-image: linear-gradient(to bottom, rgba(0, 166, 125, 0) 0%, rgba(0, 166, 125, 0.28) 50%, rgba(0, 166, 125, 0) 100%);
  background-size: 100% 18%;
  background-repeat: no-repeat;
  animation: fx-scan 1.4s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  #output-container.fx-glitch, #output-container.fx-flicker, #output-container.fx-scan { animation: none; }
}

/* Clickable commands from the start (clickbar.js). Palette from docs/ui-mockups (gui era). */
#cmdbar {
  --panel: #141b33; --ink: #dfe7ff; --dim: #8d9bc4; --line: #2b3868; --accent: #59c2ff; --btn: #1d2748; --warn: #ffcb5c;
  position: absolute; left: 0; width: 100%;
  bottom: calc(50px + env(safe-area-inset-bottom));
  box-sizing: border-box; padding: 8px 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  max-height: 38vh; overflow-y: auto; overflow-x: hidden;
  background: var(--panel); border-top: 1px solid var(--accent);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}
#cmdbar[hidden] { display: none; }
.cb {
  min-height: 44px; min-width: 44px; padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--ink); background: var(--btn);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cb:hover { border-color: var(--accent); }
.cb:active { background: var(--accent); color: #0b1020; }
.cb:disabled { opacity: 0.45; cursor: default; }
.cb-new { border-color: var(--accent); color: var(--accent); animation: cb-new 1.6s infinite; }
@keyframes cb-new { 50% { box-shadow: 0 0 0 4px rgba(89, 194, 255, .25); } }
.cb-back { color: var(--dim); }
.cb-confirm { border-color: var(--warn); color: var(--warn); }
.cb-go { border-color: var(--accent); color: var(--accent); }
.cb-head { flex: 0 0 100%; display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.cb-row { flex: 0 0 100%; display: flex; gap: 8px; }
.cb-field { flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--ink); background: #0b1020; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; }
.cb-none { color: var(--dim); align-self: center; }
@media (min-width: 900px) {
  body { --col: 340px; }
  body.has-board { --col: 420px; }
  #cmdbar { left: auto; right: 0; top: calc(50px + var(--board-h, 0px)); bottom: 0; width: var(--col); max-height: none; border-top: none; border-left: 1px solid var(--accent); }
  #output-container, #input-container { width: calc(100% - var(--col)); }
  body:not(.has-cmdbar) #output-container, body:not(.has-cmdbar) #input-container { width: 100%; }
  #output-container { bottom: calc(50px + env(safe-area-inset-bottom)); }
}

/* Tappable game boards (boards.js). Look: docs/ui-mockups/02-mid-desktop.png, dark navy and cyan. */
#board {
  --panel: #141b33; --ink: #dfe7ff; --dim: #8d9bc4; --line: #2b3868; --accent: #59c2ff; --btn: #1d2748; --warn: #ffcb5c;
  position: absolute; left: 0; width: 100%; box-sizing: border-box; padding: 8px;
  bottom: calc(50px + env(safe-area-inset-bottom) + var(--cbar-h, 0px));
  background: var(--panel); border-top: 1px solid var(--accent); color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; z-index: 2;
}
#board[hidden] { display: none; }
.bd-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 6px; }
.bd-title { font-size: 12px; letter-spacing: .14em; color: var(--dim); }
.bd-tag { font-size: 11px; letter-spacing: .1em; color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.bd-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; min-height: 28px; }
.bd-status { color: var(--dim); font-size: 13px; line-height: 1.25; }
.bd-send { min-width: 88px; }
#board button { font: inherit; color: inherit; padding: 0; border: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bd-grid { margin: 0 auto; border: 2px solid var(--line); box-sizing: border-box; }
.bd-8 { display: grid; grid-template-columns: repeat(8, 1fr); width: clamp(328px, min(100%, 50vh), 400px); aspect-ratio: 1; }
.bd-sq { position: relative; display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.bd-sq.l { background: #1d2748; } .bd-sq.d { background: #2b3868; }
@media (min-width: 900px) { .bd-8 { width: min(100%, 396px); } }
.bd-sq[data-rank]::before { content: attr(data-rank); position: absolute; top: 1px; left: 3px; font-size: 10px; color: var(--dim); }
.bd-sq[data-file]::after { content: attr(data-file); position: absolute; bottom: 1px; right: 3px; font-size: 10px; color: var(--dim); }
.pc { width: 72%; height: 72%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: #0b1020; box-shadow: inset 0 0 0 3px rgba(0,0,0,.28); pointer-events: none; }
.pw { background: #e8e8e8; } .pb { background: #59c2ff; }
.pc.king { font-size: 15px; }
.sel { outline: 3px solid var(--warn); outline-offset: -3px; }
.hint::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: var(--warn); opacity: .85; pointer-events: none; }
.hint:has(.pc)::after { width: 100%; height: 100%; border-radius: 0; background: none; box-shadow: inset 0 0 0 3px var(--warn); opacity: .9; }
.bd-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: min(100%, 280px); border: 0; }
.bd-t { min-height: 80px; aspect-ratio: 1; background: #2b3868; border-radius: 6px; font-size: 44px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bd-t.X { color: #e8e8e8; } .bd-t.O { color: #59c2ff; }
.bd-nim { display: flex; justify-content: center; gap: 18px; padding: 4px 0; min-height: 230px; align-items: flex-end; }
.bd-pile { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; min-width: 64px; padding: 4px; border-radius: 8px; }
.bd-pile.on { outline: 2px solid var(--warn); }
.bd-stone { width: 44px; height: 44px; border-radius: 50%; background: #59c2ff; box-shadow: inset 0 0 0 3px rgba(0,0,0,.28); }
.bd-empty { color: var(--dim); font-size: 12px; min-height: 44px; display: flex; align-items: center; }
.bd-lab { color: var(--dim); font-size: 12px; }
@media (min-width: 900px) {
  #board { left: auto; right: 0; top: 50px; bottom: auto; width: var(--col); border-top: none; border-left: 1px solid var(--accent); }
}
#board button.bd-t { font-weight: 700; font-size: 44px; } #board button.pc, #board .pc { font-weight: 700; }

/* Backgammon panel (reduced game, #10461) */
.bd-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; width: min(100%, 360px); border: 0; }
.bd-pt { min-height: 44px; background: #2b3868; border-radius: 6px; color: #e8e8e8; font-size: 12px; line-height: 1.2; white-space: pre-line; padding: 2px; }
.bd-pt.hint { outline: 2px solid var(--warn); }
.bd-trays { display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 6px; }
.bd-trays .bd-pt { min-width: 88px; }
.bd-tray { color: var(--dim); font-size: 13px; }

/* Prompt games: draw the picture, answer the people (#10464, #10465) */
.bd-prompt { display: flex; flex-direction: column; gap: 6px; max-width: 520px; margin: 0 auto; }
.bd-ask { color: #e8e8e8; font-size: 14px; line-height: 1.3; }
.bd-scene { white-space: pre; font-size: 12px; line-height: 1.1; color: var(--dim); overflow-x: auto; }
.bd-choices { display: flex; flex-direction: column; gap: 4px; }
.bd-choice { min-height: 44px; text-align: left; background: #2b3868; border-radius: 6px; color: #e8e8e8; font-size: 13px; line-height: 1.25; padding: 6px 8px; }
.bd-choice.hint { outline: 2px solid var(--warn); }
.bd-skip { background: transparent; border: 1px dashed var(--line); color: var(--dim); }
