* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', sans-serif;
    overflow: hidden;
    height: 100vh;
    cursor: url('/cursor.png'), auto; /* Default cursor for the desktop */
}

/* Elements that should display the interact cursor */
.desktop-icon,
.window-control,
#start-button,
.taskbar-app,
button,
.computer-sidebar li,
.google-result,
.recycle-item,
.drive-item,
.app-item,
.paint-toolbar button,
.paint-toolbar select,
.paint-toolbar input[type="color"],
.calculator button,
.video-item,
.controls-overlay button {
    cursor: url('/interact.png'), pointer; /* Hand cursor for clickable elements */
}

/* Specific overrides for elements with distinct cursor types */
.window-header {
    cursor: move; /* Keep move cursor for window dragging */
}

input[type="text"],
textarea {
    cursor: text; /* I-beam for text input fields */
}

#desktop {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #008080;
}

#wallpaper {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    user-select: none;
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

.desktop-icon span {
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    text-align: center;
}

.window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: #f0f0f0;
    border: 2px solid #000080;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.3);
    z-index: 100;
    transition: all 0.2s ease-out; /* Add smooth transition for maximizing/restoring */
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 30px) !important; /* Account for taskbar height */
    transform: none !important; /* Override the centering transform */
    border-radius: 0; /* No rounded corners when maximized */
    box-shadow: none; /* No shadow when maximized */
}

.window-header {
    background: linear-gradient(to right, #000080, #1084d0);
    color: white;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.window-title {
    font-size: 14px;
    font-weight: bold;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-control {
    width: 20px;
    height: 20px;
    background: #c0c0c0;
    border: 1px solid #808080;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.window-content {
    padding: 0; 
    height: calc(100% - 30px);
    overflow: hidden; /* Changed to hidden to prevent scrollbars from app content divs */
    background: #e0e0e0; /* A more common background for content in XP */
}

#taskbar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, #2f4fbf, #1e4fbf);
    display: flex;
    align-items: center;
    padding: 0 5px;
}

#start-button {
    display: flex;
    align-items: center;
    padding: 2px 8px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    height: 24px;
}

#start-button img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

#start-button span {
    font-size: 12px;
    color: black;
}

#taskbar-apps {
    display: flex;
    gap: 2px;
    margin-left: 5px;
}

.taskbar-app {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#clock {
    position: absolute;
    right: 5px;
    background: #c0c0c0;
    padding: 2px 10px;
    font-size: 12px;
    border: 1px inset #c0c0c0;
}

.google-search {
    display: flex;
    gap: 5px;
    padding: 10px; /* Reduced padding for a more compact look */
    background: #d0d0d0; /* Slightly darker than content */
    border-bottom: 1px solid #a0a0a0;
}

.google-search input {
    flex: 1;
    padding: 4px; /* Smaller padding */
    font-size: 13px;
    border: 1px inset #808080; /* Inset border for input field */
    background: white;
}

.google-search button {
    padding: 4px 12px; /* Smaller padding */
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 13px;
    color: black;
}

.google-search button:active {
    border: 2px inset #c0c0c0; /* Pressed state */
}

.google-results {
    margin-top: 0; /* No top margin as it's directly below search bar */
    padding: 10px;
    flex-grow: 1; /* Allow results to fill remaining space */
    overflow-y: auto;
    background: #e0e0e0; /* Match content background */
}

.google-result {
    margin-bottom: 10px; /* Reduced margin */
    padding: 8px; /* Reduced padding */
    border: 1px solid #b0b0b0;
    cursor: pointer;
    background: white;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* Keep a slight shadow */
}

.google-result:hover {
    background: #e9e9e9; /* Light hover effect */
}

.google-result h3 {
    color: #0000FF; /* Classic blue link color */
    cursor: pointer;
    font-size: 15px; /* Slightly smaller for old look */
}

.google-result p {
    color: #333333; /* Darker grey for text */
    font-size: 13px; /* Slightly smaller for old look */
    margin-top: 2px;
}

.google-result small {
    color: #008000; /* Green URL */
    font-size: 11px;
}

.recycle-content {
    background: #e0e0e0; /* Consistent background */
    border: 2px outset #c0c0c0; /* Standard window content border */
    padding: 10px;
}

.recycle-content button {
    padding: 5px 10px;
    margin: 2px;
    background: #c0c0c0; /* Standard button color */
    border: 2px outset #c0c0c0; /* Standard button border */
    cursor: pointer;
}

.recycle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    margin: 5px 0;
    background: white;
    border: 1px solid #a0a0a0; /* Slightly darker border */
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.recycle-item button {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 5px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
}

.recycle-item img {
    width: 32px;
    height: 32px;
}

.computer-content {
    display: flex;
    gap: 20px;
    background: #e0e0e0; /* Consistent background */
    border: 2px outset #c0c0c0; /* Standard window content border */
    padding: 10px;
}

.computer-sidebar {
    width: 200px;
    background: #f0f0f0; /* Lighter background for sidebar */
    border: 1px solid #a0a0a0; /* Simpler border */
    padding: 10px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1); /* Slight inset for a panel look */
}

.computer-sidebar h3 {
    margin-bottom: 10px;
    color: #000080; /* Blue header */
}

.computer-sidebar ul {
    list-style: none;
}

.computer-sidebar li {
    padding: 5px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0; /* Separator lines */
}

.computer-sidebar li:hover {
    background: #b0d0ff; /* Windows blue highlight */
    color: white;
}

