    /* Base styles */
    html, body {
        margin: 0; padding: 0; overflow: hidden;
        background-color: #eaecf0; /* Wikipedia's light grey page background */
        width: 100%; height: 100%;
        font-family: sans-serif; /* Wikipedia default */
        color: #202122; /* Wikipedia default text */
        font-size: 14px; /* Wikipedia base font size */
        touch-action: none; /* Prevent pinch zoom on mobile */
    }
    .no-select, .no-select * {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    canvas {
        display: block;
        width: 100%;
        height: 100%;
        background-color: #000;
        cursor: pointer;
        touch-action: none; /* Prevent pinch zoom on mobile */
    }

    canvas.ps1-mode {
        image-rendering: pixelated;
        filter: contrast(150%) saturate(120%);
    }
  
    /* --- Transition Overlay (Keep As Is) --- */
    #transitionOverlay {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background-color: #000; opacity: 0; pointer-events: none; z-index: 50;
        transition: opacity 0.5s ease-in-out;
        display: flex; justify-content: center; align-items: center;
        text-align: center; font-size: 2em; color: white;
    }
    #transitionOverlay.active { opacity: 1; pointer-events: all; }
    #transitionOverlay.hidden { display: none; }
  
    /* --- Wiki Panel Styling (Main UI Containers) --- */
    .wiki-panel {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        text-align: left; /* Standard text alignment */
        background-color: #ffffff; /* White content background */
        padding: 25px 35px;
        border: 1px solid #a2a9b1; /* Standard wiki border */
        z-index: 15;
        color: #202122;
        width: 90%;
        max-width: 960px; /* Match typical Wikipedia content width */
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Subtle shadow */
        border-radius: 2px; /* Very subtle rounding */
        max-height: 100vh; /* Prevent panel overflowing viewport */
        overflow-y: auto; /* Allow scrolling if content overflows */
        overflow-x: hidden; /* Prevent horizontal scrolling */
        box-sizing: border-box; /* Include padding in width calculations */
    }
    #loadingIndicator, #gameOver, #levelTransitionUI, #introMessage { display: none; } /* Initially hidden */
  
    /* Logo mimicking Wikipedia lead image */
    .logo-container {
        float: right; /* Float to the right like infoboxes/lead images */
        width: 250px; /* Adjust width as needed */
        border: 1px solid #a2a9b1;
        background-color: #f8f9fa; /* Light grey background for image box */
        padding: 5px;
        margin: 0 0 15px 20px; /* Margin top, right, bottom, left */
        font-size: 0.9em;
        text-align: center;
    }
    #gameLogo {
        display: block;
        max-width: 100%;
        height: auto;
        margin-bottom: 5px;
    }
.logo-caption {
        color: #54595d; /* Grey caption text */
        text-align: left; /* Captions are usually left-aligned */
        font-size: 0.85em;
        padding-left: 3px;
    }

/* Mobile adjustments for start screen */
@media (max-width: 600px) {
    .wiki-panel {
        width: 90%;
        padding: 20px;
    }
    .logo-container {
        float: none;
        width: 100%;
        margin: 0 0 15px 0;
    }
}

