/* The game's pages (singleplayer/index.html, multiplayer/play.html): the canvas, the log, the
   notice of a stop, and the menu. */
html, body { margin: 0; height: 100%; background: #000; color: #ccc; font: 14px system-ui, sans-serif; }
#canvas { display: block; margin: 0 auto; outline: none; }
#log { position: fixed; left: 0; right: 0; bottom: 0; max-height: 30%; overflow: auto; margin: 0;
       padding: 6px 10px; background: rgba(0, 0, 0, 0.7); font: 12px ui-monospace, monospace; white-space: pre-wrap; }
#fatal { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); max-width: min(640px, calc(100vw - 110px));
         box-sizing: border-box; padding: 10px 14px; border: 1px solid #a33; border-radius: 6px;
         background: rgba(60, 10, 10, 0.95); color: #fdd; }
#fatal[hidden] { display: none; }
#fatal strong { display: block; margin-bottom: 4px; }
#fatal pre { max-height: 30vh; overflow: auto; margin: 0; font: 12px ui-monospace, monospace; white-space: pre-wrap; }
#fatal button { margin-top: 8px; padding: 3px 10px; border: 1px solid #a66; border-radius: 4px; background: #522;
                color: #fdd; font: inherit; cursor: pointer; }
#menu { position: fixed; top: 8px; right: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#menu-button { width: 32px; height: 32px; padding: 0; border: 1px solid #555; border-radius: 6px;
               background: rgba(0, 0, 0, 0.6); color: #ccc; font-size: 18px; cursor: pointer; opacity: 0.45; }
#menu-button:hover, #menu.open #menu-button { opacity: 1; }
#menu-panel { display: none; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 70px); overflow: auto; box-sizing: border-box;
              padding: 12px; border: 1px solid #555; border-radius: 6px; background: rgba(20, 20, 20, 0.94); }
#menu.open #menu-panel { display: block; }
#menu-panel h2 { margin: 12px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
                 text-transform: uppercase; color: #999; }
#menu-panel h2:first-child { margin-top: 0; }
#menu-panel label { display: block; margin: 6px 0; }
#menu-panel label.check { display: flex; align-items: center; gap: 6px; }
#menu-panel span { display: block; margin-bottom: 2px; font-size: 12px; color: #aaa; }
#menu-panel input[type=text], #menu-panel input[type=number], #menu-panel select, #menu-panel textarea {
  width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid #555; border-radius: 4px;
  background: #111; color: #ddd; font: 13px system-ui, sans-serif; }
#menu-panel input[type=range] { width: 100%; box-sizing: border-box; margin: 0; accent-color: #9cf; }
#menu-panel textarea { height: 56px; font: 12px ui-monospace, monospace; resize: vertical; }
#menu-panel .size { display: flex; align-items: center; gap: 6px; }
#menu-panel .size[hidden] { display: none; }
#menu-panel button { width: 100%; margin-top: 8px; padding: 6px; border: 1px solid #777; border-radius: 4px;
                     background: #333; color: #eee; font: inherit; cursor: pointer; }
#menu-panel button:hover { background: #444; }
#menu-panel p { margin: 6px 0 0; font-size: 12px; color: #888; }
#menu-panel a { color: #9cf; }
#menu-panel details { margin-top: 12px; }
#menu-panel summary { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
                      color: #888; cursor: pointer; }
#menu-panel details[open] summary { margin-bottom: 6px; }
#controls { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
            background: rgba(0, 0, 0, 0.6); }
#controls[hidden] { display: none; }
.controls-panel { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
                  box-sizing: border-box; padding: 16px; border: 1px solid #555; border-radius: 8px;
                  background: #1b1b1b; color: #ddd; font: 13px system-ui, sans-serif; }
.controls-panel h2 { margin: 0 0 10px; font-size: 16px; }
.controls-panel button { padding: 4px 10px; border: 1px solid #666; border-radius: 4px; background: #333;
                         color: #eee; font: inherit; cursor: pointer; }
.controls-panel button:hover { background: #444; }
.controls-kind, .controls-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.controls-kind button.on, .controls-tabs button.on { background: #2a4a66; border-color: #9cf; }
.controls-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; table-layout: fixed; }
.controls-table caption { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
                          text-transform: uppercase; color: #888; padding: 4px 0; }
.controls-table th { text-align: left; font-weight: 500; color: #888; padding: 2px 4px; }
.controls-table td { padding: 2px 4px; border-top: 1px solid #2a2a2a; white-space: nowrap; }
.controls-table th:first-child { width: 34%; }
.controls-table td:first-child { white-space: normal; }
.controls-table .bind { min-width: 130px; text-align: left; }
.controls-table .bind.listening { border-color: #9cf; color: #9cf; }
.controls-table .bind.conflict { border-color: #c96; }
.controls-table .clear { margin-left: 4px; padding: 2px 7px; color: #aaa; }
.controls-options { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 4px 0 8px; }
.controls-options label { display: flex; flex-direction: column; gap: 2px; }
.controls-options label.check { flex-direction: row; align-items: center; gap: 6px; }
.controls-panel p { color: #999; font-size: 12px; margin: 6px 0; }
.controls-footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.pad-picture svg { width: 100%; height: auto; }
.pad-body { fill: #2b2b2b; stroke: #666; stroke-width: 2; }
.pad-part { fill: #3a3a3a; stroke: #777; }
.pad-btn { stroke: none; }
.pad-btn.a { fill: #3e8a45; } .pad-btn.b { fill: #b8433a; } .pad-btn.x { fill: #3b6fb8; } .pad-btn.y { fill: #c8a43a; }
.pad-key text, text.pad-key { fill: #eee; font: 600 10px system-ui, sans-serif; text-anchor: middle; }
.pad-lines path { fill: none; stroke: #777; stroke-width: 1; }
.pad-lines text { fill: #ddd; font: 12px system-ui, sans-serif; }
.pad-lines text.end { text-anchor: end; }
#menu-panel p.note { margin: 0 0 6px; color: #e9a; }
#menu-panel .save { display: flex; align-items: center; gap: 4px; margin: 4px 0; font-size: 12px; }
#menu-panel .save div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#menu-panel .save small { display: block; color: #888; }
#menu-panel .save button { width: auto; margin: 0; padding: 2px 6px; font-size: 12px; }
#menu-panel label.upload { display: block; margin: 8px 0 0; padding: 6px; border: 1px solid #777; border-radius: 4px;
                           background: #333; color: #eee; text-align: center; cursor: pointer; }
#menu-panel label.upload:hover { background: #444; }
