:root {

  --btn-size: 56px;       /* rozmiar okrągłego przycisku */
  --icon-size: 24px;      /* rozmiar ikony w środku */
  --accent: #ef7c00;      /* kolor tła przycisku */

  /* Stan dostępności (sterowane z JS) */
  --scale: 1;
  --grayscale: 0;
  --invert: 0;
  --contrast: 1;

  /* Kolory panelu */
  --panel-bg: #111;
  --panel-fg: #fff;
  --panel-accent: #3da5ff;
  --btn-bg: #222;
  --btn-bg-hover: #2d2d2d;
  --btn-fg: #fff;
  --btn-border: #444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

html, body {
  height: 100%;
  margin: 0;
  background: #000;
  font: 14px/1.4 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: #ddd;
}

/* Scena i skalowanie/filtry */
#stage {
  position: fixed;
  inset: 0;
}

#viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#zoomed {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--scale));
  height: calc(100% / var(--scale));
  transform: scale(var(--scale));
  transform-origin: 0 0;
  filter: grayscale(var(--grayscale)) invert(var(--invert)) contrast(var(--contrast));
  will-change: transform, filter;
  background: #000;
}

iframe#exb {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* =========================
   TOGGLE BUTTON (round)
   ========================= */
#toolbarToggle {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 4000;

  display: flex;
  align-items: center;
  justify-content: center;

  width: var(--btn-size);
  height: var(--btn-size);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;

  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transition: transform .2s ease;
}

/* rotate 5deg on hover (no color change) */
#toolbarToggle:hover,
#toolbarToggle:focus {
  transform: rotate(5deg);
}

/* accessibility focus ring */
#toolbarToggle:focus {
  outline: 3px solid rgba(239,124,0,.45);
  outline-offset: 3px;
}

/* icon inside toggle - white stroke/fill */
#toolbarToggle svg {
  width: var(--icon-size);
  height: var(--icon-size);
  display: block;
  fill: #fff;       /* main fill white */
  stroke: none;
  vertical-align: middle;
  pointer-events: none; /* clicks hit button, not svg */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* ====== Panel dostępności ====== */
.a11y-panel {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 10000;
  width: min(280px, calc(100vw - 32px));
  background: var(--panel-bg);
  color: var(--panel-fg);
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: none;
}

.a11y-panel[open] {
  display: block;
}

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--btn-border);
}

.a11y-title {
  margin: 0;
  font-size: 16px;
}

.a11y-close {
  background: transparent;
  color: var(--panel-fg);
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.a11y-body {
  padding: 10px 12px;
}

.a11y-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.a11y-btn {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.a11y-btn:hover {
  background: var(--btn-bg-hover);
}

.a11y-btn[aria-pressed="true"] {
  outline: 2px solid var(--panel-accent);
  outline-offset: 2px;
}

.a11y-footer {
  border-top: 1px solid var(--btn-border);
  padding: 8px 12px;
  color: #aaa;
  font-size: 12px;
  # white-space: pre-line;
  line-height: 2.8;
}

.a11y-kbd {
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 1px 4px;
}

@media (prefers-contrast: more) {
  :root {
    --panel-accent: #00c2ff;
  }
}