* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    overflow-x: hidden;
    min-height: 100vh;
}

.stripes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
            90deg,
            transparent,
            transparent 48px,
            rgba(0, 0, 0, 0.3) 48px,
            rgba(0, 0, 0, 0.3) 52px
    );
    pointer-events: none;
    z-index: 1;
}

.spiral {
    position: fixed;
    width: 400px;
    height: 400px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

.spiral:nth-child(1) { top: -200px; right: -200px; }
.spiral:nth-child(2) { bottom: -200px; left: -200px; animation-direction: reverse; }

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}

h1 {
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: bold;
    letter-spacing: clamp(3px, 1vw, 8px);
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
    0 0 40px rgba(138, 43, 226, 0.4),
    5px 5px 0px rgba(0, 0, 0, 0.8);
    animation: flicker 3s infinite alternate;
    transform: skewY(-2deg);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; text-shadow: 0 0 30px rgba(255, 255, 255, 0.7); }
}

.subtitle {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    color: #a0a0a0;
    margin-top: 15px;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    text-transform: uppercase;
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.card {
    background: rgba(20, 20, 20, 0.8);
    border: 3px solid #333;
    border-radius: 0;
    padding: 25px;
    position: relative;
    transform: skew(-1deg, 1deg);
    transition: all 0.3s ease;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: skew(-1deg, 1deg) translateY(-10px) scale(1.02);
    border-color: #8a2be2;
    box-shadow: 15px 15px 0 rgba(138, 43, 226, 0.3),
    0 0 30px rgba(138, 43, 226, 0.4);
}

.card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px dashed #555;
    pointer-events: none;
}

.card h3 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.card p {
    color: #b0b0b0;
    line-height: 1.6;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.eye {
    width: 80px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    margin: 20px 10px;
    animation: blink 4s infinite;
}

.eye::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: look 6s infinite;
}

@keyframes blink {
    0%, 96%, 100% { transform: scaleY(1); }
    98% { transform: scaleY(0.1); }
}

@keyframes look {
    0%, 100% { left: 50%; }
    25% { left: 60%; }
    75% { left: 40%; }
}

.button {
    display: inline-block;
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: 3px solid #8a2be2;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    position: relative;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 5px 5px 0 rgba(138, 43, 226, 0.5);
}

.button:hover,
.button:active {
    background: #8a2be2;
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 rgba(138, 43, 226, 0.7);
}

.moon {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.5),
    inset -20px 0 40px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    border-top: 3px dashed #444;
    background: rgba(0, 0, 0, 0.6);
}

footer p {
    color: #888;
    letter-spacing: 2px;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

nav {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 3px dashed #444;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav li {
    display: inline-block;
}

.big-button {
    display: inline-block;
    padding: 12px 20px;
    background: rgba(20, 20, 20, 0.9);
    color: #e8e8e8;
    border: 3px solid #333;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    font-weight: bold;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    font-family: 'Courier New', monospace;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
    transform: skew(-2deg);
}

.big-button::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px dashed #555;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.big-button:hover,
.big-button:active {
    background: rgba(40, 40, 40, 0.9);
    border-color: #8a2be2;
    transform: skew(-2deg) translateY(-5px);
    box-shadow: 8px 8px 0 rgba(138, 43, 226, 0.4),
    0 0 20px rgba(138, 43, 226, 0.3);
    color: #fff;
}
/* Delete Button - Ghost Style */
.delete-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;

    /* Default State: Ghostly/Transparent */
    background: transparent;
    color: rgba(255, 255, 255, 0.3); /* Faint text */
    border: 2px solid rgba(255, 255, 255, 0.3); /* Faint border ring */

    /* Shape & Font */
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    font-family: 'Courier New', monospace;
    font-weight: bold;

    /* Centering the X */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;

    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Spooky bouncy transition */
}

/* Hover State: Wakes up the ghost */
.delete-btn:hover {
    background: #8a0000; /* Deep Blood Red */
    color: #fff; /* White X */
    border-color: #fff; /* White border */

    transform: scale(1.1) rotate(90deg); /* Spins */
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6); /* Red Glow */
}
.big-button:hover::before,
.big-button:active::before {
    opacity: 1;
}

