/* DUELHOUSE.IO - Battle UI Components */

/* Live Battle Viewer */
.live-battle-viewer {
    background: linear-gradient(135deg, rgba(22, 33, 62, 0.8), rgba(10, 10, 10, 0.9));
    border: 2px solid var(--neon-purple);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 50px rgba(189, 0, 255, 0.3),
        inset 0 0 50px rgba(189, 0, 255, 0.1);
}

.live-battle-viewer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-void);
    border-radius: 8px;
    opacity: 0.5;
    z-index: -1;
    animation: border-pulse 3s infinite;
}

@keyframes border-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.battle-stage {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.fighter {
    text-align: center;
    position: relative;
}

.fighter-avatar {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: fighter-idle 2s infinite ease-in-out;
}

.left-fighter .fighter-avatar {
    animation-delay: 0s;
}

.right-fighter .fighter-avatar {
    animation-delay: 1s;
    transform: scaleX(-1);
}

@keyframes fighter-idle {
    0%, 100% { transform: translateY(0) scaleX(1); }
    50% { transform: translateY(-10px) scaleX(1); }
}

.health-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gray-mech);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-fill {
    height: 100%;
    background: var(--gradient-fire);
    transition: width 0.5s ease;
    position: relative;
}

.health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: health-shine 2s infinite;
}

@keyframes health-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.health-fill.enemy {
    background: var(--gradient-ice);
}

.fighter-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-top: 0.5rem;
    color: var(--neon-yellow);
}

.versus-indicator {
    text-align: center;
}

.vs-text {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--neon-red);
    text-shadow: 
        0 0 20px var(--neon-red),
        0 0 40px var(--neon-red);
    animation: vs-pulse 1s infinite;
}

@keyframes vs-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.battle-timer {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--neon-green);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
}

.battle-info {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.battle-info span {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Action Panel */
.action-panel {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.action-btn {
    position: relative;
    padding: 1rem 3rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--anim-base);
}

.action-btn .btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-fire);
    clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
    transition: all var(--anim-base);
    z-index: -1;
}

.primary-action .btn-bg {
    background: var(--gradient-fire);
    box-shadow: 0 0 30px rgba(255, 8, 68, 0.5);
}

.secondary-action .btn-bg {
    background: var(--gradient-ice);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.tertiary-action .btn-bg {
    background: var(--gradient-poison);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.action-btn:hover .btn-bg {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.action-btn:hover {
    transform: scale(1.05);
}

.btn-content {
    position: relative;
    z-index: 1;
}

/* Battles Grid */
.battles-grid,
.tournament-zone,
.leaderboard-section,
.forge-section,
.game-modes,
.stats-dashboard {
    padding: 4rem 2rem;
}

.section-frame {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-display);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 3px;
}

.neon-text {
    background: linear-gradient(90deg, var(--neon-red), var(--neon-purple), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neon-shift 3s infinite;
}

@keyframes neon-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-chip {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray-mech);
    color: var(--light-steel);
    font-family: var(--font-display);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--anim-base);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--gradient-fire);
    color: #fff;
    border-color: var(--neon-red);
    transform: scale(1.05);
}

/* Battle Cards */
.battles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.battle-card {
    background: linear-gradient(135deg, rgba(62, 62, 78, 0.3), rgba(26, 26, 46, 0.5));
    border: 1px solid var(--gray-mech);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: all var(--anim-base);
    overflow: hidden;
}

.battle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-fire);
    transition: left var(--anim-slow);
}

.battle-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-red);
    box-shadow: 0 10px 30px rgba(255, 8, 68, 0.3);
}

.battle-card:hover::before {
    left: 0;
}

.battle-card.live {
    border-color: var(--neon-red);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 8, 68, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 8, 68, 0.6); }
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.battle-id {
    font-family: var(--font-mono);
    color: var(--neon-yellow);
    font-size: 0.9rem;
}

