/* Arcade frame page (D73). */
.ac-body { min-height: 100vh; display: flex; flex-direction: column; }
.ac-bar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--mc-surface); border-bottom: 1px solid var(--mc-border); }
.ac-bar h1 { font-size: 20px; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mc-game-link { color: inherit; text-decoration: none; }
.mc-game-link:hover, .mc-game-link:focus-visible { text-decoration: underline; }
.ac-bar .button { min-height: 36px; padding: 6px 14px; }
.ac-badge { font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; background: #1d1630; color: #fff; }
.ac-warning { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 20px; background: #fff4e5; color: #6b3a00; font-size: 14px; border-bottom: 1px solid #f3d7ad; }
.ac-warning a { font-weight: 700; color: #a3122a; }
.ac-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px; max-width: 1500px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.ac-stage { position: relative; background: #0f0b1a; border-radius: var(--mc-radius); overflow: hidden; min-height: 70vh; display: flex; flex-direction: column; }
.ac-frame { flex: 1; width: 100%; min-height: 0; border: 0; display: block; }
.ac-stage:fullscreen, .ac-stage.ac-fake-full { position: fixed; inset: 0; border-radius: 0; z-index: 10; min-height: 0; }
.ac-exit { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255, 255, 255, 0.9); }
.ac-msg { color: #fff; padding: 24px; }
.ac-info h2 { font-size: 16px; margin: 16px 0 4px; }
.ac-info p { margin: 0 0 8px; }
.ac-pre { white-space: pre-line; color: var(--mc-text-muted); font-size: 14px; }
.ac-note { font-size: 14px; font-weight: 700; }
.ac-content { color: #7a3b00; background: #fff4e5; padding: 6px 10px; border-radius: 8px; }
.ac-small { font-size: 13px; color: var(--mc-text-muted); margin-top: 16px !important; }
@media (max-width: 900px) { .ac-main { grid-template-columns: 1fr; } .ac-stage { min-height: 60vh; } }
.ac-exit[hidden] { display: none; }
/* Agent bar (D77-D80): Robokade's own controls above the game frame. */
.ac-agents { background: var(--mc-surface); color: var(--mc-text); border-bottom: 3px solid #5b3fd1; padding: 8px 12px; font-size: 14px; flex: none; } /* size: the floating panel below */
.ac-agents[hidden] { display: none; }
.ac-agents-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.ac-agents .button { min-height: 32px; padding: 4px 12px; }
.ac-muted { color: var(--mc-text-muted); }
.ac-agents-status { color: #a3122a; font-weight: 700; }
.ac-seat { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--mc-border); margin-top: 6px; }
.ac-seat-id { font-weight: 800; font-family: var(--mc-font-mono, monospace); min-width: 70px; padding-top: 6px; }
.ac-seat-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ac-seat-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-seat-ask { background: #fff4e5; color: #6b3a00; padding: 6px 8px; border-radius: 8px; }
.ac-code { font-weight: 800; background: #efeaff; color: #2a1a6b; padding: 2px 8px; border-radius: 6px; user-select: all; }
.ac-tag { font-size: 1.35em; font-weight: 800; letter-spacing: .06em; background: #fff3c4; color: #4a3300; padding: 2px 10px; border-radius: 6px; margin-right: 4px; }
.ac-tip { font-size: 13px; }
.ac-chat-log p { margin: 2px 0; overflow-wrap: anywhere; }
.ac-chat-who { font-weight: 700; }
.ac-chat-agent { background: #f1f1f4; color: #333; font-style: italic; padding: 2px 8px; border-radius: 6px; }
.ac-chat-form { display: flex; gap: 6px; }
.ac-chat-form input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--mc-border); border-radius: 8px; font: inherit; }
.ac-agents [hidden] { display: none !important; }
.ac-agents .link { background: none; border: 0; padding: 0; color: #a3122a; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* Reviewer's seat test page (D99) */
.ac-review-warning { background: #fde0e4; color: #7a0f20; border-bottom-color: #f2b8c1; }
#ac-hint { margin: 8px 20px; }
/* "Copy prompt for my agent" panel (D102): inline, full width, wraps at phone width. */
.ac-prompt { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--mc-border); border-radius: 8px; background: var(--mc-bg, #fff); min-width: 0; }
.ac-prompt-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ac-prompt-tab { font: inherit; font-weight: 700; padding: 4px 14px; border: 1px solid var(--mc-border); border-radius: 999px; background: none; color: inherit; cursor: pointer; }
.ac-prompt-tab[aria-pressed="true"] { background: #5b3fd1; border-color: #5b3fd1; color: #fff; }
.ac-cmd { font-family: var(--mc-font-mono, monospace); font-size: 13px; background: #efeaff; color: #2a1a6b; padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.ac-prompt-text { width: 100%; box-sizing: border-box; min-width: 0; font-family: var(--mc-font-mono, monospace); font-size: 12px; line-height: 1.4; padding: 6px 8px; border: 1px solid var(--mc-border); border-radius: 8px; resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; }
@media (max-width: 520px) { .ac-seat:has(.ac-prompt) { flex-direction: column; gap: 4px; } .ac-seat:has(.ac-prompt) .ac-seat-id { padding-top: 0; } }

/* Compact agent bar (the game keeps its room): short scrolling chat, Hide agents. */
.ac-chat-log { max-height: 5.2em; overflow-y: auto; font-size: 13px; }
.ac-collapse { margin-left: auto; color: var(--mc-text) !important; }
.ac-summary:empty { display: none; }
.ac-agents.ac-collapsed { padding-top: 4px; padding-bottom: 4px; }

/* Floating agent panel over the game (the game keeps its full size). */
.ac-agents { position: absolute; z-index: 5; width: min(480px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto;
  border: 1px solid var(--mc-border); border-bottom: 3px solid #5b3fd1; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); opacity: .97; }
.ac-agents.ac-at-tr { top: 10px; right: 10px; } .ac-agents.ac-at-tl { top: 10px; left: 10px; }
.ac-agents.ac-at-bl { bottom: 10px; left: 10px; } .ac-agents.ac-at-br { bottom: 10px; right: 10px; }
.ac-agents.ac-collapsed { width: auto; max-width: calc(100% - 20px); }
.ac-agents.ac-collapsed .ac-agents-head > .ac-muted:not(.ac-summary) { display: none; }
.ac-agents-head > .ac-muted:not(.ac-summary) { font-size: 12px; }
.ac-move { margin-left: auto; color: var(--mc-text) !important; }
.ac-move + .ac-collapse { margin-left: 0; }
@media (max-width: 520px) { .ac-agents { width: calc(100% - 20px); max-height: 60%; } }
/* Online play with friends (D117): Robokade's room panel over the game (seats, room chat, Report this game). */
.ac-online-say[hidden] { display: none; }
.ac-online-status, .ac-online-meter { font-size: 12px; }
.ac-online-banner { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: #fff4e5; color: #6b3a00; font-weight: 700; }
.ac-online-banner[hidden] { display: none; }
.ac-online-seats { list-style: none; margin: 6px 0; padding: 0; font-size: 14px; }
.ac-online-seats li { margin: 2px 0; }
.ac-online .mc-chat-lines { list-style: none; margin: 4px 0 6px; padding: 6px 8px; max-height: 84px; overflow-y: auto; background: var(--mc-surface-2); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.ac-online .mc-chat-lines li { margin: 2px 0; }
.ac-online .mc-chat-sys { color: var(--mc-text-muted); font-style: italic; }
.ac-online .mc-chat-tool { margin-left: 6px; font-size: 12px; background: none; border: 0; color: var(--mc-blue); text-decoration: underline; cursor: pointer; padding: 0; }
.ac-online .mc-chat-text { display: flex; gap: 6px; margin: 0 0 6px; }
.ac-online .mc-chat-text input { flex: 1; min-width: 0; font: inherit; padding: 4px 8px; border: 1px solid var(--mc-border); border-radius: 8px; }
.ac-online .mc-chat-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.ac-online .mc-chat-preset { font: inherit; font-size: 13px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--mc-border); background: var(--mc-surface); cursor: pointer; }
.ac-online-body[hidden] { display: none; }
/* Reviewer's two-frame online test (D117) and the kit's harness classes. */
.ac-online-test { padding: 10px; color: var(--mc-text); background: var(--mc-surface); }
.ac-online-test .ot-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 0 0 8px; }
.ac-online-test .ot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.ac-online-test .ot-head { font-size: 13px; font-weight: 700; padding: 4px 0; }
.ac-online-test .ot-frame { border: 0; width: 100%; height: 480px; display: block; background: #0f0b1a; }
.ac-online-test .ot-log { white-space: pre-wrap; font-size: 12px; max-height: 180px; overflow: auto; }

/* Room panels polish (Online and Agents): soft, rounded, a clear header and a small pill when folded. Floating over
   the game on wide screens; at 900px and below they sit under the game so they never cover its controls. */
.ac-agents { background: rgba(255, 255, 255, 0.97); border: 1px solid var(--mc-border); border-top: 3px solid #5b3fd1; border-radius: var(--mc-radius);
  box-shadow: 0 14px 36px rgba(15, 11, 26, 0.32), 0 2px 6px rgba(15, 11, 26, 0.12); opacity: 1; padding: 10px 14px 12px; line-height: 1.45; }
.ac-online { border-top-color: #0b7a5a; } /* its width: "Round 2" below */
.ac-agents-head { gap: 4px 10px; padding-bottom: 6px; }
.ac-agents-head > strong { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; letter-spacing: -0.01em; }
.ac-agents-head > strong::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5b3fd1; box-shadow: 0 0 0 3px rgba(91, 63, 209, 0.18); }
.ac-online .ac-agents-head > strong::before { background: #0b7a5a; box-shadow: 0 0 0 3px rgba(11, 122, 90, 0.18); }
.ac-agents .ac-move, .ac-agents .ac-collapse { font-size: 13px; font-weight: 700; text-decoration: none; padding: 3px 9px; border-radius: 8px; color: var(--mc-text-muted) !important; transition: background-color 0.15s, color 0.15s; }
.ac-agents .ac-move:hover, .ac-agents .ac-collapse:hover { background: var(--mc-surface-2); color: var(--mc-text) !important; }
.ac-agents .button { min-height: 32px; padding: 4px 12px; border-width: 1.5px; border-radius: 10px; font-size: 14px; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.ac-agents .button:hover { background: var(--mc-surface-2); border-color: var(--mc-violet); color: var(--mc-text); }
.ac-agents .button.primary:hover { background: var(--mc-violet); color: #fff; }
.ac-seat { border-top-color: var(--mc-border); padding-top: 8px; }
.ac-online-banner { border-radius: 10px; font-size: 14px; }
.ac-online-seats { margin: 4px 0 8px; }
.ac-online-seats li { padding: 4px 8px; margin: 3px 0; border-radius: 8px; background: var(--mc-surface-2); overflow-wrap: anywhere; }
.ac-online-seats .link { margin-left: 4px; font-size: 13px; }
.ac-online .mc-chat-lines { border: 1px solid var(--mc-border); border-radius: 10px; min-height: 2.6em; }
.ac-online .mc-chat-empty { color: var(--mc-text-muted); font-style: italic; }
.ac-online .mc-chat-text input, .ac-chat-form input { border-radius: 10px; min-height: 34px; }
.ac-online .mc-chat-preset { transition: background-color 0.15s, border-color 0.15s; }
.ac-online .mc-chat-preset:hover { background: var(--mc-surface-2); border-color: var(--mc-violet); }
.ac-online-body > .ac-seat-line:last-of-type { padding-top: 8px; border-top: 1px solid var(--mc-border); }
/* folded: a small pill */
.ac-agents.ac-collapsed, .ac-online:has(> .ac-online-body[hidden]) { border-radius: 999px; padding: 5px 8px 5px 14px; border-top-width: 1px; }
.ac-agents.ac-collapsed .ac-agents-head, .ac-online:has(> .ac-online-body[hidden]) .ac-agents-head { padding-bottom: 0; flex-wrap: nowrap; }
.ac-online:has(> .ac-online-body[hidden]) .ac-online-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ac-online:has(> .ac-online-body[hidden]) { width: auto; max-width: calc(100% - 20px); }
@media (max-width: 900px) {
  /* the page's header wraps: the game's name gets its own line */
  .ac-bar { flex-wrap: wrap; gap: 6px 12px; padding: 8px 14px; }
  .ac-bar h1 { order: 3; flex: 1 1 100%; font-size: 17px; }
  .ac-bar #ac-full { margin-left: auto; }
  .ac-warning { padding: 8px 14px; }
  .ac-main { padding: 12px; gap: 12px; }
  /* panels under the game (not over it), unless the game is in full window */
  .ac-stage:not(:fullscreen):not(.ac-fake-full) { overflow: visible; background: none; min-height: 0; gap: 12px; }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-frame { flex: none; height: 62vh; min-height: 300px; background: #0f0b1a; border-radius: var(--mc-radius); }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-msg { background: #0f0b1a; border-radius: var(--mc-radius); margin: 0; }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-agents { position: static; order: 2; width: auto; max-width: none; max-height: none; box-shadow: var(--mc-shadow); }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-agents.ac-collapsed,
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-online:has(> .ac-online-body[hidden]) { align-self: flex-start; max-width: 100%; }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-move { display: none; }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-move + .ac-collapse { margin-left: auto; }
}
@media (max-width: 480px) { .ac-bar .brand { font-size: 18px; } .ac-bar .brand img { width: 26px; height: 26px; } }
@media (prefers-reduced-motion: reduce) { .ac-agents .button, .ac-agents .ac-move, .ac-agents .ac-collapse, .ac-online .mc-chat-preset { transition: none; } }
/* Online panel header: title and Move / Hide on the first line, the status under it (one line when folded). */
.ac-online .ac-agents-head::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
.ac-online .ac-online-status { order: 5; }
.ac-online .ac-online-meter { order: 6; }
.ac-online:has(> .ac-online-body[hidden]) .ac-agents-head::after { display: none; }
.ac-online:has(> .ac-online-body[hidden]) .ac-online-status, .ac-online:has(> .ac-online-body[hidden]) .ac-online-meter { order: 0; }
/* Round 2: a compact open Online panel on wide screens (covers less of the game), Quick messages, touch sizes. */
.ac-online { width: min(320px, calc(100% - 20px)); max-height: min(60vh, calc(100% - 20px)); overflow-y: auto; overscroll-behavior: contain; }
.ac-online .mc-chat-lines { max-height: 72px; }
.ac-quick > summary { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; margin-left: -8px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--mc-text-muted); cursor: pointer; list-style: none; }
.ac-quick > summary::-webkit-details-marker { display: none; }
.ac-quick > summary::before { content: "▸"; transition: transform 0.15s; }
.ac-quick[open] > summary::before { transform: rotate(90deg); }
.ac-quick > summary:hover { background: var(--mc-surface-2); color: var(--mc-text); }
.ac-quick .mc-chat-presets { padding: 4px 0 2px; }
@media (max-width: 900px) {
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-online { order: 2; overflow: visible; }
  .ac-stage:not(:fullscreen):not(.ac-fake-full) .ac-agents:not(.ac-online) { order: 3; }
  .ac-agent-intro { display: none; }
}
@media (pointer: coarse) {
  .ac-agents .button, .ac-agents .link, .ac-agents .ac-move, .ac-agents .ac-collapse, .ac-online .mc-chat-preset, .ac-online .mc-chat-tool, .ac-quick > summary, .ac-agents input, .ac-prompt-tab { min-height: 44px; }
  .ac-agents .link, .ac-online .mc-chat-tool { display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .ac-quick > summary::before { transition: none; } }

/* One-page Arcade rooms (docs/PLAN_ARCADESEATS.md phase A): arcade.html is also the room's lobby (#mc-lobby, room.css
   rules through .rm-main); the game stage and its notes are hidden there; the Room button opens the lobby as a drawer over
   the running game (room.css body.mc-drawer-open). */
body.ac-body.mc-in-lobby .ac-main { display: block; max-width: 1140px; }
body.ac-body.mc-in-lobby .ac-stage, body.ac-body.mc-in-lobby .ac-info, body.ac-body.mc-in-lobby #ac-full, body.ac-body.mc-in-lobby #ac-room { display: none; }
#ac-room[hidden] { display: none; }
.ac-online-wait { margin: 6px 0 0; padding: 6px 8px; border-radius: 8px; background: #efeaff; color: #2a1a6b; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-online-wait[hidden] { display: none; }
.ac-lobby-note { margin: 6px 0 0; }
.ac-lobby-note[hidden] { display: none; }
@media (max-width: 600px) { .ac-bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 16px; } .ac-bar h1 { flex-basis: 100%; order: 3; font-size: 18px; } body.ac-body.mc-in-lobby .ac-main { padding: 10px 16px; } }
@media (max-width: 600px) { .ac-bar .button { min-height: 36px; padding: 4px 10px; font-size: 14px; } }
