/* --- GLOBAL STYLES --- */
body {
    background-color: #0a0a0a;
    color: #eeeeee;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background: #111;
    border-bottom: 2px solid #333;
    padding: 15px 0;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* --- THE MAIN POKEDEX FRAME --- */
#trainer-card {
    max-width: 1000px; /* Wide layout */
    margin: 40px auto;
    background: #151515;
    border: 3px solid #333;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

#trainer-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    color: #51ff00;
    margin: 0;
}

.subtitle {
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 2px;
}

.pokemon-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: #aaa; /* Subtle grey so it doesn't distract from stats */
    margin-bottom: 10px;
    padding-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Keeps long names like "Corvisquire" from breaking the card */
}

/* Optional: Make the name glow if it's a Shiny */
.shiny-card .pokemon-name {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}
/* --- SEARCH & SORT BAR --- */
.controls-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#pokemon-filter, #sort-order, #username-input {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    border-radius: 8px;
}

#pokemon-filter { flex-grow: 1; }

/* --- STORAGE GRID --- */
#pokemon-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* --- THE RECTANGULAR POKEMON CARD --- */
.pokemon-card {
    background: linear-gradient(145deg, #1e1e1e, #111);
    border: 2px solid #333;
    border-radius: 12px; /* Rectangular with rounded corners */
    padding: 15px;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.pokemon-card:hover {
    transform: translateY(-5px);
    border-color: #51ff00;
}

.pokemon-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* --- THE STAT BOX --- */
.stats-box {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #222;
    border-radius: 6px;
    padding: 10px 5px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    margin: 5px 0;
    padding: 0 8px;
}

.stat-label { color: #777; }
.stat-value { color: #fff; }

.perfect-stat {
    color: #51ff00 !important;
    text-shadow: 0 0 5px rgba(81, 255, 0, 0.5);
}

/* --- RELEASE BUTTON --- */
.release-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-weight: bold;
    display: none; /* Controlled by JS .is-owner */
}

.is-owner .release-btn { display: block; }

.release-btn:hover { background: #ff0000; }

/* --- SPECIAL CARD STYLES --- */
.shiny-card {
    border-color: #ffd700;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1);
}

.divider { border: 0; border-top: 1px solid #333; margin: 20px 0; }

#user-display {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #51ff00;
}

/* --- TRAINER STATS BAR --- */
.trainer-stats-bar {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(81, 255, 0, 0.1);
}

.stat-item {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
}

.stat-item .label {
    display: block;
    font-size: 0.5rem;
    color: #666;
    margin-bottom: 8px;
}

.stat-item .value {
    font-size: 1.1rem;
    color: #51ff00;
    text-shadow: 0 0 10px rgba(81, 255, 0, 0.5);
}

/* Ensure the layout doesn't break on mobile */
@media (max-width: 600px) {
    .trainer-stats-bar {
        flex-direction: column;
        gap: 15px;
    }
}

/* --- HEADER & NAVIGATION --- */
.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* --- TWITCH LOGIN BUTTON --- */
#login-btn {
    background-color: #9146FF; /* Twitch Purple */
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 #6441a5; /* Darker purple bottom border */
}

#login-btn:hover {
    background-color: #a970ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(145, 70, 255, 0.4);
}

#login-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #6441a5;
}

/* --- TRAINER SEARCH UNIT --- */
.search-trainer {
    display: flex;
    gap: 0; /* Merges input and button */
}

#username-input {
    background: #000;
    border: 2px solid #333;
    border-right: none; /* Connects to button */
    color: #51ff00;
    padding: 10px 15px;
    border-radius: 8px 0 0 8px;
    font-family: 'Segoe UI', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

#username-input:focus {
    border-color: #51ff00;
}

.search-trainer button {
    background: #51ff00;
    color: #000;
    border: 2px solid #51ff00;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.search-trainer button:hover {
    background: #000;
    color: #51ff00;
}

/* --- USER DISPLAY (Logged In State) --- */
#user-display {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: #51ff00;
    background: rgba(81, 255, 0, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px hide #51ff00;
    text-shadow: 0 0 8px rgba(81, 255, 0, 0.5);
}

#trainer-display-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.4rem; /* Slightly smaller to fit the full line */
    color: #777; /* Grey label color */
    margin: 0;
}

#trainer-name {
    color: #51ff00; /* Neon green for the actual name */
    text-shadow: 0 0 10px rgba(81, 255, 0, 0.5);
}

