/* style.css */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    text-align: center;
    background-color: #121213;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #ffffff;
}

h1 {
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#header-container {
    transition: margin-top 0.3s ease;
}

#game-container {
    max-width: 350px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: max-width 0.3s ease;
}

.row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.fade-out {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.15s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tile {
    width: calc((100% - 20px) / var(--word-length, 5));
    aspect-ratio: 1;
    min-height: 42.5px;
    border: 2px solid #3a3a3c;
    margin: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #1c1c1c;
    color: #ffffff;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tile:hover {
    border-color: #4a4a4c;
    transform: translateY(-1px);
}

.keyboard {
    margin-top: 20px;
    user-select: none;
    padding: 10px;
    background-color: #1a1a1b;
    border-radius: 8px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    background-color: #818384;
    border: 0;
    border-radius: 6px;
    margin: 0 3px;
    padding: 0;
    min-width: 42px;
    height: 58px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key:hover {
    background-color: #919394;
    transform: translateY(-1px);
}

.key:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.key-wide {
    min-width: 65px;
}

.key.key-wide[data-key="enter"] {
    font-size: 15px;
}

.correct {
    background-color: #538d4e;
    color: white;
    border-color: #538d4e;
    box-shadow: 0 2px 8px rgba(83, 141, 78, 0.3);
}

.present {
    background-color: #b59f3b;
    color: white;
    border-color: #b59f3b;
    box-shadow: 0 2px 8px rgba(181, 159, 59, 0.3);
}

.absent {
    background-color: #3a3a3c;
    color: white;
    border-color: #3a3a3c;
}

.message {
    font-size: 18px;
    font-weight: 600;
    height: 24px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    30% { transform: translateX(5px); }
    50% { transform: translateX(-5px); }
    70% { transform: translateX(5px); }
    90% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.bounce {
    animation: bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.flip {
    animation: none;
}

@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

#new-game-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background-color: #538d4e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(83, 141, 78, 0.3);
}

#new-game-btn:hover {
    background-color: #4a7d45;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(83, 141, 78, 0.4);
}

#new-game-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(83, 141, 78, 0.3);
}

/* Settings Panel Styles */
.settings-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: #1c1c1c;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #3a3a3c;
}

.settings-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #3a3a3c;
}

.settings-section {
    border-bottom: 1px solid #3a3a3c;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-section-header:hover {
    background-color: #2a2a2c;
}

.settings-section-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
}

.arrow {
    color: #ffffff;
    transition: transform 0.2s ease;
}

.settings-section-header.collapsed .arrow {
    transform: rotate(0deg);
}

.settings-section-header:not(.collapsed) .arrow {
    transform: rotate(180deg);
}

.settings-section-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.settings-section-header:not(.collapsed) + .settings-section-content {
    padding: 15px 20px;
    max-height: 800px;
}

.settings-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1c1c1c;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 999;
}

.settings-toggle:hover {
    background-color: #2a2a2c;
    transform: scale(1.1);
}

.settings-toggle svg {
    width: 24px;
    height: 24px;
}

.settings-toggle.simulate-active {
    background-color: #2ecc40 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(46,204,64,0.3);
}

.setting-item {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #ffffff;
    font-size: 16px;
}

.setting-select {
    background-color: #2a2a2c;
    color: #ffffff;
    border: 1px solid #3a3a3c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.setting-select:hover {
    border-color: #4a4a4c;
}

.setting-select:focus {
    outline: none;
    border-color: #538d4e;
}

.number-input-container {
    display: flex;
    align-items: center;
    background-color: #2a2a2c;
    border: 1px solid #3a3a3c;
    border-radius: 4px;
    overflow: hidden;
}

.number-input-btn {
    background-color: #3a3a3c;
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.number-input-btn:hover {
    background-color: #4a4a4c;
}

.setting-input {
    background-color: #2a2a2c;
    color: #ffffff;
    border: none;
    width: 50px;
    height: 32px;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

.setting-input::-webkit-outer-spin-button,
.setting-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.setting-input-wide {
    background-color: #2a2a2c;
    color: #ffffff;
    border: 1px solid #3a3a3c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.setting-input-wide:hover {
    border-color: #4a4a4c;
}

.setting-input-wide:focus {
    outline: none;
    border-color: #538d4e;
}

.test-btn {
    background-color: #b59f3b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    width: 100%;
}

.test-btn:hover {
    background-color: #a08f35;
}

.test-btn:active {
    transform: translateY(1px);
}

.setting-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #538d4e;
    cursor: pointer;
}

.setting-checkbox:hover {
    transform: scale(1.1);
}

/* Profile Settings Styles */
.profile-upload {
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #3a3a3c;
    background-color: #2a2a2c;
}

.profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 200px;
}

