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

html {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
}

body {
    font-family: 'Cinzel', serif;
    /* Dark wood texture background - tiled */
    background: #3d2817 url('assets/dark_wood.jpg') repeat;
    background-size: auto;
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto !important;
    /* Removed dark overlay - ensure no blocking elements */
}

/* Ensure no pseudo-elements are blocking interaction */
body::before,
body::after {
    display: none !important;
    content: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    pointer-events: auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 1rem;
    background: none;
    cursor: pointer;
    display: inline-block;
}

button.nav-link {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.6);
}

header h1,
.hero-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 3.5rem;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 1rem;
    margin-top: 0;
    font-weight: normal;
    letter-spacing: normal;
}

.subtitle,
.hero-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #f5e6d3;
    margin-bottom: 2rem;
    opacity: 1;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

section {
    background: #d4a574;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #b8956a;
}

section h2 {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    margin-bottom: 20px;
    color: #5d4037;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: none;
}

.scan-section {
    width: 100%;
    padding: 20px;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: rgba(232, 213, 183, 0.9);
    border: 2px solid #8b6f47;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #3d2817;
}

.location-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.location-text {
    flex: 1;
    font-weight: 500;
}

.location-status .btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: auto;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    position: relative;
}

.upload-area {
    border: 3px dashed #8b6f47;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #e8d5b7;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.upload-area:hover {
    border-color: #6b5438;
    background: #e0c9a5;
}

.upload-area.dragover {
    border-color: #6b5438;
    background: #d8c195;
    transform: scale(1.02);
}

.upload-content svg {
    color: #8b6f47;
    margin-bottom: 10px;
    width: 48px;
    height: 48px;
}

.upload-content p {
    color: #5d4037;
    margin: 5px 0;
}

.upload-hint {
    font-size: 0.9rem;
    color: #6b5438;
    margin-bottom: 15px;
}

.upload-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-upload {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #8b6f47;
    background: #d4a574;
    color: #3d2817;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-upload:hover {
    background: #8b6f47;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.4);
}

.btn-upload:active {
    transform: translateY(0);
}

.btn-camera {
    background: linear-gradient(135deg, #8b6f47 0%, #6b5438 100%);
    color: white;
    border-color: #5d4037;
}

.btn-camera:hover {
    background: linear-gradient(135deg, #6b5438 0%, #5d4037 100%);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.5);
}


.image-preview {
    text-align: center;
    margin: 15px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto 10px auto;
}

.image-preview .btn-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    font-weight: 600;
    flex-shrink: 0;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: #8b6f47;
    color: white;
}

.btn-primary:hover {
    background: #6b5438;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.message {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    display: none;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

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

.message.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 2px solid #1e7e34;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.message.success::before {
    content: "✓";
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message.error::before {
    content: "✕";
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(114, 28, 36, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #856404;
    border: 2px solid #ffb300;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.message.warning::before {
    content: "⚠";
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(133, 100, 4, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.character-inventory-container {
    display: flex;
    gap: 30px;
    width: 100%;
}

.character-section {
    flex: 1;
    min-width: 0;
    min-height: 400px;
}

.inventory-section {
    flex: 1;
    min-width: 0;
    min-height: 400px;
}

.character-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #b8956a;
}

.character-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #6b5438;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    letter-spacing: 1px;
}

.character-tab-btn:hover {
    color: #8b6f47;
}

.character-tab-btn.active {
    color: #8b6f47;
    border-bottom-color: #8b6f47;
    font-weight: 600;
}

.character-tab-content {
    display: none;
}

.character-tab-content.active {
    display: block;
}

.character-content {
    background: #e8d5b7;
    border: 2px solid #b8956a;
    border-radius: 8px;
    padding: 20px;
}

.level-experience-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #b8956a;
}

.level-experience-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #d4a574 0%, #b8956a 100%);
    border-radius: 8px;
    border: 2px solid #8b6f47;
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.2);
    transition: all 0.3s ease;
}

.level-experience-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 111, 71, 0.3);
    border-color: #6b5438;
}

