﻿/* =============================================================================
   RESPONSIVE STYLES
   Main stylesheet for responsive breakpoints and mobile optimizations
   ============================================================================= */

/* =============================================================================
   IOS INPUT ZOOM PREVENTION
   ============================================================================= */

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="number"],
    input[type="search"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* =============================================================================
   MOBILE SCROLL SNAP & SAFE AREAS
   ============================================================================= */

/* === SCROLL SNAP FOR HORIZONTAL SECTIONS === */
@media (max-width: 768px) {
    .community-sidebar {
        scroll-snap-type: x mandatory;
        scroll-padding: 12px;
    }
    
    .sidebar-section {
        scroll-snap-align: start;
    }
}

/* === BOTTOM PADDING FOR MOBILE (virtual keyboard space) === */
@media (max-width: 768px) {
    body {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    .chat-input-wrapper {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* =============================================================================
   MOBILE BREAKPOINT - 480PX AND BELOW
   Comprehensive mobile optimization for small phones
   ============================================================================= */

/* =====================================================
   COMPREHENSIVE MOBILE OPTIMIZATION (480px and below)
   ===================================================== */
@media (max-width: 480px) {
    /* Base adjustments */
    html, body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    /* Header - Compact mobile layout */
    header {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .header-left {
        width: 100%;
        order: 1;
    }
    
    .brand-wrapper {
        max-width: none;
    }
    
    .scrolling-title {
        font-size: 0.85rem;
    }
    
    .header-nav {
        width: 100%;
        order: 3;
        justify-content: center;
        gap: 5px;
        margin: 5px 0;
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 0.7rem;
        min-height: 36px;
    }
    
    .header-right {
        width: 100%;
        order: 2;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .header-clock-group {
        flex-direction: column;
        gap: 2px;
        align-items: center;
    }
    
    .header-time-val {
        font-size: 0.9rem;
    }
    
    .wiki-search-container {
        width: 100%;
        max-width: none;
        order: 4;
    }
    
    .wiki-search-container input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Dashboard - Stack cards vertically */
    .dashboard {
        padding: 10px;
        gap: 12px;
        display: flex;
        flex-direction: column;
    }
    
    /* Cards keep good minimum height on mobile */
    .card {
        min-height: 380px;
        padding: 15px;
        margin-bottom: 0;
    }
    
    /* Specific card sizing - keep wilderness flash/rotations/santa properly sized */
    #santa-card,
    .card:has(.chase-items-section) {
        min-height: 420px;
    }
    
    .card-title {
        font-size: 0.75rem;
        letter-spacing: 1px;
        gap: 6px;
    }
    
    .card-main-text {
        font-size: 1.8rem;
        margin: 8px 0;
    }
    
    .card-sub-text {
        font-size: 1rem;
    }
    
    .icon-img {
        width: 24px;
        height: 24px;
    }
    
    /* Flash event card mobile */
    .special-box {
        padding: 10px;
        margin-top: 10px;
    }
    
    .special-label {
        font-size: 0.6rem;
        margin-bottom: 6px;
    }
    
    .special-name {
        font-size: 0.9rem;
    }
    
    .upcoming-row {
        margin-top: 8px;
        padding-top: 8px;
        font-size: 0.75rem;
    }
    
    .upcoming-row span {
        font-size: 0.85rem;
    }
    
    /* Rotations card mobile */
    .rot-row {
        padding: 6px 0;
    }
    
    .rot-label {
        font-size: 0.75rem;
    }
    
    .rot-val {
        font-size: 0.8rem;
    }
    
    /* Santa card mobile */
    .chase-items-section {
        padding-top: 6px;
        margin-top: auto !important;
    }
    
    .chase-header {
        font-size: 0.65rem;
        margin-bottom: 5px;
    }
    
    .chase-grid {
        gap: 6px;
    }
    
    .chase-item {
        width: 32px;
        height: 32px;
    }
    
    /* Tasks container mobile */
    .tasks-container {
        padding: 10px;
    }
    
    .task-card {
        height: auto;
        min-height: 400px;
    }
    
    .tab-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        padding: 10px 8px;
        font-size: 0.7rem;
        min-width: 60px;
        flex: 1 1 auto;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .reset-bar {
        padding: 8px;
        font-size: 0.75rem;
        margin-bottom: 10px;
    }
    
    .reset-time {
        display: block;
        margin-top: 3px;
        margin-left: 0;
    }
    
    .task-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .task-item {
        padding: 10px 12px;
    }
    
    .task-item label {
        font-size: 0.85rem;
    }
    
    /* XP Tracker mobile */
    .tracker-controls {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .tracker-controls.dual-search {
        padding: 10px !important;
    }
    
    .search-section {
        padding: 10px;
    }
    
    .search-box-large {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-box-styled button {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .mode-toggle {
        gap: 5px;
    }
    
    .mode-toggle button {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    /* Profile results mobile */
    .profile-header {
        padding: 12px;
    }
    
    #p-name {
        font-size: 1.2rem;
    }
    
    .stats-row {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .stat-badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    /* Skills grid mobile - uses flexbox for centering */
    .skills-grid .skill-card-detailed {
        flex: 0 0 calc(50% - 6px);
        min-width: calc(50% - 6px);
        max-width: calc(50% - 6px);
    }

    /* Clan results mobile */
    .clan-name-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .clan-stats-pills {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-pill-box {
        width: 100%;
        justify-content: center;
    }
    
    /* Modals mobile - preserve max-width, just limit to viewport */
    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
    }
    
    /* Buttons - touch friendly */
    button, .btn, .nav-btn, .tab-btn, .action-btn, .submit-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Inputs - prevent zoom on iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Community page mobile */
    .community-tabs {
        padding: 8px;
        gap: 5px;
    }
    
    .community-tab-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .suggestions-feed {
        padding: 10px;
    }
    
    .suggestion-card {
        padding: 12px;
    }
    
    .card-header {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .avatar-main {
        width: 36px;
        height: 36px;
    }
    
    .user-name-large {
        font-size: 0.9rem;
    }
    
    .card-body {
        font-size: 0.85rem;
    }
    
    /* Chat mobile */
    .chat-messages-container {
        padding: 10px;
    }
    
    .chat-msg {
        max-width: 85%;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .chat-input-area {
        padding: 10px;
    }
    
    .chat-input-wrapper input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Profile page mobile */
    .profile-grid {
        padding: 10px;
        gap: 15px;
    }
    
    .profile-hero {
        padding: 20px 15px;
    }
    
    .profile-avatar-large {
        width: 80px;
        height: 80px;
    }
    
    .profile-name-display {
        font-size: 1.4rem;
    }
    
    .wall-container {
        min-height: 400px;
    }
    
    .wall-header, .wall-input-area, .wall-feed {
        padding: 12px;
    }
    
    /* Custom timers mobile */
    .custom-timer-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ct-form-body {
        padding: 15px;
        gap: 12px;
    }
    
    .ct-row-split {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Merchant display mobile */
    .merchant-grid-layout {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .merchant-item-box {
        min-height: 80px;
    }
    
    /* =====================================================
       XP TRACKER - PLAYER PROFILE MOBILE (480px)
       ===================================================== */
    
    /* Tracker layout */
    .tracker-container {
        padding: 10px !important;
    }
    
    .tracker-split-layout:not([style*="display: none"]) {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #player-results {
        grid-column: auto !important;
        order: -1;
    }
    
    .results-section,
    .sidebar-panel {
        width: 100% !important;
        min-height: 400px !important;
        max-height: 600px !important;
        height: auto !important;
        overflow-y: auto !important;
    }
    
    .right-sidebar {
        width: 100% !important;
        min-height: 400px !important;
        max-height: 600px !important;
        overflow-y: auto !important;
    }
    
    /* Profile header mobile */
    .profile-header {
        padding: 15px 12px 12px !important;
        padding-right: 55px !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-identity {
        flex-direction: row !important;
        gap: 12px !important;
        text-align: left;
        flex-wrap: nowrap;
    }
    
    .profile-details-col {
        align-items: flex-start !important;
        text-align: left;
        min-width: 0;
        flex: 1;
    }
    
    #p-avatar {
        width: 55px !important;
        height: 55px !important;
        flex-shrink: 0;
    }
    
    #p-name {
        font-size: 1.1rem !important;
        text-align: left !important;
    }
    
    #clan-banner-container {
        top: 6px !important;
        right: 5px !important;
    }
    
    #clan-banner-img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .profile-meta-row {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        justify-content: center;
    }
    
    .rank-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .rank-toggle-container {
        margin-left: 0 !important;
        justify-content: center;
    }
    
    /* Clan banner on profile - hide or reduce on mobile */
    #clan-banner-container {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        margin-top: 10px;
    }
    
    #clan-banner-img {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Stats row mobile */
    .stats-row {
        justify-content: center !important;
        gap: 6px;
    }
    
    .stat-pill {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
    
    .stat-pill span {
        font-size: 0.75rem;
    }
    
    .stat-pill img {
        width: 16px;
        height: 16px;
    }
    
    /* Skills grid mobile - uses flexbox for centering */
    .skills-grid .skill-card-detailed {
        flex: 0 0 calc(50% - 5px) !important;
        min-width: calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
    }
    
    /* Sidebar tabs mobile */
    .sidebar-tabs {
        flex-wrap: wrap;
    }
    
    .sidebar-tab-btn {
        flex: 1 1 auto;
        padding: 10px 8px;
        font-size: 0.7rem;
        min-width: 70px;
    }
    
    .sidebar-content {
        padding: 12px !important;
    }
    
    /* Highlights mobile */
    .highlights-container {
        gap: 8px;
    }
    
    .highlight-card {
        padding: 10px;
    }
    
    .highlight-content {
        font-size: 0.95rem;
    }
    
    /* Cape goals mobile */
    .cape-progress-card {
        padding: 10px;
    }
    
    .rtm-label {
        font-size: 0.7rem;
    }
    
    /* =====================================================
       XP TRACKER - CLAN PAGE MOBILE (480px)
       ===================================================== */
    
    #clan-results {
        width: 100% !important;
        overflow: visible !important;
    }
    
    .clan-header-banner {
        padding: 15px 10px !important;
        gap: 15px !important;
    }
    
    .clan-name-title {
        font-size: 1.5rem !important;
        letter-spacing: 1px !important;
    }
    
    .clan-stats-pills {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100%;
    }
    
    .stat-pill-box {
        width: 100% !important;
        padding: 8px 15px !important;
        justify-content: space-between !important;
    }
    
    .pill-label {
        font-size: 0.65rem;
    }
    
    .pill-val {
        font-size: 0.95rem;
    }
    
    /* Clan podiums mobile */
    .clan-podiums-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin: 10px 0 20px !important;
    }
    
    .podium-group {
        padding: 12px;
    }
    
    .podium-header {
        font-size: 0.85rem;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .podium-grid {
        gap: 6px;
    }
    
    .podium-card {
        padding: 8px;
    }
    
    .podium-card.rank-1 {
        min-height: 110px;
    }
    
    .medal-icon {
        font-size: 1.2rem;
    }
    
    .podium-avatar {
        width: 32px;
        height: 32px;
    }
    
    .rank-1 .podium-avatar {
        width: 40px;
        height: 40px;
    }
    
    .podium-name {
        font-size: 0.75rem;
    }
    
    .podium-val {
        font-size: 0.65rem;
    }
    
    /* Clan table mobile */
    .clan-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    #clan-filter-input {
        width: 100% !important;
    }
    
    .table-config-bar {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        margin: 0 8px 8px 8px;
    }
    
    .clan-table-wrapper {
        margin: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .clan-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .clan-table th,
    .clan-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    /* Search controls mobile */
    .tracker-controls.dual-search {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px !important;
    }
    
    .search-section {
        width: 100%;
        padding: 0;
    }
    
    .search-box-large {
        flex-direction: column;
        min-width: 100% !important;
        max-width: 100% !important;
        gap: 8px;
    }
    
    .search-box-large input {
        width: 100%;
    }
    
    .search-box-large button {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .mode-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .mode-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    
    .search-divider {
        display: none !important;
    }
}

/* =============================================================================
   VERY SMALL PHONES BREAKPOINT - 360PX AND BELOW
   ============================================================================= */

/* =====================================================
   VERY SMALL PHONES (360px and below)
   ===================================================== */
@media (max-width: 360px) {
    html, body {
        font-size: 13px;
    }
    
    header {
        padding: 6px 8px;
    }
    
    .scrolling-title {
        font-size: 0.75rem;
    }
    
    .nav-btn {
        padding: 6px 8px;
        font-size: 0.65rem;
    }
    
    .dashboard {
        padding: 8px;
        gap: 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card-title {
        font-size: 0.7rem;
    }
    
    .card-main-text {
        font-size: 1.5rem;
    }
    
    .tab-btn {
        padding: 8px 5px;
        font-size: 0.65rem;
        min-width: 50px;
    }
    
    .task-item {
        padding: 8px 10px;
    }
    
    .task-item label {
        font-size: 0.8rem;
    }
    
    .chase-item {
        width: 28px;
        height: 28px;
    }
    
    .modal-content {
        width: 98%;
        margin: 5px;
        padding: 12px;
    }
    
    /* Ensure touch targets remain accessible */
    button, .btn, .nav-btn, .tab-btn {
        min-height: 40px;
    }
    
    /* XP Tracker - Very small phones */
    .skill-card-detailed {
        flex: 1 1 calc(50% - 3px) !important;
        min-width: calc(50% - 3px) !important;
        padding: 6px !important;
        min-height: 75px !important;
    }
    
    .skill-lvl {
        font-size: 0.9rem !important;
    }
    
    .skill-icon-lg {
        width: 18px !important;
        height: 18px !important;
    }
    
    #p-name {
        font-size: 1.1rem !important;
    }
    
    #p-avatar {
        width: 60px !important;
        height: 60px !important;
    }
    
    .clan-name-title {
        font-size: 1.2rem !important;
    }
    
    .podium-card.rank-1 {
        min-height: 95px;
    }
    
    .podium-name {
        font-size: 0.65rem;
    }
}

/* =============================================================================
   PWA (PROGRESSIVE WEB APP) STYLES
   Update toasts, install prompts, and standalone mode adjustments
   ============================================================================= */

/* ===== PWA Styles ===== */
.pwa-update-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.pwa-update-toast button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.pwa-update-toast button:hover {
    background: rgba(255,255,255,0.3);
}

.pwa-update-toast button:last-child {
    padding: 6px 8px;
    background: transparent;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.pwa-install-prompt h4 {
    margin: 0 0 8px 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-prompt p {
    margin: 0 0 12px 0;
    color: var(--text-sub);
    font-size: 0.85rem;
}

.pwa-install-buttons {
    display: flex;
    gap: 8px;
}

.pwa-install-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.pwa-install-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pwa-install-btn.secondary {
    background: var(--bg-input);
    color: var(--text-sub);
    border: 1px solid var(--border-color);
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Standalone mode adjustments (when installed as PWA) */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    header {
        padding-top: env(safe-area-inset-top);
    }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .pwa-update-toast {
        bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .pwa-install-prompt {
        bottom: max(20px, env(safe-area-inset-bottom));
        right: max(20px, env(safe-area-inset-right));
    }
}

/* =============================================================================
   MOBILE SKILLS GRID FIX
   ============================================================================= */

/* =====================================================
   MOBILE SKILLS GRID FIX - Already handled above
   These are kept for backwards compatibility but simplified
   ===================================================== */
@media (max-width: 768px) {
    .skill-card-detailed {
        flex: none !important;
        min-width: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
}

/* =============================================================================
   TABLET & MID-SIZED SCREEN BREAKPOINTS
   ============================================================================= */

/* =====================================================
   MID-SIZED SCREENS (921px - 1200px)
   Switch to 2-column layout for better readability
   ===================================================== */
@media (min-width: 921px) and (max-width: 1200px) {
    /* XP Tracker - 2 column layout with stacked sidebars */
    .tracker-split-layout:not([style*="display: none"]) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 15px !important;
    }
    
    /* Left sidebar on top-left */
    .tracker-split-layout .sidebar-panel:first-of-type {
        grid-column: 1;
        grid-row: 1;
    }
    
    /* Main results spans both columns on bottom row */
    .tracker-split-layout .results-section {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    
    /* Right sidebar on top-right */
    .tracker-split-layout .right-sidebar {
        grid-column: 2;
        grid-row: 1;
    }
    
    .sidebar-panel,
    .right-sidebar {
        max-height: 550px;
        overflow-y: auto;
    }
}

/* =====================================================
   SAMSUNG Z FOLD 4 / TABLET SUPPORT (717px - 920px)
   ===================================================== */
@media (min-width: 717px) and (max-width: 920px) {
    /* Header adjustments */
    header {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    /* Dashboard grid - 2 columns on medium screens */
    .dashboard {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        max-width: 1400px;
    }
    
    /* XP Tracker layout - stack on fold (only when visible) */
    .tracker-split-layout:not([style*="display: none"]) {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .sidebar-panel {
        width: 100% !important;
        max-height: 500px !important;
        order: 2;
        overflow-y: auto !important;
    }
    
    .results-section {
        width: 100% !important;
        order: 1;
    }
    
    .right-sidebar {
        width: 100% !important;
        order: 3;
        max-height: 500px !important;
        overflow-y: auto !important;
    }
    
    /* Skills grid - handled by comprehensive rules above */
    .skill-card-detailed {
        flex: none !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    
    /* Clan table */
    .clan-table-wrapper {
        overflow-x: auto;
    }
    
    /* Notification panel */
    .notification-panel {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 400px !important;
    }
    .notification-panel.show {
        transform: translateX(-50%) translateY(0) scale(1) !important;
    }
}

/* =============================================================================
   CLAN PAGE ELEMENT VISIBILITY
   ============================================================================= */

/* =====================================================
   CLAN PAGE - HIDE PLAYER-ONLY ELEMENTS
   ===================================================== */
/* When clan-results is visible, ensure sidebars are hidden */
#clan-results:not([style*="display: none"]) ~ .sidebar-panel,
#clan-results:not([style*="display: none"]) ~ .right-sidebar {
    display: none !important;
}

/* Make sure tracker-split-layout is fully hidden when viewing clans */
.tracker-split-layout[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Clan results should take full width */
#clan-results {
    width: 100%;
}

/* Ensure proper mobile clan display */
@media (max-width: 768px) {
    #clan-results {
        padding: 10px;
    }
    
    .clan-header-banner-wrap {
        flex-direction: column;
        padding: 15px;
    }
    
    .clan-name-title {
        font-size: 1.3rem !important;
    }
    
    .clan-compact-header,
    .clan-banner-stats-overlay {
        flex-direction: column;
        gap: 10px;
    }
    
    .clan-header-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .mini-stat {
        flex: 0 0 auto;
    }
}

/* =============================================================================
   REIMAGINED PROFILE MODAL
   Complete profile card redesign with animations and effects
   ============================================================================= */

/* === REIMAGINED PROFILE === */
@keyframes gradient-shift-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-overlay {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15), rgba(255, 152, 0, 0.15));
    background-size: 400% 400%;
    animation: gradient-shift-bg 15s ease infinite;
    backdrop-filter: blur(20px) saturate(150%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-card {
    background: linear-gradient(135deg, rgba(22, 22, 22, 0.95), rgba(26, 26, 26, 0.98));
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    width: 85%;
    max-width: 300px;
    height: 90vh;
    min-height: 500px;
    max-height: 95vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255, 152, 0, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(255, 152, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.4), rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    animation: border-glow 3s ease infinite;
}

@keyframes border-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.profile-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.2), rgba(200, 30, 30, 0.3));
    border: 1px solid rgba(255, 50, 50, 0.3);
    color: #ff6b6b;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.profile-close-btn:hover { 
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.4), rgba(200, 30, 30, 0.5));
    border-color: rgba(255, 50, 50, 0.6);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 50, 50, 0.4);
}

/* Header */
.profile-header {
    flex-shrink: 0;
    background: transparent;
    border-bottom: 2px solid rgba(255, 152, 0, 0.15);
    position: relative;
}

.profile-banner {
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff9800 100%);
    background-size: 200% 200%;
    animation: gradient-shift 10s ease infinite;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.profile-banner.has-image {
    background: none !important;
    animation: none !important;
}

.profile-banner.has-image::after {
    display: none !important;
}

.profile-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 1;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-header-content {
    padding: 0 20px 15px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    margin-top: -40px;
    position: relative;
}

.profile-avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-container .profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Allow avatar-style-* classes to work */
}

.profile-user-info {
    flex: 1;
    padding-bottom: 5px;
    min-width: 0;
}

.profile-name-row {
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    letter-spacing: -0.5px;
}

/* Ensure title colors are preserved */
.profile-name-row .user-title {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
}

/* Gradient text effect for profile names without special name effects or titles */
.profile-name-row > span:not([class*='name-effect-']):not(.user-title):not(.dev-badge) {
    background: linear-gradient(135deg, #ffffff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-status-row {
    color: var(--text-sub);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-msg { 
    font-style: italic; 
    color: var(--text-main);
    background: rgba(255, 152, 0, 0.1);
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}
.pronouns { 
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Profile Actions - positioned in redesigned header */
.profile-header-redesigned .profile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    align-self: flex-start;
}

.profile-action-btn {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 152, 0, 0.05));
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: var(--accent);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.profile-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 152, 0, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.profile-action-btn:hover::before {
    transform: translateX(100%);
}

.profile-action-btn:hover { 
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.15));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

.profile-action-btn.danger { 
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.15), rgba(255, 51, 51, 0.1));
    border-color: rgba(255, 51, 51, 0.4);
    color: #ff6b6b;
    width: auto;
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-action-btn.danger:hover {
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.25), rgba(255, 51, 51, 0.2));
    box-shadow: 0 8px 20px rgba(255, 51, 51, 0.4);
}

/* Nav */
.profile-nav {
    display: flex;
    padding: 8px 30px;
    border-bottom: 2px solid rgba(255, 152, 0, 0.1);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent);
    gap: 10px;
    backdrop-filter: blur(10px);
}

.profile-nav-item {
    background: transparent;
    border: none;
    color: var(--text-sub);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

.profile-nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 152, 0, 0.08);
    transform: translateY(-1px);
}

.profile-nav-item.active {
    color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.08));
    box-shadow: 
        0 4px 12px rgba(255, 152, 0, 0.2),
        inset 0 1px 0 rgba(255, 152, 0, 0.3);
}

.profile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--accent);
}