.big-button.active {
    background: #8a2be2;
    border-color: #8a2be2;
    color: #fff;
    box-shadow: 8px 8px 0 rgba(138, 43, 226, 0.6),
    0 0 30px rgba(138, 43, 226, 0.5);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.big-button.active::before {
    opacity: 1;
    border-color: #fff;
}

/* iPhone-specific optimizations */
@media screen and (max-width: 430px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 3px;
    }

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .card {
        padding: 20px;
    }

    .big-button {
        padding: 10px 18px;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    nav ul {
        gap: 10px;
    }

    .moon {
        width: 80px;
        height: 80px;
        top: 60px;
        right: 15px;
    }

    .spiral {
        width: 300px;
        height: 300px;
    }

    .spiral:nth-child(1) { top: -150px; right: -150px; }
    .spiral:nth-child(2) { bottom: -150px; left: -150px; }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .button,
    .big-button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Replace hover effects with active states for touch */
    .card:active {
        transform: skew(-1deg, 1deg) scale(0.98);
    }
}

a {
    text-decoration: none;
    color: inherit;
}.add-item-btn {
     position: absolute;
     /* This moves it nicely above the first card */
     top: -75px;
     left: 10px; /* Aligns slightly indented with the card */

     width: 60px;
     height: 60px;
     background: rgba(20, 20, 20, 0.9);
     border: 3px solid #8a2be2;
     color: #8a2be2;
     font-size: 2.5rem;
     line-height: 1;
     font-weight: bold;
     font-family: 'Courier New', monospace;
     cursor: pointer;
     z-index: 100;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.3s ease;
     box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
     transform: skew(-2deg);
 }

/* Hover effect stays the same */
.add-item-btn:hover {
    background: #8a2be2;
    color: #fff;
    transform: skew(-2deg) scale(1.1) rotate(90deg);
    box-shadow: 10px 10px 0 rgba(138, 43, 226, 0.6),
    0 0 30px rgba(138, 43, 226, 0.5);
}

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup Card - Burton Style */
.popup-card {
    background: rgba(20, 20, 20, 0.95);
    border: 3px solid #8a2be2;
    padding: 35px;
    position: relative;
    transform: skew(-1deg, 1deg);
    box-shadow: 15px 15px 0 rgba(138, 43, 226, 0.4),
    0 0 40px rgba(138, 43, 226, 0.5);
    max-width: 500px;
    width: 90%;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes popIn {
    from {
        transform: skew(-1deg, 1deg) scale(0.7);
        opacity: 0;
    }
    to {
        transform: skew(-1deg, 1deg) scale(1);
        opacity: 1;
    }
}

.popup-card::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 2px dashed #555;
    pointer-events: none;
}

/* Close Button */
.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #8a0000;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

.popup-close:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.8);
    background: #ff0000;
}

/* Popup Title */
.popup-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Form Styling */
.popup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.form-input {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #333;
    color: #e8e8e8;
    padding: 12px 15px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.form-input:focus {
    outline: none;
    border-color: #8a2be2;
    box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.3),
    0 0 15px rgba(138, 43, 226, 0.4);
}

.form-input::placeholder {
    color: #555;
}

/* Submit Button */
.popup-submit {
    display: inline-block;
    padding: 14px 30px;
    background: #000;
    color: #fff;
    border: 3px solid #8a2be2;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    position: relative;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 5px 5px 0 rgba(138, 43, 226, 0.5);
    cursor: pointer;
    width: 100%;
}

.popup-submit:hover {
    background: #8a2be2;
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 rgba(138, 43, 226, 0.7);
}


/* Mobile Optimizations */
@media screen and (max-width: 430px) {
    /* 1. Fix the Add Button Position */
    .add-item-btn {
        position: relative; /* Stop floating absolute */
        top: auto;          /* Reset top */
        left: auto;         /* Reset left */

        /* Center it and push cards down */
        margin: 0 auto 20px auto;

        /* Adjust size slightly for mobile touch */
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }

    /* 2. Ensure the grid layout doesn't break */
    .card-grid {
        display: flex;
        flex-direction: column;
        gap: 25px;
        margin-top: 10px; /* Small gap from the button */
    }

    .popup-card {
        padding: 25px;
        width: 95%;
    }

    .popup-title {
        font-size: 1.5rem;
    }
}