.live-indicator {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

.countdown {
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.combatants {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player {
    text-align: center;
}

.player-avatar {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.player-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: #fff;
}

.player-rank {
    display: block;
    font-size: 0.8rem;
    color: var(--neon-green);
}

.vs {
    font-size: 1.5rem;
    color: var(--neon-red);
}

.battle-stats {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.stat {
    font-size: 0.9rem;
}

.watch-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--gradient-ice);
    color: #fff;
    border: none;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all var(--anim-base);
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
}

.watch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
}

/* Tournament Zone */
.tournament-banner {
    background: linear-gradient(135deg, rgba(189, 0, 255, 0.2), rgba(255, 8, 68, 0.2));
    border: 2px solid var(--neon-purple);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tournament-name {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--neon-yellow);
}

.tournament-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.tournament-info span {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}

.tournament-timer {
    margin-top: 1rem;
}

.timer-label {
    display: block;
    font-size: 0.9rem;
    color: var(--light-steel);
    margin-bottom: 0.5rem;
}

.timer-display {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--neon-green);
}

.time-unit {
    display: inline-block;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--neon-green);
    border-radius: 4px;
}

.tournament-btn {
    padding: 1rem 2rem;
    background: var(--gradient-void);
    color: #fff;
    border: none;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 2px;
    cursor: pointer;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    transition: all var(--anim-base);
}

.tournament-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(189, 0, 255, 0.5);
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 2rem;
    background: transparent;
    border: 1px solid var(--gray-mech);
    color: var(--light-steel);
    font-family: var(--font-display);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--anim-base);
}

.tab-btn.active {
    background: var(--gradient-fire);
    color: #fff;
    border-color: var(--neon-red);
}

.leaderboard-table {
    background: rgba(26, 26, 46, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 150px;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: all var(--anim-base);
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table-row.header {
    background: rgba(0, 0, 0, 0.5);
    font-family: var(--font-display);
    letter-spacing: 1px;
    color: var(--neon-yellow);
}

.table-row.champion {
    background: linear-gradient(90deg, rgba(255, 214, 0, 0.1), transparent);
    border-left: 3px solid var(--neon-yellow);
}

.rank {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.player {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    font-size: 1.5rem;
}

.wins,
.ratio,
.earnings {
    text-align: center;
    font-family: var(--font-mono);
}

/* Game Modes */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.mode-card {
    background: linear-gradient(135deg, rgba(62, 62, 78, 0.5), rgba(26, 26, 46, 0.7));
    border: 2px solid var(--gray-mech);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--anim-base);
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--neon-purple), transparent);
    transform: translate(-50%, -50%);
    transition: all var(--anim-slow);
}

.mode-card:hover {
    transform: translateY(-10px);
    border-color: var(--neon-purple);
    box-shadow: 0 20px 40px rgba(189, 0, 255, 0.4);
}

.mode-card:hover::before {
    width: 300px;
    height: 300px;
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--neon-yellow);
}

.mode-desc {
    margin-bottom: 1rem;
    color: var(--light-steel);
}

.mode-rewards {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stats Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(189, 0, 255, 0.1));
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-ice);
    animation: stat-load 2s ease-out;
}

@keyframes stat-load {
    0% { width: 0; }
    100% { width: 100%; }
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--neon-green);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: var(--font-display);
    letter-spacing: 2px;
    color: var(--light-steel);
}

/* Footer */
.battle-footer {
    background: linear-gradient(to bottom, rgba(26, 26, 46, 0.9), var(--dark-void));
    border-top: 2px solid var(--neon-purple);
    padding: 3rem 2rem 1rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--neon-yellow);
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--light-steel);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: all var(--anim-base);
}

.footer-section a:hover {
    color: var(--neon-blue);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray-mech);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all var(--anim-base);
}

.social-link:hover {
    background: var(--gradient-fire);
    border-color: var(--neon-red);
    transform: scale(1.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light-steel);
}

/* Modal System */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal-overlay.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--dark-chrome), var(--dark-steel));
    border: 2px solid var(--neon-purple);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    z-index: 1001;
}

.modal.active {
    display: block;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--neon-red);
    font-size: 2rem;
    cursor: pointer;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--neon-yellow);
}