/* Content */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    position: relative;
}

.profile-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(255, 152, 0, 0.03), transparent);
    pointer-events: none;
}

.profile-panel { display: none; animation: fadeInUp 0.3s ease; }
.profile-panel.active { display: block; }

/* Profile Quick Stats Bar */
.profile-quick-stats {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(20, 20, 20, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 20px;
}

.quick-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.quick-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.quick-stat-item.accent {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.05));
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.quick-stat-item .quick-stat-icon {
    font-size: 1.2rem;
}

.quick-stat-item .quick-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.quick-stat-item.accent .quick-stat-value {
    color: var(--accent);
}

.quick-stat-item .quick-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
}

/* Profile About Section */
.profile-about-section {
    margin-bottom: 20px;
}

.profile-box.full-width {
    width: 100%;
}

/* Profile Overview Grid */
.profile-overview-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

/* Grid Layout (legacy support) */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
}

.profile-column { display: flex; flex-direction: column; gap: 20px; }

.profile-box {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.6), rgba(26, 26, 26, 0.4));
    border: 1px solid rgba(255, 152, 0, 0.15);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 152, 0, 0.5), transparent);
}

.profile-box:hover {
    border-color: rgba(255, 152, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 152, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-box-title {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.profile-text-content {
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
}

/* Details List */
.profile-details-list .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-dark);
    font-size: 0.95rem;
}
.profile-details-list .detail-row:last-child { border-bottom: none; }
.profile-details-list .label { color: var(--text-sub); }

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid;
    backdrop-filter: blur(10px);
}
.status-pill.active { 
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.15));
    color: #66bb6a;
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}
.status-pill.idle { 
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.25), rgba(255, 152, 0, 0.15));
    color: #ffb74d;
    border-color: rgba(255, 152, 0, 0.4);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}
