    /* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap');

/* --- Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: #fff;
  color: #111;
  z-index: 9999;
  border-radius: 4px;
}

/* Site footer */
.site-footer {
  background: #222;
  color: #ddd;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.9rem;
}

    /* The header is now only composed of the top-bar and the button */
    .page-header {
        display: flex;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    /* --- Top Bar (Takes up most of the space) --- */
    .top-bar {
        /* Use flex-grow to let the top bar take up all available space */
        flex-grow: 1; 
        height: 40px;
        background-color: #3b5998;
        color: white;
        display: flex;
        align-items: center;
        padding-left: 20%;
        font-size: 0.9em;
        gap: 15px;
    }

    /* Logo Styling */
    .logo {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 900;
        font-size: 1.3em;
        letter-spacing: 1px;
        text-decoration: none;
        color: white;
        transition: transform 0.3s ease;
    }

    .logo:hover {
        transform: scale(1.05);
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, #ff0055, #ff6b9d);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2em;
        font-weight: 900;
        color: white;
    }
    
    /* Image logo (generated) */
    .header-logo {
      width: 36px;
      height: 36px;
      display: inline-block;
      vertical-align: middle;
      border-radius: 6px;
      object-fit: cover;
    }

    /* --- Hamburger Button (Always Visible) --- */
    .hamburger-button {
        /* Position the button on the far right of the page-header */
        position: relative; 
        right: 0px;
        padding-top: 6px;
        z-index: 20; 
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 6px;
        height: 30px;
        width: 40px;
        padding-right: 13px; /* Add some space from the edge */
        padding-left: 7px;
        background-color: rgb(109, 255, 170);
        padding-bottom: 34px;
    }

    /* Styling the three bars of the hamburger icon */
    .hamburger-button .bar {
        display: block;
        width: 100%;
        height: 3px;
        margin: 4px auto;
        background-color: rgb(67, 175, 172); 
        transition: all 0.3s ease-in-out;
    }

    /* --- Navigation Menu (The drop-down list) --- */
    .nav-menu {
        /* 1. HIDE IT BY DEFAULT */
        display: none; 
        /* 2. POSITION IT TO DROP DOWN FROM THE HEADER */
        position: absolute;
        top: 40px; /* Below the 40px header height */
        right: 0; /* Align to the right side of the screen */
        background-color: #f1f1f1;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 15; /* Above main content, below the button */
        height: auto;
    }

    /* 3. SHOW THE MENU WHEN THE 'is-open' CLASS IS ADDED BY JS */
    .nav-menu.is-open {
        display: block;
    }

    /* Styling the menu list items */
    .nav-menu ul {
        list-style: none;
        display: flex;
        flex-direction: column; /* Stack links vertically */
        padding: 10px 0;
    }

    .nav-menu li {
        text-align: left;
    }

    .nav-menu a {
        text-decoration: none;
        color: #333;
        padding: 10px 15px;
        font-weight: bold;
        display: block; 
        border-bottom: 1px solid #ddd;
    }

    .nav-menu a:hover {
        background-color: #e2e2e2;
    }

    /* ... (Keep all your existing styles for .page-header, .top-bar, .nav-menu, etc.) ... */

    /* --- Main Content Layout Wrapper --- */
    .content-wrapper {
      /* Use CSS Grid for the main content wrapper (requirement: use CSS Grid) */
      display: grid;
      grid-template-columns: 1fr; /* single column layout; sidebar is fixed separately */
      width: 100%;
      min-height: calc(100vh - 40px); /* Fill the viewport height minus the header height */
      max-width: calc(100% - 41px); /* Prevents overflow due to sidebar */
      margin-top: 40px; /* Account for fixed header */
      overflow-y: auto; /* Allow scrolling */
      gap: 16px;
    }

    /* --- The Main Content Area --- */
    main {
        /* 1. Explicitly set the maximum width */
        /* This calculation ensures the main area never overlaps the 41px sidebar */
        max-width: calc(100% - 41px); 

        /* 2. Set the minimum height to allow full visibility */
        min-height: 100%;
        
        /* 3. The remaining properties */
        flex-grow: 1; /* Still takes all available space horizontally */
        
        padding: 20px;
        line-height: 1.6;
        background-color: #c9f0cc;
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    /* --- The 40px Right Sidebar Column --- */
    .right-sidebar {
        position: fixed;
        /* 1. Sets the fixed width as requested */
        width: 41px; 
        /* 2. Prevents it from shrinking */
        flex-shrink: 0; 
        
        background-color: #e0e0e0;
        border-left: 1px solid #ccc;
        
        /* Center the container */
        text-align: center;
        
        right: 0px;
        height: calc(100vh - 40px); 
        top: 40px;
        
        /* Use Flexbox to align content */
        display: flex;
        flex-direction: column; 
        
        /* KEY CHANGE: Pushes content to the bottom of the column */
        justify-content: flex-end; 
        
        align-items: center; /* Still centers it horizontally */
        padding: 5px 0;
    }

/* Style the content container inside the sidebar */
/* --- Style the content container inside the sidebar (Updated) --- */
.sidebar-content {
    /* KEY STYLES FOR VERTICAL TEXT */
    writing-mode: vertical-lr; 
     
    
    /* NEW: Set display to inline-block to allow elements to flow horizontally/vertically */
    display: inline-block; 
    white-space: nowrap; /* Prevents wrapping, crucial for vertical single line */

    padding-top: 5px;
    font-size: 0.7em;
    color: #555;
    font-weight: bold;
    line-height: 1.5;
}

/* IMPORTANT: Target the inner elements to remove block/width constraints */
.sidebar-content p, .sidebar-content h4 {
    margin: 5px 0; 
    /* NEW: Force content to act as inline elements so they flow next to each other */
    display: inline; 
    /* REMOVED: width: 100%; */
}
/* --- Contact Page Specific Styles --- */

/* Social Media Links */
.social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

.social-links a {
  text-decoration: none;
  color: #3b5998;
  font-size: 1.2em;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.social-links a:hover {
  color: #ff0055;
  transform: scale(1.2);
}
/* --- Contact Page Layout & Centering (Revised) --- */

/* Reset .contact-grid structure to just be a centered container */
.contact-grid {
    display: block; 
    max-width: 600px; /* Optional: Sets a reasonable maximum width for the form */
    margin: 0 auto; /* KEY: Centers the form container horizontally */
    padding-top: 0;
    padding-bottom: 20px;
    padding-right: 40px;
}

/* 2. Style the Form Elements (using the new class .main-contact-form) */
.main-contact-form label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #3b5998;
}

.main-contact-form input[type="text"],
.main-contact-form input[type="email"],
.main-contact-form textarea {
    width: 80%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.main-contact-form textarea {
    resize: vertical;
}

/* Required fields styling */
.required-star {
  color: red;
  font-size: 1.1em;
  margin-left: 4px;
}

.main-contact-form input:required,
.main-contact-form input[required],
.main-contact-form textarea[required] {
  border: 2px solid #d33;
  box-shadow: 0 0 0 3px rgba(211,50,50,0.06);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.main-contact-form input:focus,
.main-contact-form textarea:focus {
  outline: none;
  border-color: #ff0055;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

/* NOTE: .submit-button styles remain the same and will work *//* --- Required Field Styling --- */
.required-star {
    color: red;
    font-size: 1.1em;
    margin-left: 2px;
}

/* Ensure the submit button and the form title are styled correctly */
.form-title {
    text-align: center;
    color: #3b5998;
    margin-bottom: 20px;
}
.social-links {
    /* Pushes the content to the top (default Flexbox behavior for column) */
    
    /* Set vertical flow */
    writing-mode: vertical-lr;
    
    
    padding: 100px 0;
    margin-bottom: 5px;
    border-bottom: 1px solid #aaa; /* Visual separation from contact text */
    
    /* Ensures the element fits the width and controls content flow */
    display: flex; 
    flex-direction: row; /* Treat links as a horizontal row (which is vertical when rotated) */
    align-items: center;
    letter-spacing: 15px;
}

.social-links a {
    /* Styles for the individual links/icons */
    text-decoration: none;
    color: #3b5998; /* Use your brand color */
    font-size: 1.2em;
    font-weight: bold;
    padding: 5px 0; /* Vertical spacing between links */
    display: block;
    line-height: 1;
    transition: color 0.2s;
}
 
.social-links a:hover {
    color: rgb(67, 175, 172); /* Hover color */
}
/* Container for the entire game setup */
#game1-container {
    width:100%; /* Prevents overflow due to sidebar */
    margin: 20px;
    padding: 20px;
    border: 3px solid #333;
    border-radius: 10px;
    text-align: center;
    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
    margin-right: 41px;
    margin-left: 1px;
}

/* The actual game area where targets appear */
#game1 {
    position: relative;
    width: 100%;
    
    /* FORCE A HEIGHT: 
       We use a fixed pixel height here to guarantee it never collapses 
       regardless of screen width or empty content.
    */
    height: 60vh; 
    min-height: 400px;

    margin: 10px 0;
    border: 1px solid #999;
    background-color: #e0e0e0;
    overflow: hidden; /* Keeps targets inside */
    cursor: crosshair;
}

/* Base style for all targets */
.game1-target {
    position: absolute; /* This allows them to move freely inside #game1 */
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.05s ease-out;
    z-index: 10; /* Ensures they appear on top of the background */
}

/* Good targets (Green) */
.game1-target.good {
    background-color: #4CAF50;
    border: 2px solid #388E3C;
}

/* Evil targets (Red) */
.game1-target.evil {
    background-color: #F44336;
    border: 2px solid #D32F2F;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

/* Controls Area */
#game1-controls-area {
    margin-bottom: 10px;
}

/* Stats Styling */
#game1-stats {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    font-size: 1.2em;
    font-weight: bold;
}

/* Button Styling */
#game1-start-btn {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
}

#game1-start-btn:hover {
    background-color: #0056b3;
}

