/* ==================== HUB STYLE - MODERN UI ====================
   Interface style Brawl Stars / .io games
   Design propre, moderne et intuitif
   ============================================================== */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hub-container {
    width: 100vw;
    height: 100vh;
    /* Background transparent pour laisser voir le canvas 3D */
    background: transparent;
    position: relative;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
}

/* ==================== TOP BAR ==================== */
.hub-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    padding-top: env(safe-area-inset-top, 0);
    z-index: 1000;
}

.hub-logo {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    letter-spacing: 3px;
}

.hub-player-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.hub-gold-display,
.hub-level-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 255, 136, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.hub-gold-display .icon,
.hub-level-display .icon {
    font-size: 24px;
}

.hub-gold-display .value,
.hub-level-display .value {
    font-size: 20px;
    font-weight: 700;
    color: #00ff88;
}

.hub-username {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 255, 136, 0.1);
    padding: 10px 25px;
    border-radius: 25px;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

/* ==================== CENTER CHARACTER ==================== */
.hub-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hub-character-container {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.hub-character {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.6);
    animation: floatCharacter 3s ease-in-out infinite;
}

@keyframes floatCharacter {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hub-player-name-edit {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 30px;
    border-radius: 30px;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.hub-player-name-edit input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    text-align: center;
    min-width: 200px;
    outline: none;
}

.hub-player-name-edit input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== NAVIGATION BUTTONS ==================== */
.hub-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0 40px;
    z-index: 1000;
}

.hub-nav-btn {
    flex: 1;
    max-width: 200px;
    height: 90px;
    background: rgba(0, 255, 136, 0.1);
    border: 3px solid #00ff88;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hub-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
    transition: left 0.5s ease;
}

.hub-nav-btn:hover::before {
    left: 100%;
}

.hub-nav-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.2);
}

.hub-nav-btn.active {
    background: rgba(0, 255, 136, 0.3);
    border-width: 4px;
}

.hub-nav-btn .icon {
    font-size: 36px;
}

.hub-nav-btn .label {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.hub-nav-btn.play-btn {
    max-width: 250px;
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    border-color: #00ffff;
    color: #000;
}

.hub-nav-btn.play-btn .icon {
    font-size: 48px;
}

.hub-nav-btn.play-btn .label {
    font-size: 20px;
    color: #000;
}

.hub-nav-btn.play-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 255, 255, 0.6);
}

/* ==================== SIDE PANELS ==================== */
.hub-panel {
    position: absolute;
    top: 80px;
    bottom: 140px;
    width: 400px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 255, 136, 0.3);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
    overflow-y: auto;
}

.hub-panel.left {
    left: 0;
    border-left: none;
}

.hub-panel.right {
    right: 0;
    border-right: none;
    transform: translateX(100%);
}

.hub-panel.active {
    transform: translateX(0);
}

.hub-panel-header {
    padding: 30px;
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
}

.hub-panel-title {
    font-size: 28px;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 10px;
}

.hub-panel-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.hub-panel-content {
    padding: 20px;
}