.status-pill.offline { 
    background: linear-gradient(135deg, rgba(158, 158, 158, 0.25), rgba(158, 158, 158, 0.15));
    color: #bdbdbd;
    border-color: rgba(158, 158, 158, 0.4);
    box-shadow: 0 2px 8px rgba(158, 158, 158, 0.1);
}
.status-pill.hidden { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    color: #ccc;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Tags */
.profile-tags-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-chip {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(255, 152, 0, 0.06));
    border: 1px solid rgba(255, 152, 0, 0.25);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.tag-chip:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.12));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Links */
.profile-links-list { display: flex; flex-direction: column; gap: 10px; }
.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 8px;
    background: rgba(255, 152, 0, 0.05);
    border-radius: 8px;
    transition: 0.2s;
}
.link-item:hover { background: rgba(255, 152, 0, 0.1); }

/* Linked Player Profiles */
.profile-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.linked-player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}
.linked-player-card:hover {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.linked-player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 152, 0, 0.4);
    object-fit: cover;
    background: #1a1a2e;
    flex-shrink: 0;
}
.linked-player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.linked-player-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.linked-player-label {
    font-size: 0.75rem;
    color: var(--accent, #ff9800);
    opacity: 0.8;
}
.linked-player-card:hover .linked-player-label {
    opacity: 1;
}

/* Player Profiles Edit Form */
.players-editor-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.player-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-edit-num {
    font-size: 0.8rem;
    color: #666;
    min-width: 20px;
    text-align: center;
}
.form-hint {
    font-size: 0.78rem;
    color: #777;
    margin: 0 0 10px;
}

/* Showcase */
.profile-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.profile-showcase-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.showcase-card {
    background: var(--bg-dropdown);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: 0.2s;
}
.showcase-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.showcase-icon { font-size: 1.5rem; }
.showcase-info { min-width: 0; }
.showcase-title { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-url { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Forms */
.profile-edit-form { max-width: 600px; margin: 0 auto; }
.form-section { margin-bottom: 30px; background: var(--bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--border-dark); }
.form-section h4 { margin: 0 0 20px 0; color: var(--accent); border-bottom: 1px solid var(--border-dark); padding-bottom: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-sub); }
.style-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: 0.2s;
}
.style-input:focus { border-color: var(--accent); outline: none; }
textarea.style-input { min-height: 100px; resize: vertical; }
.char-count { text-align: right; font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }

.showcase-editor-grid { display: flex; flex-direction: column; gap: 10px; }
.showcase-edit-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 15px; margin-top: 20px; }
.error-msg { color: var(--urgent-red); font-size: 0.9rem; }

