/* Comments on Plays (public/js/features/comments.js): a retro panel on the right, a bottom sheet on phones. */
.cm-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(5, 4, 10, .5); opacity: 0; transition: opacity .2s; }
.cm-backdrop.open { opacity: 1; }
.cm-panel {
  position: fixed; z-index: 81; top: var(--top, 64px); right: 0; bottom: 0; width: min(400px, 100vw);
  display: flex; flex-direction: column; background: var(--px-panel, #1C1E33); color: var(--px-text, #F2F3FA);
  border-left: 3px solid var(--px-edge, #2F3354); box-shadow: -8px 0 0 #000;
  transform: translateX(105%); transition: transform .22s cubic-bezier(.2, .7, .2, 1);
}
.cm-panel.open { transform: none; }
.cm-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px 18px; border-bottom: 3px solid var(--px-edge, #2F3354); }
.cm-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-shadow: 2px 2px 0 #000; }
.cm-count { color: var(--px-gold, #B9A8FF); margin-left: 4px; }
.cm-x { width: 40px; height: 40px; display: grid; place-items: center; background: var(--px-panel-2, #22253D); border: 3px solid var(--px-edge, #2F3354); color: inherit; cursor: pointer; }
.cm-x:hover { background: var(--px-panel-3, #2A2D4A); }
.cm-x svg, .cm-x img { width: 16px; height: 16px; fill: currentColor; }
.cm-list { flex: 1; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none; overscroll-behavior: contain; }
.cm-empty { padding: 40px 24px; text-align: center; color: var(--px-text-2, #A9ACC6); }
.cm-item { display: flex; gap: 12px; padding: 12px 18px; }
.cm-item + .cm-item { border-top: 1px solid rgba(255, 255, 255, .06); }
.cm-ava { flex: none; }
.cm-main { min-width: 0; flex: 1; }
.cm-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cm-meta a { color: inherit; text-decoration: none; }
.cm-meta a:hover b { text-decoration: underline; }
.cm-meta time { color: var(--px-text-3, #7F83A3); font-size: 12px; }
.cm-text { margin: 3px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-actions { display: flex; gap: 14px; margin-top: 4px; }
.cm-actions:empty { display: none; }
.cm-actions button { padding: 2px 0; background: none; border: 0; color: var(--px-text-3, #7F83A3); font: 600 12px/1.4 var(--font-ui, system-ui); cursor: pointer; }
.cm-actions button:hover:not(:disabled) { color: var(--px-text, #F2F3FA); }
.cm-actions button[data-cm="delete"]:hover { color: var(--px-red, #FF6B7A); }
.cm-actions button:disabled { cursor: default; opacity: .7; }
.cm-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 3px solid var(--px-edge, #2F3354); background: var(--px-panel-2, #22253D); }
.cm-form { display: flex; align-items: flex-end; gap: 10px; }
.cm-form .ava { flex: none; margin-bottom: 6px; }
.cm-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: 10px 12px; resize: none; font-size: 14px; line-height: 1.4; color: var(--px-text, #F2F3FA); }
.cm-form .btn { flex: none; height: 44px; }
.cm-signin { display: flex; justify-content: center; width: 100%; }

@media (max-width: 760px) {
  .cm-panel {
    top: auto; left: 0; width: 100%; height: min(72dvh, 620px);
    border-left: 0; border-top: 3px solid var(--px-edge, #2F3354); box-shadow: 0 -6px 0 #000;
    transform: translateY(105%);
  }
  .cm-panel.open { transform: none; }
  .cm-head { padding-top: 18px; }
  .cm-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; background: var(--px-edge, #2F3354); }
  .cm-form textarea { font-size: 16px; } /* no zoom-on-focus on iOS */
}
@media (prefers-reduced-motion: reduce) { .cm-panel, .cm-backdrop { transition: none; } }