/* ==================== GAME MODES ==================== */
.hub-mode-card {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hub-mode-card:hover {
    background: rgba(0, 255, 136, 0.1);
    transform: translateX(10px);
    border-color: #00ff88;
}

.hub-mode-card.selected {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    border-width: 3px;
}

.hub-mode-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.hub-mode-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.hub-mode-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.hub-mode-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.hub-mode-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== STATS GRID ==================== */
.hub-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.hub-stat-card {
    background: rgba(0, 255, 136, 0.05);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.hub-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 5px;
}

.hub-stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ==================== AUTH BUTTONS ==================== */
.hub-auth-buttons {
    display: flex;
    gap: 10px;
}

.hub-auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.hub-auth-btn .icon {
    font-size: 16px;
}

.hub-auth-btn .label {
    color: inherit;
}

.hub-auth-btn.login {
    border-color: #00ff88;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.hub-auth-btn.login:hover {
    background: rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.hub-auth-btn.register {
    border-color: #00d4ff;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.hub-auth-btn.register:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.hub-auth-btn.logout {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.hub-auth-btn.logout:hover {
    background: rgba(255, 68, 68, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .hub-panel {
        width: 350px;
    }

    .hub-player-info {
        gap: 15px;
    }

    .hub-auth-btn .label {
        display: none;
    }

    .hub-auth-btn {
        padding: 10px 15px;
    }
}

@media (max-width: 992px) {
    .hub-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
        gap: 10px;
    }

    .hub-logo {
        font-size: 24px;
        width: 100%;
        text-align: center;
    }

    .hub-player-info {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hub-center {
        top: 45%;
    }

    .hub-panel {
        width: 100%;
        top: auto;
        bottom: 120px;
        max-height: 50vh;
    }

    .hub-panel.left {
        left: 0;
        right: 0;
        transform: translateY(100%);
    }

    .hub-panel.right {
        left: 0;
        right: 0;
        transform: translateY(100%);
    }

    .hub-panel.active {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hub-topbar {
        padding: 10px 15px;
    }

    .hub-logo {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .hub-gold-display,
    .hub-level-display {
        padding: 8px 12px;
    }

    .hub-gold-display .icon,
    .hub-level-display .icon {
        font-size: 18px;
    }

    .hub-gold-display .value,
    .hub-level-display .value {
        font-size: 16px;
    }

    .hub-username {
        font-size: 14px;
        padding: 8px 15px;
    }

    .hub-auth-buttons {
        gap: 5px;
    }

    .hub-auth-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .hub-auth-btn .icon {
        font-size: 14px;
    }

    .hub-nav {
        height: 100px;
        gap: 8px;
        padding: 0 10px;
    }

    .hub-nav-btn {
        height: 70px;
        max-width: none;
        flex: 1;
        border-radius: 12px;
        border-width: 2px;
    }

    .hub-nav-btn .icon {
        font-size: 24px;
    }

    .hub-nav-btn .label {
        font-size: 10px;
    }

    .hub-nav-btn.play-btn {
        max-width: none;
        flex: 1.5;
    }

    .hub-nav-btn.play-btn .icon {
        font-size: 32px;
    }

    .hub-nav-btn.play-btn .label {
        font-size: 14px;
    }

    .hub-center {
        width: 90%;
        max-width: 300px;
        height: auto;
        top: 40%;
    }

    .hub-character-container {
        width: 200px;
        height: 200px;
    }

    .hub-character {
        width: 140px;
        height: 140px;
        font-size: 50px;
    }

    .hub-player-name-edit {
        padding: 10px 20px;
    }

    .hub-player-name-edit input {
        font-size: 18px;
        min-width: 150px;
    }

    .hub-panel {
        bottom: 100px;
        max-height: 45vh;
    }

    .hub-panel-header {
        padding: 20px;
    }

    .hub-panel-title {
        font-size: 22px;
    }

    .hub-panel-content {
        padding: 15px;
    }

    .hub-mode-card {
        padding: 15px;
    }

    .hub-mode-icon {
        font-size: 28px;
    }

    .hub-mode-name {
        font-size: 18px;
    }

    .hub-mode-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hub-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .hub-stat-card {
        padding: 15px;
    }

    .hub-stat-value {
        font-size: 24px;
    }

    .hub-stat-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hub-topbar {
        padding: 8px 10px;
        height: auto;
        min-height: 60px;
    }

    .hub-logo {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .hub-player-info {
        gap: 4px;
    }

    .hub-gold-display,
    .hub-level-display {
        padding: 5px 8px;
        border-radius: 12px;
    }

    .hub-gold-display .icon,
    .hub-level-display .icon {
        font-size: 12px;
    }

    .hub-gold-display .value,
    .hub-level-display .value {
        font-size: 12px;
    }

    .hub-username {
        display: none;
    }

    .hub-auth-btn {
        padding: 5px 8px;
    }

    .hub-auth-btn .label {
        display: none;
    }

    .hub-auth-btn .icon {
        font-size: 12px;
    }

    .hub-nav {
        height: 70px;
        gap: 4px;
        padding: 5px;
        padding-bottom: calc(5px + env(safe-area-inset-bottom, 0));
    }

    .hub-nav-btn {
        height: 55px;
        border-radius: 8px;
        gap: 2px;
        border-width: 2px;
        padding: 5px;
    }

    .hub-nav-btn .icon {
        font-size: 18px;
    }

    .hub-nav-btn .label {
        font-size: 7px;
        letter-spacing: 0;
    }

    .hub-nav-btn.play-btn {
        flex: 1.3;
    }

    .hub-nav-btn.play-btn .icon {
        font-size: 22px;
    }

    .hub-nav-btn.play-btn .label {
        font-size: 10px;
    }

    .hub-center {
        top: 35%;
    }

    .hub-character-container {
        width: 140px;
        height: 140px;
        margin-bottom: 10px;
    }

    .hub-character {
        width: 100px;
        height: 100px;
        font-size: 35px;
    }

    .hub-player-name-edit {
        padding: 6px 12px;
        border-radius: 15px;
    }

    .hub-player-name-edit input {
        font-size: 14px;
        min-width: 100px;
    }

    .hub-panel {
        bottom: 70px;
        max-height: 35vh;
    }

    .hub-panel-header {
        padding: 12px;
    }

    .hub-panel-title {
        font-size: 16px;
    }

    .hub-panel-subtitle {
        font-size: 11px;
    }

    .hub-panel-content {
        padding: 10px;
    }

    .hub-mode-card {
        padding: 10px;
        margin-bottom: 10px;
    }

    .hub-mode-icon {
        font-size: 24px;
    }

    .hub-mode-name {
        font-size: 14px;
    }

    .hub-mode-desc {
        font-size: 11px;
    }

    .hub-stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .hub-stat-card {
        padding: 8px;
        border-radius: 8px;
    }

    .hub-stat-value {
        font-size: 16px;
    }

    .hub-stat-label {
        font-size: 9px;
    }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 380px) {
    .hub-topbar {
        padding: 5px 8px;
    }

    .hub-logo {
        font-size: 14px;
    }

    .hub-gold-display,
    .hub-level-display {
        padding: 4px 6px;
    }

    .hub-auth-btn {
        padding: 4px 6px;
    }

    .hub-nav {
        height: 65px;
        gap: 3px;
        padding: 3px;
    }

    .hub-nav-btn {
        height: 50px;
    }

    .hub-nav-btn .icon {
        font-size: 16px;
    }

    .hub-nav-btn .label {
        font-size: 6px;
    }

    .hub-center {
        top: 32%;
    }

    .hub-character-container {
        width: 120px;
        height: 120px;
    }

    .hub-character {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hub-topbar {
        height: 50px;
        padding: 5px 15px;
    }

    .hub-logo {
        font-size: 16px;
    }

    .hub-center {
        top: 50%;
    }

    .hub-character-container {
        width: 120px;
        height: 120px;
    }

    .hub-character {
        width: 80px;
        height: 80px;
        font-size: 30px;
    }

    .hub-nav {
        height: 60px;
    }

    .hub-nav-btn {
        height: 50px;
    }

    .hub-nav-btn .icon {
        font-size: 18px;
    }

    .hub-nav-btn .label {
        display: none;
    }

    .hub-panel {
        top: 50px;
        bottom: 60px;
        max-height: none;
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .hub-nav-btn,
    .hub-auth-btn,
    .hub-mode-card {
        min-height: 44px;
    }
}