/* Profile Stats & Achievements */
.profile-stats-container { max-width: 900px; margin: 0 auto; }
.stats-section { margin-bottom: 40px; }
.stats-section-title { 
    font-size: 1.2rem; 
    font-weight: 700; 
    margin-bottom: 20px; 
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dropdown) 100%);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-summary {
    margin-bottom: 20px;
    text-align: center;
}

.achievements-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}

.achievements-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-darker);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.achievements-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ffd700);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: var(--bg-card);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-card:not(.locked) {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255,152,0,0.1) 0%, var(--bg-card) 50%);
}

.achievement-card:not(.locked):hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.achievement-card.locked:hover {
    opacity: 0.8;
}

.achievement-card.unlocked {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255,152,0,0.1) 0%, var(--bg-card) 50%);
}

.achievement-check {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 152, 0, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.achievement-lock {
    font-size: 0.9rem;
    opacity: 0.5;
}

.achievement-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.5);
}

.badge-item.gold {
    background: linear-gradient(135deg, #ffd700 0%, #aa9d56 100%);
    color: #000;
}

.badge-item.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
    color: #000;
}

.badge-item.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
    color: #fff;
}

/* Enhanced Form Elements */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.checkbox-label:hover {
    background: var(--bg-hover);
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.range-value {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    min-width: 30px;
}

/* Enhanced Profile Banner with Gradient Overlay */
.profile-banner.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

/* Enhanced Avatar with Glow Effect */
.profile-avatar-container {
    position: relative;
}

.profile-avatar-container::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.profile-avatar-container:hover::before {
    opacity: 0.5;
    animation: pulse 2s infinite;
}

/* =============================================================================
   PROFILE UTILITY STYLES
   ============================================================================= */

/* Improved Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-style: italic;
}

/* Responsive adjustments for stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 15px; margin-top: 20px; }
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* =============================================================================
   PROFILE PRIVACY SETTINGS
   ============================================================================= */

/* Privacy */
.privacy-settings { max-width: 600px; margin: 0 auto; background: var(--bg-card); padding: 25px; border-radius: 16px; border: 1px solid var(--border-dark); }
.privacy-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border-dark); cursor: pointer; }
.privacy-row:last-of-type { border-bottom: none; }
.privacy-title { display: block; font-weight: 600; margin-bottom: 4px; }
.privacy-desc { font-size: 0.85rem; color: var(--text-dim); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-card { height: 100%; max-height: none; border-radius: 0; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-header-content { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
    .profile-actions { justify-content: center; }
    .profile-nav { padding: 0 15px; overflow-x: auto; }
    .profile-nav-item { white-space: nowrap; }
    .form-row { grid-template-columns: 1fr; }
}

/* =============================================================================
   CHAT PREVIEW POPUP
   ============================================================================= */

/* Chat Preview Popup */
.chat-preview-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.chat-preview-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.chat-preview-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-dark);
}

