body {
    background-color: #121212;
    color: #E0E0E0;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
}

h2 {
    color: #FFB74D;
}

h3 {
    color: #B3B3B3;
}

a {
    color: #FFB74D;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-header {
    background-image: url('/static/banner.png');
    background-size: contain;
    background-position: top center;
    background-repeat: no-repeat;
    height: 200px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background-color: black;
}

.page-greeting {
    position: absolute;
    transform: translateX(-50%);
    font-size: 28px !important;
    font-weight: bold !important;
    font-family: 'Arial', sans-serif !important;
    line-height: 1.2;
    display: block;
    color: #fff;
    text-shadow: 0 0 4px #000, 0 0 8px #111;
    background-color: rgba(0, 0, 0, 0.3);
    bottom: 12px;
    left: 50%;
    padding: 6px 16px;
    border-radius: 12px;
}

form {
  margin: 0;
  padding: 0;
}

.header img {
    width: 150px;
    height: auto;
}

.container {
    padding: 20px;
    margin-top: 20px;
    display: flex;
    gap: 40px; /* slightly larger gap because we're putting a line */
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    align-items: flex-start; /* important for button later too */
    position: relative;
}

.score-table {
    width: auto;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.score-table th,
.score-table td {
    width: auto;
    max-width: 200px;
    border: none;
    border-bottom: 1px solid #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-table td {
    padding: 4px 8px;
}

.score-table th {
    padding: 4px 8px;
    text-align: center;
    background-color: #333;
}

.score-cell {
    font-size: 0.9rem;
    padding: 2px 4px;
    text-align: right;
}

.score-table tbody tr:hover td {
    background-color: #002f2f !important;
    transition: background-color 0.3s ease;
}

.score-table tbody tr:nth-child(even) {
    background-color: #1A1A1A;
}
.score-table tbody tr:nth-child(odd) {
    background-color: #262626;
}

.score-table td.score-cell,
.score-table th.score-header {
    width: 125px;
}

.player-name {
    font-size: 1.1rem;
    color: white;
    text-shadow:
        0 0 3px black,
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
    text-align: left;
}

.upload-button {
    background-color: #FFB74D;
    color: #121212;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
}

.upload-button:hover {
    background-color: #FF9800;
}

/* Modal Background (the dark overlay) */
.modal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal.show {
    opacity: 1;
}

/* Modal Content Box */
.modal-content {
    background-color: #1e1e1e;
    color: white;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 40%;
    max-width: 600px;
    text-align: center;
    position: relative;
    top: 50%;
    transform: translateY(-50%) scale(0.95);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.modal-content.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

input[type="file"] {
    width: 100%;
    background-color: #2b2b2b;
    color: #ddd;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.95rem;
}

input[type="file"]::file-selector-button {
    background-color: #3360b2;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background-color: #2a4e91;
}

.close {
    color: #E0E0E0;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #FFB74D;
    text-decoration: none;
    cursor: pointer;
}

.player-row.selected td {
    background-color: #002f2f !important;
}

#merge-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #1F1F1F;
    margin-top: 40px;
    color: #B3B3B3;
}

.flash-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    opacity: 1;
}

.flash-banner.success {
    background-color: #2e7d32;
    color: #ffffff;
}

.flash-banner.error {
    background-color: #b71c1c;
    color: #ffffff;
}