/* Landscape mobile adjustment to prevent horizontal overflow */
@media (orientation: landscape) and (max-height: 600px) {
    .wiki-panel {
        width: 90%;
        max-width: 90%;
    }
}
  
    /* Loading screen specific logo */
    #loadingLogo {
        display: block;
        max-width: 150px; /* Smaller */
        height: auto;
        margin: 0 auto 15px auto; /* Centered */
    }
  
    /* --- Text Styling --- */
    .wiki-heading {
        font-family: 'Linux Libertine', Georgia, Times, serif; /* Wiki heading font */
        font-weight: normal;
        border-bottom: 1px solid #a2a9b1;
        font-size: 1.8em; /* Larger heading size */
        margin-top: 0.8em;
        margin-bottom: 0.5em;
        padding-bottom: 0.17em;
        color: #000000;
    }
    .wiki-heading:first-of-type {
        margin-top: 0; /* No top margin for the very first heading */
    }
  
    .wiki-subheading {
         font-family: 'Linux Libertine', Georgia, Times, serif;
         font-weight: normal;
         font-size: 1.4em;
         margin-top: 1em;
         margin-bottom: 0.4em;
         color: #000000;
     }
  
    .wiki-body {
        line-height: 1.6;
        margin-bottom: 1em;
        clear: both; /* Ensure body text clears floated elements like the logo */
    }
  
    /* --- Input and Buttons --- */
    .input-section {
        margin-top: 15px;
        margin-bottom: 25px;
    }
    .input-group {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
    }
    input[type="text"] {
        padding: 8px 10px;
        background-color: #ffffff;
        border: 1px solid #a2a9b1;
        color: #202122;
        font-family: sans-serif;
        border-radius: 2px;
        font-size: 1em;
        flex-grow: 1; /* Input takes available space */
        margin-right: 10px;
        box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
        -webkit-user-select: text; /* Re-enable text selection for input */
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    input[type="text"]::placeholder {
        color: #72777d;
        opacity: 1;
    }
    /* Standard button style */
    button {
        padding: 8px 15px;
        cursor: pointer;
        background-color: #f8f9fa; /* Light grey button */
        color: #202122;
        border: 1px solid #a2a9b1;
        border-radius: 2px;
        font-family: sans-serif;
        font-size: 1em;
        font-weight: bold;
        transition: background-color 0.1s, border-color 0.1s;
        box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    }
    button:hover {
        background-color: #f0f1f2; /* Slightly darker grey */
        border-color: #72777d;
    }
     button:active {
         background-color: #e0e1e2;
         border-color: #54595d;
         box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
     }
     /* Primary action button style (optional, could use standard) */
     .wiki-button-primary {
         background-color: #eaf3ff; /* Light blue */
         border-color: #a2ccff;
         color: #3366cc; /* Blue text */
     }
     .wiki-button-primary:hover {
          background-color: #cfe4ff;
          border-color: #74aafa;
      }
      .wiki-button-primary:active {
          background-color: #b2d4ff;
          border-color: #5599f8;
      }
  
     /* Quick Start Buttons (styled like links) */
     .quick-start {
          font-size: 0.9em;
          margin-left: 5px;
          color: #54595d;
     }
      .quick-start-label {
          margin-right: 5px;
          font-weight: bold;
      }
     .quick-start-button {
          background: none;
          border: none;
          color: #3366cc; /* Wiki link blue */
          padding: 0 3px;
          margin: 0;
          font-size: inherit; /* Match surrounding text size */
          cursor: pointer;
          font-weight: normal;
          box-shadow: none;
          text-decoration: none; /* Initially no underline */
     }
     .quick-start-button:hover {
          text-decoration: underline; /* Underline on hover */
          background: none;
          border: none;
     }
     .quick-start-button:active {
          color: #1a4b8f; /* Darker blue on click */
          background: none;
          border: none;
          box-shadow: none;
      }

    /* Social Share Links */
    .share-links {
        font-size: 0.9em;
        margin-left: 5px;
        color: #54595d;
    }
    .share-link {
        background: none;
        border: none;
        color: #3366cc; /* Wiki link blue */
        padding: 0 3px;
        margin: 0;
        font-size: inherit;
        cursor: pointer;
        font-weight: normal;
        text-decoration: none;
    }
    .share-link:hover {
        text-decoration: underline;
        background: none;
        border: none;
    }
    .share-link:active {
        color: #1a4b8f;
        background: none;
        border: none;
        box-shadow: none;
    }
  
    /* Error Message */
    .wiki-error {
        color: #d33; /* Wikipedia error red */
        margin-top: 10px;
        min-height: 1.2em;
        font-size: 0.9em;
    }
  
    /* --- Centered Panels --- */
    #loadingIndicator,
    #gameOver {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Loading indicator specific styling */
    #loadingIndicator { text-align: center; } /* Center loading contents */
    #loadingPageTitle { font-style: italic; color: #54595d; }
    .wiki-status { color: #54595d; font-size: 0.9em; margin-top: 5px;}

    /* Game Over panel */
    #gameOver { text-align: center; }
  
    /* Progress Bar */
    progress.wiki-progress {
        width: 80%;
        height: 12px; /* Slimmer bar */
        margin-top: 15px;
        border: 1px solid #a2a9b1;
        border-radius: 2px;
        overflow: hidden;
        background-color: #eaecf0; /* Light grey background */
        display: block; /* Center using auto margins */
        margin-left: auto;
        margin-right: auto;
    }
    progress.wiki-progress::-webkit-progress-bar {
        background-color: #eaecf0;
        border-radius: 2px;
    }
    progress.wiki-progress::-webkit-progress-value {
        background-color: #3366cc; /* Wiki link blue */
        border-radius: 0; /* Sharp edge */
         transition: width 0.1s ease;
    }
    progress.wiki-progress::-moz-progress-bar {
         background-color: #3366cc;
         border-radius: 0;
         transition: width 0.1s ease;
    }
  
    /* --- Upgrade Selection --- */
    #upgradeSelectionContainer {
        margin-top: 20px;
        border-top: 1px solid #a2a9b1;
        padding-top: 15px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center; /* Center the boxes */
        gap: 10px;
    }
    .wiki-upgrade {
        border: 1px solid #a2a9b1;
        background-color: #f8f9fa; /* Light grey background */
        padding: 8px 12px;
        border-radius: 2px;
        cursor: pointer;
        transition: background-color 0.1s, border-color 0.1s;
        min-width: 180px;
        box-sizing: border-box;
        font-size: 0.9em;
        flex: 1 1 180px;
        max-width: 240px;
        text-align: center;
        color: #202122;
        display: block; /* Ensure display is reset */
    }
    .rarity-common { border-color: #dcdcdc; background-color: #f9f9f9; }
    .rarity-uncommon { border-color: #4caf50; background-color: #e8f5e9; }
    .rarity-rare { border-color: #2196f3; background-color: #e3f2fd; }
    .rarity-epic { border-color: #9c27b0; background-color: #f3e5f5; }
    .rarity-legendary { border-color: #ffc107; background-color: #fff8e1; }
    .wiki-upgrade:hover {
        background-color: #eaf3ff; /* Light blue hover */
        border-color: #74aafa;
    }
    .wiki-upgrade.selected {
        background-color: #cfe4ff; /* Darker blue selected */
        border-color: #3366cc; /* Strong blue border */
        font-weight: bold;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    }
  
    /* --- Game Over --- */
    .game-over-text {
        color: #d33; /* Error red */
        text-align: center;
        border-bottom: none; /* No underline for game over message */
        font-size: 3em;
    }

    /* Centered summary of levels beaten */
    #levelsBeaten {
        text-align: center;
        font-size: 1.4em;
        font-weight: bold;
        margin-top: 10px;
        margin-bottom: 20px;
    }
  
    /* --- Debug Info (Simple) --- */
    #debugInfo {
      position: absolute; top: 10px; left: 10px; color: #54595d;
      font-family: monospace; font-size: 11px;
      background-color: rgba(255,255,255,0.8); border: 1px solid #ccc; padding: 3px 5px; z-index: 10; pointer-events: none; display: none; border-radius: 2px;
    }
    #fpsCounter {
      position: absolute; top: 10px; right: 10px; color: #54595d;
      font-family: monospace; font-size: 11px;
      background-color: rgba(255,255,255,0.8); border: 1px solid #ccc; padding: 3px 5px; z-index: 10; pointer-events: none; border-radius: 2px; display: none;
    }
    /* Screen Flashes (Subtler) */
    #screenFlash,
    #damageFlash,
    #damageEdgeFlash {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: none;
        z-index: 30; /* Above gameplay layer */
        pointer-events: none; /* Avoid intercepting clicks */
    }
    #screenFlash { background-color: rgba(230, 230, 230, 0.4); }
    #damageFlash { background-color: rgba(255, 0, 0, 0.5); }
#damageEdgeFlash {
    background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0) 60%, rgba(255, 0, 0, 0.6) 100%);
}