.chat-preview-username {
    font-weight: 600;
    color: var(--text-light);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-preview-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.chat-preview-close:hover {
    color: var(--text-light);
}

.chat-preview-text {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.chat-preview-link {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.chat-preview-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .chat-preview-popup {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 10px;
    }
}

/* =====================================================
   PROFILE CUSTOMIZATION V2 - Enhanced Profile System
   ===================================================== */

/* Redesigned Header - Avatar Left Layout */
.profile-header-redesigned {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 30px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    border-bottom: 1px solid rgba(255, 152, 0, 0.15);
    position: relative;
}

/* Large Avatar Container */
.profile-avatar-large-container {
    --av-color: #ff9800; /* Default, can be overridden via JS */
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    padding: 4px;
    transition: all 0.4s ease;
}

/* Basic styles (solid, dashed, double, none) - show colored background */
.profile-avatar-large-container.avatar-basic-style {
    background: var(--av-color);
    box-shadow: 
        0 0 30px var(--av-color),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Fancy styles (glow, fire-ring, etc) - transparent background to show effects */
.profile-avatar-large-container.avatar-fancy-style {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.profile-avatar-large-container:hover {
    transform: scale(1.05);
}

.profile-avatar-large-container.avatar-basic-style:hover {
    box-shadow: 
        0 0 40px var(--av-color),
        0 12px 40px rgba(0, 0, 0, 0.6);
}

.profile-avatar-large-container .profile-avatar-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    /* Don't set border here - let avatar-style-* classes handle it */
}

/* For fancy styles, the image needs full size since container has no padding */
.profile-avatar-large-container.avatar-fancy-style .profile-avatar-large {
    width: 120px;
    height: 120px;
}

/* Default border for avatars without custom style */
.profile-avatar-large-container .profile-avatar-large:not([class*="avatar-style-"]) {
    border: 3px solid var(--av-color, var(--accent));
}

/* Identity Section */
.profile-identity {
    flex: 1;
    min-width: 0;
}

.profile-name-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 8px;
}

.profile-name-main {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.profile-user-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--accent);
    font-style: italic;
    opacity: 0.9;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), transparent);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.profile-title-prefix .profile-user-title {
    margin-right: 4px;
}

.profile-title-suffix .profile-user-title {
    margin-left: 4px;
}

/* Blurb */
.profile-blurb {
    font-size: 0.95rem;
    color: var(--text-sub);
    font-style: italic;
    margin-top: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid rgba(255, 152, 0, 0.4);
    max-width: 500px;
}

/* Highlight Section - Achievements & Goals */
.profile-highlight-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.profile-highlight-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-highlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-highlight-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 152, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.profile-highlight-card:hover::before {
    opacity: 1;
}

.profile-highlight-card.proudest-achievement {
    border-left: 4px solid #ffd700;
}

.profile-highlight-card.active-goal {
    border-left: 4px solid #4fc3f7;
}

.highlight-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.highlight-content {
    flex: 1;
    min-width: 0;
}

.highlight-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 4px;
    font-weight: 700;
}

.highlight-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.highlight-value .not-set {
    color: #555;
    font-style: italic;
    font-weight: 400;
}

/* Goal Progress Bar */
.goal-progress-container {
    margin-top: 12px;
}

.goal-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6, #4fc3f7);
    background-size: 200% 100%;
    animation: progress-shimmer 2s ease infinite;
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.goal-progress-text {
    font-size: 0.75rem;
    color: #888;
    margin-top: 6px;
    font-weight: 600;
}

/* Form Enhancements */
.form-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 16px 0;
}

.form-group.flex-2 {
    flex: 2;
}

.label-hint {
    font-size: 0.75em;
    color: #666;
    font-weight: 400;
}

/* Mobile Responsive for Profile Redesign */
@media (max-width: 768px) {
    .profile-header-redesigned {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .profile-avatar-large-container {
        width: 100px;
        height: 100px;
    }
    
    /* For fancy styles on mobile, adjust the image size too */
    .profile-avatar-large-container.avatar-fancy-style .profile-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .profile-name-title-row {
        justify-content: center;
        font-size: 1.4rem;
    }
    
    .profile-blurb {
        max-width: 100%;
        border-left: none;
        border-top: 3px solid rgba(255, 152, 0, 0.4);
        text-align: center;
    }
    
    .profile-header-redesigned .profile-actions {
        justify-content: center;
        width: 100%;
        margin-top: 12px;
        margin-left: 0;
    }
    
    .profile-identity {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .profile-highlight-section {
        grid-template-columns: 1fr;
    }
    
    .profile-highlight-card {
        padding: 16px;
    }
    
    .highlight-icon {
        font-size: 2rem;
    }
    
    .profile-quick-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .quick-stat-item {
        flex: 1 1 45%;
        min-width: 80px;
    }
    
    .profile-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   LARGE SCREEN & WINDOW RESIZE SUPPORT
   Handling for half-screen, 1440p, 4K, and ultra-wide displays
   ============================================================================= */

/* =====================================================
   HALF-SCREEN / WINDOW RESIZED SUPPORT
   Handle cases where browser is resized to half screen
   or smaller on larger monitors (1440p, 4K)
   ===================================================== */

/* When window is narrower than full layout needs */
@media (max-width: 1300px) {
    .tracker-split-layout {
        grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr) minmax(250px, 1fr);
        gap: 15px;
    }
    
    /* Skills grid card sizing */
    .skills-grid .skill-card-detailed {
        flex: 0 0 110px;
        min-width: 110px;
        max-width: 140px;
    }
}

/* Narrower windows - stack to 2-column layout */
@media (max-width: 1100px) {
    .tracker-split-layout {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
    }
    
    .tracker-split-layout > .sidebar-panel:first-child {
        grid-column: 1;
        grid-row: 1;
    }
    
    .tracker-split-layout > .results-section {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    
    .tracker-split-layout > .right-sidebar {
        grid-column: 2;
        grid-row: 1;
    }
    
    .skills-grid .skill-card-detailed {
        flex: 0 0 105px;
        min-width: 105px;
        max-width: 130px;
    }
}

/* =====================================================
   1440P SIDEBAR WIDTH FIX
   At 1440p resolution, constrain sidebar width to prevent
   them from becoming too wide on large monitors.
   Adventurer's Log was reported as too wide at 1440p.
   ===================================================== */
@media (min-width: 1400px) {
    /* XP Tracker sidebars - constrained width for 1440p */
    .tracker-split-layout {
        grid-template-columns: minmax(300px, 360px) minmax(0, 900px) minmax(300px, 360px);
    }
    
    /* Community hub sidebars */
    .community-sidebar-left,
    .community-sidebar-right {
        width: 260px;
        max-width: 260px;
    }
}

/* Large monitors (1600px+) - slightly wider sidebars */
@media (min-width: 1600px) {
    .tracker-split-layout {
        grid-template-columns: minmax(340px, 400px) minmax(0, 950px) minmax(340px, 400px);
    }
    
    .community-sidebar-left,
    .community-sidebar-right {
        width: 280px;
        max-width: 280px;
    }
}

/* Ultra-wide (1920px+) - balanced sidebar width */
@media (min-width: 1920px) {
    .tracker-split-layout {
        grid-template-columns: 420px minmax(0, 1100px) 420px;
        max-width: 2200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .community-hub {
        max-width: 1900px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .community-sidebar-left,
    .community-sidebar-right {
        width: 300px;
        max-width: 300px;
    }
}

/* 4K displays (2560px+) - use available space wisely */
@media (min-width: 2560px) {
    .tracker-split-layout {
        grid-template-columns: 480px minmax(0, 1200px) 480px;
        max-width: 2400px;
    }
}

/* =============================================================================
   REDESIGNED PROFILE STATS PANEL
   Quick stats, achievements, and badges display
   ============================================================================= */

/* ========================================
   REDESIGNED PROFILE STATS PANEL
   ======================================== */
.profile-stats-redesigned {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

/* Quick Stats Row - Horizontal cards at top */
.stats-quick-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dropdown) 100%);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--border-dark), transparent);
}

.quick-stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.15);
}

