:root {
    --wood-dark: #3e2723;
    --wood-light: #5d4037;
    --leather: #8d6e63;
    --gold: #ffc107;
    --gold-dim: #ffb300;
    --denim: #1a237e;
    --off-white: #f5f5f5;
    --paper: #fff8e1;
    --border-color: #3e2723;
    --highlight-green: #d4edda;
    --highlight-border: #28a745;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--wood-dark);
    color: #333;
    margin: 0;
    padding: 20px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjM2UyNzIzIi8+CjxwYXRoIGQ9Ik0wIDBMNCA0Wk00IDBMMCA0WiIgc3Ryb2tlPSIjNDU3ZDUxIiBzdHJva2Utd2lkdGg9IjEiLz4KPC9zdmc+');
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--paper);
    min-height: 90vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 8px solid var(--wood-light);
    border-radius: 4px;
    position: relative;
    padding-bottom: 50px;
}

.container::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px dashed var(--wood-dark);
    pointer-events: none;
}

header {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--denim);
    color: var(--off-white);
    border-bottom: 4px solid var(--gold);
}

h1 {
    font-family: 'Rye', serif;
    font-size: 3rem;
    margin: 0;
    text-shadow: 2px 2px 0px #000;
}

.subtitle {
    font-size: 1.2rem;
    margin-top: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--gold);
}

main {
    padding: 30px;
}

h2 {
    font-family: 'Rye', serif;
    color: var(--wood-dark);
    text-align: center;
    font-size: 2rem;
    margin-top: 0;
    border-bottom: 2px solid var(--wood-light);
    display: inline-block;
    padding-bottom: 10px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--paper);
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 6px solid var(--wood-light);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}

.identity-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.identity-btn {
    background: white;
    border: 1px solid var(--leather);
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.identity-btn:hover {
    background: var(--denim);
    color: var(--gold);
    border-color: var(--denim);
}

.identity-status {
    background: var(--denim);
    color: white;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.identity-status span {
    color: var(--gold);
    font-weight: bold;
}

/* Setup Section */
#setup-section {
    text-align: center;
}

.player-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px auto;
    max-width: 1000px;
}

.player-inputs input {
    padding: 10px;
    font-family: 'Roboto', sans-serif;
    border: 2px solid var(--leather);
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
}

.primary-btn {
    background-color: var(--denim);
    color: var(--gold);
    border: none;
    padding: 15px 40px;
    font-family: 'Rye', serif;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    text-transform: uppercase;
}

.primary-btn:hover {
    background-color: #283593;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.primary-btn.small {
    padding: 10px 20px;
    font-size: 1.2rem;
}

.primary-btn:disabled {
    background-color: #9e9e9e;
    color: #e0e0e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Section */
.hidden {
    display: none !important;
}

.actions-secondary {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.secondary-btn {
    background: var(--leather);
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

.secondary-btn:hover {
    background: var(--wood-light);
}

/* Draft Console */
.draft-console {
    background: var(--denim);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 800px;
    text-align: center;
    border: 4px solid var(--gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.draft-console h3 {
    margin: 0 0 10px 0;
    font-family: 'Rye', serif;
    color: var(--gold);
    font-size: 1.8rem;
}

.console-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.master-select {
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 4px;
    border: 2px solid var(--gold);
    min-width: 300px;
    max-width: 100%;
    color: #333;
}

.draft-board-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th,
td {
    border: 1px solid var(--leather);
    padding: 8px;
    text-align: left;
}

th {
    background-color: var(--wood-dark);
    color: var(--gold);
    font-family: 'Rye', serif;
    font-weight: normal;
    text-align: center;
}

.pos-col {
    width: 40px;
    text-align: center;
    background-color: var(--denim);
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    color: white;
}

.player-col {
    font-weight: bold;
    color: var(--denim);
    width: 150px;
}

/* Active Turn Highlight */
tr.active-turn {
    background-color: var(--highlight-green) !important;
    border: 2px solid var(--highlight-border);
}

tr.active-turn td {
    border-top: 2px solid var(--highlight-border);
    border-bottom: 2px solid var(--highlight-border);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .console-controls {
        flex-direction: column;
    }

    .master-select {
        width: 100%;
    }

    .identity-list {
        grid-template-columns: 1fr;
        /* Stack name buttons */
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border: none;
        width: 100%;
        max-width: none;
    }

    #turn-display,
    .draft-console,
    .actions-secondary,
    #setup-section,
    #identity-modal,
    .identity-status {
        display: none !important;
    }

    th,
    td {
        border: 1px solid black !important;
        color: black !important;
    }

    tr.active-turn {
        background-color: transparent !important;
        border: none;
    }
}