/* ============================================
   ANGRY NEIGHBOR: Tree Cutter & Pranks
   AAA Quality Styles - happystoner5420 Games
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Permanent+Marker&family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Arial, sans-serif;
    cursor: none;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

/* ============= MAIN MENU ============= */
#main-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.menu-bg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, 
        rgba(0,0,0,0.85) 0%, 
        rgba(20,5,0,0.9) 30%,
        rgba(50,10,0,0.85) 60%,
        rgba(0,0,0,0.95) 100%
    );
    z-index: 0;
}

.menu-bg-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(255,100,0,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(255,0,0,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255,150,0,0.1) 0%, transparent 40%);
    animation: menuPulse 4s ease-in-out infinite alternate;
}

@keyframes menuPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.menu-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.game-title {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 7rem;
    color: #ff4400;
    text-shadow: 
        0 0 20px rgba(255,68,0,0.8),
        0 0 40px rgba(255,68,0,0.5),
        0 0 80px rgba(255,68,0,0.3),
        4px 4px 0 #000,
        -2px -2px 0 #000;
    letter-spacing: 8px;
    animation: titleGlow 2s ease-in-out infinite alternate;
    margin-bottom: -10px;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(255,68,0,0.8), 0 0 40px rgba(255,68,0,0.5), 0 0 80px rgba(255,68,0,0.3), 4px 4px 0 #000; }
    100% { text-shadow: 0 0 30px rgba(255,100,0,1), 0 0 60px rgba(255,68,0,0.7), 0 0 120px rgba(255,68,0,0.5), 4px 4px 0 #000; }
}

.game-subtitle {
    font-family: 'Permanent Marker', cursive;
    font-size: 2.5rem;
    color: #ffaa00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 20px rgba(255,170,0,0.4);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.menu-tagline {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    color: #ff6644;
    text-shadow: 0 0 10px rgba(255,100,50,0.5);
    margin-bottom: 40px;
    font-style: italic;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 1.8rem;
    padding: 15px 60px;
    background: linear-gradient(180deg, #ff5500 0%, #cc2200 100%);
    color: #fff;
    border: 3px solid #ff7733;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.2s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    box-shadow: 0 4px 15px rgba(255,68,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    min-width: 350px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    transition: all 0.3s;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #ff7733 0%, #ff4400 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255,68,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: #ffaa55;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:active {
    transform: scale(0.98);
    background: linear-gradient(180deg, #cc3300 0%, #aa1100 100%);
}

.btn-icon {
    margin-right: 10px;
}

.menu-footer {
    position: absolute;
    bottom: 30px;
    font-family: 'Permanent Marker', cursive;
    font-size: 1rem;
    color: rgba(255,170,100,0.5);
    z-index: 1;
    letter-spacing: 2px;
}

/* ============= OVERLAY SCREENS ============= */
.overlay-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1001;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    backdrop-filter: blur(5px);
}

.overlay-content {
    text-align: center;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    background: linear-gradient(180deg, rgba(30,10,0,0.9) 0%, rgba(15,5,0,0.95) 100%);
    border: 2px solid rgba(255,100,0,0.3);
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(255,68,0,0.2);
}

.overlay-content::-webkit-scrollbar {
    width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}

.overlay-content::-webkit-scrollbar-thumb {
    background: rgba(255,100,0,0.5);
    border-radius: 4px;
}

.overlay-content h2 {
    font-family: 'Bangers', 'Impact', sans-serif;
    font-size: 3.5rem;
    color: #ff5500;
    text-shadow: 0 0 20px rgba(255,68,0,0.5), 3px 3px 0 #000;
    margin-bottom: 25px;
    letter-spacing: 4px;
}

/* ============= HOW TO PLAY ============= */
.instructions {
    text-align: left;
    margin-bottom: 30px;
}

.instruction-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,100,0,0.05);
    border-left: 3px solid #ff5500;
    border-radius: 0 8px 8px 0;
}

.instruction-group h3 {
    font-family: 'Bangers', sans-serif;
    font-size: 1.5rem;
    color: #ffaa00;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.instruction-group p {
    color: #ddd;
    font-size: 1rem;
    line-height: 1.8;
    padding-left: 10px;
}

