/* ==============================
   Gates (Boss) Page
   ============================== */
.gates-energy-bar {
    margin-bottom: 24px;
    position: relative;
    height: 4px;
}
.energy-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--cyan-400) 20%,
        var(--blue-400) 40%,
        var(--purple-400) 60%,
        var(--blue-400) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: energyFlow 3s linear infinite;
    border-radius: 2px;
    box-shadow: 0 0 20px var(--cyan-glow), 0 0 40px var(--blue-glow);
}

.gates-layout {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 24px;
    align-items: start;
}

/* Gate Pillars */
.gate-pillar {
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.gate-pillar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(34, 197, 94, 0.08) 0%,
        rgba(34, 197, 94, 0.02) 50%,
        rgba(34, 197, 94, 0.08) 100%
    );
    pointer-events: none;
}

.gate-rank {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: var(--text-secondary);
}

.gate-boss-name {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

/* Gate Center */
.gate-center {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Boss Card */
.boss-card {
    padding: 24px;
    text-align: center;
}
.boss-emoji-large {
    font-size: 4rem;
    margin-bottom: 12px;
    display: block;
}
.boss-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Gate Rank Badge ---- */
.gate-rank-badge {
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    display: inline-block;
}
.gate-rank-badge.e-rank { color: var(--green-400); border: 1px solid var(--green-400); }
.gate-rank-badge.d-rank { color: var(--blue-400); border: 1px solid var(--blue-400); }
.gate-rank-badge.c-rank { color: var(--gold-400); border: 1px solid var(--gold-400); }
.gate-rank-badge.b-rank { color: var(--orange-400); border: 1px solid var(--orange-400); }
.gate-rank-badge.a-rank { color: var(--red-400); border: 1px solid var(--red-400); }
.gate-rank-badge.s-rank { color: var(--purple-400); border: 1px solid var(--purple-400); }

/* ---- WAITING STATE ---- */
.gate-waiting {
    padding: 32px 16px;
    text-align: center;
}
.gate-waiting-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 16px;
    animation: spin 6s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.gate-waiting h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.gate-waiting-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.gate-waiting-countdown {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.gate-stats-mini {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ---- SPAWNED STATE (Acceptance Window) ---- */
.gate-spawn-alert {
    padding: 24px 16px;
    text-align: center;
    animation: fadeIn 0.6s ease;
}
.gate-spawn-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 12px 0;
    font-style: italic;
}
.gate-window-timer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 16px 0;
    padding: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
}
.gate-window-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--red-400);
    text-transform: uppercase;
}
.gate-window-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.gate-spawn-rewards {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--gold-400);
}
.gate-spawn-challenge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 12px 0 4px;
    padding: 10px;
    background: rgba(124, 58, 237, 0.08);
    border-left: 3px solid var(--purple-400);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    text-align: left;
}
.gate-spawn-days {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.gate-accept-btn {
    font-size: 1rem;
    padding: 14px 32px;
    letter-spacing: 2px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 8px var(--purple-glow); }
    50% { box-shadow: 0 0 24px var(--purple-glow), 0 0 40px var(--blue-glow); }
}

/* ---- IN PROGRESS STATE ---- */
.boss-days {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
}
.boss-day {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(20, 25, 40, 0.6);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: border-color var(--transition-fast);
}
.boss-day.done {
    border-color: var(--green-500);
    background: rgba(34, 197, 94, 0.06);
}
.boss-day.current {
    border-color: var(--blue-400);
    background: rgba(74, 158, 255, 0.06);
}
.boss-day-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-glow);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
    color: transparent;
    flex-shrink: 0;
}
.boss-day-checkbox.checked {
    background: var(--green-500);
    border-color: var(--green-500);
    color: #000;
}
.boss-day-checkbox:hover:not(.checked) {
    border-color: var(--green-400);
    background: rgba(34, 197, 94, 0.15);
}
.boss-day-label {
    font-size: 0.9rem;
}

.boss-progress {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.boss-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(74, 158, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.boss-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-500), var(--cyan-400));
    border-radius: 4px;
    transition: width var(--transition-slow);
}
.boss-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.boss-losses {
    font-size: 0.85rem;
    color: var(--red-400);
    margin-top: 8px;
}

/* Gate Action Buttons */
.gate-action-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--red-400);
    color: var(--red-400);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}
.btn-ghost {
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}
.btn-ghost:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* ---- VICTORY STATE ---- */
.gate-victory {
    padding: 32px 16px;
    text-align: center;
}
.gate-victory h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold-400);
    margin: 12px 0 8px;
    letter-spacing: 2px;
}
.gate-victory p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Boss System Panel */
.boss-system {
    padding: 20px;
}
.boss-sys-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}
.boss-sys-warning {
    color: var(--gold-400);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.boss-sys-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.6;
}
.boss-sys-rewards {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}
.boss-sys-rewards h4 {
    color: var(--gold-400);
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.boss-sys-reward-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.boss-sys-history {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}
.boss-sys-history h4 {
    font-size: 0.8rem;
    color: var(--purple-400);
    margin-bottom: 6px;
}

/* Gate Color Variants */
.gate-pillar.e-rank { border-color: var(--green-500); }
.gate-pillar.e-rank::before { background: linear-gradient(180deg, rgba(34,197,94,0.08), transparent, rgba(34,197,94,0.08)); }

.gate-pillar.d-rank { border-color: var(--blue-400); }
.gate-pillar.d-rank::before { background: linear-gradient(180deg, rgba(74,158,255,0.08), transparent, rgba(74,158,255,0.08)); }

.gate-pillar.c-rank { border-color: var(--gold-400); }

.gate-pillar.b-rank { border-color: var(--orange-400); }

.gate-pillar.a-rank { border-color: var(--red-400); }

.gate-pillar.s-rank { border-color: var(--purple-400); }

@media (max-width: 900px) {
    .gates-layout {
        grid-template-columns: 1fr;
    }
    .gate-pillar {
        min-height: 120px;
        flex-direction: row;
    }
}