.level-experience-label {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    color: #5d4037;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-experience-value {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 700;
    color: #3d2817;
    font-size: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.character-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f5e6d3;
    border-radius: 6px;
    border: 1px solid #d4a574;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #e8d5b7;
    border-color: #8b6f47;
    transform: translateX(3px);
}

.stat-label {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    color: #5d4037;
    font-size: 1rem;
}

.stat-value {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    color: #8b6f47;
    font-size: 1.1rem;
}

.character-attributes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f5e6d3;
    border-radius: 6px;
    border: 1px solid #d4a574;
    transition: all 0.3s ease;
}

.attribute-item:hover {
    background: #e8d5b7;
    border-color: #8b6f47;
    transform: translateX(3px);
}

.attribute-label {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    color: #5d4037;
    font-size: 1rem;
    text-transform: capitalize;
}

.attribute-value {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    color: #8b6f47;
    font-size: 1.1rem;
}

.inventory-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #b8956a;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #6b5438;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    letter-spacing: 1px;
}

.tab-btn:hover {
    color: #8b6f47;
}

.tab-btn.active {
    color: #8b6f47;
    border-bottom-color: #8b6f47;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.inventory-item {
    position: relative;
    background: #e8d5b7;
    border: 2px solid #b8956a;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    border-color: #8b6f47;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(139, 111, 71, 0.3);
}

.inventory-item h3 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 10px;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.inventory-item p {
    color: #5d4037;
    font-size: 0.9rem;
    margin: 5px 0;
}

/* Tooltip for item details on hover */
.inventory-item .item-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.inventory-item .item-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}


.inventory-item:hover .item-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.inventory-item .item-description {
    margin-bottom: 8px;
    line-height: 1.4;
}

