/* Coven arcade "Report a bug" (shared module: C:\Studio\Arcade\shared\bugreport). Phone-first bottom sheet.
   Colours come from the game's own theme tokens (--night-2, --accent, ...; every Coven game has them, and
   theme switching just works). A game can set the --cbug-* tokens to override any of them. */
.cbug-bg, .cbug-sheet {
  --cb-panel: var(--cbug-panel, var(--night-2, #33265e));
  --cb-line: var(--cbug-line, var(--night-3, #45357a));
  --cb-field: var(--cbug-field, var(--deep, #1b1436));
  --cb-ink: var(--cbug-ink, var(--ink, #fff8ec));
  --cb-dim: var(--cbug-dim, var(--dim, #a99cd0));
  --cb-accent: var(--cbug-accent, var(--accent, #ffd166));
  --cb-on-accent: var(--cbug-on-accent, var(--on-accent, #2c2050));
  --cb-accent-shadow: var(--cbug-accent-shadow, var(--accent-shadow, #b0862e));
  --cb-shade: var(--cbug-shade, var(--shade, #160f2e));
  --cb-bad: var(--cbug-bad, var(--bad, #ff7a90));
  --cb-font: var(--cbug-font, inherit);
}
.cbug-bg[hidden], .cbug-sheet[hidden], .cbug-sheet [hidden] { display: none !important; }
.cbug-bg { position: fixed; inset: 0; z-index: 1000; background: var(--cbug-scrim, var(--scrim, rgba(10, 6, 24, .6))); }
.cbug-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-width: 560px; margin: 0 auto; box-sizing: border-box;
  background: var(--cb-panel); color: var(--cb-ink); font-family: var(--cb-font); font-size: 16px; line-height: 1.35;
  border-radius: 22px 22px 0 0; border-top: 2px solid var(--cb-line);
  padding: 16px 16px max(16px, env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  -webkit-user-select: text; user-select: text; text-align: left;
  animation: cbug-up .2s ease-out;
}
@keyframes cbug-up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cbug-sheet { animation: none; } }
.cbug-sheet *, .cbug-sheet *::before, .cbug-sheet *::after { box-sizing: border-box; }
.cbug-sheet h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 21px; font-weight: 600; }
.cbug-sheet h2 .cbug-ico { width: 24px; height: 24px; color: var(--cb-accent); }
.cbug-form { display: grid; gap: 12px; margin: 0; }
.cbug-field { display: grid; gap: 5px; color: var(--cb-dim); font-size: 14px; }
.cbug-field small { font-size: 13px; opacity: .85; }
.cbug-field textarea, .cbug-field input {
  width: 100%; font: inherit; font-size: 16px; /* 16px: phones don't zoom in */ color: var(--cb-ink);
  background: var(--cb-field); border: 2px solid var(--cb-line); border-radius: 12px; padding: 10px 12px; resize: vertical;
  -webkit-user-select: text; user-select: text;
}
.cbug-field textarea { min-height: 4.2em; }
.cbug-field textarea:focus, .cbug-field input:focus { outline: none; border-color: var(--cb-accent); }
.cbug-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.cbug-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--cb-accent); flex: none; }
.cbug-check span { flex: 1; }
.cbug-thumb { flex: none; height: 56px; max-width: 110px; object-fit: cover; border-radius: 8px; border: 2px solid var(--cb-line); }
.cbug-check input:not(:checked) ~ .cbug-thumb { opacity: .3; }
.cbug-note { margin: 0; color: var(--cb-dim); font-size: 13px; }
.cbug-msg { margin: 0; min-height: 1.2em; font-size: 15px; color: var(--cb-dim); }
.cbug-msg.bad { color: var(--cb-bad); }
.cbug-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.cbug-sheet button { font: inherit; touch-action: manipulation; cursor: pointer; }
.cbug-cancel, .cbug-send {
  min-height: 52px; border: 0; border-radius: 14px; font-size: 18px; font-weight: 600;
}
.cbug-cancel { background: var(--cb-line); color: var(--cb-ink); box-shadow: 0 4px 0 var(--cb-shade); }
.cbug-send { background: var(--cb-accent); color: var(--cb-on-accent); box-shadow: 0 4px 0 var(--cb-accent-shadow); }
.cbug-cancel:active, .cbug-send:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--cb-shade); }
.cbug-send:disabled { opacity: .6; cursor: default; }
.cbug-done { display: grid; gap: 14px; padding: 6px 0 2px; }
.cbug-done[hidden] { display: none; }
.cbug-thanks { margin: 0; font-size: 18px; }
.cbug-close { width: 100%; }

/* The buttons the game places (they also take the game's own class: chip-btn, icon-btn, ...) */
.cbug-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cbug-btn .cbug-ico { width: 20px; height: 20px; flex: none; }
.cbug-icon .cbug-ico { width: 22px; height: 22px; }
.cbug-corner {
  position: fixed; z-index: 30; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom));
  width: 40px; height: 40px; padding: 0; border-radius: 50%; opacity: .75;
  color: var(--cbug-ink, var(--ink, #fff8ec)); background: var(--cbug-panel, var(--night-2, #33265e));
  border: 2px solid var(--cbug-line, var(--night-3, #45357a));
}
.cbug-corner:hover, .cbug-corner:focus-visible { opacity: 1; }
html.cbug-open .cbug-corner { display: none; }
