body {
  font-family: system-ui, sans-serif;
  padding: 1rem;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
}

h1, h2, h3 {
    color: #ffffff;
}

/* Main content */
/*==============*/
#main-content {
    flex-grow: 1;
    flex-basis: 0;
    overflow-wrap: break-word;
    min-width: 0;
    padding: 1rem;
}

#content {
    margin-top: 1rem;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

#game-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;

    max-width: 85%;
    margin: auto;
}

/* Sidebar */
/*=========*/
#sidebar {
    width: 220px;
    flex-shrink: 0;
    background-color: #1b1b1b;
    color: #e0e0e0;
    padding: 1rem;
    border-right: 1px solid #333;
    box-sizing: border-box;
    position: sticky;
    top: 1rem;
    height: fit-content;
}

#home-btn {
    cursor: pointer;
}

#sidebar h2 {
    margin-top: 0;
    color: #ffffff;
}

#sidebar p {
    margin: 0.5rem 0;
}

.tooltip {
    position: absolute;
    max-width: 300px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.tooltip.visible {
    opacity: 1;
}

/* Images */
#content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    pointer-events: none;
}

#content .infobox img {
    max-width: 100%;
    border-radius: 4px;
}

/* Infoboxes / tables */
#content .infobox,
#content .infobox_v2,
#content tr,
#stub,
#content .article-about-box,
#content table {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border: 1px solid #333;
}

/* Navboxes */
#content .navbox,
.NavHead,
.NavContent,
th,
td,
#content .vertical-navbox,
#content .metadata {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Table rows and cells */
#content table th,
#content table td {
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

/* Links inside tables */
#content table a {
    color: #90caf9 !important;
}

/* Page title */
#page-title {
    transition: color 0.3s ease, opacity 0.4s ease-in-out;
}

/* Header */
header h1 {
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #90caf9;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: #f48fb1;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Paragraphs, lists, tables */
p, li, table {
    color: #e0e0e0;
}

/*=== Start overlay ===*/
#start-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(8px);
    background-color: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

#start-box {
    background-color: #1e1e1e;
    color: #e0e0e0;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    min-width: 400px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
}

/* Custom scrollbar for modal */
#start-box::-webkit-scrollbar {
    width: 8px;
}

#start-box::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 10px;
}

#start-box::-webkit-scrollbar-thumb {
    background: #90caf9;
    border-radius: 10px;
}

#start-box::-webkit-scrollbar-thumb:hover {
    background: #64b5f6;
}

#start-box input {
    width: 100%;
    padding: 0.7rem;
    margin: 0 0 1rem 0;
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    outline: none;
    font-size: 1rem;
    box-sizing: border-box;
    display: block;
}

#start-box input:hover {
    border-color: #90caf9;
}

#wiki-lang,
#gamemode {
    width: 100%;
    padding: 0.7rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

#wiki-lang:hover,
#gamemode:hover {
    border-color: #90caf9;
}

#time-limit-preset,
#custom-time-input {
    width: 100%;
    padding: 0.7rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

#time-limit-preset:hover,
#custom-time-input:hover {
    border-color: #90caf9;
}

#start-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

/* Dropdowns container */
.dropdowns-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dropdown-section {
    flex: 1;
}

/* Time limit section - hidden by default */
.time-limit-section {
    margin-bottom: 1rem;
}

.time-limit-section.hidden {
    display: none !important;
}

/* Page input sections - hidden by default for random mode */
.page-input-section {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.page-input-section label {
    min-width: 100px;
    text-align: left;
    margin-bottom: 0;
}

.page-input-section input {
    flex: 1;
    width: auto;
    margin: 0;
}

/* Buttons container with flexbox layout */
#start-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#start-box button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#start-box button:hover {
    transform: translateY(-2px);
}

.button-container button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.button-container button:hover {
    transform: translateY(-2px);
}

/* All buttons - Blue */
#start-game-btn,
#create-party-btn,
#join-party-btn {
    background-color: #90caf9;
    color: #121212;
}

