/* Canvas Styles */
canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%; /* Ensure canvas takes full width */
  height: 100%; /* Ensure canvas takes full height */
  z-index: -1;
  opacity: 0.4; /* Reverted to original value */
  pointer-events: none; /* Added to ensure canvas doesn't block interaction */
}

/* Error Message for Canvas */
#canvas-error {
  display: none;
  color: #ff0000;
  text-align: center;
  padding-top: 50px;
  font-size: 1.2em;
}

/* Selection Screen Styles */
#selection-screen {
  position: relative;
  z-index: 10;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Skip to main content for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -1;
}

.skip-link:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  padding: 10px;
  background-color: #000000;
  color: #00ff00;
  z-index: 9999;
  text-decoration: none;
}

/* Main content */
#main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin-bottom: var(--footer-actual-height); /* Ensure space for fixed footer */
}

/* Mode Container for centering modules */
#mode-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--matrix-base);
}
::-webkit-scrollbar-thumb {
  background: var(--matrix-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--matrix-dim);
}

.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.1;
}
#matrix-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: rgba(13, 2, 8, 0.5);
  color: var(--matrix-dim);
  font-size: 0.8rem;
  z-index: 1000;
  box-shadow: 0 -5px 15px rgba(0, 255, 65, 0.1);
}
.footer-status-group {
    display: flex;
    gap: 1rem;
    flex-shrink: 1;
    min-width: 0;
}

#matrix-footer #fps-counter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--matrix-dim);
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--matrix-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    flex-shrink: 1;
    min-width: 0;
}

#matrix-footer a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--matrix-dim);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--matrix-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    flex-shrink: 1;
    min-width: 0;
}

#matrix-footer a:hover {
    color: var(--matrix-light);
    border-color: var(--matrix-light);
    background-color: var(--button-hover-bg);
    box-shadow: 0 0 10px var(--matrix-glow);
}

#matrix-footer a svg {
    fill: currentColor;
}
#matrix-footer a span {
    overflow-wrap: break-word;
    white-space: normal;
    overflow: hidden;
}

.status-online-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    text-shadow: 0 0 10px var(--matrix-glow);
    color: var(--matrix-color);
}