#objectiveText {
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    z-index: 20;
}

#menuButton {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 30;
    pointer-events: auto;
}

#orientationWarning {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #000;
    text-shadow: none;
    font-size: 14px;
    z-index: 50;
    pointer-events: none;
    display: none;
}

@media (orientation: portrait) {
    #killBossText {
        font-size: 1em; /* Match standard text size on mobile */
    }
}
/* Introductory message overlay */
#introMessage {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2em;
    width: 80%;
    max-width: 600px;
    text-align: center;
    pointer-events: none;
    z-index: 40;
    transition: opacity 1s ease;
}

/* --- Pause Menu Specific Styles --- */
#pauseMenu {
    /* Inherits .wiki-panel styles */
    text-align: center; /* Center content inside pause menu */
    max-width: 500px; /* Smaller width */
}
.pause-options {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Space between buttons */
}
#copyFeedback {
    margin-top: 10px;
    font-size: 0.9em;
    color: #3366cc;
    opacity: 0;
    transition: opacity 0.5s;
    text-align: center;
}
#shareLevelOptions {
    margin-top: 10px;
    padding-top: 10px;
    text-align: center;
    margin-left: 0;
}
#pauseLevelTitle {
    margin-bottom: 15px;
    border-bottom: 1px dashed #ccc; /* Separator */
    padding-bottom: 10px;
}
#sensitivityValue {
    font-weight: bold;
}
.sensitivity-control {
    margin-top: 10px;
    text-align: center;
}
.sensitivity-control input[type="range"] {
    width: 200px;
}

