:root {
    --main-1: #59392B;
    --main-2: #80471c;
    --main-3: #9A7b4f;
    --main-4: #ebd59b;
    --card: #e5e5e4;
    --text-1: #17181a;
}

* {
    color: var(--text-1);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--main-1) 0%, var(--main-2) 50%, var(--main-3) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-1);
    margin: 0;
}

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

/* App Container */
.app-container {
    display: block;
}

.app-container--hidden {
    display: none;
}

/* Main Content */
.main-content {
    display: block;
}

.main-content--hidden {
    display: none;
}

/* Header Styles */
.app-header {
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

.header-title {
    font-size: 2em;
    color: white;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-subtitle {
    margin: 0;
}

h1 {
    font-size: 2em;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95em;
}

/* Language Toggle Styles */
.language-toggle {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.lang-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-btn--active,
.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.lang-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Loading & Error Containers */
.error-container {
    /* Placeholder for dynamic error messages */
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2em;
}

.loading--hidden {
    display: none;
}

.error {
    background: #fc8181;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #68d391;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .language-toggle {
        top: 20px;
        right: 20px;
        margin-top: 15px;
        width: 100px;
    }

}

.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

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

.player-row {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 12px;
    transition: all 0.3s;
    gap: 12px;
    border: 1px solid rgba(150, 133, 143, 0.1);
}

.player-row:hover {
    box-shadow: 0 4px 12px rgba(150, 133, 143, 0.2);
    background: var(--main-4);
    cursor: pointer
}

.rank {
    font-size: 1.5em;
    font-weight: 300;
    width: 40px;
}

.player-name {
    flex: 1;
    font-weight: 400;
    font-size: 1.1em;
}

.player-points {
    font-size: 1.2em;
    font-weight: 300;
    margin-right: 10px;
}

.rounds-played {
    font-size: 0.85em;
    color: var(--main-2);
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

/* Date Input Styles */
.date-input-wrapper {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}

.date-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 1.1em;
}

#gameDateDisplay {
    text-align: center;
    width: 30%;
}

.date-input {
    padding: 8px;
    border: 2px solid rgba(150, 133, 143, 0.2);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.9);
}

.date-input--display {
    width: 250px;
    max-width: 100%;
    cursor: pointer;
    background: white;
}

.date-input--hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 250px;
}

.round-number-display {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--main-2);
    background: rgba(150, 133, 143, 0.12);
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

.divider {
    width: 100%;
    height: 6px;
    background: linear-gradient(180deg, var(--main-1) 0%, var(--main-2) 20%, var(--main-3) 50%);
}

.player-inputs {
    display: flex;
    justify-content: space-evenly;
    gap: 10px;
}

.player-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: space-around;
    padding: 10px 0;
}

.player-input-label-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
}

.player-input-label {
    padding-left: 12px;
    font-weight: 500;
    font-size: 1.1em;
}

.player-input-field {
    padding: 12px;
    border: 2px solid rgba(150, 133, 143, 0.2);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.9);
    width: 120px;
}

label {
    display: flex;
    justify-content: center;
    font-weight: 400;
}

input,
select {
    padding: 12px;
    border: 2px solid rgba(150, 133, 143, 0.2);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.9);
    width: 120px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #6D7993;
    background: white;
    box-shadow: 0 0 0 3px rgba(109, 121, 147, 0.1);
}

.button-group {
    text-align: center;
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--main-1) 0%, var(--main-2) 50%, var(--main-3) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(109, 121, 147, 0.3);
    width: 180px;
    margin-right: 10px
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--main-3) 0%, var(--main-2) 50%, var(--main-1) 100%);
    opacity: 0.8;
    box-shadow: 0 6px 20px rgba(109, 121, 147, 0.4);
}

.btn-secondary {
    background: var(--main-3);
    border: 1px solid rgba(150, 133, 143, 0.2);
    width: 180px;
    margin-left: 10px
}

.btn-secondary:hover:not(:disabled) {
    background: var(--main-1);
    color: white;
}

.game-nights-list {
    max-height: 600px;
    overflow-y: auto;
    margin-top: 15px;
}

.game-night-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #6D7993;
    border: 1px solid rgba(150, 133, 143, 0.15);
}

.game-night-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(150, 133, 143, 0.15);
    cursor: pointer;
    user-select: none;
}

.game-night-header:hover {
    opacity: 0.8;
}

.game-night-date {
    font-weight: 400;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 1.2em;
    color: #6D7993;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.night-winner {
    background: var(--main-4);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid rgba(255, 229, 199, 0.5);
}

.rounds-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    transition: all 0.3s ease;
    overflow-x: auto;
    padding-bottom: 10px;
}

.rounds-container.collapsed {
    display: none;
}

.round-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-width: 280px;
    flex-shrink: 0;
}

.round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.round-title {
    font-weight: 600;
    font-size: 1em;
}