.favorites-container {
    background: rgba(81, 255, 0, 0.05);
    border: 1px solid #222;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.favorites-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #51ff00;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.favorites-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* The Star Button Base Styling */
.fav-btn {
    position: absolute;
    top: -2px;      /* Moved from bottom to top */
    left: 4px;     /* Moved from right to left */
    background: none;
    border: none;
    color: #444; 
    font-size: 1.8rem; 
    cursor: pointer;
    display: none; 
    z-index: 10;
    transition: all 0.2s ease; 
}

/* Hover effect */
.fav-btn:hover {
    color: #ffd700;
    transform: scale(1.2);
}

/* NEW: The Active (Favorited) State */
.fav-btn.active {
    color: #ffd700; /* Solid Yellow */
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6); /* Golden glow */
}

/* ONLY display the button if the user is the owner */
.is-owner .fav-btn { 
    display: block; 
}

.is-owner .fav-btn { display: block; }
.fav-btn.active { color: #ffd700; text-shadow: 0 0 5px gold; }

.fav-slot {
    width: 110px;      /* Made slightly wider */
    min-height: 130px; /* Made taller to fit text */
    background: #111;
    border: 2px solid #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    transition: all 0.3s ease;
    position: relative;
}

.fav-slot:hover {
    border-color: #51ff00;
    box-shadow: 0 0 15px rgba(81, 255, 0, 0.2);
}

.fav-slot img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 8px 0; /* Adds breathing room around the sprite */
}

/* New text styles for the mini-cards */
.fav-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #aaa;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if the name is too long */
}

.fav-stats {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    color: #888;
    background: #222;
    padding: 4px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Optional: Make Shiny names pop */
.shiny-text {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
}

/* Shrink the star slightly inside the top bar so it doesn't block the name */
.fav-slot .fav-btn {
    font-size: 1.2rem;
    top: 2px;
    left: 0px;
}

/* --- CUSTOM MODAL STYLES --- */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Dims the rest of the site */
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 9999; /* Ensures it stays on top of everything */
}

.modal-overlay.hidden { 
    display: none; 
}

.modal-box {
    background: #111; 
    border: 2px solid #51ff00; 
    border-radius: 8px;
    padding: 30px; 
    text-align: center; 
    font-family: 'Press Start 2P', cursive;
    box-shadow: 0 0 20px rgba(81, 255, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.modal-box p { 
    color: #fff; 
    font-size: 0.7rem; 
    line-height: 1.6; 
    margin-bottom: 25px; 
}

.modal-buttons { 
    display: flex; 
    justify-content: space-around; 
}

.neon-btn {
    background: #222; 
    color: #51ff00; 
    border: 1px solid #51ff00;
    padding: 12px 20px; 
    font-family: 'Press Start 2P', cursive; 
    font-size: 0.7rem;
    cursor: pointer; 
    transition: 0.2s;
}

.neon-btn:hover { 
    background: #51ff00; 
    color: #000; 
}

.red-btn { 
    color: #ff3333; 
    border-color: #ff3333; 
}

.red-btn:hover { 
    background: #ff3333; 
    color: #000; 
}

/* --- SLOT SELECTOR STYLES --- */
.slot-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.slot-btn {
    flex: 1; /* Makes all 4 buttons stretch equally */
    padding: 15px 0;
    font-size: 1rem;
}

/* --- POKEDEX DETAIL MODAL & FLIP ANIMATION --- */
.detail-card-container {
    perspective: 1000px; /* Gives the flip a 3D depth effect */
    width: 90%;
    max-width: 380px;
}

.detail-card-inner {
    background: #111;
    border: 3px solid #51ff00;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 40px rgba(81, 255, 0, 0.4);
    position: relative;
    
    /* The Animation starting state */
    transform-style: preserve-3d;
    transform: rotateY(-90deg) scale(0.5); 
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Creates a bouncy spring effect */
}

/* When we add this class via JS, it springs forward */
.detail-card-inner.show {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #444;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: #ff3333;
    transform: scale(1.2);
}

#detail-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    margin-top: -10px;
}

.dex-entry {
    color: #aaa;
    font-size: 0.75rem;
    line-height: 1.6;
    background: #222;
    padding: 15px;
    border-radius: 8px;
    font-style: italic;
    font-family: sans-serif; /* Standard font makes paragraphs easier to read */
    border-left: 4px solid #51ff00;
    text-align: left;
}

/* --- POKEMON TYPE BUBBLES --- */
.type-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: -5px;
    margin-bottom: 15px;
}

