/* Apply variables to existing styles */
#main {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

#main > .panel {
  background: var(--bg-primary);
}

/* Intro panel uses its own background, constrained to 50em width */

body, input, textarea, select {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

strong, b, h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.015em;
  text-rendering: optimizeLegibility;
}

header > p {
  color: var(--text-muted);
}

hr {
  border-top: solid 1px var(--border-color);
}

blockquote {
  border-left: solid 0.5em var(--border-color);
}

table.default tbody tr {
  border-bottom: solid 1px var(--bg-secondary);
}

table.default thead {
  border-bottom: solid 2px var(--bg-secondary);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form select,
form textarea {
  background: var(--bg-secondary);
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form select:focus,
form textarea:focus {
  background: var(--bg-primary);
}

/* Dark mode toggle button */
.theme-toggle {
  position: fixed;
  top: 1em;
  right: 1em;
  z-index: 10000;
  background: var(--nav-bg);
  color: var(--nav-text);
  border: none;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Music toggle button */
.music-toggle {
  position: fixed;
  top: 4em;
  right: 1em;
  z-index: 10000;
  background: var(--nav-bg);
  color: var(--nav-text);
  border: none;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.music-toggle:hover {
  transform: scale(1.1);
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 6px;
}

/* Improved focus states */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

/* Go Back Button */
.go-back-btn {
  padding: 0.5em !important;
  font-size: 0.9em !important;
  width: 2em !important;
  height: 2em !important;
  min-width: 2em !important;
  min-height: 2em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.3) !important; /* Semi-transparent background for visibility */
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  cursor: pointer;
  opacity: 0.8;
  margin: 0;
}

.go-back-btn .icon {
  font-size: 1em;
  margin: 0 !important;
  padding: 0 !important;
  color: #ffffff !important; /* Always white */
  background: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.go-back-btn .icon:before {
  background-color: #ffffff !important; /* Always white - needed for mask-image */
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.go-back-btn:hover {
  transform: translateX(-2px);
  background: rgba(0, 0, 0, 0.5) !important;
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