.instruction-group b {
    color: #ff8844;
}

.prank-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 0;
}

.prank-list-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: block;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

/* ============= CREDITS ============= */
.credits-text {
    margin-bottom: 30px;
}

.credit-studio {
    font-family: 'Bangers', sans-serif;
    font-size: 2.5rem;
    color: #ffaa00;
    text-shadow: 0 0 20px rgba(255,170,0,0.5);
    margin-bottom: 5px;
}

.credit-line {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    color: #ff6644;
    margin-bottom: 10px;
    letter-spacing: 5px;
}

.credit-title {
    font-family: 'Bangers', sans-serif;
    font-size: 1.8rem;
    color: #ff5500;
    text-shadow: 0 0 10px rgba(255,68,0,0.4);
}

.credit-role {
    font-family: 'Permanent Marker', cursive;
    font-size: 1rem;
    color: #888;
    letter-spacing: 2px;
    margin-top: 5px;
}

.credit-name {
    font-family: 'Bangers', sans-serif;
    font-size: 1.4rem;
    color: #ffcc88;
}

.credit-special {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.1rem;
    color: #ff8844;
    font-style: italic;
    margin: 3px 0;
}

.credit-copy {
    font-size: 0.85rem;
    color: #666;
    margin: 3px 0;
}

/* ============= GAME HUD ============= */
#game-hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    pointer-events: none;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 25px;
}

#prank-progress {
    font-family: 'Bangers', sans-serif;
    font-size: 1.6rem;
    color: #ffcc00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255,200,0,0.3);
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,200,0,0.3);
}

#alert-level {
    text-align: center;
}

#alert-text {
    font-family: 'Bangers', sans-serif;
    font-size: 1.4rem;
    color: #00ff44;
    text-shadow: 0 0 10px rgba(0,255,68,0.5), 2px 2px 4px rgba(0,0,0,0.8);
    display: block;
    margin-bottom: 5px;
    letter-spacing: 2px;
    transition: color 0.3s;
}

#alert-text.warning {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255,170,0,0.5), 2px 2px 4px rgba(0,0,0,0.8);
}

#alert-text.danger {
    color: #ff2200;
    text-shadow: 0 0 15px rgba(255,34,0,0.8), 2px 2px 4px rgba(0,0,0,0.8);
    animation: dangerPulse 0.5s ease-in-out infinite alternate;
}

@keyframes dangerPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

#alert-bar {
    width: 200px;
    height: 8px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

#alert-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff44, #ffaa00, #ff2200);
    border-radius: 4px;
    transition: width 0.3s;
}

#lives-display {
    font-family: 'Bangers', sans-serif;
    font-size: 1.6rem;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255,68,68,0.3);
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,68,68,0.3);
}

#hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#inventory {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: min(100vw - 28px, 580px);
}

.inv-slot {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.2s;
    position: relative;
}

.inv-icon {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
    pointer-events: none;
}

.inv-slot.active {
    border-color: #ff5500;
    background: rgba(255,85,0,0.2);
    box-shadow: 0 0 15px rgba(255,85,0,0.4), inset 0 0 10px rgba(255,85,0,0.1);
    transform: scale(1.1);
}

.inv-slot.completed {
    opacity: 0.4;
    border-color: #00ff44;
}

.inv-slot.completed::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #00cc33;
    color: #fff;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.inv-slot.completed::after {
    content: '\2713';
}

#current-item-name {
    font-family: 'Bangers', sans-serif;
    font-size: 1.3rem;
    color: #ff8844;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-top: 8px;
    letter-spacing: 2px;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    font-family: monospace;
    font-weight: bold;
    pointer-events: none;
}

#interaction-prompt {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Bangers', sans-serif;
    font-size: 1.3rem;
    color: #ffcc00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255,200,0,0.3);
    background: rgba(0,0,0,0.6);
    padding: 8px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255,200,0,0.3);
    animation: promptBounce 1s ease-in-out infinite;
}

@keyframes promptBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

#message-display {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Bangers', sans-serif;
    font-size: 2rem;
    text-align: center;
    padding: 15px 40px;
    border-radius: 10px;
    animation: messageFade 2.5s forwards;
    white-space: nowrap;
}

