:root {
    --bg: #0f1117;
    --card: #14151b;
    --card-glass: rgba(20, 21, 27, 0.7);
    --text: #fff;
    --muted: #9aa0a6;
    --accent: #4effff;
    --accent-glow: rgba(78, 255, 255, 0.4);
    --danger: #ff4d4d;
    --success: #00ff88;
    --warning: #ffcc00;
    --shadow: 0 12px 40px rgba(0, 0, 0, .6);
    --type-normal: #a8a878; --type-fire: #f08030; --type-water: #6890f0; 
    --type-grass: #78c850; --type-electric: #f8d030; --type-ice: #98d8d8; 
    --type-fighting: #c03028; --type-poison: #a040a0; --type-ground: #e0c068; 
    --type-flying: #a890f0; --type-psychic: #f85888; --type-bug: #a8b820; 
    --type-rock: #b8a038; --type-ghost: #705898; --type-dragon: #7038f8; 
    --type-dark: #705848; --type-steel: #b8b8d0; --type-fairy: #ee99ac;
}

.tpj-wrapper * {
    box-sizing: border-box;
}

.tpj-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 100px);
    background: linear-gradient(180deg, #12141c, #0a0b0f);
    color: var(--text);
    font-family: 'Poppins', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.admin-bar .tpj-wrapper {
    /* min-height: calc(100vh - 32px); */
}

.tpj-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.95) translateY(20px);
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.title {
    font-weight: 800;
    font-size: 2rem;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 6px;
    z-index: 2;
    letter-spacing: 1px;
}

.subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
    z-index: 2;
}

.center-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 100%;
    padding: 20px 0;
}

#team-flex-container {
    justify-content: flex-start;
    padding-top: 40px;
}

.instruction-badge {
    background: rgba(78, 255, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    box-shadow: 0 0 15px var(--accent-glow);
    backdrop-filter: blur(5px);
    z-index: 2;
}

.btn {
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .12);
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
    letter-spacing: 1px;
}

.btn:active:not(:disabled) {
    transform: scale(0.96);
}

.btn.primary {
    background: linear-gradient(135deg, rgba(78, 255, 255, 0.15), rgba(78, 255, 255, 0.05));
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(78, 255, 255, 0.15);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pokeball-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    z-index: 2;
}

.pokeball-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pokeball {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    z-index: 2;
    object-fit: contain;
}

.pokeball-pedestal {
    position: absolute;
    bottom: -10px;
    width: 60px;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 10px 10px 40px 10px;
    z-index: 2;
}

.pokemon-card {
    background: var(--card-glass);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.pokemon-card:nth-child(2) { animation-delay: 0.2s; }
.pokemon-card:nth-child(3) { animation-delay: 0.4s; }

.pokemon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--type-color) 50%, transparent 100%);
}

.card-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.nature-badge {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid rgba(255,255,255,0.05);
}

.level-badge {
    background: var(--type-color);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 0 10px var(--type-color);
}

.sprite-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.sprite-glow {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: var(--type-color);
    filter: blur(30px);
    opacity: 0.3;
    animation: pulseGlow 2s infinite alternate;
}

.sprite-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.6));
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

.pkmn-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pkmn-type {
    color: var(--type-color);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.stats-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-row {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-label {
    width: 45px;
    color: var(--muted);
    text-transform: uppercase;
}

.stat-val {
    width: 35px;
    text-align: right;
    margin-right: 10px;
    font-family: monospace;
    font-size: 0.9rem;
}

.stat-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(120%);
    opacity: 0;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulseGlow { 0% { opacity: 0.2; transform: scale(0.9); } 100% { opacity: 0.5; transform: scale(1.1); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.8) translateY(30px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes shakeRapid { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(-4px, 2px) rotate(-10deg); } 50% { transform: translate(4px, -2px) rotate(10deg); } 75% { transform: translate(-4px, -2px) rotate(-10deg); } }

.anim-shake-rapid { animation: shakeRapid 0.4s infinite; }

@media (min-width: 768px) {
    .tpj-wrapper {
        border-radius: 0;
        background: radial-gradient(circle at center, #1a1d27 0%, #0a0b0f 100%);
    }
    
    .title { font-size: 3.5rem; margin-bottom: 15px; }
    .subtitle { font-size: 1.2rem; max-width: 800px; margin-bottom: 40px; }
    
    #team-flex-container {
        justify-content: center;
        padding-top: 0;
    }

    .pokeball-container { gap: 60px; margin: 60px 0; }
    .pokeball-wrapper { width: 120px; height: 120px; }
    .pokeball-pedestal { width: 90px; bottom: -15px; }

    .team-grid { grid-template-columns: repeat(3, 1fr); gap: 30px; }
    .pokemon-card { padding: 30px; }
    .sprite-wrap { width: 180px; height: 180px; margin-bottom: 20px; }
    .pkmn-name { font-size: 1.8rem; }
    .stats-container { padding: 20px; gap: 12px; }
    .stat-row { font-size: 0.9rem; }
    .stat-label { width: 50px; }
    .stat-val { width: 40px; font-size: 1rem; }
    .stat-bar-bg { height: 8px; }
}

@media (max-width: 767px) {
    #toast-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
}
.rewards-section {
    width: 100%;
    max-width: 1200px;
    z-index: 2;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
    animation-delay: 0.6s; /* Delays animation so it pops in after the 3 Pokémon */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 40px 10px;
}

.rewards-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 15px;
}

.reward-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 180px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, border-color 0.3s;
}

.reward-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.reward-card img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.reward-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.reward-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    letter-spacing: 0.5px;
}

.reward-qty {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 800;
}