#start-game-btn:hover,
#create-party-btn:hover,
#join-party-btn:hover {
    background-color: #64b5f6;
}

/* Separator styling */
#start-box br {
    display: none;
}

/* Button container for party buttons */
.button-container {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 0.8rem;
}

/*=== Win overlay ===*/
#win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(5px);
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

#win-box {
    background-color: #1e1e1e;
    color: #e0e0e0;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

#win-box button {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    background-color: #90caf9;
    color: #121212;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#win-box button:hover {
    background-color: #64b5f6;
    transform: translateY(-2px);
}

a[style*="not-allowed"] {
    color: #a44;
    text-decoration: none;
}

#party-lobby-modal {
    text-align: center;
    /* if you prefer flex centering (JS sets display:flex) */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.party-lobby-content {
    background-color: #252525;
    border-radius: 10px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
}

.party-lobby-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #90caf9;
    font-size: 1.5rem;
}

.party-info {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.party-info p {
    margin: 0.5rem 0;
}

.party-code-display {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4CAF50;
    margin: 0.5rem 0 0 0 !important;
}

.party-gamemode {
    margin-bottom: 1.5rem;
}

.party-gamemode label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

.party-gamemode select {
    width: 100%;
    padding: 0.7rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    box-sizing: border-box;
}

.party-gamemode select:hover {
    border-color: #90caf9;
}

.party-gamemode select:focus {
    outline: none;
    border-color: #90caf9;
    box-shadow: 0 0 5px rgba(144, 202, 249, 0.3);
}

.party-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.party-buttons button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.party-buttons button:nth-child(1) {
    background-color: #90caf9;
    color: #121212;
}

.party-buttons button:nth-child(1):hover {
    background-color: #64b5f6;
    transform: translateY(-2px);
}

.party-buttons button:nth-child(2) {
    background-color: #f44336;
    color: white;
}

.party-buttons button:nth-child(2):hover {
    background-color: #e53935;
    transform: translateY(-2px);
}

/*=== Leaderboard overlay ===*/
#leaderboard-box {
    background-color: #1e1e1e;
    color: #e0e0e0;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    min-width: 400px;
    max-width: 90%;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
}

#leaderboard-box h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #ffffff;
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #333;
}

.leaderboard-tab {
    padding: 0.7rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #b0b0b0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.leaderboard-tab:hover {
    color: #90caf9;
}

.leaderboard-tab.active {
    color: #ffffff;
    border-bottom-color: #90caf9;
}

#leaderboard-content {
    width: 100%;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.leaderboard-table thead {
    background-color: #2a2a2a;
}

.leaderboard-table th {
    padding: 0.8rem;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 2px solid #333;
}

.leaderboard-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

.leaderboard-table tbody tr {
    cursor: pointer;
}

.leaderboard-table tbody tr:hover {
    background-color: #2a2a2a;
    transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr.expanded {
    background-color: #2a2a2a;
}

.player-cell {
    position: relative;
}

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

.player-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #444;
    font-size: 0.85rem;
    color: #b0b0b0;
    transition: all 0.3s ease;
}

.player-details.hidden {
    display: none;
}

.route-info {
    text-align: left;
    margin: 0.3rem 0;
}

.route-info strong {
    color: #90caf9;
    margin-right: 0.3rem;
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child {
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #90caf9;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    text-align: left;
}

.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3),
.leaderboard-table th:nth-child(4),
.leaderboard-table td:nth-child(4) {
    text-align: center;
    width: 80px;
}

/* Custom scrollbar for leaderboard */
#leaderboard-box::-webkit-scrollbar {
    width: 8px;
}

#leaderboard-box::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 10px;
}

#leaderboard-box::-webkit-scrollbar-thumb {
    background: #90caf9;
    border-radius: 10px;
}

#leaderboard-box::-webkit-scrollbar-thumb:hover {
    background: #64b5f6;
}
