@font-face {
  font-family: "nudicamono-regular";
  src: url("../../nudicamono-regular-webfont.woff2") format("woff2"),
    url("../../nudicamono-regular-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --surface: #111111;
  --border: rgba(241, 241, 241, 0.15);
  --text: #f1f1f1;
  --muted: rgba(241, 241, 241, 0.55);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: "nudicamono-regular", monospace;
  font-size: 12px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Version badge & footer */
#version-badge {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1001;
  font-size: 13px;
  color: var(--text);
  pointer-events: none;
}
#site-footer {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 1001;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

/* UI toggle (shown in Clean UI mode) */
#ui-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1002;
  display: none;
  background: transparent;
  border: 1px solid rgba(241, 241, 241, 0.15);
  color: #f1f1f1;
  font-family: "nudicamono-regular", "Courier New", Courier, monospace;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  text-transform: uppercase;
}

#ui-toggle:hover,
#ui-toggle:focus {
  background: rgba(241, 241, 241, 0.08);
  border-color: rgba(241, 241, 241, 0.35);
  outline: none;
}
body.ui-hidden .qide-ui-panel,
body.ui-hidden #version-badge,
body.ui-hidden #site-footer {
  display: none !important;
}
body.ui-hidden #ui-toggle {
  display: block;
}

/* Info modal */
#info-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#info-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px 40px;
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-inner h2 {
  font-family: "nudicamono-regular", monospace;
  font-size: 18px;
  font-weight: normal;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 4px;
}
.modal-inner .modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.modal-inner p {
  font-family: "nudicamono-regular", monospace;
  font-size: 12px;
  font-weight: normal;
  color: rgba(241, 241, 241, 0.8);
  line-height: 1.7;
  margin-bottom: 14px;
}
.modal-inner em {
  color: var(--text);
  font-style: normal;
}
.modal-inner strong {
  color: var(--text);
  font-weight: normal;
}
.modal-inner .kbd-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin-top: 20px;
}
.kbd {
  display: inline-block;
  background: rgba(241, 241, 241, 0.06);
  border: 1px solid var(--border);
  padding: 2px 7px;
  font-family: "nudicamono-regular", monospace;
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
}
.kbd-desc {
  font-size: 11px;
  color: var(--muted);
  align-self: center;
}
.modal-close {
  margin-top: 24px;
  display: block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: "nudicamono-regular", monospace;
  font-size: 11px;
  padding: 8px 20px;
  transition: all 0.2s;
  letter-spacing: 0.08em;
}
.modal-close:hover {
  background: rgba(241, 241, 241, 0.08);
  border-color: rgba(241, 241, 241, 0.35);
}

/* Noscript fallback */
.noscript-fallback {
  color: #f1f1f1;
  font-family: "nudicamono-regular", monospace;
  padding: 2rem;
  background: #000000;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile responsive */
@media (max-width: 600px) {
  body {
    font-size: 11px;
  }
  .modal-inner {
    padding: 24px 18px;
    width: 95%;
  }
  #version-badge,
  #site-footer {
    font-size: 11px;
  }
}
