:root {
    /* Color Palette */
    --bg-dark: #0a0a1a;
    --bg-card: rgba(22, 33, 62, 0.6);
    --bg-card-hover: rgba(22, 33, 62, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --accent-primary: #00f5ff;
    --accent-gold: #ffd700;
    --accent-purple: #7b2ff7;
    --accent-red: #ff3366;
    --border-color: rgba(0, 245, 255, 0.2);
    
    /* Gradients */
    --gradient-bg: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
    --gradient-accent: linear-gradient(90deg, #00f5ff, #7b2ff7);
    
    /* Shadows & Effects */
    --glow: 0 0 15px rgba(0, 245, 255, 0.4);
    --glass-blur: blur(10px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
}

.site-footer {
    margin-top: 48px;
    padding: 24px 0 12px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.site-footer p + p {
    margin-top: 8px;
}

.site-footer a {
    color: var(--accent-primary);
    text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text-primary);
}

.site-footer-sources {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 12px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo .accent {
    color: var(--accent-primary);
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav a:hover, .nav a.active {
    color: var(--accent-primary);
    text-shadow: var(--glow);
}

/* Main Views */
.hidden {
    display: none !important;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Section */
.hero-search-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-search-section h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-search-section p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: var(--glass-blur);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 25px;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--accent-primary);
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.1);
}

.filter-roles {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: var(--glass-blur);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-primary);
    color: #000;
    box-shadow: var(--glow);
}

/* Heroes Grid */
.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: var(--glass-blur);
    position: relative;
    overflow: hidden;
}

.hero-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--glow);
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
}

.hero-card:hover .hero-avatar {
    border-color: var(--accent-primary);
}

.hero-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.hero-role {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}

/* Counter Detail View */
.back-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--accent-primary);
}

.counter-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.target-hero-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    gap: 30px;
}

.target-hero-panel img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.hero-profile {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.hero-splash {
    display: block;
    width: 100%;
    max-height: 330px;
    object-fit: cover;
    object-position: center 35%;
}

.hero-profile-body {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 28px;
}

.hero-profile-avatar {
    width: 132px;
    height: 132px;
    flex: none;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid var(--accent-primary);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-badge-difficulty {
    background: rgba(255, 215, 0, .2);
    color: var(--accent-gold);
}

.hero-source {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent-primary);
    font-size: .9rem;
}

.skin-gallery {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
}

.skin-gallery summary {
    color: var(--accent-gold);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.skin-card {
    overflow: hidden;
    background: rgba(0, 0, 0, .2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.skin-card img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.skin-card figcaption {
    padding: 8px 10px;
    font-size: .85rem;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.skill-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.skill-card img {
    width: 64px;
    height: 64px;
    flex: none;
    border-radius: 10px;
    object-fit: cover;
}

.skill-kind {
    color: var(--accent-primary);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.skill-card h3 {
    margin: 2px 0 8px;
    color: var(--accent-gold);
}

.skill-card p {
    color: var(--text-secondary);
    font-size: .92rem;
    line-height: 1.55;
}

.pending-analysis {
    color: var(--text-secondary);
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}

.target-hero-info h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.info-badge {
    background: rgba(255,51,102,0.2);
    color: var(--accent-red);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 10px;
}

.traits {
    margin-top: 15px;
    display: flex;
    gap: 30px;
}

.traits h4 {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.traits ul {
    list-style-type: none;
}

.traits li {
    position: relative;
    padding-left: 15px;
    font-size: 0.95rem;
}

.traits li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.section-title {
    font-size: 1.8rem;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.counter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
}

.counter-pick {
    width: 100%;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, transform .2s, background .2s;
}

.counter-pick:hover,
.counter-pick.selected {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.counter-title {
    display: flex;
    flex-direction: column;
}

.counter-title strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
}

.counter-title small {
    color: var(--text-secondary);
}

.counter-pick .counter-reason {
    display: block;
    margin-top: 12px;
}

.counter-action {
    margin-top: auto;
    padding-top: 14px;
    color: var(--accent-primary);
    font-weight: 700;
}

.analysis-note {
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.build-panel h3 {
    margin: 26px 0 14px;
    color: var(--accent-gold);
}

.build-panel h3 a {
    margin-left: 8px;
    color: var(--accent-primary);
    font-size: .8rem;
    font-weight: 500;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.recommend-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}

.recommend-card img {
    width: 58px;
    height: 58px;
    flex: none;
    border-radius: 9px;
    object-fit: contain;
}

.recommend-card h4 {
    color: var(--text-primary);
    line-height: 1.3;
}

.recommend-card p {
    margin-top: 4px;
    color: var(--accent-primary);
    font-size: .88rem;
}

.recommend-card small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.counter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.counter-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

.counter-title h3 {
    font-size: 1.4rem;
}

.counter-type {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 5px;
    display: inline-block;
}

.type-hard {
    background: rgba(255, 51, 102, 0.2);
    color: var(--accent-red);
}

.type-soft {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent-gold);
}

.counter-reason {
    font-size: 0.95rem;
    color: #d0d0e0;
}

/* Items List */
.items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 15px;
    flex: 1 1 calc(50% - 15px);
}

.item-card img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.item-info h4 {
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.item-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .recommend-grid {
        grid-template-columns: 1fr;
    }
    .hero-profile-body {
        flex-direction: column;
    }
    .skill-grid {
        grid-template-columns: 1fr;
    }
    .target-hero-panel {
        flex-direction: column;
        text-align: center;
    }
    .traits {
        flex-direction: column;
        gap: 15px;
    }
    .item-card {
        flex: 1 1 100%;
    }
}

/* ---------------- Phase 3 CSS ---------------- */
/* Light Mode */
body.light-mode {
    --bg-dark: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --accent-primary: #0077ff;
    --border-color: rgba(0, 119, 255, 0.3);
    --gradient-bg: linear-gradient(135deg, #f0f2f5 0%, #e0e5ec 50%, #d1d8e0 100%);
    --glow: 0 0 15px rgba(0, 119, 255, 0.3);
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.icon-btn:hover { transform: scale(1.1); }

/* Team Slots */
.team-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.slot {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: all 0.3s;
}
.slot:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--glow);
}
.slot.filled {
    border-style: solid;
    border-color: var(--accent-red);
    color: transparent;
}