.quick-stat-card.accent {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, var(--bg-card) 100%);
}

.quick-stat-card.accent::before {
    background: linear-gradient(90deg, var(--accent), var(--accent-hover), var(--accent));
}

.quick-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.quick-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.quick-stat-card.accent .quick-stat-value {
    background: linear-gradient(135deg, var(--accent), #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Two Column Layout */
.stats-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stats-column {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    max-height: 350px;
    overflow: hidden;
}

.stats-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-dark);
}

.stats-column-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.stats-column-count {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    background: rgba(255, 152, 0, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

/* Compact Achievements Grid */
.achievements-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 5px;
}

.achievement-mini {
    background: var(--bg-dropdown);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.achievement-mini:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.achievement-mini.unlocked {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15) 0%, var(--bg-dropdown) 100%);
}

.achievement-mini.locked {
    opacity: 0.5;
    filter: grayscale(40%);
}

.achievement-mini.locked.clickable {
    opacity: 0.7;
    cursor: pointer;
    position: relative;
}

.achievement-mini.locked.clickable:hover {
    opacity: 0.9;
    filter: grayscale(20%);
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, var(--bg-dropdown) 100%);
}

.achievement-link-hint {
    font-size: 1rem;
    color: var(--gold);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.achievement-mini.locked.clickable:hover .achievement-link-hint {
    opacity: 1;
    transform: translateX(3px);
}

.achievement-mini-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.achievement-mini-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.achievement-mini-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-mini-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact Badges Grid */
.badges-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    max-height: 280px;
    padding-right: 5px;
}

.badge-mini {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.badge-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.badge-mini.gold {
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    color: #000;
}

.badge-mini.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
    color: #000;
}

.badge-mini.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
}

.empty-state-compact {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 30px 15px;
    font-style: italic;
}

/* Profile Badge Items */
.profile-badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(var(--badge-color-rgb, 102, 126, 234), 0.2), rgba(var(--badge-color-rgb, 102, 126, 234), 0.1));
    border: 1px solid var(--badge-color, #667eea);
    border-radius: 10px;
    transition: all 0.2s ease;
}
.profile-badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.profile-badge-icon {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}
.profile-badge-icon img {
    width: 20px;
    height: auto;
    max-height: 28px;
    object-fit: contain;
    filter: brightness(1.5) contrast(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    padding: 2px;
    border-radius: 3px;
}
/* Increase size for normal ironman badge in profile */
.profile-badge-icon img[src*="Ironman_badge.png"] {
    width: 28px;
    max-height: 36px;
}

/* Global rule: Add background to ALL normal ironman icons anywhere on the site */
img[src*="Ironman_badge.png"]:not([src*="Hardcore"]):not([src*="Group"]):not([src*="Competitive"]) {
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 2px !important;
    border-radius: 3px !important;
}
.profile-badge-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--badge-color, #667eea);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-quick-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-two-column {
        grid-template-columns: 1fr;
    }
    
    .stats-column {
        max-height: 250px;
    }
    
    .quick-stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-quick-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .quick-stat-card {
        padding: 10px 8px;
    }
    
    .quick-stat-icon {
        font-size: 1.2rem;
    }
    
    .quick-stat-value {
        font-size: 1.3rem;
    }
    
    .achievements-compact {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   ANIMATED HEADER BACKGROUNDS
   Aurora, fire, ocean, lightning, galaxy, geometric, neon grid effects
   ============================================================================= */

/* ========================================
   ANIMATED HEADER BACKGROUNDS
   ======================================== */

.header-anim-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Aurora Borealis */
.header-anim-aurora {
    background: linear-gradient(135deg, #0a0020 0%, #1a0030 50%, #0a0020 100%) !important;
    overflow: hidden;
}
.header-anim-aurora::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 150% 60% at 20% 80%, rgba(0, 255, 127, 0.3), transparent),
        radial-gradient(ellipse 120% 50% at 80% 20%, rgba(0, 191, 255, 0.3), transparent),
        radial-gradient(ellipse 100% 40% at 50% 50%, rgba(138, 43, 226, 0.3), transparent);
    animation: aurora-wave 8s ease-in-out infinite;
    filter: blur(30px);
}
@keyframes aurora-wave {
    0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.8; }
    50% { transform: translateY(-20px) scaleY(1.2); opacity: 1; }
}

/* Fire/Inferno */
.header-anim-fire {
    background: linear-gradient(180deg, #1a0000 0%, #330000 50%, #1a0000 100%) !important;
    overflow: hidden;
}
.header-anim-fire::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 100% at 50% 100%, rgba(255, 100, 0, 0.6), transparent 60%),
        radial-gradient(ellipse 60% 80% at 30% 100%, rgba(255, 200, 0, 0.4), transparent 50%),
        radial-gradient(ellipse 60% 80% at 70% 100%, rgba(255, 50, 0, 0.5), transparent 50%);
    animation: fire-flicker 0.5s ease-in-out infinite alternate;
    filter: blur(20px);
}
@keyframes fire-flicker {
    0% { transform: scaleY(1) translateY(0); opacity: 0.9; }
    100% { transform: scaleY(1.1) translateY(-5px); opacity: 1; }
}

/* Ocean Waves */
.header-anim-ocean-waves {
    background: linear-gradient(180deg, #001428 0%, #003366 50%, #001428 100%) !important;
    overflow: hidden;
}
.header-anim-ocean-waves::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 200% 40% at 50% 90%, rgba(0, 150, 255, 0.4), transparent),
        radial-gradient(ellipse 150% 30% at 30% 85%, rgba(0, 200, 200, 0.3), transparent),
        radial-gradient(ellipse 150% 30% at 70% 80%, rgba(50, 100, 200, 0.3), transparent);
    animation: ocean-wave 4s ease-in-out infinite;
    filter: blur(25px);
}
@keyframes ocean-wave {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(-10px) translateY(-5px); }
}

/* Lightning/Electric Storm */
.header-anim-lightning {
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%) !important;
    overflow: hidden;
}
.header-anim-lightning::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--lightning-x, 50%) var(--lightning-y, 50%), rgba(100, 150, 255, 0.8), transparent 30%);
    animation: lightning-flash 3s ease-in-out infinite;
    filter: blur(10px);
}
@keyframes lightning-flash {
    0%, 90%, 100% { opacity: 0; }
    92%, 94%, 96% { opacity: 1; }
    93%, 95% { opacity: 0; }
}