.round-actions {
    display: flex;
    gap: 6px;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8em;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-edit {
    background: #4299e1;
    color: white;
}

.btn-edit:hover {
    background: #3182ce;
}

.btn-delete {
    background: #fc8181;
    color: white;
}

.btn-delete:hover {
    background: #f56565;
}

.round-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-container {
    height: 405px;
    position: relative;
    background: white;
    padding: 5px;
    border-radius: 10px;
}

.chart-container canvas {
    max-height: 400px !important;
    height: 400px !important;
}

/* Chart tab wrapper */
.chart-tab-wrapper {
    max-height: 600px;
    overflow-y: auto;

}

/* Chart Type Selector */
.chart-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-type-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid rgba(150, 133, 143, 0.2);
    border-radius: 10px;
    font-size: 1em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s;
    color: #4a5568;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.chart-type-btn:hover {
    background: var(--main-3);
    border-color: var(--main-2);
    box-shadow: 0 4px 12px rgba(109, 121, 147, 0.2);
}

.chart-type-btn--active,
.chart-type-btn.active {
    background: linear-gradient(135deg, var(--main-1) 0%, var(--main-2) 50%, var(--main-3) 100%);
    color: white;
    border-color: var(--main-1);
    box-shadow: 0 4px 12px rgba(109, 121, 147, 0.3);
}

.chart-type-btn--active:hover,
.chart-type-btn.active:hover {
    box-shadow: 0 6px 16px rgba(109, 121, 147, 0.4);
}

.tabs {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    gap: 10px;
    margin-bottom: 15px;
}

.tab {
    padding: 10px 20px;
    width: 33%;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1em;
    transition: all 0.2s;
    font-weight: 400;
    border-radius: none !important;
}

.tab--active,
.tab.active {
    font-weight: 500;
    opacity: 0.8;
    border-bottom: 6px solid var(--main-1);
    background: var(--main-4);
    border-radius: 15px 15px 0 0;
}

.tab:hover {
    background: var(--main-4);
    border-radius: 15px 15px 0 0;
}

.tab-content {
    display: block;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(150, 133, 143, 0.1);
}

.stat-label {
    font-size: 0.85em;
    color: var(--main-2);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 300;
    color: #6D7993;
}

.info-box {
    background: var(--main-4);
    opacity: 0.8;
    border: 1px solid rgba(150, 133, 143, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* Login Screen Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    margin: -20px;
}

/* FIX 2: Two hidden states for login — one for initial load, one for after JS takes over */
.login-container--hidden {
    display: none;
}

.login-container--initial-hidden {
    display: none;
}

.login-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    position: relative;
}

.login-left {

    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(154, 123, 79, 0.4) 0%, transparent 70%);
    filter: blur(80px);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2) translate(-30px, 30px);
        opacity: 0.8;
    }
}