.upload-btn {
    background-color: #538d4e;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}

.upload-btn:hover {
    background-color: #4a7d45;
}

.remove-btn {
    background-color: #3a3a3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-btn:hover {
    background-color: #4a4a4c;
}

.tile.profile-img-tile {
    width: calc((100% - 20px) / var(--word-length, 5));
    aspect-ratio: 1;
    min-height: 42.5px;
    border: 2px solid #3a3a3c;
    margin: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1c1c1c;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.profile-img-in-tile {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    transition: opacity 0.15s ease;
}

.profile-username-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 2px 3px;
    line-height: 1.2;
    z-index: 2;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row.fade-out .profile-img-in-tile {
    opacity: 0;
}

#group-guess-bar-chart {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0;
    margin: 24px auto 0 auto;
    min-height: 220px;
    height: 220px;
    max-width: 100%;
    width: max-content;
    overflow-x: auto;
    background: none;
    scrollbar-width: none; /* Firefox */
    transition: height 0.3s ease, min-height 0.3s ease;
}
#group-guess-bar-chart::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.bar-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    max-width: 64px;
    position: relative;
    padding: 0;
    background: none;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.35s cubic-bezier(.36,.07,.19,.97);
    z-index: 1;
}

#group-guess-bar-chart .bar-stack {
    z-index: unset;
}

.bar-word-label {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 40px;
    background: #111;
    border-radius: 8px;
    padding: 2px 8px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.bar-user-img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid #3a3a3c;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    background: #222;
    object-fit: cover;
    z-index: 1;
    display: block;
    transition: transform 0.2s ease;
}

.bar-user-img:hover {
    transform: scale(1.1);
    z-index: 2;
}

.bar-stack .bar-user-img + .bar-user-img {
    margin-top: 2px;
}

/* Winning Modal Styles */
.winning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.winning-overlay.show {
    opacity: 1;
    visibility: visible;
}

.winning-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
}

.close-winning-stats-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.close-winning-stats-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.winning-overlay.show .winning-modal {
    transform: scale(1);
}

.winning-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.winning-word {
    font-size: 1.5em;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Single Winner Styles */
.single-winner {
    display: none;
    flex-direction: column;
    align-items: center;
}

.winner-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin-bottom: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.winner-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Group Winners Styles */
.group-winners {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.group-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
}

.group-winner-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-bottom: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.group-winner-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
    word-break: break-word;
}

/* Modal Streak Metrics */
.modal-streak-metrics {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-streak-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.modal-streak-number {
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.modal-streak-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .winning-modal {
        padding: 30px 20px;
    }
    
    .winning-title {
        font-size: 2em;
    }
    
    .winner-photo {
        width: 120px;
        height: 120px;
    }
    
    .group-winner-photo {
        width: 50px;
        height: 50px;
    }
    
    .group-winners {
        gap: 12px;
    }
    
    .group-winner {
        padding: 10px;
        min-width: 70px;
    }
    
    .group-winner-name {
        font-size: 0.8em;
    }
    
    .modal-streak-metrics {
        gap: 20px;
    }
    
    .modal-streak-number {
        font-size: 20px;
    }
    
    .modal-streak-label {
        font-size: 0.7em;
    }
    
    .profile-username-overlay {
        font-size: 10px;
        padding: 1px 2px;
    }
}

.setting-textarea {
    background-color: #2a2a2c;
    color: #ffffff;
    border: 1px solid #3a3a3c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    resize: vertical;
    font-family: inherit;
}

.setting-textarea:hover {
    border-color: #4a4a4c;
}

.setting-textarea:focus {
    outline: none;
    border-color: #538d4e;
}

/* Instruction Popup Styles */
.instruction-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 350px;
    z-index: 999;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
}