/* Optional: Dim the background when paused */
/* You might need to adjust your canvas element if you use this */
/*
body.paused canvas {
    filter: brightness(0.4) blur(2px);
    transition: filter 0.3s ease-out;
}
*/

/* --- Mobile Controls --- */
#mobileControls {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.joystick {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    pointer-events: auto;
}

.joystick .stick {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#leftJoystick {
    bottom: 30px; /* Moved slightly lower */
    left: 20px;
}

#rightControls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    width: 200px;
    height: 200px;
    pointer-events: none;
}

#rightJoystick {
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: auto;
}

.control-btn {
    position: absolute;
    pointer-events: auto;
    background: rgba(255,255,255,0.8);
    border: 1px solid #666;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.control-btn.small {
    width: 40px;
    height: 40px;
}

.control-btn img {
    width: 80%;
    height: 80%;
    pointer-events: none;
}

#shootButton {
    left: 20px;
    bottom: 35px; /* Align center with joystick */
}

#reloadButton {
    left: 75px; /* Position right of shoot button */
    bottom: 120px;
}

#switchButton {
    left: 75px; /* Position right of shoot button */
    bottom: -40px; /* Move below joystick to avoid overlap */
}

/* Landscape mobile adjustment for switch button */
@media (orientation: landscape) and (max-height: 600px) {
    #switchButton {
        left: 65px;
        bottom: -30px;
    }
}

/* Layout container for canvas and controls */
#gameWrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Portrait orientation adjustments */
@media (orientation: portrait) {
    #gameWrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    #gameWrapper canvas {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    #mobileControls {
        position: relative;
        width: 100%;
        height: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 30px; /* Push controls lower */
        pointer-events: auto;
    }

    #mobileControls #rightControls {
        position: relative;
        width: 200px;
        height: 200px;
        pointer-events: auto;
    }

    #mobileControls #leftJoystick {
        position: relative;
    }
    #mobileControls #rightJoystick {
        position: absolute;
        bottom: 0;
        right: 0;
    }
    /* Scale down intro text overlay on small screens */
    #introMessage {
        font-size: 0.8em;
        width: 90%;
        max-width: none;
        /* Center within the canvas height rather than the full screen */
        top: calc(50vw * 9 / 16);
    }
}
