:root {
    --red: #cc0000;
    --red-dark: #8b0000;
    --dark: #1a1a1a;
    --darker: #0d0d0d;
    --light: #f5f5f5;
    --screen-bg: #98cb98;
    --screen-border: #5a8a5a;
    --yellow: #f8d030;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Press Start 2P', system-ui, sans-serif;
    background: var(--dark);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--light);
}

.pokedex {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--red);
    padding: 20px;
    box-shadow: inset 0 -8px 0 var(--red-dark);
}

.pokedex-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--red-dark);
}

.pokedex-light {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #7df9ff, #00bfff, #0080ff);
    border-radius: 50%;
    border: 4px solid var(--light);
    box-shadow:
        0 0 20px rgba(0, 191, 255, 0.6),
        inset 0 -5px 10px rgba(0, 0, 0, 0.3);
}

.pokedex-header h1 {
    font-size: 1.2rem;
    text-shadow: 2px 2px 0 var(--red-dark);
}

#app {
    flex: 1;
    background: var(--screen-bg);
    border: 8px solid var(--screen-border);
    border-radius: 10px;
    padding: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--dark);
    font-size: 0.8rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

/* Collection Grid */
.collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.collection-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--dark);
}

.collection-empty p {
    font-size: 0.7rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.collection-empty .hint {
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Mini Card (in grid) */
.mini-card {
    background: var(--light);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--dark);
    display: block;
}

.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mini-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: var(--screen-bg);
    display: block;
}

.mini-card-name {
    font-size: 0.5rem;
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-card-number {
    font-size: 0.45rem;
    text-align: center;
    color: #666;
    margin-top: 4px;
}

/* Full Entry Card */
.entry-card {
    max-width: 400px;
    margin: 0 auto;
}

.entry-card-image-container {
    background: var(--light);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
}

.entry-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.entry-card-info {
    background: var(--light);
    border-radius: 15px;
    padding: 15px;
    color: var(--dark);
}

.entry-card-number {
    font-size: 0.6rem;
    color: #666;
    margin-bottom: 8px;
}

.entry-card-name {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.entry-card-description {
    font-size: 0.6rem;
    line-height: 1.8;
    color: #444;
}

.entry-card-collected {
    font-size: 0.5rem;
    color: #888;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px dashed #ddd;
}

.entry-card-new {
    display: inline-block;
    background: var(--yellow);
    color: var(--dark);
    font-size: 0.5rem;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    animation: pulse 0.5s ease-in-out 3;
}

@keyframes pulse {
    50% { transform: scale(1.1); }
}

/* Back button */
.back-button {
    display: inline-block;
    background: var(--light);
    color: var(--dark);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.6rem;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.back-button:hover {
    background: var(--yellow);
}

/* Error state */
.error {
    text-align: center;
    padding: 40px 20px;
    color: var(--dark);
}

.error h2 {
    font-size: 1rem;
    margin-bottom: 15px;
}

.error p {
    font-size: 0.6rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--screen-border);
}

.stats-bar h2 {
    font-size: 0.7rem;
    color: var(--dark);
}

.stats-count {
    font-size: 0.6rem;
    color: var(--dark);
    background: var(--light);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Desktop: constrained card layout */
@media (min-width: 600px) {
    body {
        background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
        padding: 20px;
        align-items: flex-start;
    }

    .pokedex {
        flex: none;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        border-radius: 20px;
        box-shadow:
            inset 0 -8px 0 var(--red-dark),
            0 10px 30px rgba(0, 0, 0, 0.5);
    }
}
