* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', Consolas, monospace;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.main-menu,
.pause-menu,
.game-over,
.shop-menu,
.achievements-menu,
.settings-menu,
.reward-offer,
.forced-ad,
.ammo-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(20, 5, 5, 0.97) 0%, rgba(5, 5, 20, 0.97) 100%);
    z-index: 1000;
}
.menu-content {
    text-align: center;
    padding: 30px;
    max-width: 600px;
    width: 90%;
}
.game-title {
    font-size: 3rem;
    color: #ff3333;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    margin-bottom: 10px;
    letter-spacing: 5px;
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000; }
    50% { text-shadow: 0 0 30px #ff0000, 0 0 60px #ff0000, 0 0 80px #ff0000; }
}
h2 {
    font-size: 1.8rem;
    color: #ff4444;
    text-shadow: 0 0 15px #ff0000;
    margin-bottom: 20px;
    letter-spacing: 3px;
}
h3 {
    font-size: 0.9rem;
    color: #888;
    margin: 15px 0 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
}
.records-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.3);
    border-radius: 5px;
}
.record-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.record-label {
    font-size: 0.8rem;
    color: #999;
}
.record-value {
    font-size: 1.5rem;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.5);
    font-weight: bold;
}
.btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin: 6px 0;
    font-family: inherit;
    font-size: 1rem;
    color: #ff6666;
    background: transparent;
    border: 2px solid #ff3333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.btn:hover {
    background: #ff3333;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
}
.btn-primary {
    background: rgba(255, 50, 50, 0.2);
    border-width: 3px;
}
.btn-cancel {
    border-color: #666;
    color: #888;
}
.btn-cancel:hover {
    background: #666;
    color: #000;
}
.btn-revive {
    background: #ffcc00 !important;
    border-color: #ffaa00 !important;
    color: #000 !important;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-revive:hover {
    background: #ffdd33 !important;
    box-shadow: 0 0 25px rgba(255, 200, 0, 0.6);
}
.ad-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #000;
    color: #ffcc00;
    border-radius: 50%;
    font-size: 12px;
}
.controls-info {
    margin-top: 25px;
    color: #444;
    line-height: 1.5;
    font-size: 0.8rem;
}
.controls-info span {
    color: #ff6666;
    font-weight: bold;
}
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}
.hud-top-left {
    position: absolute;
    top: 10px;
    left: 10px;
}
.hud-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    text-align: right;
}
.hud-bottom-left {
    position: absolute;
    bottom: 10px;
    left: 10px;
}
.hud-bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
}
.health-bar {
    width: 160px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff3333;
    position: relative;
}
.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff4444);
    transition: width 0.2s ease;
}
.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}
.armor-display {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #4488ff;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
}
.wave-info {
    color: #fff;
    text-shadow: 2px 2px 4px #000;
    font-size: 12px;
}
.wave-number {
    display: block;
    font-size: 2rem;
    color: #ff4444;
    font-weight: bold;
    line-height: 1;
}
.enemies-count {
    color: #aaa;
    font-size: 12px;
    margin-top: 5px;
    text-shadow: 1px 1px 2px #000;
}
.weapon-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    border-radius: 4px;
}
.weapon-icon {
    font-size: 1.8rem;
}
.weapon-text {
    text-align: left;
}
.weapon-name {
    display: block;
    color: #aaa;
    font-size: 11px;
}
.ammo {
    display: block;
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}
.inventory-slots {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}
.inv-slot {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}
.inv-slot.has-item {
    border-color: #ff6666;
    color: #fff;
    font-size: 14px;
}
.inv-slot.active {
    border-color: #ffcc00;
    box-shadow: 0 0 8px #ffcc00;
}
.coins-display {
    color: #ffcc00;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px #000;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
}
.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff0000;
}
.crosshair-line {
    position: absolute;
    background: rgba(255, 0, 0, 0.9);
    box-shadow: 0 0 4px #ff0000;
}
.crosshair-line.top {
    width: 2px;
    height: 8px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}
.crosshair-line.bottom {
    width: 2px;
    height: 8px;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}
.crosshair-line.left {
    width: 8px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}
.crosshair-line.right {
    width: 8px;
    height: 2px;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}
.damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(255, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}
.damage-overlay.show {
    opacity: 1;
}
.wave-announce {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    color: #ff3333;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.wave-announce.show {
    opacity: 1;
    animation: wave-pulse 0.4s ease-in-out infinite alternate;
}
@keyframes wave-pulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.1); }
}
.click-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 500;
    cursor: pointer;
}
.click-prompt p {
    font-size: 1.4rem;
    color: #ff6666;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.shop-content {
    max-height: 85vh;
    overflow-y: auto;
}
.shop-coins {
    font-size: 1.3rem;
    color: #ffcc00;
    margin-bottom: 15px;
}
.shop-section {
    margin-bottom: 15px;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
@media (min-width: 700px) {
    .shop-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
.shop-item {
    padding: 8px 4px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid #444;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.shop-item:hover:not(.disabled) {
    border-color: #ff6666;
    background: rgba(80, 40, 40, 0.9);
    transform: scale(1.02);
}
.shop-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.shop-item.ad-item {
    border-color: #aaaa00;
}
.shop-item.ad-item:hover {
    border-color: #ffff00;
    background: rgba(80, 80, 20, 0.9);
}
.item-icon {
    font-size: 1.6rem;
}
.item-name {
    color: #ccc;
    font-size: 0.65rem;
    line-height: 1.1;
}
.item-price {
    color: #ffcc00;
    font-size: 0.7rem;
    font-weight: bold;
}
.ad-progress {
    width: 100%;
    height: 14px;
    background: #222;
    border-radius: 2px;
    position: relative;
    margin-top: 3px;
}
.ad-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffaa00, #ffcc00);
    border-radius: 2px;
    transition: width 0.3s;
}
.ad-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
    text-shadow: 1px 1px 1px #000;
}
.ammo-dialog .dialog-content {
    background: rgba(30, 30, 30, 0.98);
    padding: 25px;
    border: 2px solid #ff6666;
    border-radius: 8px;
    max-width: 300px;
}
.ammo-dialog h3 {
    color: #ff6666;
    margin-bottom: 10px;
}
.ammo-dialog p {
    color: #aaa;
    margin-bottom: 15px;
}
.setting-item {
    margin: 20px 0;
    text-align: left;
}
.setting-item label {
    display: block;
    color: #aaa;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}
.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border-radius: 50%;
    cursor: pointer;
}
.setting-item span {
    display: block;
    text-align: right;
    color: #ff6666;
    margin-top: 5px;
    font-size: 0.9rem;
}
.language-selector {
    margin-bottom: 15px;
}
.lang-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.lang-btn {
    flex: 1;
    padding: 12px 15px;
    font-size: 1rem;
    background: rgba(60, 60, 60, 0.9);
    border: 2px solid #555;
    border-radius: 5px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}
.lang-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: #888;
}
.lang-btn.active {
    background: rgba(100, 50, 50, 0.9);
    border-color: #ff4444;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.3);
}
.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 55vh;
    overflow-y: auto;
    margin-bottom: 15px;
}
.achievement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid #333;
    border-radius: 4px;
    text-align: left;
}
.achievement-item.unlocked {
    border-color: #4a4;
    background: rgba(40, 60, 40, 0.9);
}
.achievement-item.locked {
    opacity: 0.6;
}
.ach-icon {
    font-size: 1.6rem;
}
.ach-info {
    flex: 1;
}
.ach-name {
    display: block;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
}
.ach-desc {
    display: block;
    color: #888;
    font-size: 0.75rem;
}
.ach-reward {
    display: block;
    color: #ffcc00;
    font-size: 0.7rem;
    margin-top: 2px;
}
.ach-status {
    font-size: 1.1rem;
    color: #4a4;
}
.achievement-item.locked .ach-status {
    color: #666;
}
.achievement-popup {
    position: fixed;
    top: 70px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffcc00;
    border-radius: 6px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.4s ease;
}
.achievement-popup.show {
    opacity: 1;
    transform: translateX(0);
}
.achievement-popup .achievement-icon {
    font-size: 1.6rem;
}
.achievement-popup .achievement-title {
    display: block;
    color: #ffcc00;
    font-weight: bold;
    font-size: 0.9rem;
}
.achievement-popup .achievement-desc {
    display: block;
    color: #88ff88;
    font-size: 0.8rem;
}
.notification-popup {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 25px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #88ff88;
    border-radius: 6px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}
.notification-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.notification-popup span {
    color: #88ff88;
    font-size: 1rem;
}
.forced-ad .reward-text {
    color: #ffcc00;
    font-size: 1.3rem;
    margin: 15px 0;
}
.stats {
    margin: 12px 0;
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.6;
}
.stats span {
    color: #ff6666;
    font-weight: bold;
}
.shop-content::-webkit-scrollbar,
.achievements-grid::-webkit-scrollbar {
    width: 5px;
}
.shop-content::-webkit-scrollbar-track,
.achievements-grid::-webkit-scrollbar-track {
    background: #222;
}
.shop-content::-webkit-scrollbar-thumb,
.achievements-grid::-webkit-scrollbar-thumb {
    background: #ff3333;
    border-radius: 3px;
}
@media (max-width: 600px) {
    .game-title {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.4rem;
    }
    .btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    .health-bar {
        width: 120px;
        height: 16px;
    }
    .wave-number {
        font-size: 1.5rem;
    }
    .weapon-icon {
        font-size: 1.4rem;
    }
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .inv-slot {
        width: 30px;
        height: 30px;
    }
}