.instruction-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.instruction-popup.slide-out {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.instruction-popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.instruction-popup-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.instruction-popup-gif {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Info Button Styles */
.info-toggle {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1c1c1c;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 998;
}

.info-toggle:hover {
    background-color: #2a2a2c;
    transform: scale(1.1);
}

.info-toggle svg {
    width: 24px;
    height: 24px;
}

/* Responsive adjustments for instruction popup */
@media (max-width: 600px) {
    .instruction-popup {
        width: calc(100vw - 40px);
        max-width: 350px;
    }
    
    .instruction-popup.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    
    .instruction-popup.slide-out {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    
    .instruction-popup-content {
        padding: 15px;
    }
    
    .instruction-popup-text {
        font-size: 14px;
    }
    
    .info-toggle {
        top: 70px;
        right: 15px;
    }
}

/* Best guess styling for individual mode */
.tile.best-guess {
    position: relative;
    border: 2px solid #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.best-guess-star {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 12px;
    background: #ffd700;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: bold;
    z-index: 10;
}

.tile.best-guess.correct {
    background-color: #6aaa64;
    border-color: #5a8f54;
    color: white;
}

.tile.best-guess.present {
    background-color: #c9b458;
    border-color: #b8a042;
    color: white;
}

.tile.best-guess.absent {
    background-color: #787c7e;
    border-color: #6a6d70;
    color: white;
}

.loss-gif {
    width: 300px;
    height: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

/* Statistics Card Styles */
.statistics-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background-color: #1c1c1c;
    border: 2px solid #3a3a3c;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 900;
    user-select: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.statistics-card.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.statistics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #3a3a3c;
    cursor: move;
    background-color: #2a2a2c;
    border-radius: 10px 10px 0 0;
}

.statistics-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.close-statistics-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-statistics-btn:hover {
    background-color: #3a3a3c;
}

.statistics-content {
    padding: 20px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.statistics-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #3a3a3c;
}

.clear-statistics-btn {
    background-color: #d73527;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-statistics-btn:hover {
    background-color: #c23128;
}

.clear-statistics-btn:active {
    background-color: #a02622;
    transform: translateY(1px);
}

/* Dragging state */
.statistics-card.dragging {
    opacity: 0.8;
    transform: rotate(2deg);
    transition: none;
    z-index: 1000;
}

/* Responsive adjustments for statistics card */
@media (max-width: 600px) {
    .statistics-card {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

.floating-leaderboard {
    background: #1a1a1a;
    border-color: #444;
  }
  
  .floating-leaderboard-header {
    background: #2d2d2d;
    border-bottom-color: #444;
  }
  
  .leaderboard-item {
    background: #2d2d2d;
  }
  
  .leaderboard-username {
    color: #e0e0e0;
  }
  
  .leaderboard-rank {
    color: #b0b0b0;
  }
  
  .leaderboard-page-info {
    color: #b0b0b0;
  }
  
  .leaderboard-nav-btn:hover:not(:disabled) {
    background: #444;
  }
  
  .leaderboard-empty {
    color: #b0b0b0;
  }

  /* Floating Leaderboard */
.floating-leaderboard {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    font-family: 'Nunito', Arial, sans-serif;
    cursor: move;
    user-select: none;
  }
  
  .floating-leaderboard.opacity-50 {
    opacity: 0.8;
  }
  
  .floating-leaderboard-header {
    background: #333;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #444;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: move;
  }
  
  .floating-leaderboard-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .floating-leaderboard-toggle:hover {
    background: #444;
    border-radius: 3px;
  }
  
  .floating-leaderboard-body {
    padding: 8px;
    max-height: 290px;
    overflow-y: auto;
    display: block;
  }
  
  .leaderboard-height-toggle {
    position: sticky;
    bottom: 4px;
    left: 220px;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
    margin-left: 210px;
  }
  
  .floating-leaderboard-body.collapsed {
    display: none;
  }
  
  .leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #3a3a3a;
    border-radius: 4px;
    padding: 6px 10px;
    height: 36px;
  }
  
  .leaderboard-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }
  
  .leaderboard-rank {
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 18px;
    text-align: right;
    flex-shrink: 0;
  }
  
  .leaderboard-img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
    background: #555;
    flex-shrink: 0;
  }
  
  .leaderboard-username {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
  }
  
  .leaderboard-points {
    color: #4285f4;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
  }
  
  .leaderboard-empty {
    color: #888;
    font-size: 0.8rem;
    text-align: center;
    padding: 20px;
    font-style: italic;
  }
  
  .leaderboard-controls {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .leaderboard-nav-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.2s;
  }
  
  .leaderboard-nav-btn:hover:not(:disabled) {
    background: #444;
  }
  
  .leaderboard-nav-btn:disabled {
    color: #666;
    cursor: not-allowed;
  }
  
  .leaderboard-page-info {
    color: #ccc;
    font-size: 16px;
    min-width: 24px;
    text-align: center;
    margin: 0 2px;
  }