/* ===== Existing app layout ===== */

body::before {
  content: '';
  position: absolute;
  height: 100vh;
  visibility: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #2E2E2E;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.container {
  position: relative;
  margin: 0;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  background: #222;
}

#connectWalletButton {
  font-size: 14px;
  padding: 6px 12px;
  background-color: #FFA629;
  color: #000;
  border: 2px solid #FFC300;
  border-radius: 5px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10000; /* Ensure button is on top */
}

#connectWalletButton:hover {
  background-color: #FFC300;
}

h1 {
  font-size: 16px;
  margin: 0;
  padding: 5px;
  color: #FFA629;
}

h2 {
  font-size: 14px;
  margin: 0;
  padding: 0;
}

.controls,
.buttons,
.small-buttons-container,
.resolution-container,
.color-container {
  margin: 0;
  padding: 0;
  gap: 2px;
}

.buttons,
.small-buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.canvas-responsive-container {
  max-height: calc(100vh - 190px);
  width: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

canvas {
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
}

@media (max-height: 600px) {
  h1 { font-size: 0.8em; }
  h2 { font-size: 0.7em; }

  #connectWalletButton {
    font-size: 12px;
    padding: 5px 8px;
  }

  button {
    font-size: 0.7em;
    padding: 4px;
    min-width: 30px;
  }

  .small-button {
    width: 24px;
    height: 14px;
    font-size: 0.6em;
  }

  .color-swatch {
    width: 10px;
    height: 10px;
  }

  input[type="color"] {
    width: 14px;
    height: 14px;
  }

  .canvas-responsive-container {
    max-height: calc(100vh - 120px);
  }
}

.canvas-adjustment-controls,
.primary-drawing-controls,
.secondary-tool-controls,
.color-selection-controls {
  margin: 0;
  padding: 0;
}

#errorNotification {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #FF4444;
  color: #FFFFFF;
  padding: 15px 30px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 3000;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  user-select: text; /* explicitly allows copying error messages */
}

/* ===== Stepper modal (added; matches app.js) ===== */

:root {
  --rg-gold: #FFA629;
  --rg-gold-2: #FFC300;
  --rg-bg: #000000;
  --rg-panel: #1b1b1b;
  --rg-border: #2e2e2e;
  --rg-muted: #A0A0A0;
}

/* Overlay */
.oc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none; /* toggled by script */
  align-items: center;
  justify-content: center;
  z-index: 20000 !important;
}
.oc-modal-overlay.open { display: flex; }

/* Panel */
.oc-modal {
  width: min(520px, calc(100vw - 28px));
  background: var(--rg-panel);
  color: #fff;
  border-radius: 12px;
  padding: 18px 18px 14px;
  border: 1px solid var(--rg-border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  font-family: inherit;
}

/* Header / misc */
.oc-header {
  font-weight: 700;
  color: var(--rg-gold);
  font-size: 18px;
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}
.oc-sub { color: #bbb; font-size: 13px; margin-top: 2px; }

.oc-row { display: flex; gap: 8px; align-items: center; }
.oc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* Steps */
.oc-steps { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.oc-step {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  background: #111;
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  padding: 10px 12px;
}
.oc-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #666;
}
.oc-step.active .oc-dot { background: var(--rg-gold); box-shadow: 0 0 0 3px rgba(255,195,0,0.15); }
.oc-step.done   .oc-dot { background: #12d47b; box-shadow: 0 0 0 3px rgba(18,212,123,0.15); }

.oc-right {
  font-size: 12px; color: #aaa;
  min-height: 16px; display: flex; align-items: center; gap: 6px;
}

/* Payment box / Result box */
.oc-box {
  background: #101010;
  border: 1px dashed #3b3b3b;
  border-radius: 8px;
  padding: 10px;
  margin-top: 12px;
}

/* KV rows (IDs, txids, etc.) */
.oc-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: center;
}
.oc-kv code {
  background: #0E0E0E;
  border: 1px solid var(--rg-border);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.25;
  word-break: break-all;
  user-select: text;
}

/* Buttons */
.oc-btn {
  background: var(--rg-gold);
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.oc-btn.secondary {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #3b3b3b;
}
.oc-btn:disabled { opacity: .6; cursor: not-allowed; }
.oc-btn:hover { background: var(--rg-gold-2); }
.oc-btn:focus-visible { outline: 2px solid var(--rg-gold-2); outline-offset: 2px; }

/* Copy chip */
.oc-copy {
  background: #2a2a2a;
  color: #ddd;
  border: 1px solid #3b3b3b;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.oc-copy:hover { background: #3a3a3a; }

/* Footer (CTA row) */
.oc-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* QR */
.oc-qr {
  width: 130px; height: 130px;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.oc-qr canvas, .oc-qr img {
  width: 130px; height: 130px;
  image-rendering: pixelated;
}

/* Fast spinner */
.oc-spin {
  width: 14px; height: 14px;
  border: 2px solid #555;
  border-top-color: var(--rg-gold);
  border-radius: 50%;
  animation: oc-spin .6s linear infinite;
  display: inline-block;
}
@keyframes oc-spin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 600px) {
  .oc-kv { grid-template-columns: 1fr; }
  .oc-footer { flex-direction: column; }
  .oc-modal { width: calc(100vw - 20px); padding: 14px; }
  .oc-qr { width: 150px; height: 150px; }
}