/* CSS FOR GAME 2 */
    
    /* The Container: Positions the game on the screen */
    #game2-container {
        position: fixed;
        left: 0;
        bottom: 0;
        /* Scales to the edges minus your requested 41px margin */
        top: 40px;
        right: 41px;
        
        background-color: #111; /* Dark background */
        z-index: 1000; /* Ensures it sits on top */
        overflow: hidden;
        border-top: 2px solid #444;
        border-right: 2px solid #444;
        font-family: 'Courier New', Courier, monospace;
    }

    /* The Canvas: Scales to fill the container */
    canvas.game2 {
        display: block;
        width: 100%;
        height: 100%;
    }

    /* Overlay for Start/Game Over text */
    .game2-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #0f0; /* Retro green */
        text-align: center;
        pointer-events: none; /* Let clicks pass through to canvas if needed */
        text-shadow: 0 0 10px #0f0;
    }

    .game2-overlay h1 {
        margin: 0;
        font-size: 2rem;
        text-transform: uppercase;
    }
    
    .game2-overlay p {
        font-size: 1rem;
        margin-top: 10px;
    }

    /* CONTAINER STYLES 
           - Fixed to bottom left
           - Calcs used to adhere to the 40px top / 41px right constraints
        */
        #game3.game3 {
            position: fixed;
            left: 0;
            bottom: 0;
            /* Width is full screen minus 41px from the right */
            width: calc(100vw - 41px); 
            /* Height is full screen minus 40px from the top */
            height: calc(100vh - 40px);
            background-color: #222; /* Dark background */
            border-top: 2px solid #555;
            border-right: 2px solid #555;
            font-family: 'Courier New', Courier, monospace;
            overflow: hidden;
            z-index: 1000; /* Ensures it sits above other content */
            user-select: none;
            outline: none;
        }

        /* CANVAS STYLES */
        #game3 canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* UI OVERLAY STYLES */
        .g3-ui {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: #fff;
            pointer-events: none; /* Let clicks pass through to the game container */
        }

        .g3-ui h1 {
            margin: 0;
            font-size: 2rem;
            text-transform: uppercase;
            letter-spacing: 5px;
            color: #ff4757;
            text-shadow: 2px 2px #000;
        }

        .g3-ui p {
            font-size: 1rem;
            color: #ccc;
            margin-top: 10px;
        }

        .g3-score {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 1.5rem;
            color: #fff;
            font-weight: bold;
            pointer-events: none;
        }

        /* --- SCALABLE CSS --- 
       This allows the game to fit anywhere 
    */
    :root {
      --bg-color: #202028;
      --text-color: #ffffff;
      --accent-color: #ff0055;
    }

    /* Container for game and contact form (stacked by default) */
    #idk {
      display: flex;
      flex-direction: column; /* Always stack: game then contact form */
      gap: 12px;
      align-items: stretch;
      width: 100%;
      box-sizing: border-box;
      margin-top: 8px;
    }

    /* The Wrapper: Controls the max size of the game */
    .game-wrapper {
      /* Always full width so contact form stays below */
      width: 100%;
      max-width: 100%;
      padding: 6px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      /* Force a vertical fit for the game area + UI
         Reserve space for header/footer and controls
      */
      height: calc(100vh - 120px);
      max-height: calc(100vh - 80px);
    }

    /* Contact form container styling */
    .contact-form-container {
      flex: 1;
      min-width: 200px; /* lowered to allow tighter widths */
      padding: 12px;
      box-sizing: border-box;
    }

    .game-container {
      position: relative;
      width: 100%;
      /* Allow the container to grow inside the wrapper but not overflow */
      flex: 1 1 auto;
      border: 2px solid #333;
      background-color: #000;
      max-width: 100%;
      box-sizing: border-box;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    /* Canvas scales to fit the container and fill available vertical space */
    canvas {
      display: block;
      width: 100%;
      height: 100%;
      /* Keeps pixels sharp when scaled up */
      image-rendering: pixelated; 
      flex: 1 1 auto;
    }

    /* Ensure no horizontal scrolling site-wide */
    html, body {
      overflow-x: hidden;
    }

    /* UI Overlay (Start Screen) */
    .ui-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.85);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 10;
      visibility: hidden;
    }

    .ui-overlay.active {
      visibility: visible;
    }

    .title {
      font-size: 3rem;
      margin-bottom: 1rem;
      color: var(--accent-color);
      text-transform: uppercase;
      font-weight: 900;
    }

    .btn {
      padding: 12px 24px;
      font-size: 1.2rem;
      background: #fff;
      border: none;
      cursor: pointer;
      font-weight: bold;
      text-transform: uppercase;
      transition: background 0.2s;
    }

    .btn:hover {
      background: var(--accent-color);
      color: #fff;
    }

    /* Subtle transitions for interactive elements */
    .game-container,
    .score-board,
    .control-btn,
    .btn,
    .logo {
      transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    .game-container:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    }

    /* Score Board */
    .score-board {
      display: flex;
      justify-content: space-between;
      width: 100%;
      font-size: 1.2rem;
      margin-bottom: 10px;
      font-weight: bold;
    }

    /* --- MOBILE CONTROLS --- 
       Grid layout for on-screen buttons 
    */
    .controls {
      display: flex;
      gap: 8px;
      margin-top: 12px;
      width: 100%;
      justify-content: center;
      align-items: center;
      flex-wrap: nowrap;
    }

    .control-btn {
      background: #333;
      color: white;
      border: none;
      padding: clamp(6px, 1.2vw, 14px) 0; /* slightly smaller padding */
      font-size: clamp(12px, 2.2vw, 18px);
      border-radius: 8px;
      cursor: pointer;
      user-select: none; /* Prevents text selection on double tap */
      touch-action: manipulation; /* Improves touch response */
      flex: 1 1 36px; /* allow shrinking, lower minimum width */
      min-width: 36px;
      max-width: 110px;
      box-sizing: border-box;
      text-align: center;
    }

    .control-btn:active {
      background: var(--accent-color);
    }

    /* Page media styles */
    .page-image {
      max-width: 100%;
      height: auto;
      display: block;
      margin: 12px auto;
      border-radius: 8px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }

    .responsive-video {
      width: 100%;
      max-width: 720px;
      height: auto;
      display: block;
      margin: 12px auto;
      border-radius: 6px;
      background: #000;
    }

    /* --- RESPONSIVE DESIGN --- */
    /* Mobile Layout (640px and less) */
    @media (max-width: 640px) {
      .top-bar {
        padding-left: 10%;
        font-size: 0.7em;
      }

      main {
        padding: 10px;
      }

      .game-wrapper {
        width: 100%;
        max-width: 100%;
        min-width: auto;
      }

      .contact-form-container {
        width: 100%;
        min-width: auto;
        padding: 10px;
      }

      #idk {
        flex-direction: column;
        gap: 10px;
      }

      .game-container {
        max-width: 100%;
      }

      .main-contact-form input[type="text"],
      .main-contact-form input[type="email"],
      .main-contact-form textarea {
        width: 100%;
      }

      .right-sidebar {
        height: auto;
        position: relative;
        top: auto;
        width: 100%;
        flex-direction: row;
        justify-content: center;
        margin-top: 20px;
        padding: 10px;
      }

      .sidebar-content {
        writing-mode: horizontal-tb;
        display: flex;
        flex-direction: column;
        text-align: center;
      }

      .controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }

      .control-btn {
        padding: 15px 0;
        font-size: 1.2rem;
      }

      .title {
        font-size: 1.5rem;
      }

      .score-board {
        font-size: 1rem;
      }
    }

    /* Desktop Layout (641px and above) */
    @media (min-width: 641px) {
      /* Keep single-column stack but allow slightly larger content widths */
      #idk {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
      }

      .game-wrapper {
        width: 100%;
        max-width: 720px; /* allow wider game area if desired but keep stacked */
        margin: 0 auto;
      }

      .contact-form-container {
        min-width: auto;
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
      }
    }