:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --radius: 0.5rem;
}
.dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
}

/* ===== Login Screen ===== */
#login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444 0%, #ef4444 50%, #f8fafc 50%, #f8fafc 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 380px;
    margin: 1rem;
    padding: 2.5rem 2rem 2rem;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow:
        0 0 0 4px #1e293b,
        0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Pokeball icon */
.pokeball-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 4px #1e293b, 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pokeball-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #ef4444;
}

.pokeball-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #f8fafc;
}

.pokeball-band {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #1e293b;
    transform: translateY(-50%);
    z-index: 1;
}

.pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: #f8fafc;
    border: 4px solid #1e293b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokeball-button {
    width: 10px;
    height: 10px;
    background: #f8fafc;
    border: 2px solid #1e293b;
    border-radius: 50%;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #1e293b;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1.75rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-button {
    margin-top: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: #ef4444;
    color: #fff;
    border: 3px solid #1e293b;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    box-shadow: 0 4px 0 #1e293b;
}

.login-button:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #1e293b;
}

.login-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1e293b;
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    padding: 0.6rem 0.75rem;
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}