.low-score {
    background-color: #2d0000 !important;
    color: #ffcccc;
    font-weight: bold;
    animation: pulse-inner-glow 5s infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse-inner-glow {
    0% {
        box-shadow: inset 0 0 0px #800000;
    }
    50% {
        box-shadow: inset 0 0 8px 2px #a60000;
    }
    100% {
        box-shadow: inset 0 0 0px #800000;
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInAnimation ease 1s;
    animation-fill-mode: forwards;
    animation-delay: 0.2s;
}

@keyframes fadeInAnimation {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.merge-button {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: gray;
    color: white;
    cursor: not-allowed;
    transition: all 0.3s ease;
    box-shadow: none;
}

.merge-button.enabled {
    background-color: #2e7d32; /* dark green */
    cursor: pointer;
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.8);
}

.merge-button.enabled:hover {
    background-color: #43a047; /* lighter green on hover */
    box-shadow: 0 0 12px rgba(67, 160, 71, 0.8);
}

.theme-text {
    font-size: 0.75rem;
    color: #aaa;
    font-style: italic;
}

.dashboard-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    width: 100%;
}

.dashboard-pair > div {
    flex: 1 1 48%;
    min-width: 260px;
}

.dashboard-pair .score-table {
    width: 100%;
    font-size: 0.85rem;
    table-layout: fixed;
}

.dashboard-pair th,
.dashboard-pair td {
    padding: 4px 6px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-pair .score-table th,
.dashboard-pair .score-table td {
    width: auto;
    max-width: unset;
    padding: 4px 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Narrow, precise column widths for dashboard tables */
.dashboard-pair .score-table th:first-child,
.dashboard-pair .score-table td:first-child {
    width: 36px;
    max-width: 36px;
    text-align: center;
}

.dashboard-pair .score-table th:nth-child(2),
.dashboard-pair .score-table td:nth-child(2) {
    width: 140px;
    max-width: 160px;
    text-align: left;
}

.dashboard-pair .score-table th:nth-child(3),
.dashboard-pair .score-table td:nth-child(3) {
    width: 100px;
    max-width: 100px;
    text-align: right;
}

section > h2 {
    margin-bottom: 0px; /* or even 8px */
}

.dashboard-pair h3 {
    margin-bottom: 6px;
}

/* Buttons */
.small-btn {
    padding: 4px 8px;
    font-size: 12px;
    margin-top: 4px;
    border-radius: 6px;
    display: inline-block;
    background-color: #FFB74D;
    border: none;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.4);
	color: black;
	transition: background-color 0.3s ease-in-out;
}

.small-btn:hover {
    background-color: #FF9800;
}

.red-btn {
	background-color: #c62828;
    color: white;
}

.red-btn:hover {
    background-color: #8e0000;
}

.green-btn {
	background-color: #2e7d32;
    color: white;
}

.green-btn:hover {
    background-color: #1b5e20;
}

.blue-btn {
	background-color: #233d92;
    color: white;
}

.blue-btn:hover {
    background-color: #324da5;
}

.purple-btn {
    background-color: #4c2994;
    color: white;
}

.purple-btn:hover {
    background-color: #5933a6;
}

.grey-btn {
    background-color: #444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.grey-btn:hover {
    background-color: #666;
}

.delete-btn {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    transition: color 0.3s ease-in-out;
}

.delete-btn:hover {
    color: darkred;
}

#auth-controls {
    display: none;
}

.rename-cell:hover .rename-btn {
    visibility: visible;
}

/* Optional: reserve space to prevent shifting */
.rename-btn::before {
    content: '✏️';
    visibility: hidden;
}

.rename-btn {
    font-size: 14px;
    color: #ccc;
}

.player-table-container {
    width: 100%;
    max-width: 630px; /* Weekly table is ~900px, so 30% smaller */
    margin: 0 auto;    /* Center it horizontally */
}

.floating-bar {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    gap: 20px;
    align-items: center;
    animation: fadeIn 0.3s ease;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#action-bar.dimmed {
    opacity: 0.1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.more-aliases {
    color: #3360b2;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 4px;
    text-decoration: none;
}
.more-aliases:hover {
    color: #517dce;
}

.identity-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #222;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
}

.identity-checkbox:checked {
    background-color: #1a2a3a;
}

.identity-checkbox:checked::after {
    content: "✔";
    position: absolute;
    top: -2px;
    left: 3px;
    font-size: 14px;
    color: #3360b2;
    font-weight: bold;
    pointer-events: none;
}

#upload-filename {
    margin-bottom: 6px;
}

#upload-spinner {
    display: none;
    width: 28px;
    height: 28px;
    margin: 10px auto;
    border: 4px solid #444;
    border-top: 4px solid #3360b2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#upload-spinner.visible {
    opacity: 1;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}