:root {
    color-scheme: dark;
    font: 15px system-ui, sans-serif;
    background: #191713;
    color: #eee5d3;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; padding: 5px 8px; border: 1px solid #74624a; border-radius: 3px; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:not(:disabled) { background: #513b24; }
#lobby { padding: 12px 16px; min-width: 1040px; min-height: 100vh; display: flex; flex-direction: column; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#join { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
#join label { display: grid; gap: 4px; }
#join input { width: 150px; }
header:has(#join:not([hidden])) { align-items: start; flex-direction: column; }
h1 { margin: 0; font: 700 27px Georgia, serif; color: #ecc68d; }
h1 span { font: 500 15px system-ui, sans-serif; color: #d4c3a7; margin-left: 7px; }
#menu_link { color: #ecc68d; }
#manual_link { color: #ecc68d; margin-inline-start: 12px; }
#status { min-height: 21px; margin: 6px 0 10px; color: #dbbc8a; }
.columns { display: grid; flex: 1; grid-template-columns: minmax(480px, 1fr) 512px; gap: 16px; }
.left { min-width: 0; display: flex; flex-direction: column; }
.right { display: flex; flex-direction: column; gap: 8px; }
#preview { display: block; width: 512px; height: 512px; background: #2b231a; image-rendering: pixelated; }
#map { width: 512px; }
#options { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.defeat-conditions { display: grid; gap: 5px; }
.defeat-row { display: grid; grid-template-columns: 74px auto; align-items: center; gap: 8px; }
.defeat-row select { width: 74px; }
.defeat-row label { display: flex; align-items: center; gap: 5px; }
table { width: 100%; border-collapse: collapse; background: #27221a; }
th, td { padding: 5px; border-bottom: 1px solid #524334; text-align: left; }
th:not(:first-child) { width: 1%; }
th, td:not(:first-child) { white-space: nowrap; }
td:first-child { overflow-wrap: anywhere; }
td { height: 35px; }
td input { width: 100%; min-width: 0; }
td select { padding-inline: 4px; }
td button { padding-inline: 4px; }
select, select:disabled, .color-picker summary, .color-picker[aria-disabled='true'] summary {
    color: #eee5d3;
    background-color: #3b342b;
    border: 1px solid #b39b77;
    opacity: 1;
    box-shadow: inset 0 0 0 1px #4f4231;
}
.color-picker[aria-disabled='true'] summary { cursor: default; }
.slot-actions { width: 100%; min-width: 0; }
.ready-button { width: 36px; height: 30px; padding: 0; font-size: 23px; line-height: 26px; color: #ee716a; }
.ready-button.is-ready { color: #8cdb8a; }
.ready-button:disabled { opacity: 1; }
#options { flex-direction: column; align-items: stretch; }
#save_recording { position: fixed; z-index: 2; top: 8px; right: 8px; }
#directory td { white-space: normal; }
#directory td:last-child { white-space: nowrap; }
.slot-diagnostic { white-space: normal; overflow-wrap: anywhere; width: 0; min-width: 100%; }
.color-swatch { display: inline-block; width: 18px; height: 14px; border: 1px solid #a48d6e; vertical-align: middle; }
.color-picker { position: relative; width: max-content; }
.color-picker summary {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 3px;
    list-style: none;
    cursor: pointer;
}
.color-picker summary::-webkit-details-marker { display: none; }
.color-picker summary::after { content: ''; border: 4px solid transparent; border-bottom: 0; border-top-color: #d4c3a7; }
.color-options {
    position: absolute;
    z-index: 1;
    inset-inline-start: 0;
    min-width: 100%;
    display: grid;
    padding: 2px;
    background: #302920;
    border: 1px solid #74624a;
    border-radius: 3px;
}
.color-options button { padding: 3px; background: transparent; border-color: transparent; }
.color-options button:hover, .color-options button[aria-pressed='true'] { border-color: #a48d6e; }
.ready { color: #a4d39c; }
#colors { color: #ffd082; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 140px; margin-top: 8px; }
#messages { flex: 1; height: 0; min-height: 106px; overflow-y: auto; padding: 8px; background: #211d16; overflow-wrap: anywhere; }
#chat { display: flex; gap: 6px; margin-top: 6px; }
#message { flex: 1; }
#game iframe { position: fixed; inset: 0; border: 0; width: 100vw; height: 100vh; }
#game:not(.visible) iframe { visibility: hidden; }

[hidden] { display: none !important; }