.login-branding {
    color: white;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.login-heading {
    font-size: 3.5em;
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.login-heading em {
    font-style: italic;
    color: var(--main-4);
}

.login-description {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-weight: 300;
}

.login-right {
    background: white;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--main-2);
    margin-bottom: 40px;
    font-size: 1em;
    font-weight: 300;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-error-container {
    /* Placeholder for dynamic login errors */
}

.login-input {
    padding: 16px 20px;
    border: 2px solid rgba(150, 133, 143, 0.2);
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s;
    background: white;
    width: 100%;
}

.login-input:focus {
    outline: none;
    border-color: var(--main-2);
    box-shadow: 0 0 0 3px rgba(128, 71, 28, 0.1);
}

.login-button {
    padding: 16px;
    background: linear-gradient(135deg, var(--main-1) 0%, var(--main-2) 50%, var(--main-3) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(89, 57, 43, 0.3);
    width: 100%;
}

.login-button:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(89, 57, 43, 0.4);
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-error {
    background: rgba(232, 180, 180, 0.2);
    border: 1px solid rgba(232, 180, 180, 0.4);
    color: #8B4A4A;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9em;
}

@media (max-width: 900px) {
    .login-card {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .login-left {
        padding: 60px 30px;
        min-height: 40vh;
    }

    .login-right {
        padding: 60px 30px;
    }

    .login-heading {
        font-size: 2.5em;
    }
}

/* Translation loading overlay */
.translation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(109, 121, 147, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.translation-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.translation-spinner {
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.translation-text {
    font-size: 1.2em;
    font-weight: 600;
}

/* Player Profile Modal */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.profile-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.profile-close:hover {
    background: #cbd5e0;
    transform: scale(1.1);
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #6D7993;
    box-shadow: 0 8px 24px rgba(109, 121, 147, 0.3);
}

.profile-avatar-emoji-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    border: 4px solid #6D7993;
    box-shadow: 0 8px 24px rgba(109, 121, 147, 0.3);
}

.profile-change-avatar {
    display: block;
    margin: 15px auto 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--main-1) 0%, var(--main-2) 50%, var(--main-3) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(89, 57, 43, 0.3);
}

.profile-change-avatar:hover {
    box-shadow: 0 6px 16px rgba(89, 57, 43, 0.4);
}

.profile-name {
    font-size: 2em;
    margin: 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.profile-stat-item {
    background: var(--card);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(150, 133, 143, 0.1);
}

.profile-stat-label {
    font-size: 0.9em;
    color: var(--main-2);
    margin-bottom: 8px;
}

.profile-stat-value {
    font-size: 2em;
    font-weight: 300;
}

/* Avatar Options */
.avatar-options {
    text-align: center;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.emoji-option {
    width: 60px;
    height: 60px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-option:hover {
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Round Scores with Avatars */
.score-entry-avatar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.score-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.score-player-name {
    font-weight: 500;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.score-value {
    font-size: 1em;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

.score-rank {
    font-size: 0.75em;
    font-weight: 500;
    background: rgba(109, 121, 147, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Player Avatar Styles */
.player-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.player-avatar--sm {
    width: 36px;
    height: 36px;
}

.player-avatar--md {
    width: 45px;
    height: 45px;
}

.player-avatar--lg {
    width: 55px;
    height: 55px;
}

.player-avatar-emoji {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 50%;
}

.player-avatar-emoji--sm {
    font-size: 22px;
    width: 32px;
    height: 32px;
}

.player-avatar-emoji--md {
    font-size: 28px;
    width: 40px;
    height: 40px;
}

.player-avatar-emoji--lg {
    font-size: 32px;
    width: 50px;
    height: 50px;
}

/* Edit Modal Styles */
.edit-modal-content {
    max-width: 500px;
}

.edit-modal-title {
    margin-bottom: 20px;
}

.edit-modal-date-wrapper {
    margin-bottom: 20px;
}

.edit-modal-date-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.edit-modal-date-display {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

.edit-modal-date-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.edit-modal-scores {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.edit-modal-score-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
    align-items: center;
}

.edit-modal-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-modal-player-name {
    font-weight: 500;
}

.edit-modal-score-input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.edit-modal-buttons {
    display: flex;
    gap: 10px;
}

.edit-modal-button {
    flex: 1;
}

/* Avatar Modal Styles */
.avatar-modal-title {
    margin-bottom: 20px;
}

.avatar-section-title {
    margin-bottom: 15px;
}

.avatar-upload-section {
    margin: 30px 0;
    border-top: 2px solid #e2e8f0;
    padding-top: 30px;
}

.avatar-upload-note {
    font-size: 0.85em;
    margin-top: 10px;
}

/* Stats Grid Specific Styles */

.stats-grid {
    display: flex;
    justify-content: center;
}

.stats-grid-container {
    display: grid;
    grid-template-columns: minmax(200px, auto) repeat(4, 1fr);
    gap: 8px 20px;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 10px;
    width: 80%;
}

.stats-grid-header-cell {
    text-align: center;
    padding: 15px 10px;
}

.stats-grid-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stats-grid-player-name {
    margin: 0;
    font-weight: 500;
    font-size: 1em;
}

.stats-grid-row-label {
    text-align: left;
    padding-left: 40px;
    color: var(--main-2);
    font-size: 1.0em;
    font-weight: 500;
}

.stats-grid-value-cell {
    text-align: center;
    padding: 12px;
}

.stats-grid-value {
    font-size: 1.2em;
    font-weight: 300;
}

/* Negative value styling */
.score-value--negative {
    color: #e53e3e !important;
}

.stats-grid-value--negative {
    color: #e53e3e !important;
}

/* ── Night Result Card ───────────────────────────────────── */
.night-result-card {
    background: var(--main-4);
    opacity: 0.85;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--main-3);
    min-width: 280px;
    flex-shrink: 0;
}

.night-result-header {
    display: flex;
    align-items: center;
    min-height: 24px;
    font-weight: 600;
    font-size: 0.85em;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    color: var(--main-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.night-result-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.night-result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.result-pos {
    font-weight: 700;
    font-size: 0.9em;
    color: #718096;
    width: 28px;
    flex-shrink: 0;
}

.result-player-name {
    flex: 1;
    font-size: 0.95em;
}

.result-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.result-pts {
    font-size: 0.8em;
    color: #718096;
    min-width: 40px;
    text-align: right;
}

.result-gp {
    font-size: 0.8em;
    color: #718096;
    min-width: 44px;
    text-align: right;
}

.result-euro {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--main-2);
    background: rgba(150, 133, 143, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 36px;
    text-align: center;
}

/* ── Pool Footer (Leaderboard) ───────────────────────────── */
.pool-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.pp-pools {
    display: flex;
    gap: 10px
}

.pool-footer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;

    border-radius: 10px;
}

.pool-footer-row--total {

    border-color: var(--main-3);
}

.pool-footer-label {
    font-size: 0.78em;
    font-weight: 500;
    color: var(--main-2);
    white-space: nowrap;
}

.pool-footer-label a {
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    color: var(--main-2);
    transition: color 0.15s ease;
}

.pool-footer-label a:hover {
    color: var(--main-3);
    text-decoration: none;
}

.pool-footer-value {
    font-size: 1em;
    font-weight: 700;
    color: var(--main-2);
    text-align: center;
}

.pool-footer-row--total .pool-footer-value {
    font-weight: 800;
    color: var(--main-1);
}