* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #1a1a2e;
    font-family: 'Courier New', monospace;
    color: #e6e6e6;
    padding: 50px 20px 20px; /* 100px top, 20px sides, 20px bottom */
}
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1300px;
    gap: 20px;
}

.site-footer {
    margin-top: 18px;
    padding: 10px 14px;
    border: 1px solid #555;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-footer a {
    color: #9ad1ff;
    text-decoration: none;
    font-size: 13px;
}

.site-footer a + a {
    border-left: 1px solid #6d7482;
    padding-left: 14px;
    margin-left: 2px;
}

.site-footer a:hover {
    color: #c8e7ff;
    text-decoration: underline;
}

.game-header {
    text-align: center;
    margin-bottom: 10px;
}

.game-header h1 {
    color: #ffcc00;
    font-size: 2.5rem;
    text-shadow: 2px 2px 0px #cc0000;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.game-header p {
    color: #aaa;
    margin-bottom: 10px;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.game-container {
    position: relative;
    overflow: hidden;
    background-color: #000;
    width: fit-content;
    height: fit-content;
    box-shadow: 0 0 20px rgba(172, 157, 87, 0.3);
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-color: #000;
}

.bottom-panel {
    display: flex;
    gap: 20px;
    
    justify-content: center;
}

.info-panel {
    background-color: #2d2d44;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #555;
    width: 100%;
    min-width: 750px;
    max-width: 900px;
}

.info-panel h3 {
    color: #ffcc00;
    margin-bottom: 10px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.info-panel p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    background-color: #252536;
    padding: 10px;
    border-radius: 5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    min-height: 24px;
    align-items: center;
}

.stat-label {
    color: #aaa;
    white-space: nowrap;
    margin-right: 10px;
}

.stat-value {
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    text-align: right;
    min-width: 80px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.zoom-buttons {
    display: flex;
    gap: 10px;
}

button {
    padding: 8px 15px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

button:hover {
    background-color: #555;
    transform: translateY(-1px);
}

button.active {
    background-color: #ffcc00;
    color: #000;
    font-weight: bold;
}

.ai-button {
    background-color: #0066cc;
}

.ai-button:hover {
    background-color: #0077ee;
}

.ai-button.active {
    background-color: #00aaff;
    color: #000;
}

.instructions {
    font-size: 0.9rem;
    color: #aaa;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

.bullet-info {
    color: #ff6666;
    font-weight: bold;
}

.cooldown-info {
    color: #ff9900;
    font-weight: bold;
}

.enemy-info {
    color: #ff4444;
    font-weight: bold;
}

.player-info {
    color: #44ff44;
    font-weight: bold;
}

.spawn-info {
    color: #66ccff;
    font-weight: bold;
}

.ai-info {
    color: #00aaff;
    font-weight: bold;
}

.ai-debug {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 10px;
    background-color: #333;
    padding: 5px;
    border-radius: 3px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-ready {
    background-color: #44ff44;
}

.status-active {
    background-color: #ffcc00;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.steel-info {
    color: #8888FF;
    font-weight: bold;
}

/* Add to your style.css file */

.game-area {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.game-container {
    flex: 1;
}

.right-controls {
    width: 110px;
    margin-top: 10px;
}

.zoom-controls-panel {
    background-color: rgba(30, 30, 30, 0.9);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
}

.zoom-header {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0px;
    text-align: center;
    padding-bottom: 8px;
}

.zoom-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0px;
}

.zoom-btn {
    padding: 8px 15px;
    background-color: #333;
    color: #fff;
    border: 2px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    text-align: center;
}

.zoom-btn:hover {
    background-color: #444;
    border-color: #666;
    transform: translateY(-2px);
}

.zoom-btn.active {
    background-color: #4CAF50;
    border-color: #66BB6A;
    color: white;
}

.zoom-description {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    padding-top: 8px;
    border-top: 1px solid #444;
}

#zoomSizeDisplay {
    color: #4CAF50;
    font-weight: bold;
}


/* Mobile Responsive Fixes */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100vw;
        padding: 0 10px;
    }
    
    .game-area {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    .game-container {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
        border: none !important;
        /* box-shadow removed to allow global shadow to apply */
        border-radius: 0 !important;
        order: 2; /* Game canvas goes second */
    }
    
    #gameCanvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }
    
    .right-controls {
        width: 100% !important;
        margin-top: 0 !important;
        order: 1; /* Controls go first */
        display: flex;
        justify-content: center;
        margin-bottom: 15px; /* Space between controls and game */
        position: relative;
        padding: 0 10px;
    }
    
    .zoom-controls-panel {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        background-color: rgba(30, 30, 30, 0.95);
        border: 2px solid #555;
        border-radius: 10px;
        padding: 12px 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    
    .zoom-header {
        font-size: 16px;
        margin-bottom: 8px;
        color: #ffcc00;
        text-align: center;
    }
    
    .zoom-buttons {
        display: flex;
        flex-direction: row !important; /* All buttons in one line */
        justify-content: space-between; /* Evenly distribute */
        align-items: center;
        gap: 8px; /* Small gap between buttons */
        width: 100%;
    }
    
    .zoom-btn {
        flex: 1; /* All buttons equal width */
        min-width: 0; /* Allow buttons to shrink */
        padding: 12px 8px;
        font-size: 15px;
        background-color: #333;
        border: 2px solid #666;
        border-radius: 6px;
        font-weight: bold;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .zoom-btn:hover {
        background-color: #444;
        transform: translateY(-2px);
    }
    
    /* Info panel adjustments */
    .info-panel {
        min-width: 100% !important;
        max-width: 100vw !important;
        padding: 12px !important;
        margin: 15px 0 0 0 !important;
        overflow-x: auto;
        order: 3;
    }
    
    .bottom-panel {
        display: block !important;
        margin-top: 15px;
    }
    
    .stats {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        font-size: 14px;
    }
    
    .stat-item {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .stat-label {
        font-size: 13px;
        margin-right: 5px;
    }
    
    .stat-value {
        min-width: 70px;
        font-size: 13px;
    }
    
    .game-header h1 {
        font-size: 1.8rem;
    }
    
    .main-content {
        gap: 15px;
        display: flex;
        flex-direction: column;
    }
}

/* For very small screens (under 480px) */
@media screen and (max-width: 480px) {
    .right-controls {
        margin-bottom: 10px;
        padding: 0 8px;
    }
    
    .zoom-controls-panel {
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    .zoom-header {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    .zoom-buttons {
        gap: 6px; /* Smaller gap on very small screens */
    }
    
    .zoom-btn {
        padding: 10px 6px;
        font-size: 14px;
        border-width: 1px;
    }
    
    body {
        padding: 5px;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    #gameCanvas {
        max-height: 70vh;
    }
}

/* For extra small screens (under 360px) */
@media screen and (max-width: 360px) {
    .zoom-btn {
        padding: 10px 4px;
        font-size: 13px;
    }
    
    .zoom-buttons {
        gap: 4px;
    }
    
    .zoom-controls-panel {
        padding: 8px 10px;
    }
}

/* For landscape mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .game-area {
        flex-direction: row !important;
        gap: 10px !important;
        align-items: flex-start;
    }
    
    .game-container {
        flex: 2;
        order: 1;
    }
    
    .right-controls {
        flex: 1;
        order: 2;
        margin-bottom: 0;
        margin-left: 10px;
        max-width: 150px;
        padding: 0;
    }
    
    .zoom-controls-panel {
        max-width: 100%;
    }
    
    .zoom-buttons {
        flex-direction: column !important; /* Stack vertically in landscape */
        gap: 8px;
    }
    
    .zoom-btn {
        width: 100%;
        min-height: 44px; /* Touch-friendly size */
        padding: 12px 8px;
    }
    
    #gameCanvas {
        max-height: 80vh;
    }
}

/* Mobile Gamepad - Gesture D-Pad */
.mobile-gamepad {
    display: none;
    width: 100%;
    max-width: 420px;
    margin: 10px auto 5px auto;
    padding: 12px;
    background-color: rgba(45, 45, 68, 0.92);
    border-radius: 14px;
    border: 2px solid #555;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    touch-action: manipulation;
}

.gamepad-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 12px;
    align-items: center;
    position: relative;
    min-height: 130px;
}

/* Gesture D-Pad Area */
.gesture-dpad-area {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gesture-dpad {
    position: relative;
    width: 140px;
    height: 140px;
    background-color: #222;
    border-radius: 20px;
    border: 2px solid #444;
}

.dpad-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: #333;
    border-radius: 12px;
    border: 2px solid #555;
    z-index: 2;
}

/* Direction Zones - Triangles */
.dpad-zone {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.1s;
    z-index: 1;
}

.dpad-zone.active {
    background-color: rgba(255, 204, 0, 0.4);
}

/* Up Zone */
.up-zone {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 40px solid rgba(255, 255, 255, 0.05);
}

.up-zone.active {
    border-bottom-color: rgba(255, 204, 0, 0.4);
}

/* Down Zone */
.down-zone {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-top: 40px solid rgba(255, 255, 255, 0.05);
}

.down-zone.active {
    border-top-color: rgba(255, 204, 0, 0.4);
}

/* Left Zone */
.left-zone {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 40px solid transparent;
    border-bottom: 40px solid transparent;
    border-right: 40px solid rgba(255, 255, 255, 0.05);
}

.left-zone.active {
    border-right-color: rgba(255, 204, 0, 0.4);
}

/* Right Zone */
.right-zone {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 40px solid transparent;
    border-bottom: 40px solid transparent;
    border-left: 40px solid rgba(255, 255, 255, 0.05);
}

.right-zone.active {
    border-left-color: rgba(255, 204, 0, 0.4);
}

/* Fire Button */
.action-area {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fire-btn {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid #cc0000;
    background: linear-gradient(145deg, #ff3333, #cc0000);
    color: white;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.08s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 0 #990000, 0 6px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fire-btn:active, .fire-btn.active {
    transform: scale(0.95);
    box-shadow: 0 1px 0 #990000, 0 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(145deg, #ff6666, #ff3333);
}

/* Pause Button */
.pause-area {
    grid-column: 1 / span 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #444;
    margin-top: 8px;
}

.pause-btn {
    padding: 10px 30px;
    background-color: #444;
    border: 2px solid #666;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.08s;
    min-width: 130px;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pause-btn:active, .pause-btn.active {
    background-color: #ffcc00;
    border-color: #ff9900;
    color: #000;
    transform: scale(0.95);
}

/* Show gamepad only on mobile */
@media screen and (max-width: 768px) {
    .mobile-gamepad {
        display: block;
        order: 3;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    .gesture-dpad {
        width: 120px;
        height: 120px;
    }
    
    .up-zone, .down-zone {
        border-left: 35px solid transparent;
        border-right: 35px solid transparent;
    }
    
    .up-zone {
        border-bottom: 35px solid rgba(255, 255, 255, 0.05);
    }
    
    .down-zone {
        border-top: 35px solid rgba(255, 255, 255, 0.05);
    }
    
    .left-zone, .right-zone {
        border-top: 35px solid transparent;
        border-bottom: 35px solid transparent;
    }
    
    .left-zone {
        border-right: 35px solid rgba(255, 255, 255, 0.05);
    }
    
    .right-zone {
        border-left: 35px solid rgba(255, 255, 255, 0.05);
    }
    
    .dpad-center {
        width: 40px;
        height: 40px;
    }
    
    .fire-btn {
        width: 65px;
        height: 65px;
        font-size: 14px;
    }
}

/* Landscape mode */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .gesture-dpad {
        width: 110px;
        height: 110px;
    }
    
    .up-zone, .down-zone {
        border-left: 30px solid transparent;
        border-right: 30px solid transparent;
    }
    
    .up-zone {
        border-bottom: 30px solid rgba(255, 255, 255, 0.05);
    }
    
    .down-zone {
        border-top: 30px solid rgba(255, 255, 255, 0.05);
    }
    
    .left-zone, .right-zone {
        border-top: 30px solid transparent;
        border-bottom: 30px solid transparent;
    }
    
    .left-zone {
        border-right: 30px solid rgba(255, 255, 255, 0.05);
    }
    
    .right-zone {
        border-left: 30px solid rgba(255, 255, 255, 0.05);
    }
    
    .dpad-center {
        width: 35px;
        height: 35px;
    }
}

/* Game Info Styles - Responsive version */
.game-info {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px;
    width: 140px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

/* Desktop layout (default) - vertical stack */
.player-info, .enemy-info {
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    min-width: 0;
}

.player-info:last-child, .enemy-info:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.info-title {
    color: #ff9900;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    font-size: 11px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #aaa;
    font-family: 'Courier New', monospace;
    flex: 1;
    min-width: 0;
}

.info-value {
    color: #fff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: right;
    min-width: 0;
    flex: 0 0 auto;
}

/* Color coding */
#p1Lives { color: #00ccff; }
#p2Lives { color: #ff4444; }
#p1Score, #p2Score { color: #00ff00; }
#tankRemains { color: #ff4444; }

/* Keep existing right-controls styling */
.right-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 140px;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .game-info {
        flex-direction: row; /* Horizontal layout on mobile */
        justify-content: space-between;
        width: 100%;
        max-width: 300px;
        margin: 10px auto 0;
    }
    
    .player-info, .enemy-info {
        flex: 1;
        padding: 0 8px;
        border-bottom: none;
        border-right: 1px solid #333;
        min-width: 0;
    }
    
    .player-info:last-child, .enemy-info:last-child {
        border-right: none;
    }
    
    .info-title {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .info-row {
        font-size: 10px;
    }
    
    .info-value {
        min-width: 35px;
    }
}

/* For very small mobile screens */
@media (max-width: 480px) {
    .game-info {
        padding: 6px;
        gap: 4px;
    }
    
    .player-info, .enemy-info {
        padding: 0 4px;
    }
    
    .info-title {
        font-size: 10px;
    }
    
    .info-row {
        font-size: 9px;
    }
    
    .info-value {
        min-width: 30px;
    }
}