.inventory-item .item-tooltip .scan-date {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.inventory-item .item-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.inventory-item .item-image-container {
    margin-bottom: 10px;
    height: 180px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5e6d3;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.inventory-item .item-image {
    width: 100%;
    height: 100%;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 4px;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.inventory-hint {
    position: relative;
    background: #e8d5b7;
    border-left: 4px solid #8b6f47;
    border-radius: 6px;
    padding: 20px;
    transition: all 0.3s ease;
}

.inventory-hint:hover {
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
    transform: translateX(5px);
}

.inventory-hint .location-hint {
    color: #5d4037;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

/* Tooltip for hint details on hover */
.inventory-hint .hint-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.inventory-hint .hint-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.inventory-hint:hover .hint-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.inventory-hint .hint-content {
    color: white;
    margin-bottom: 8px;
    line-height: 1.4;
}

.inventory-hint .hint-tooltip .scan-date {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.empty-state {
    text-align: center;
    color: #6b5438;
    padding: 40px;
    font-style: italic;
}

.scan-date {
    font-size: 0.85rem;
    color: #6b5438;
    margin-top: 10px;
}

/* FAQ Styles */
.intro-section {
    grid-column: 1 / -1;
}

.intro-section h2 {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    margin-bottom: 20px;
    color: #5d4037;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: none;
}

.intro-content {
    background: #e8d5b7;
    border: 2px solid #b8956a;
    border-radius: 8px;
    padding: 20px;
}

.intro-content p {
    color: #5d4037;
    line-height: 1.8;
    margin: 15px 0;
    font-size: 1rem;
}

.intro-content p:first-of-type {
    margin-top: 0;
}

.intro-content p:last-of-type {
    margin-bottom: 0;
}

.faq-section {
    grid-column: 1 / -1;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: #e8d5b7;
    border: 2px solid #b8956a;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #8b6f47;
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.2);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #5d4037;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: #8b6f47;
}

.faq-question .faq-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #8b6f47;
    flex-shrink: 0;
    margin-left: 15px;
}

.faq-item.active .faq-question .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    padding: 0 20px 20px 20px;
}

.faq-answer p {
    color: #5d4037;
    line-height: 1.6;
    margin: 10px 0;
}

.faq-answer p:first-child {
    margin-top: 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    color: #5d4037;
    margin: 10px 0;
    padding-left: 25px;
    line-height: 1.6;
}

.faq-answer li {
    margin: 8px 0;
}

.faq-answer strong {
    color: #8b6f47;
    font-weight: 600;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .character-inventory-container {
        flex-direction: column;
    }
    
    .character-section,
    .inventory-section {
        width: 100%;
    }
    
    .level-experience-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .level-experience-value {
        font-size: 1.5rem;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .scan-section {
        max-width: 100%;
    }
    
    .upload-area {
        min-height: 200px;
        padding: 30px 20px;
    }
    
    .upload-content svg {
        width: 64px;
        height: 64px;
    }
    
    .upload-content p {
        font-size: 1.1rem;
    }
    
    .upload-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .btn-upload {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        padding: 16px 24px;
        font-size: 1.1rem;
    }
    
    
    .btn {
        min-height: 48px;
        padding: 14px 28px;
        font-size: 1.1rem;
    }
    
    .image-preview img {
        max-height: 400px;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 15px;
        min-height: 44px;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 15px 15px 15px;
    }
}

/* Leaderboard Styles */
.leaderboard-section {
    width: 100%;
}

.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.leaderboard-table-container {
    background: #e8d5b7;
    border: 2px solid #b8956a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaderboard-table-container h3 {
    font-family: 'MedievalSharp', 'Cinzel Decorative', fantasy;
    font-weight: 600;
    margin-bottom: 20px;
    color: #5d4037;
    font-size: 1.3rem;
    letter-spacing: 1px;
    text-align: center;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 6px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #8b6f47 0%, #6b5438 100%);
    color: white;
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #5d4037;
}

.leaderboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    position: relative;
    padding-right: 30px;
}

.leaderboard-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-table th.sortable .sort-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.8;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: #f5f5f5;
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

.leaderboard-table td {
    padding: 12px 15px;
    color: #5d4037;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
}

.leaderboard-table td.loading,
.leaderboard-table td.empty-state,
.leaderboard-table td.error {
    text-align: center;
    padding: 30px;
    color: #6b5438;
    font-style: italic;
}

.leaderboard-table td.error {
    color: #721c24;
}

.rank-cell {
    font-weight: 600;
    color: #8b6f47;
    text-align: center;
    width: 80px;
}

.username-cell {
    font-weight: 500;
    color: #5d4037;
}

.level-cell {
    text-align: center;
    width: 100px;
    font-weight: 600;
    color: #8b6f47;
}

.experience-header {
    text-align: right !important;
    padding-right: 20px;
}

.leaderboard-table td.experience-cell {
    text-align: right !important;
    font-weight: 600;
    color: #6b5438;
    font-family: 'MedievalSharp', fantasy;
    padding-right: 20px;
}

.item-name-cell {
    font-weight: 500;
    color: #5d4037;
}

.count-cell {
    text-align: center;
    font-weight: 600;
    color: #8b6f47;
    width: 120px;
    font-family: 'MedievalSharp', fantasy;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #b8956a;
}

.pagination-info {
    text-align: center;
    color: #5d4037;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    border: 2px solid #8b6f47;
    background: #e8d5b7;
    color: #5d4037;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #d4a574;
    border-color: #6b5438;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e0e0e0;
    border-color: #b0b0b0;
}

.pagination-pages {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 2px solid #8b6f47;
    background: #e8d5b7;
    color: #5d4037;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-page-btn:hover {
    background: #d4a574;
    border-color: #6b5438;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.3);
}

.pagination-page-btn.active {
    background: linear-gradient(135deg, #8b6f47 0%, #6b5438 100%);
    color: white;
    border-color: #5d4037;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.4);
}

.pagination-page-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.5);
}

@media (max-width: 768px) {
    .leaderboard-container {
        gap: 20px;
    }
    
    .leaderboard-table-container {
        padding: 15px;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .leaderboard-table th.sortable {
        padding-right: 25px;
    }
    
    .pagination-controls {
        gap: 8px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .pagination-page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
}

/* Manual Input Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #8b6f47 0%, #6b5438 100%);
    border: 3px solid #5d4037;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
}

.modal-hint {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-body label {
    display: block;
    color: #d4af37;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
}

.manual-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #5d4037;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #3d2817;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.manual-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-buttons .btn {
    min-width: 100px;
}

.btn-manual {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-color: #495057;
}

.btn-manual:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.5);
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 90%;
    }
    
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        width: 100%;
    }
}

