/* Canvas — page styles. Kept tiny on purpose: the canvas is the product. */

:root {
  --bg: #0d0e10;
  --fg: #f4f4f5;
  --muted: #9aa0a6;
  --accent: #6ee7b7;
  --danger: #f87171;
  --border: #2a2c31;
  --panel: #15171b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.topbar {
  position: sticky; top: 0;
  background: rgba(13, 14, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.counter {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 14px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.empty-state {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}

.composer {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.composer-row {
  display: flex; gap: 8px; align-items: stretch;
}
#textInput {
  flex: 1 1 auto;
  min-width: 0;
  background: #0a0b0d;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
#textInput:focus { border-color: var(--accent); }
#textInput:disabled { opacity: 0.6; }
#submitBtn {
  flex: 0 0 auto;
  background: var(--accent);
  color: #062018;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
}
#submitBtn:disabled { background: #2a2c31; color: var(--muted); cursor: not-allowed; }
.composer-meta {
  display: flex; justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px 0 4px;
}
.error {
  color: var(--danger);
  min-height: 1em;
  text-align: right;
}

.disclosure {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 60ch;
}
.disclosure a { color: var(--muted); text-decoration: underline; }
.disclosure-dialog {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
  max-width: 480px;
  padding: 18px 20px;
}
.disclosure-dialog::backdrop { background: rgba(0,0,0,0.6); }

/* Admin pages */
.auth-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 12px;
}
.auth-form h1 { margin: 0; font-size: 20px; }
.auth-form input {
  background: #0a0b0d; color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 15px;
}
.auth-form button {
  background: var(--accent); color: #062018; border: 0;
  border-radius: 8px; padding: 10px; font-weight: 600; cursor: pointer;
}
.auth-error { color: var(--danger); margin: 0; font-size: 14px; }

.admin-stage {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px;
}
.admin-header { display: flex; justify-content: space-between; align-items: center; }
.admin-header h1 { margin: 0; font-size: 22px; }
.logout-form button {
  background: transparent; color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.admin-meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); }

table.messages {
  width: 100%; border-collapse: collapse; margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
table.messages th, table.messages td {
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
table.messages th {
  background: #0a0b0d; color: var(--muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}
table.messages tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; }
td.text { word-break: break-word; max-width: 360px; }
td.meta { color: var(--muted); max-width: 220px; word-break: break-all; }
button.danger {
  background: transparent; color: var(--danger);
  border: 1px solid #5a1f1f; border-radius: 6px;
  padding: 4px 8px; cursor: pointer; font-size: 12px;
}
button.danger:hover { background: #2a1212; }

.pager { display: flex; gap: 16px; margin-top: 16px; }
.pager a { color: var(--accent); text-decoration: none; }