.computer-main {
    flex: 1;
    background: #f0f0f0; /* Lighter background for main area */
    border: 1px solid #a0a0a0;
    padding: 10px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

.hidden {
    display: none;
}

.drive-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
}

.drive-item:hover {
    background: #e9e9e9;
}

.appstore-content {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced gap */
    padding: 10px; /* Reduced padding */
    background: #e0e0e0; /* Consistent background */
    border: 2px outset #c0c0c0; /* Standard window content border */
}

.app-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border: 1px solid #a0a0a0; /* Darker border */
    background: white;
    cursor: pointer;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.app-item:hover {
    background: #e9e9e9;
}

.app-info h3 {
    margin: 0;
    color: #0000FF; /* Blue for titles */
}

.app-info p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 12px;
}

.paint-container {
    background: #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px outset #c0c0c0; /* Standard window content border */
}

.paint-toolbar {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 5px;
    display: flex;
    gap: 5px;
    align-items: center;
    min-height: 40px; /* Ensure toolbar has a fixed height */
    flex-wrap: wrap; /* Allow toolbar items to wrap if window is very narrow */
}

.paint-toolbar button, 
.paint-toolbar select, 
.paint-toolbar input[type="color"] {
    padding: 4px 8px;
    background: #e0e0e0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 12px;
    height: 30px; /* Consistent height for controls */
}

.paint-toolbar button:active,
.paint-toolbar button.active-tool {
    border: 2px inset #c0c0c0;
    background: #b0b0b0;
}

.paint-toolbar input[type="color"] {
    width: 30px;
    padding: 0;
    border: 1px solid #808080;
    cursor: pointer;
}

.paint-toolbar label {
    font-size: 12px;
    margin-left: 5px;
    white-space: nowrap;
}

.paint-canvas-area {
    flex-grow: 1; /* This will make canvas take remaining space */
    background: white;
    cursor: crosshair; /* Crosshair for drawing on canvas */
    border: 1px solid #ccc; /* Border for the canvas itself */
    margin: 5px; /* Add some margin around the canvas within its container */
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.2); /* Inner shadow for drawing area */
}

.paint-text-input {
    z-index: 100;
    background: white;
    border: 1px dashed black;
    padding: 2px;
    /* Font styles will be applied via JS for consistency with tool settings */
    position: absolute; /* Crucial for positioning over canvas parent */
    min-width: 50px;
    box-sizing: content-box; /* Ensures padding/border doesn't affect width/height calculations for positioning */
}

.game-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(to bottom, #87CEEB, #90EE90);
    overflow: hidden;
}

.game-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    border: 2px solid #333;
}

.player, .noob, .chicken, .shedletsky {
    position: absolute;
    z-index: 10;
}

.shedletsky-sword {
    position: absolute;
    z-index: 11;
    display: none; /* Hidden by default, shown when swinging */
    transform-origin: 50% 50%; /* For rotation animation */
    transition: transform 0.1s ease-out; /* Smooth but quick transition for attack animation */
}

/* New style for Gubby's gun */
.gubby-gun {
    position: absolute;
    z-index: 12;
    display: none; /* Hidden by default */
    transform-origin: 0% 50%; /* Origin for aiming */
    transition: opacity 0.1s ease-in-out; /* Smooth fade in/out */
    pointer-events: none; /* Do not block mouse events */
}

.player {
    width: 40px;
    height: 40px;
}

.noob {
    width: 35px;
    height: 35px;
}

.chicken {
    width: 20px;
    height: 20px;
    z-index: 5;
}

.health-bar {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: red;
    border: 1px solid black;
}

.health-fill {
    height: 100%;
    background: green;
    transition: width 0.3s;
}

.stamina-bar {
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 3px;
    background: orange;
    border: 1px solid black;
}

.stamina-fill {
    height: 100%;
    background: blue;
    transition: width 0.3s;
}

.game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
}

.controls-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    max-width: 280px;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.controls-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.controls-overlay h4 {
    margin: 0 0 4px 0;
    font-size: 12px;
}

.controls-overlay p {
    margin: 2px 0;
    font-size: 10px;
}

.controls-overlay button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 2px 6px;
    margin-top: 4px;
    font-size: 9px;
    cursor: pointer;
    border-radius: 2px;
}

.chat-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    max-height: 100px;
    overflow-y: auto;
}

.chat-input {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

.damage-text {
    position: absolute;
    color: red;
    font-weight: bold;
    font-size: 14px;
    z-index: 20;
    animation: damageFloat 1s ease-out forwards;
}

@keyframes damageFloat {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

.download-progress {
    background: #4CAF50;
    height: 4px;
    width: 0%;
    transition: width 0.3s;
    margin-top: 5px;
}

.downloaded {
    background: #e0f7fa;
    border: 1px solid #4CAF50;
}

.app-status {
    font-size: 11px;
    color: #4CAF50;
    margin-top: 5px;
}

.compass-noob {
    width: 35px;
    height: 35px;
    position: absolute;
    filter: brightness(0.3) hue-rotate(180deg);
    z-index: 12;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* Added styles for generic iframes in windows for better appearance */
.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white; /* Ensure background if iframe content doesn't load */
}

/* Added styles for calculator buttons for a more Windows XP feel */
.calculator button {
    padding: 8px;
    font-size: 16px;
    background: #c0c0c0; /* Standard button color */
    border: 2px outset #c0c0c0; /* Standard button border */
    cursor: pointer;
    font-weight: bold;
    color: black;
}

.calculator button:active {
    border: 2px inset #c0c0c0; /* Pressed state */
}