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

body {
    background-color: #0e0e10;
    color: #efeff1;
    font-family: 'Press Start 2P', monospace;
    text-align: center;
    padding: 30px 20px;
    min-height: 100vh;
}

/* Wskaznik Live i Profil */
.live-status {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #18181b;
    border: 2px solid #303032;
    font-size: 10px;
    z-index: 1000;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.live-status.online {
    border-color: #00ff55;
    color: #00ff55;
}
.live-status.online .status-dot {
    background-color: #00ff55;
    box-shadow: 0 0 10px #00ff55;
    animation: pulse 1.5s infinite;
}

.live-status.offline {
    border-color: #ff4444;
    color: #adadb8;
}
.live-status.offline .status-dot {
    background-color: #ff4444;
    box-shadow: 0 0 6px #ff4444;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 85, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(0, 255, 85, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 85, 0); }
}

.auth-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.login-twitch-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #9146ff;
    color: #ffffff;
    text-decoration: none;
    font-size: 9px;
    border: 2px solid #772ce8;
    transition: 0.2s;
}

.login-twitch-btn:hover {
    background: #772ce8;
    transform: translateY(-2px);
}

.btn-twitch-icon {
    width: 14px;
    height: 14px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    background: #18181b;
    border: 2px solid #9146ff;
    color: #ffffff;
    text-decoration: none;
    font-size: 9px;
    transition: 0.2s;
}

.user-profile-btn:hover {
    background: #24242c;
    border-color: #ffcb05;
    transform: translateY(-2px);
}

.user-avatar-icon {
    width: 16px;
    height: 16px;
    color: #ffcb05;
}

.user-name {
    color: #ffcb05;
}

.page-wrapper {
    margin-top: 40px;
}

h1 { 
    color: #ffcb05; 
    text-shadow: 3px 3px #3b4cca; 
    font-size: 24px;
    margin: 15px 0;
}

.back-link { 
    color: #adadb8; 
    text-decoration: none; 
    font-size: 10px; 
    display: inline-block;
    margin-bottom: 10px;
}

.back-link:hover {
    color: #ffcb05;
}

.search-container {
    margin: 25px 0;
}

input[type="text"] {
    padding: 12px;
    font-size: 12px;
    font-family: 'Press Start 2P', monospace;
    border-radius: 6px;
    border: 2px solid #303032;
    background: #1f1f23;
    color: white;
    outline: none;
    width: 250px;
}

button {
    padding: 12px 18px;
    font-size: 12px;
    font-family: 'Press Start 2P', monospace;
    border-radius: 6px;
    border: none;
    background: #ffcb05;
    color: #2b2b2b;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    box-shadow: 0 4px 0 #c79c00;
}

button:hover { 
    background: #ffe169; 
    transform: translateY(-2px);
}

button:active {
    transform: translateY(2px);
    box-shadow: none;
}

#stats-info {
    font-size: 12px;
    color: #a0a0a0;
    margin-bottom: 25px;
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #18181b;
    border-radius: 8px;
    padding: 12px 8px;
    border: 3px solid #303032;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 203, 5, 0.2);
}

.card img {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
}

.not-caught {
    opacity: 0.25;
    filter: grayscale(100%);
}

.common { border-color: #a0a0a0; }
.uncommon { border-color: #1eff00; }
.rare { border-color: #0070dd; }
.rare_holo { border-color: #00d8d8; }
.ultra_rare { border-color: #a335ee; }
.secret { border-color: #ff8000; }

.pokemon-id {
    font-size: 9px;
    color: #adadb8;
}

.pokemon-name { 
    font-size: 9px; 
    font-weight: bold; 
    margin-top: 8px; 
    text-transform: capitalize; 
    line-height: 1.2;
}

/* Modal Pop-Up */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #18181b;
    border-radius: 12px;
    border: 4px solid #a0a0a0;
    padding: 25px 20px;
    max-width: 440px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 30px rgba(160, 160, 160, 0.35);
    text-align: center;
    animation: popIn 0.2s ease-out;
}

.modal-content.common { border-color: #a0a0a0; box-shadow: 0 0 30px rgba(160, 160, 160, 0.35); }
.modal-content.uncommon { border-color: #1eff00; box-shadow: 0 0 30px rgba(30, 255, 0, 0.35); }
.modal-content.rare { border-color: #0070dd; box-shadow: 0 0 30px rgba(0, 112, 221, 0.35); }
.modal-content.rare_holo { border-color: #00d8d8; box-shadow: 0 0 30px rgba(0, 216, 216, 0.35); }
.modal-content.ultra_rare { border-color: #a335ee; box-shadow: 0 0 30px rgba(163, 53, 238, 0.35); }
.modal-content.secret { border-color: #ff8000; box-shadow: 0 0 30px rgba(255, 128, 0, 0.35); }

.modal-content.common #modal-pokemon-name, .modal-content.common .owners-list-title { color: #a0a0a0; }
.modal-content.uncommon #modal-pokemon-name, .modal-content.uncommon .owners-list-title { color: #1eff00; }
.modal-content.rare #modal-pokemon-name, .modal-content.rare .owners-list-title { color: #0070dd; }
.modal-content.rare_holo #modal-pokemon-name, .modal-content.rare_holo .owners-list-title { color: #00d8d8; }
.modal-content.ultra_rare #modal-pokemon-name, .modal-content.ultra_rare .owners-list-title { color: #a335ee; }
.modal-content.secret #modal-pokemon-name, .modal-content.secret .owners-list-title { color: #ff8000; }

@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #adadb8;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover { color: #ff4d4d; }

.modal-img {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    margin: 10px auto 5px auto;
    display: block;
}

.modal-rarity-badge {
    font-size: 10px;
    font-weight: bold;
    margin: 6px auto 14px auto;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    background: #101012;
    border: 1px solid #303032;
    letter-spacing: 1px;
}

.modal-stats {
    font-size: 10px;
    line-height: 1.8;
    margin: 15px 0;
    color: #efeff1;
    text-align: left;
    background: #121214;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #2d2d31;
}

.owners-list-box {
    margin-top: 15px;
    text-align: left;
}

.owners-list-title {
    font-size: 10px;
    margin-bottom: 8px;
}

.owners-list {
    max-height: 140px;
    overflow-y: auto;
    font-size: 9px;
    line-height: 1.8;
    background: #0e0e10;
    border: 1px solid #303032;
    padding: 10px;
    border-radius: 6px;
}

.shiny-badge {
    color: #ffd700;
    text-shadow: 0 0 6px #ffaa00;
}

@media (max-width: 850px) {
    .live-status, .auth-box {
        position: static;
        margin-bottom: 15px;
    }
}