.type-bubble {
    padding: 4px 10px;
    border-radius: 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Official Type Colors */
.type-normal { background-color: #A8A77A; }
.type-fire { background-color: #EE8130; }
.type-water { background-color: #6390F0; }
.type-electric { background-color: #F7D02C; }
.type-grass { background-color: #7AC74C; }
.type-ice { background-color: #96D9D6; }
.type-fighting { background-color: #C22E28; }
.type-poison { background-color: #A33EA1; }
.type-ground { background-color: #E2BF65; }
.type-flying { background-color: #A98FF3; }
.type-psychic { background-color: #F95587; }
.type-bug { background-color: #A6B91A; }
.type-rock { background-color: #B6A136; }
.type-ghost { background-color: #735797; }
.type-dragon { background-color: #6F35FC; }
.type-dark { background-color: #705848; }
.type-steel { background-color: #B7B7CE; }
.type-fairy { background-color: #D685AD; }

/* --- INFO DRAWER --- */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #0a0a0a;
    border-left: 2px solid #51ff00;
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.drawer.hidden {
    transform: translateX(100%); /* Hides it off-screen to the right */
}

.drawer-content {
    padding: 30px;
    font-family: 'Press Start 2P', cursive;
}

.info-section h3 {
    font-size: 0.7rem;
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-top: 30px;
}

.command-list {
    list-style: none;
    padding: 0;
    font-size: 0.55rem;
    line-height: 2;
}

.command-list span {
    color: #51ff00;
}

.streamer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.streamer-link a {
    color: #9146ff; /* Twitch Purple */
    text-decoration: none;
    font-size: 0.65rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #51ff00;
    border-radius: 50%;
    box-shadow: 0 0 5px #51ff00;
}

/* Floating Action Button */
.info-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #111;
    border: 2px solid #51ff00;
    color: #51ff00;
    border-radius: 50%;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 15px rgba(81, 255, 0, 0.3);
    transition: 0.2s;
}

.info-fab:hover {
    transform: scale(1.1);
    background: #51ff00;
    color: #000;
}

/* --- SHINY CARD HOLOGRAPHIC EFFECT --- */
.shiny-card {
    position: relative;
    overflow: hidden; /* Keeps the shine inside the card boundaries */
    border: 2px solid #ffd700 !important; /* Golden border for shinies */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* The Animated Shine Beam */
.shiny-card::after {
    content: "";
    position: absolute;
    top: -150%;
    left: -150%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.1) 48%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 52%,
        rgba(255, 255, 255, 0) 55%
    );
    transform: rotate(20deg);
    animation: holo-sheen 4s infinite blur; /* Slow, elegant shimmer */
    pointer-events: none; /* Allows clicks to pass through to the card */
}

@keyframes holo-sheen {
    0% { transform: translate(-20%, -20%) rotate(20deg); }
    20% { transform: translate(20%, 20%) rotate(20deg); }
    100% { transform: translate(20%, 20%) rotate(20deg); } /* Pause at the end for a loop effect */
}

/* Optional: Make the star button on Shinies glow extra bright */
.shiny-card .fav-btn.active {
    filter: drop-shadow(0 0 5px #fff);
    color: #fff !important;
}

/* --- SHINY EXPANDED VIEW --- */

/* Changes the border and glow to Golden Yellow */
.detail-card-inner.is-shiny {
    border-color: #ffd700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
}

/* Optional: Make the Name and Stats text yellow to match */
.detail-card-inner.is-shiny .pokemon-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Optional: Make the Close button (X) yellow too */
.detail-card-inner.is-shiny .close-btn:hover {
    color: #ffd700;
}

/* --- REFINED HOLO SHEEN --- */

.detail-card-inner {
    position: relative;
    overflow: hidden; /* This MUST be here to clip the beam */
    z-index: 1; /* Sets a base layer */
}

/* The Light Beam Layer */
.detail-card-inner::after {
    content: "";
    position: absolute;
    top: -150%;
    left: -150%;
    width: 400%; /* Wider beam for faster sweep */
    height: 400%;
    
    /* Stronger, more visible gradient */
    background: linear-gradient(
        135deg, 
        transparent 45%, 
        rgba(255, 255, 255, 0.1) 48%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.1) 52%, 
        transparent 55%
    );
    
    transform: rotate(25deg);
    pointer-events: none;
    z-index: 99; /* FORCE TO THE FRONT: Sits on top of the image and text */
    opacity: 0;
}

/* Trigger the sweep when the card flips open */
.detail-card-inner.show::after {
    animation: holo-sweep 1.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 0.5s; /* Wait for the 3D flip to finish */
}

@keyframes holo-sweep {
    0% {
        transform: translate(-20%, -20%) rotate(25deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate(30%, 30%) rotate(25deg);
        opacity: 0;
    }
}

/* SHINY VERSION: Golden Sheen */
.detail-card-inner.is-shiny::after {
    background: linear-gradient(
        135deg, 
        transparent 45%, 
        rgba(255, 215, 0, 0.2) 48%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(255, 215, 0, 0.2) 52%, 
        transparent 55%
    );
}

/* --- SYSTEM BUTTONS --- */
.neon-btn {
    background: transparent;
    border: 2px solid #51ff00;
    color: #51ff00;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 4px;
}

.neon-btn:hover {
    background: #51ff00;
    color: #000;
    box-shadow: 0 0 15px #51ff00;
}

/* Red version for "destructive" or "repair" actions if you prefer */
#repair-btn {
    border-color: #ff3333;
    color: #ff3333;
}

#repair-btn:hover {
    background: #ff3333;
    color: #fff;
    box-shadow: 0 0 15px #ff3333;
}

/* --- BATTLE SLOT HIGHLIGHT (SLOT 1) --- */

.fav-slot:first-child { 
    border: 2px solid #ff4b4b !important;
    box-shadow: 0 0 12px rgba(255, 75, 75, 0.4), inset 0 0 15px rgba(255, 75, 75, 0.1);
    position: relative;
    overflow: visible !important; /* CRITICAL: Allows the banner to break out of the top */
    transform: translateY(-2px);
}

/* 2. Create the "BATTLE SLOT" tab ABOVE the box */
.fav-slot:first-child::before {
    content: "BATTLE SLOT";
    position: absolute;
    top: -10px; /* Pushes the banner completely up and out of the box */
    left: -2px; /* Shifts left slightly to cover the 2px red border */
    width: calc(100% + 4px); /* Stretches to cover both left and right borders */
    background-color: #ff4b4b;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    letter-spacing: 1px;
    z-index: 10;
    border-radius: 4px 4px 0 0; /* Rounds the top corners so it looks like a sleek tab */
}

/* Make sure to DELETE any .fav-slot:first-child img rules you had so the sprite stays put! */

/* --- TAB SYSTEM --- */
.tab-container {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    margin: 15px 0;
}

.tab-btn {
    background: transparent;
    color: #555;
    border: 1px solid #333;
    padding: 8px 5px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    cursor: pointer;
    flex: 1;
    transition: 0.2s;
}

.tab-btn.active {
    color: #ff4b4b; /* Your Battle Slot Red */
    border-color: #ff4b4b;
    background: rgba(255, 75, 75, 0.1);
}

.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #51ff00; /* Neon Green */
    text-align: center;
    margin: 20px 0;
}

/* --- VISIBILITY LOGIC --- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- ITEM GRIDS --- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding-bottom: 50px;
}

.item-card {
    background: #111;
    border: 1px solid #333;
    padding: 15px;
    text-align: center;
    border-radius: 4px;
}

.item-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.15));
}
.item-name { font-size: 0.6rem; color: #fff; margin-bottom: 5px; font-weight: bold;}
.item-price { color: #ffd700; font-size: 0.6rem; margin-bottom: 10px; }
.item-desc { font-size: 0.5rem; color: #888; margin-bottom: 15px; line-height: 1.4; }

.buy-btn, .use-btn {
    width: 100%;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    padding: 8px 0;
    cursor: pointer;
    border: none;
}

.buy-btn { background: #28a745; color: white; }
.use-btn { background: #007bff; color: white; }

/* --- ITEM GRIDS --- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
    gap: 20px;
    padding: 20px 0 50px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1000px;
}

.item-card {
    background: #0d0d0d;
    border: 2px solid #2a2a2a;
    padding: 24px 16px 20px;
    text-align: center;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

/* Subtle scanline texture to match the retro aesthetic */
.item-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.012) 3px,
        rgba(255,255,255,0.012) 4px
    );
    pointer-events: none;
}

.item-card:hover {
    border-color: #51ff00;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(81, 255, 0, 0.15);
}

.item-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.15));
}

.item-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: #ffffff;
    letter-spacing: 1px;
    line-height: 1.6;
}

.item-price {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    letter-spacing: 1px;
}

.item-desc {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.78rem;
    color: #999;
    line-height: 1.6;
    flex-grow: 1;
    padding: 0 4px;
}

.buy-btn {
    width: 100%;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 10px 0;
    cursor: pointer;
    border: 2px solid #51ff00;
    background: transparent;
    color: #51ff00;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    margin-top: 4px;
}

.buy-btn:hover {
    background: #51ff00;
    color: #000;
    box-shadow: 0 0 12px rgba(81, 255, 0, 0.4);
}

.use-btn {
    width: 100%;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 10px 0;
    cursor: pointer;
    border: 2px solid #4da8ff;
    background: transparent;
    color: #4da8ff;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    margin-top: 4px;
}

.use-btn:hover {
    background: #4da8ff;
    color: #000;
    box-shadow: 0 0 12px rgba(77, 168, 255, 0.4);
}
