:root {
    --solarized-base03: #002b36;
    --solarized-base02: #073642;
    --solarized-base01: #586e75;
    --solarized-base00: #657b83;
    --solarized-base0:  #839496;
    --solarized-base1:  #93a1a1;
    --solarized-base2:  #eee8d5;
    --solarized-base3:  #fdf6e3;
    --solarized-yellow: #b58900;
    --solarized-orange: #cb4b16;
    --solarized-red:    #dc322f;
    --solarized-magenta:#d33682;
    --solarized-violet: #6c71c4;
    --solarized-blue:   #268bd2;
    --solarized-cyan:   #2aa198;
    --solarized-green:  #859900;
}

html, body {
    background: var(--solarized-base03);
    color: var(--solarized-base0);
    max-width: 100vw;
    overflow-x: hidden;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

#main-content {
    padding: 10px;
    box-sizing: border-box;
    background: var(--solarized-base03);
}

h1, h2, h3 {
    word-break: break-word;
    color: var(--solarized-yellow);
}

ul {
    padding-left: 1.2em;
}

li {
    word-break: break-word;
    color: var(--solarized-base0);
}

.btn,
button {
    font-size: 1rem;
    padding: 10px 16px;
    min-width: 44px;
    min-height: 44px;
    background: var(--solarized-blue);
    color: var(--solarized-base3);
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    margin: 5px 0;
    transition: background 0.2s;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 16px;
    font-weight: bold;
}

.btn:hover,
button:hover {
    background: var(--solarized-cyan);
    color: var(--solarized-base03);
}

.discord-logo {
    vertical-align: middle;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    margin-bottom: 3px;
    filter: brightness(0) invert(1);
}

body.loading #main-content {
    display: none;
}

.round {
    margin-bottom: 2em;
    padding: 1em;
    border: 1px solid var(--solarized-base01);
    background: var(--solarized-base02);
    border-radius: 8px;
}

/* --- Round Header --- */
.round-header {
    display: flex;
    align-items: center;
    position: relative;
}

/* --- Toggle Button for Rounds --- */
.round-toggle-btn {
    margin-right: 0.5em;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2em;
}

/* --- Cancel Round Button --- */
.cancel-round-btn {
    position: absolute;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* --- Pods Container --- */
.pods-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

/* --- Pod Card --- */
.pod {
    flex: 1 1 250px;
    min-width: 220px;
    max-width: 350px;
    box-sizing: border-box;
    background: var(--solarized-base03);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1em;
    margin-bottom: 1em;
}

.modal {
    position: fixed;
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, 0);
    background: var(--solarized-base02);
    border: 1px solid var(--solarized-blue);
    padding: 20px;
    z-index: 1000;
    color: var(--solarized-base0);
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,43,54,0.8);
    min-width: 500px;
    max-width: 800px;
    width: 95vw;
}

@media (max-width: 600px) {
    .modal {
        min-width: 0;
        width: 90vw;
        max-width: 90vw;
        left: 50%;
        bottom: 50%;
        transform: translate(-50%, 0);
        padding: 10px;
    }
    .btn,
    button {
        font-size: 1.1em;
        padding: 12px 8px;
    }
    #main-content {
        padding: 2vw;
    }
    h1 {
        font-size: 1.4em;
    }
    h2 {
        font-size: 1.2em;
    }
    h3 {
        font-size: 1.1em;
    }
}

.modal input[type="text"],
.modal input[type="url"],
.modal input[type="date"] {
    width: calc(100% - 60px);
    margin: 10px 20px 20px 20px;
    font-size: 1em;
    min-height: 36px;
    background: var(--solarized-base03);
    color: var(--solarized-base0);
    border: 1px solid var(--solarized-blue);
    border-radius: 4px;
    padding: 6px 10px;
}

@media (max-width: 600px) {
    .modal input[type="text"],
    .modal input[type="url"],
    .modal input[type="date"] {
        width: calc(100% - 40px);
        margin: 8px 8px 16px 8px;
        font-size: 1em;
        min-height: 36px;
    }
}

a {
    color: var(--solarized-cyan);
    text-decoration: underline;
}

a:hover {
    color: var(--solarized-yellow);
}

label {
    color: var(--solarized-green);
}

.start-tournament-btn {
    background: var(--solarized-green);
    color: var(--solarized-base3);
    width: 200px;
    height: 100px
}

#tournaments h2,
#tournaments h3 {
    color: var(--solarized-orange);
}

#tournaments ul {
    background: var(--solarized-base02);
    border-radius: 8px;
    padding: 1em;
}

#tournaments li {
    border-bottom: 1px solid var(--solarized-base01);
    padding: 0.5em 0;
}

#tournaments li:last-child {
    border-bottom: none;
}

div[style*="color:red"], .error, #createTournamentError, #add-player-error, #edit-player-error, #edit-tournament-error {
    color: var(--solarized-red) !important;
}

ul { padding:0 }

.player-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5em;
    background: var(--solarized-base02);
    border-radius: 8px;
    margin-bottom: 1em;
}

.player-table td {
    border: none;
    color: var(--solarized-base0);
    vertical-align: middle;
    font-size: 1em;
}

.player-position {
    text-align: center;
    font-weight: bold;
    color: var(--solarized-yellow);
    min-width: 20px;
    word-break: break-word;
}

.player-name {
    text-align: center;
    font-weight: bold;
    color: var(--solarized-yellow);
    min-width: 80px;
    word-break: break-word;
}

.player-points {
    text-align: center;
    color: var(--solarized-cyan);
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.player-deck a {
    text-align: center;
    color: var(--solarized-cyan);
    text-decoration: underline;
    font-size: 0.98em;
}

.player-edit button,
.player-remove button {
    min-width: 30px;
    margin: 0 2px;
    padding: 6px 10px;
    font-size: 0.95em;
}

.player-edit button {
    background: var(--solarized-blue);
    color: var(--solarized-base3);
}

.player-edit button:hover {
    background: var(--solarized-cyan);
    color: var(--solarized-base03);
}

.drop-player-btn,
.player-remove button {
    background: var(--solarized-red);
    color: var(--solarized-base3);
}

.player-remove button:hover {
    background: var(--solarized-orange);
    color: var(--solarized-base03);
}

@media (max-width: 600px) {
    .player-table td {
        font-size: 0.98em;
        padding: 0.4em 0.2em;
    }
    .player-name, .player-points {
        min-width: 0;
    }
}

#tournaments {
    margin-bottom: 1rem
}

.pod-seat {
    background-color: var(--solarized-base02) !important;
    color: var(--solarized-base3);
}

.pod-seat-winner {
    background-color: var(--solarized-yellow) !important;
    color: var(--solarized-base3);
}

.pod-seat-loser {
    background-color: var(--solarized-red) !important;
    color: var(--solarized-base3);
}

.pod-seat-draw {
    background-color: var(--solarized-violet) !important;
    color: var(--solarized-base3);
}