/* Galaxy Spiral */
.header-anim-galaxy {
    background: radial-gradient(ellipse at center, #0a0015 0%, #000005 100%) !important;
    overflow: hidden;
}
.header-anim-galaxy::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: 
        radial-gradient(circle at 50% 50%, transparent 30%, rgba(138, 43, 226, 0.1) 50%, transparent 70%),
        radial-gradient(circle at 50% 50%, transparent 20%, rgba(75, 0, 130, 0.1) 40%, transparent 60%);
    animation: galaxy-spin 30s linear infinite;
}
.header-anim-galaxy::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}
@keyframes galaxy-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Geometric Mesh */
.header-anim-geometric {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%) !important;
    overflow: hidden;
}
.header-anim-geometric::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(30deg, rgba(100, 150, 255, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(100, 150, 255, 0.1) 87.5%, rgba(100, 150, 255, 0.1)),
        linear-gradient(150deg, rgba(100, 150, 255, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(100, 150, 255, 0.1) 87.5%, rgba(100, 150, 255, 0.1)),
        linear-gradient(30deg, rgba(100, 150, 255, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(100, 150, 255, 0.1) 87.5%, rgba(100, 150, 255, 0.1)),
        linear-gradient(150deg, rgba(100, 150, 255, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(100, 150, 255, 0.1) 87.5%, rgba(100, 150, 255, 0.1));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    animation: geo-pulse 4s ease-in-out infinite;
}
@keyframes geo-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Neon Grid */
.header-anim-neon-grid {
    background: linear-gradient(180deg, #000 0%, #0a0015 100%) !important;
    overflow: hidden;
}
.header-anim-neon-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 0, 128, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: neon-scroll 20s linear infinite;
    perspective: 500px;
    transform: rotateX(60deg) translateY(-50%);
    transform-origin: center bottom;
}
@keyframes neon-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 400px; }
}

/* Particles animation class (uses canvas) */
.header-anim-particles {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}

/* Matrix Rain (uses canvas) */
.header-anim-matrix {
    background: linear-gradient(180deg, #000 0%, #001a00 100%) !important;
}

/* Cyber Rain (uses canvas) */
.header-anim-rain {
    background: linear-gradient(180deg, #0a0a1a 0%, #001428 100%) !important;
}

/* Snowfall (uses canvas) */
.header-anim-snow {
    background: linear-gradient(180deg, #1a2a3a 0%, #2a3a4a 50%, #1a2a3a 100%) !important;
}

/* Starfield (uses canvas) */
.header-anim-stars {
    background: radial-gradient(ellipse at center, #0a0015 0%, #000005 100%) !important;
}

/* =============================================================================
   UNIVERSAL RESPONSIVE FIXES
   Prevent overlap, cutoff, and overflow issues across all breakpoints
   ============================================================================= */

/* =====================================================
   UNIVERSAL RESPONSIVE FIXES - PREVENT OVERLAP/CUTOFF
   ===================================================== */

/* Ensure all containers respect boundaries */
* {
    box-sizing: border-box;
}

/* Prevent horizontal overflow on body */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Universal container containment */
.dashboard {
    max-width: 1400px;
    overflow-x: hidden;
    margin: 0 auto;
}

.tracker-container,
.community-hub,
.community-main,
.suggestions-feed,
.chat-container-v2,
.profile-overlay,
.profile-card {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ensure text wraps properly everywhere */
body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Cards and containers adapt to content */
.card,
.suggestion-card,
.task-card,
.profile-box,
.sidebar-panel,
.results-section {
    min-width: 0;
    max-width: 100%;
}

/* Tables scroll horizontally when needed */
.clan-table-wrapper,
table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Images never exceed container */
img, video, iframe, canvas {
    max-width: 100%;
    height: auto;
}

/* Input elements adapt to container */
input, select, textarea, button {
    max-width: 100%;
}

/* Very wide screens (1920px+) */
@media (min-width: 1920px) {
    .dashboard {
        max-width: 1400px;
        margin: 0 auto;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tracker-container {
        max-width: 1800px;
        margin: 0 auto;
    }
    
    .community-hub {
        max-width: 1800px;
        margin: 0 auto;
    }
}

/* Extra large screens (2560px+) */
@media (min-width: 2560px) {
    .dashboard {
        max-width: 1400px;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .skills-grid .skill-card-detailed {
        flex: 1 1 115px;
        min-width: 100px;
        max-width: 145px;
    }
    
    .skills-grid {
        gap: 6px;
        padding: 10px;
    }
}

/* =============================================================================
   SKILLS GRID RESPONSIVE LAYOUT
   Comprehensive breakpoints to ensure all 30 skills fit on any screen
   ============================================================================= */

/* =====================================================
   SKILLS GRID - COMPREHENSIVE RESPONSIVE LAYOUT
   Ensures all 30 skills fit properly on any screen size
   Using auto-fill to prevent overflow on any container width
   ===================================================== */

/* Very large screens (1800px+) */
@media (min-width: 1800px) {
    .skills-grid .skill-card-detailed {
        flex: 1 1 120px;
        min-width: 110px;
        max-width: 150px;
    }
    
    .skills-grid {
        gap: 8px;
        padding: 10px;
    }
}

/* Large screens (1440px - 1799px) - for 1440p monitors */
@media (min-width: 1440px) and (max-width: 1799px) {
    .skills-grid .skill-card-detailed {
        flex: 1 1 120px;
        min-width: 100px;
        max-width: 150px;
    }
    
    .skills-grid {
        gap: 8px;
        padding: 12px;
    }
    
    .skill-card-detailed {
        min-height: 88px;
        padding: 10px;
    }
    
    .skill-lvl {
        font-size: 1.1rem;
    }
    
    .skill-icon-lg {
        width: 22px;
        height: 22px;
    }
    
    .skill-card-detailed .skill-xp-text,
    .skill-card-detailed .skill-next-text {
        font-size: 0.65rem;
    }
}

/* Medium-large screens (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 115px;
        min-width: 115px;
        max-width: 145px;
    }
    
    .skills-grid {
        gap: 8px;
        padding: 10px;
    }
    
    .skill-card-detailed {
        min-height: 85px;
        padding: 8px;
    }
    
    .skill-lvl {
        font-size: 1.05rem;
    }
    
    .skill-icon-lg {
        width: 20px;
        height: 20px;
    }
}

/* Medium screens (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 110px;
        min-width: 110px;
        max-width: 135px;
    }
    
    .skills-grid {
        gap: 6px;
        padding: 10px;
    }
    
    .skill-card-detailed {
        min-height: 82px;
        padding: 8px;
    }
    
    .skill-lvl {
        font-size: 1rem;
    }
    
    .skill-icon-lg {
        width: 20px;
        height: 20px;
    }
    
    .skill-card-detailed .skill-xp-text,
    .skill-card-detailed .skill-next-text {
        font-size: 0.6rem;
    }
}

/* Small-medium screens (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 100px;
        min-width: 100px;
        max-width: 125px;
    }
    
    .skills-grid {
        gap: 6px;
        padding: 10px;
    }
    
    .skill-card-detailed {
        min-height: 80px;
        padding: 7px;
    }
    
    .skill-lvl {
        font-size: 0.95rem;
    }
    
    .skill-icon-lg {
        width: 18px;
        height: 18px;
    }
    
    .skill-card-detailed .skill-xp-text,
    .skill-card-detailed .skill-next-text {
        font-size: 0.58rem;
    }
    
    .skill-rank {
        font-size: 0.6rem;
    }
}

/* Small screens (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 95px;
        min-width: 95px;
        max-width: 115px;
    }
    
    .skills-grid {
        gap: 6px;
        padding: 8px;
    }
    
    .skill-card-detailed {
        min-height: 78px;
        padding: 6px;
    }
    
    .skill-lvl {
        font-size: 0.9rem;
    }
    
    .skill-icon-lg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile screens (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 90px;
        min-width: 90px;
        max-width: 110px;
    }
    
    .skills-grid {
        gap: 5px;
        padding: 6px;
    }
    
    .skill-card-detailed {
        min-height: 72px;
        padding: 5px;
    }
    
    .skill-lvl {
        font-size: 0.85rem;
    }
    
    .skill-icon-lg {
        width: 16px;
        height: 16px;
    }
    
    .skill-card-detailed .skill-xp-text,
    .skill-card-detailed .skill-next-text {
        font-size: 0.55rem;
    }
    
    .skill-rank {
        display: none;
    }
}

/* Very small screens (under 480px) */
@media (max-width: 479px) {
    .skills-grid .skill-card-detailed {
        flex: 0 0 85px;
        min-width: 85px;
        max-width: 100px;
    }
    
    .skills-grid {
        gap: 5px;
        padding: 6px;
    }
    
    .skill-card-detailed {
        min-height: 70px;
        padding: 5px;
    }
    
    .skill-lvl {
        font-size: 0.85rem;
    }
    
    .skill-icon-lg {
        width: 16px;
        height: 16px;
    }
    
    .skill-card-detailed .skill-xp-text {
        font-size: 0.55rem;
    }
    
    .skill-card-detailed .skill-next-text {
        font-size: 0.5rem;
    }
    
    .skill-rank {
        display: none;
    }
    
    .skill-card-top {
        margin-bottom: 2px;
    }
    
    .skill-progress-track {
        height: 4px;
        margin-bottom: 4px;
    }
}

/* =============================================================================
   UI ELEMENT VIEWPORT CONSTRAINTS
   Ensure pickers, modals, and panels stay within viewport bounds
   ============================================================================= */

/* Ensure certain UI elements work on all screens - but NOT modals (they have their own max-widths) */
.emoji-picker-v2,
.gif-picker,
.notification-panel,
.settings-dropdown {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
}

/* Fix header elements on narrow screens */
@media (max-width: 600px) {
    header {
        min-height: auto;
        padding: 8px !important;
    }
    
    .header-left,
    .header-right,
    .header-nav {
        flex-shrink: 1;
        min-width: 0;
    }
    
    .header-clock-group {
        min-width: 60px;
    }
    
    .wiki-search-container {
        min-width: 0;
        flex: 1 1 auto;
    }
    
    .wiki-search-container input {
        min-width: 0;
    }
}

/* Fix chat on all screens */
@media (max-width: 400px) {
    .chat-group-content {
        max-width: 85% !important;
    }
    
    .chat-message-item .message-content {
        padding: 8px 12px;
        max-width: 100%;
    }
    
    .chat-gif {
        max-width: 200px !important;
        max-height: 150px !important;
    }
    
    .chat-uploaded-image {
        max-width: 100% !important;
    }
}

/* Fix profile modal on small screens */
@media (max-width: 500px) {
    .profile-card {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .profile-overlay {
        padding: 0 !important;
    }
    
    .profile-banner {
        height: 150px !important;
    }
    
    .profile-header-content {
        padding: 0 15px 15px !important;
        margin-top: -40px !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-avatar-container {
        width: 100px !important;
        height: 100px !important;
    }
    
    .profile-name-row {
        font-size: 1.4rem !important;
        text-align: center;
    }
    
    .profile-nav {
        padding: 8px 10px !important;
        gap: 5px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .profile-nav-item {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
    
    .profile-content {
        padding: 15px !important;
    }
    
    .profile-overview-grid,
    .profile-grid {
        grid-template-columns: 1fr !important;
    }
    
    .profile-quick-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .quick-stat-item {
        flex: 1 1 calc(50% - 4px);
        min-width: 80px;
    }
}

/* Ensure suggestions don't overflow */
@media (max-width: 600px) {
    .suggestion-card {
        padding: 12px !important;
    }
    
    .card-header {
        flex-wrap: wrap;
    }
    
    .card-body {
        word-break: break-word;
    }
    
    .reply-item,
    .nested-reply-item {
        padding: 10px !important;
        margin-left: 0 !important;
    }
    
    .nested-reply-item {
        margin-left: 15px !important;
    }
    
    .reply-to-ref {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
    }
    
    .nested-replies-flat-container {
        margin-left: 10px !important;
        padding-left: 8px !important;
    }
}

/* Fix tracker on very small screens */
@media (max-width: 380px) {
    .tracker-controls {
        padding: 8px !important;
    }
    
    .search-box-large {
        gap: 6px !important;
    }
    
    .search-box-large input {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
    
    .mode-btn {
        padding: 8px 6px !important;
        font-size: 0.75rem !important;
    }
    
    .skill-card-detailed {
        padding: 5px !important;
        min-height: 65px !important;
    }
    
    .skill-lvl {
        font-size: 0.85rem !important;
    }
    
    .skill-icon-lg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* Ensure pickers stay in viewport */
.emoji-picker-v2,
.gif-picker {
    position: fixed !important;
}

@media (max-width: 480px) {
    .emoji-picker-v2,
    .gif-picker {
        left: 5px !important;
        right: 5px !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* Fix landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .profile-card {
        height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .profile-banner {
        height: 100px !important;
    }
    
    .modal-content {
        max-height: 95vh !important;
    }
    
    .chat-container-v2 {
        height: calc(100vh - 60px) !important;
    }
}

/* =============================================================================
   PENGUIN TRACKER BUTTONS
   Guaranteed overrides - must be at end of file
   ============================================================================= */

/* =====================================================
   PENGUIN TRACKER BUTTONS - GUARANTEED OVERRIDES
   These styles MUST be at the end to ensure they work
   ===================================================== */

.penguins-btn-row .fetch-wiki-btn,
button.fetch-wiki-btn,
.fetch-wiki-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 12px !important;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.25), rgba(255, 152, 0, 0.1)) !important;
    border: 1px solid rgba(255, 152, 0, 0.5) !important;
    border-radius: 6px !important;
    color: #ffb74d !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.penguins-btn-row .fetch-wiki-btn:hover,
button.fetch-wiki-btn:hover,
.fetch-wiki-btn:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.35), rgba(255, 152, 0, 0.2)) !important;
    border-color: #ff9800 !important;
    color: #ff9800 !important;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.3) !important;
}

.penguins-btn-row .clear-btn,
button.clear-btn,
.clear-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    background: rgba(80, 80, 80, 0.2) !important;
    border: 1px solid #555 !important;
    border-radius: 6px !important;
    color: #999 !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.penguins-btn-row .clear-btn:hover,
button.clear-btn:hover,
.clear-btn:hover {
    background: rgba(231, 76, 60, 0.25) !important;
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

.reset-bar .wiki-link-small,
a.wiki-link-small,
.wiki-link-small {
    font-size: 0.75rem !important;
    color: #999 !important;
    text-decoration: none !important;
    padding: 3px 8px !important;
    background: rgba(80, 80, 80, 0.15) !important;
    border-radius: 4px !important;
    border: 1px solid #555 !important;
}

.reset-bar .wiki-link-small:hover,
a.wiki-link-small:hover,
.wiki-link-small:hover {
    color: #ff9800 !important;
    border-color: rgba(255, 152, 0, 0.6) !important;
    background: rgba(255, 152, 0, 0.15) !important;
}

/* =============================================================================
   PROFILE AVATAR & SCROLLBAR FIXES
   Final overrides for profile display issues
   ============================================================================= */

/* ========================================
   PROFILE AVATAR FIX
   Ensure avatar displays as circle with no weird background
======================================== */
.profile-avatar-large-container,
.profile-avatar-large-container.avatar-basic-style,
.profile-avatar-large-container.avatar-fancy-style {
    border-radius: 50% !important;
    overflow: hidden !important;
}

.profile-avatar-img,
.profile-avatar-large,
.profile-avatar-img.profile-avatar-large {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    background: transparent !important;
}

/* ========================================
   PROFILE CARD SCROLLBAR FIX
   Ensure scrollbar stays inside the card
======================================== */
.profile-card {
    overflow: hidden !important;
}

.profile-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable;
}

/* Custom scrollbar for profile content */
.profile-content::-webkit-scrollbar {
    width: 6px;
}

.profile-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.profile-content::-webkit-scrollbar-thumb {
    background: rgba(255, 152, 0, 0.4);
    border-radius: 3px;
}

.profile-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 152, 0, 0.6);
}