@keyframes messageFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.msg-success {
    color: #00ff44;
    text-shadow: 0 0 20px rgba(0,255,68,0.5);
    background: rgba(0,50,0,0.7);
    border: 1px solid rgba(0,255,68,0.3);
}

.msg-warning {
    color: #ffaa00;
    text-shadow: 0 0 20px rgba(255,170,0,0.5);
    background: rgba(50,30,0,0.7);
    border: 1px solid rgba(255,170,0,0.3);
}

.msg-danger {
    color: #ff2200;
    text-shadow: 0 0 20px rgba(255,34,0,0.8);
    background: rgba(50,0,0,0.7);
    border: 1px solid rgba(255,34,0,0.3);
}

.msg-epic {
    color: #ff44ff;
    text-shadow: 0 0 20px rgba(255,68,255,0.8);
    background: rgba(50,0,50,0.7);
    border: 1px solid rgba(255,68,255,0.3);
}

/* ============= GAME OVER / WIN ============= */
.game-over-title {
    font-family: 'Bangers', sans-serif;
    font-size: 5rem !important;
    color: #ff2200 !important;
    text-shadow: 0 0 30px rgba(255,34,0,0.8), 0 0 60px rgba(255,34,0,0.4), 4px 4px 0 #000 !important;
    animation: gameOverShake 0.5s ease-in-out infinite;
}

@keyframes gameOverShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-1deg); }
    75% { transform: translateX(5px) rotate(1deg); }
}

.game-over-text {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem;
    color: #ff6644;
    margin: 20px 0 10px;
}

.game-over-subtext {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 30px;
}

.win-title {
    font-family: 'Bangers', sans-serif;
    font-size: 4rem !important;
    color: #ffcc00 !important;
    text-shadow: 0 0 30px rgba(255,200,0,0.8), 0 0 60px rgba(255,200,0,0.4), 4px 4px 0 #000 !important;
    animation: winGlow 1s ease-in-out infinite alternate;
}

@keyframes winGlow {
    0% { text-shadow: 0 0 30px rgba(255,200,0,0.8), 0 0 60px rgba(255,200,0,0.4), 4px 4px 0 #000; }
    100% { text-shadow: 0 0 50px rgba(255,200,0,1), 0 0 100px rgba(255,200,0,0.7), 4px 4px 0 #000; color: #ffdd44; }
}

.win-text {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem;
    color: #ffaa00;
    margin: 20px 0 10px;
}

.win-subtext {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 20px;
}

.win-stats {
    font-family: 'Bangers', sans-serif;
    font-size: 1.2rem;
    color: #ffcc88;
    margin-bottom: 25px;
    line-height: 2;
}

/* ============= CLICK TO START ============= */
#click-to-start {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 500;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.click-prompt h2 {
    font-family: 'Bangers', sans-serif;
    font-size: 3rem;
    color: #ff5500;
    text-shadow: 0 0 20px rgba(255,68,0,0.5), 3px 3px 0 #000;
    animation: clickPulse 1.5s ease-in-out infinite;
}

@keyframes clickPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.click-prompt p {
    color: #aaa;
    font-size: 1rem;
    margin-top: 15px;
    text-align: center;
}

/* ============= PAUSE MENU ============= */
#pause-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1002;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    backdrop-filter: blur(3px);
}

#pause-menu .overlay-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .game-title { font-size: 3.5rem; }
    .game-subtitle { font-size: 1.5rem; }
    .menu-btn { font-size: 1.3rem; padding: 12px 30px; min-width: 250px; }
    .inv-slot { width: 45px; height: 45px; font-size: 1.3rem; }
    .inv-icon { width: 30px; height: 30px; }
    .prank-list-icon { width: 24px; height: 24px; flex-basis: 24px; }
    #prank-progress, #lives-display { font-size: 1.2rem; padding: 5px 12px; }
}

/* ============= VIGNETTE EFFECT ============= */
#game-hud::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

/* ============= DAMAGE FLASH ============= */
.damage-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,0,0,0.3);
    z-index: 99;
    pointer-events: none;
    animation: flashOut 0.5s forwards;
}

@keyframes flashOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
