/* Styles specific to Room 3 (rooms/3/index.html). Loaded after the shared CSS, so it can override it. */

  kbd {
    font-family: monospace;
    font-size: 0.8em;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 0.1em 0.4em;
    color: var(--text);
  }

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

  nav a:focus-visible,
  nav a.real-link:focus-visible {
    outline: none;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 3px var(--accent-light);
    pointer-events: auto;
  }

  /* ── Main ── */
  main {
    flex: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    width: 100%;
  }

  h1 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
  }

  .intro-text {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 900;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 2rem;
    max-width: 28ch;
  }

  /* ── Hint box ── */
  .hint-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: 0 6px 6px 0;
    padding: 0.875rem 1.25rem;
    margin-bottom: 2.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
  }

  /* ── Console ──
   Four sections, each a column of three buttons.
   Looks like a real control panel — dense, functional, intimidating. */
  .console {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }

  .console-section {
    background: var(--surface);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* ── Section heading ── */
  .console-section > h2 {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  /* ── Button wrapper — positions the mouse-blocking overlay ── */
  .btn-wrapper {
    position: relative;
  }

  /*
  Control button — the actual interactive element.
  Keyboard Tab and AT (voice control) interact with this directly.
  Mouse cannot reach it because .mouse-blocker sits on top (z-index).
*/
  .control-btn {
    display: block;
    width: 100%;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 0.6rem 0.875rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: monospace;
    text-align: left;
    cursor: pointer;
    transition:
      border-color 0.15s,
      background 0.15s;
    position: relative;
    z-index: 0;
  }
  .control-btn:hover {
    border-color: var(--text-muted);
    background: color-mix(
      in srgb,
      var(--surface-raised) 85%,
      var(--accent) 15%
    );
  }
  .control-btn:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 3px;
    z-index: 2; /* focus ring above the blocker so it's visible */
  }

  /*
  Mouse-blocking overlay.
  Sits above .control-btn (z-index: 1 vs 0).
  aria-hidden="true" — voice control and screen readers skip it entirely
  and interact with the button beneath via the accessibility tree.
  Mouse pointer hits this layer first, so button.click() never fires from mouse.
*/
  .mouse-blocker {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: not-allowed;
    border-radius: 4px;
  }

  /* ── Toast ── */
  .toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(5rem);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-muted);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text);
    z-index: 100;
    opacity: 0;
    transition:
      transform 0.2s ease,
      opacity 0.2s ease;
    max-width: min(420px, calc(100vw - 2rem));
    text-align: center;
    pointer-events: none;
  }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--success);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
  }

  .modal .success-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
  }

  .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
  }

  .btn-close {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
  }

  @media (max-width: 560px) {
    main {
      padding: 2rem 1.25rem 3rem;
    }
    header {
      padding: 0.75rem 1.25rem;
    }
    .console {
      grid-template-columns: 1fr 1fr;
    }
  }
