
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
}

#sidebar-toggle {
    position: fixed;
    top: 10px;
    left: 230px; /* sit just to the right of the sidebar when expanded */
    z-index: 0; /* allow modal overlay to darken it */
    transition: left 0.3s ease;
}
body.sidebar-collapsed #sidebar-toggle { left: 10px; }

#toggle-sidebar {
    background: #f39c12;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
}

#sidebar {
    width: 210px;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

#sidebar.collapsed {
    transform: translateX(-210px);
}

#main-content {
    flex-grow: 1;
    padding: 40px;
    margin-left: 210px;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed #main-content {
    margin-left: 0;
}

body.sidebar-collapsed {
    margin-left: 0;
}

#sidebar h2 { display: none; }
#sidebar-logo {
    display: flex;
    justify-content: center;
    padding: 12px;
    margin: 10px 0 6px 0;
    background: #ffffff;
    border-radius: 8px; /* same shape as user box */
}
#sidebar-logo .logo { max-width: 140px; height: auto; }

#sidebar ul {
    list-style-type: none;
    padding: 0;
    margin-top: 12px;
}

#sidebar li {
    margin-bottom: 10px;
}

#sidebar a {
    text-decoration: none;
    color: #ecf0f1;
    font-size: 18px;
    transition: color 0.3s ease;
}

#sidebar a:hover, #sidebar a.active {
    color: #f39c12;
}

#user-area {
    margin-bottom: 14px;
    padding: 12px;
    background-color: #34495e;
    border-radius: 8px;
}

#user-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f39c12;
    color: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
}

#username-display, #team-display {
    display: block;
    margin-bottom: 5px;
    text-align: center;
    color: #ecf0f1;
}



/* Center tabs header for toplist */
/* Toplist panel with tabs that truly attach to the table */
.toplist-panel {
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    overflow: hidden; /* ensures seamless tab-to-table edge */
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.tabs-bar {
    display: flex;
    justify-content: center;
    gap: 0;
    background: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
}

.tab {
    flex: 1 1 50%;
    padding: 18px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7785;
    font-weight: 800;
    font-size: 24px;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.tab:hover {
    color: #2c3e50;
    background: #eef2f6;
}
.tab.active {
    color: #2c3e50;
    background: #ffffff;
    border-bottom-color: #f39c12;
}

.toplist-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0; /* remove any gap below tabs */
    table-layout: fixed; /* distribute widths consistently across columns */
}
.toplist-table thead th {
    background: #f6f8fa;
    color: #2c3e50;
    border-bottom: 1px solid #e1e4e8;
}
.toplist-table th, .toplist-table td {
    padding: 14px 16px;
    vertical-align: middle;
}
.toplist-table th:nth-child(1), .toplist-table td:nth-child(1) { /* Rank */
    padding-left: 32px; /* more left padding as requested */
    width: 12%;
}
.toplist-table th:nth-child(2), .toplist-table td:nth-child(2) { /* Time */
    width: 22%;
}
.toplist-table th:nth-child(3), .toplist-table td:nth-child(3) { /* User */
    width: 36%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.toplist-table th:nth-child(4), .toplist-table td:nth-child(4) { /* Date */
    width: 30%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
}

th {
    background-color: #34495e;
    color: #ecf0f1;
    font-weight: normal;
}

tr:nth-child(even) {
    background-color: #d5d8dc;
}

tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Highlight for the most recent entry */
.row-highlight {
    position: relative;
    animation: highlight-glow 2.5s ease-out forwards;
}

@keyframes highlight-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.9);
        background-color: rgba(46, 204, 113, 0.18);
    }
    30% {
        box-shadow: 0 0 0 8px rgba(46, 204, 113, 0.35);
        background-color: rgba(46, 204, 113, 0.12);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.18);
        background-color: rgba(46, 204, 113, 0.06);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
        background-color: inherit;
    }
}

button {
    width: 100%;
    padding: 10px 20px;
    background-color: #f39c12;
    color: #ffffff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
}

button:hover {
    background-color: #e67e22;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Pulsating/blinking attention style for drinking button */
#drinking-button {
    background-color: #e74c3c;
    color: #fff;
    animation: pulse .2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-sizing: border-box;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* darken everything behind modals, including toggle button */
}

.modal-content {
    background-color: #ffffff;
    margin: 6% auto;
    padding: 28px 28px 22px 28px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.modal-card {
    border-radius: 16px;
    width: 480px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border: 1px solid #eef2f5;
}
.modal-title { text-align: center; margin: 6px 0 18px 0; color: #2c3e50; }
.section { margin-top: 12px; }
.section-title { margin: 6px 0 10px 0; color: #2c3e50; }
.section-subtitle { margin: 10px 0; color: #2c3e50; }
.form-row.space-between { display: flex; justify-content: space-between; }
.form-row.align-center { display: flex; align-items: center; }
.chip { background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #2c3e50; }
.select { background: #f9fbfd; }
.btn { padding: 10px 14px; border-radius: 10px; border: 1px solid #dfe6eb; background: #ffffff; font-weight: 700; cursor: pointer; }
.btn:hover { background: #f6f8fa; }
.btn.primary { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; border: none; box-shadow: 0 6px 14px rgba(230,126,34,0.35); }
.btn.primary:hover { background: linear-gradient(135deg, #f1a128, #f39c12); }
.btn.danger { background: #e74c3c; color: white; border: none; }
.btn.outline { background: #ffffff; border: 2px solid #d0d7de; color: #2c3e50; }
.btn.outline:hover { background: #f6f8fa; border-color: #c4ccd3; }
.list { padding-left: 18px; }

/* Auth modal refined styling */
.auth-card {
    border-radius: 16px;
    width: 420px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border: 1px solid #eef2f5;
}
.auth-title {
    text-align: center;
    margin: 10px 0 18px 0;
    color: #2c3e50;
}
.auth-form .form-group {
    margin-bottom: 14px;
}
.input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #dfe6eb;
    outline: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    background: #f9fbfd;
}
.input:focus {
    border-color: #a0c4ff;
    box-shadow: 0 0 0 3px rgba(160,196,255,0.35);
    background: #ffffff;
}
.input-hint {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
}
.form-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 8px 0 16px 0;
}
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}
.btn.primary {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 10px;
    border: none;
    color: white;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 14px rgba(230,126,34,0.35);
}
.btn.primary:hover {
    background: linear-gradient(135deg, #f1a128, #f39c12);
}
.auth-footer {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}
.auth-footer .muted {
    color: #7f8c8d;
}
.link-accent {
    color: #2980b9;
    text-decoration: none;
    font-weight: 600;
}
.link-accent:hover {
    text-decoration: underline;
}

.close {
    color: #7f8c8d;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #2c3e50;
}

.results-content {
    text-align: center;
    width: 400px !important;
    background-color: #f0f8ff;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.result-big {
    font-size: 48px;
    font-weight: bold;
    color: #4CAF50;
    margin: 20px 0;
}

.result-medium {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
    margin: 15px 0;
}

.result-small {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

.toplist-container {
    display: flex;
    justify-content: space-between;
}

.toplist {
    width: 48%;
}

#toplist td:first-child, #toplist th:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

#toplist td:last-child, #toplist th:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}