/* Base variables defining light and dark colour schemes */
:root {
  /* Use a softer off‑white background to make the light mode easier on the eyes */
  --bg-colour: #f5f7fa;
  --text-colour: #2d3748;
  --accent-colour: #4caf50;
  --card-bg: #ffffff;
  --button-bg: #4caf50;
  --button-text: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-colour: #121212;
  --text-colour: #f0f0f0;
  --accent-colour: #8bc34a;
  --card-bg: #1e1e1e;
  --button-bg: #8bc34a;
  --button-text: #121212;
  --sidebar-bg: #1e1e1e;
  --sidebar-shadow: rgba(0, 0, 0, 0.3);
}

/* Global styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-colour);
  color: var(--text-colour);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Sidebar Menu Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background-color: var(--sidebar-bg);
  box-shadow: 2px 0 10px var(--sidebar-shadow);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar.open {
  left: 0;
}

.sidebar-content {
  padding: 2rem 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-colour);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-colour);
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-item {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: var(--text-colour);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.nav-item:hover {
  background-color: var(--accent-colour);
  color: var(--button-text);
  transform: translateX(5px);
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Menu Toggle Button */
.menu-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 50px;
  height: 50px;
  background-color: var(--card-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.menu-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.menu-toggle span {
  width: 20px;
  height: 3px;
  background-color: var(--text-colour);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Page Content */
.page-content {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-content.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Game Styles */
.game-container {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem;
}

.game-container h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent-colour);
}

.game-container p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.game-stats {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: bold;
}

.game-btn {
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2rem;
}

.game-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-btn:active {
  transform: scale(0.95);
}

.game-result {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-colour);
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Existing styles continue below */
header {
  padding: 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

header button#themeToggle {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-colour);
  transition: transform 0.2s ease;
}

header button#themeToggle:hover {
  transform: rotate(20deg);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  margin-top: 2rem;
}

.profile-img {
  /* Limit the size of the photo so it doesn't take over the entire page */
  width: 100%;
  max-width: 400px;
  height: auto;
  /* Do not limit height so the whole portrait can be displayed */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 1rem;
  filter: saturate(1.1);
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.fun-section {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
  text-align: center;
  width: 100%;
  max-width: 600px;
}

.fun-section p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.fun-section button {
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.fun-section button:hover {
  background-color: var(--accent-colour);
}

.excuse-output {
  font-style: italic;
  margin-top: 1rem;
  min-height: 2rem;
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--card-bg);
  color: var(--text-colour);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}