/* --- 1. VARIABLES --- */
:root {
    /* Background Base: Strawberry Milk Pink */
    --bg-color: #ffcfdc; 
    
    /* Main Accent: Hot Magenta (Used for Add & Decide buttons) */
    --main-accent: #ff007f;
    
    /* Secondary Accent: Sky Blue (Used for Stop button & Accents) */
    --sec-accent: #29b6f6;
    
    /* Header/Box Backgrounds: Floral White (Soft on eyes) */
    --highlight: #fffaf0;
    --light: #fffaf0;
    
    /* Text/Borders: Soft Black */
    --dark: #2d2d2d;
    
    /* Misc */
    --money: #00b894;
    --border-width: 3px;
    --shadow: 5px;
}

/* --- 2. RESET & BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    color: var(--dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
    z-index: 1; 
}

/* --- WALLPAPER LAYERS --- */

/* Layer -2: The Hello Kitty Image (Back) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background-image: url('assets/hello_kitty.svg'); 
    background-size: 80px; /* Less aggressive tiling */
    background-repeat: repeat;
}

/* Layer -1: The Pink Overlay (Middle) */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background-color: var(--bg-color);
    opacity: 0.85; /* Makes the kitties subtle */
}

/* --- 3. UI COMPONENTS --- */

.hard-box {
    background: var(--light);
    border: var(--border-width) solid var(--dark);
    box-shadow: var(--shadow) var(--shadow) 0px var(--dark);
    position: relative;
    border-radius: 12px; 
}

/* Buttons */
.btn {
    cursor: pointer;
    font-family: inherit;
    font-weight: 900;
    text-transform: uppercase;
    border: var(--border-width) solid var(--dark);
    box-shadow: 4px 4px 0px var(--dark);
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--light);
    transition: all 0.1s ease;
    user-select: none;
    touch-action: manipulation;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--dark);
    border-radius: 8px;
}

.btn:active {
    box-shadow: 0px 0px 0px var(--dark);
    transform: translate(4px, 4px); 
}

/* Disabled State */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ddd !important;
    color: #888 !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Button Colors */
.btn-primary { 
    background-color: var(--main-accent); 
    color: white; 
}

/* The DECIDE Button (Matches Add Button) */
.btn-action { 
    background-color: var(--main-accent); 
    color: white; 
    width: 100%; 
    font-size: 1.5rem; 
    letter-spacing: 1px;
}

/* The STOP Button (Sky Blue) */
.btn-stop {
    background-color: var(--sec-accent);
    color: white;
}

/* Inputs */
input {
    width: 100%;
    padding: 1rem;
    font-family: inherit;
    font-size: 16px; 
    border: var(--border-width) solid var(--dark);
    background: #fff;
    outline: none;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: inset 3px 3px 0px rgba(0,0,0,0.05);
}

input:focus { background: white; border-color: var(--main-accent); }

/* --- 4. LAYOUT --- */
.container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.header {
    background: var(--highlight);
    padding: 2rem;
    text-align: center;
    border: var(--border-width) dashed var(--dark);
}

.header h1 { 
    font-size: clamp(2rem, 8vw, 3.5rem); 
    line-height: 0.9; 
    text-transform: uppercase; 
    font-weight: 900; 
    margin-bottom: 0.5rem;
    color: var(--main-accent);
    text-shadow: 2px 2px 0px var(--dark);
}

.subtitle { font-weight: bold; font-size: 0.9rem; letter-spacing: 1px; }

.help-btn {
    position: absolute; top: 10px; right: 10px;
    width: 35px; height: 35px;
    background: var(--light);
    border: var(--border-width) solid var(--dark);
    font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--dark);
    border-radius: 50%;
    color: var(--main-accent);
}
.help-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0px var(--dark); }

.input-zone { padding: 1.5rem; }
.input-zone h2 { margin-bottom: 1rem; font-size: 1.2rem; text-transform: uppercase; color: var(--main-accent); }
.input-group { display: flex; gap: 10px; flex-wrap: wrap; }
.input-group input { margin-bottom: 0; flex-grow: 1; }

.clear-link-container { margin-top: 1rem; text-align: right; }
.clear-link { text-decoration: underline; cursor: pointer; font-size: 0.8rem; font-weight: bold; color: var(--dark); }
.clear-link:hover { color: var(--main-accent); }

.list-zone {
    min-height: 150px;
    padding: 1.5rem;
    display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px;
    background-color: #fff0f5; 
}
#emptyMsg { opacity: 0.5; width: 100%; text-align: center; align-self: center; }

.item-tag {
    background: var(--dark);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.3s, transform 0.3s;
    border: 2px solid var(--dark);
    border-radius: 20px;
}
.item-tag.deleting { opacity: 0; transform: scale(0.8); }

.delete-x { cursor: pointer; color: var(--sec-accent); padding: 5px; margin-right: -5px; }
.delete-x:hover { color: var(--main-accent); }

.donate-zone {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1.5rem; text-align: center; background: #e4e4e4; 
}
.credit-line { font-size: 0.75rem; margin-top: 0.5rem; }
.credit-line a { color: inherit; font-weight: bold; text-decoration: underline; }
.donate-buttons { display: flex; gap: 1rem; width: 100%; margin-top: 0.5rem; }
.btn-donate { font-size: 0.9rem; flex: 1; color: white; }
.paypal-btn { background-color: #0070BA; }
.stripe-btn { background-color: #635bff; }

/* --- 5. OVERLAYS --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 192, 203, 0.9);
    display: none;
    justify-content: center; align-items: center; flex-direction: column;
    z-index: 999; padding: 20px;
}

.modal-box {
    background: var(--light);
    padding: 2rem;
    border: 4px solid var(--dark);
    box-shadow: 10px 10px 0px var(--main-accent);
    max-width: 500px; width: 100%;
    text-align: left;
    border-radius: 12px;
}

.modal-box h2 { 
    text-transform: uppercase; margin-bottom: 1rem; font-size: 2rem; 
    border-bottom: 3px solid var(--dark); padding-bottom: 10px;
    color: var(--main-accent);
}
.modal-box ul { list-style: none; }
.modal-box li { margin-bottom: 1rem; font-size: 1.1rem; font-weight: bold; }

.winner-box {
    background: var(--sec-accent);
    padding: 2rem;
    font-size: clamp(2rem, 10vw, 4rem);
    font-weight: 900;
    text-transform: uppercase; text-align: center;
    border: 4px solid var(--light);
    box-shadow: 10px 10px 0px var(--main-accent);
    word-break: break-word;
    max-width: 100%;
    color: var(--dark);
    border-radius: 12px;
}

.result-actions {
    display: flex; justify-content: center; gap: 1rem; width: 100%; max-width: 400px; margin-top: 2rem;
}
.result-actions .btn { flex: 1; margin-top: 0; max-width: none; }

.close-btn { margin-top: 2rem; background: var(--light); width: 100%; max-width: 300px;}

@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@media (min-width: 768px) {
    .container { display: grid; grid-template-columns: 1fr 1fr; }
    .header, .action-zone, .donate-zone { grid-column: span 2; }
    .input-zone { grid-column: span 1; }
    .list-zone { grid-column: span 1; }
}