* {
    border: none;
    margin: 0;
}

/*root end*/

#logo {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: bold;
    color: #fff8e7;
    text-align: center;
    text-shadow: 0 0.15rem 0.6rem rgba(0, 0, 0, 0.45);
    letter-spacing: 0.04em;
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
}

#home-choices {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
}

.home-choice-header {
    display: flex;
}

.home-choice-title {
    font-size: 1.25rem;
    font-weight: bold;
    flex: 1;
}

.home-choice-inner {
    row-gap: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-choice {
    background-color: var(--pane-background);
    padding: 1.5rem;
    border-radius: 1.3rem;
    overflow: hidden;
    width: min(42.5vw, 35rem);
    height: 59vh;
}

.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

#lobby-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 0.75rem;
    padding: 0.25rem;
    min-height: 10rem;
}

.lobby-list-item {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.lobby-list-item:hover {
    background-color: #fafafa;
}

.lobby-list-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

.lobby-list-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.language-flag {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    margin-right: 0.25rem;
}

.lobby-list-item-info-pair {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    align-items: center;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.lobby-list-item-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.lobby-list-icon-loading {
    border-radius: 0.75rem;
    background-color: black;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-color: rgb(161, 160, 160);
    }

    50% {
        background-color: rgb(228, 228, 228);
    }

    100% {
        background-color: rgb(161, 160, 160);
    }
}

.lobby-list-placeholder {
    display: flex;
    width: 100%;
    flex: 1;
}

.lobby-list-placeholder > * {
    margin: auto;
    max-width: 80%;
}

.join-button {
    background-color: rgb(38, 187, 38);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.6rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition:
        background-color 0.2s,
        transform 0.1s;
    height: unset;
    width: unset;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.join-button:hover {
    background-color: rgb(34, 167, 34);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.join-button:active {
    transform: scale(0.96);
}

.custom-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: #f0f0f0;
    color: #666;
    border-radius: 2rem;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
}

#lobby-create {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1rem;
    row-gap: 0.5rem;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding-right: 0.5rem;
    flex: 1;
    min-height: 0;
    grid-template-rows: min-content min-content min-content min-content min-content min-content min-content max-content;
}

.lobby-create-label {
    font-weight: 600;
}

.advanced-toggle-checkbox {
    display: none !important;
}

.advanced-section-label {
    display: none !important;
}

.advanced-section-content {
    display: contents !important;
}

#custom_words {
    min-height: 4rem;
}

.lobby-create-errors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: #ff6961;
    border-radius: 1rem;
    padding: 0.5rem;
}

.create-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.create-button {
    height: 2rem;
    flex: 1;
}

.number-input {
    display: flex;
    flex-direction: row;
    padding: 0;
    border-radius: var(--component-border-radius);
    border: 2px hidden;
    min-width: 0;
    box-sizing: border-box;
}

.number-input > button {
    width: 1.5rem;
    background-color: color-mix(in srgb, var(--component-base-color), #000 5%);
}

.number-input > button:hover {
    background-color: var(--component-hover-background);
}

.number-input > button:focus {
    background-color: var(--component-focus-background);
}

.number-decrement {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.number-increment {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.number-input > input {
    flex: 1;
    border-radius: 0;
    -webkit-appearance: textfield;
    appearance: textfield;
    min-width: 0;
}

.number-input > input::-webkit-inner-spin-button,
.number-input > input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.reload-spinner {
    animation-name: spin;
    animation-duration: 1000ms;
    animation-iteration-count: infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1000px) or (orientation: portrait) {
    #lobby-create {
        grid-template-columns: 1fr minmax(0, 8.5rem) !important;
        column-gap: 0.5rem;
        scrollbar-gutter: auto;
    }

    textarea.input-item {
        height: 6rem;
    }

    #lobby-join-choice {
        flex: 1;
    }

    .home-choice {
        height: initial;
    }

    #logo {
        width: 95vw;
        max-height: 10vh;
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
    }

    #home-choices {
        flex-direction: column;
        flex: 1;
        gap: 1.5rem;
        width: 100%;
        box-sizing: border-box;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 1rem;
    }

    .home-choice {
        width: 100%;
        box-sizing: border-box;
        height: auto;
        min-height: 15rem;
        max-height: none;
        flex: none;
        overflow: visible;
    }

    #lobby-create {
        overflow-y: visible;
        flex: none;
    }

    .home-choice-inner {
        height: auto;
        min-height: 0;
    }

    #lobby-list {
        flex: 1;
    }

    .advanced-section-label {
        display: flex !important;
        grid-column: 1 / -1;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        padding-top: 0.5rem;
        margin-top: 0.5rem;
        cursor: pointer;
        user-select: none;
        font-weight: 600;
        justify-content: space-between;
        align-items: center;
    }

    .advanced-section-label .toggle-icon {
        transition: transform 0.2s;
        font-size: 0.8rem;
    }

    .advanced-toggle-checkbox:checked + .advanced-section-label .toggle-icon {
        transform: rotate(90deg);
    }

    .advanced-toggle-checkbox:checked ~ .advanced-section-content {
        display: initial !important;
        max-height: 0;
        opacity: 1;
        overflow: hidden;
        pointer-events: none;
    }

    .advanced-section-content label[for="custom_words"],
    .advanced-section-content #custom_words {
        grid-column: 1 / -1;
    }

    .lobby-list-item {
        grid-template-columns: auto 1fr auto !important;
        text-align: left !important;
        gap: 0.6rem !important;
        padding: 0.6rem 0.8rem !important;
    }

    .language-flag {
        font-size: 2.2rem !important;
        margin-right: 0 !important;
    }

    .lobby-list-rows {
        gap: 0.15rem !important;
        justify-content: center;
        display: flex;
        flex-direction: column;
    }

    .lobby-list-row {
        justify-content: flex-start !important;
        gap: 0.35rem !important;
    }

    .lobby-list-item-info-pair {
        padding: 0.15rem 0.4rem !important;
        font-size: 0.8rem !important;
    }

    .join-button {
        width: auto !important;
        margin-top: 0 !important;
        padding: 0.4rem 0.8rem !important;
        font-size: 0.9rem !important;
        align-self: center !important;
    }
}

/* ---------- Montagsmaler: Startseite im Design „Winterabend“ ---------- */

body {
    background: var(--ground);
}

body::before {
    opacity: var(--pattern-opacity);
}

.home-choice {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.wordlist-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    background: transparent;
    padding: 0;
}

.wordlist-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
}

.wordlist-choice:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.wordlist-choice input {
    accent-color: var(--accent);
}

.theme-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    background: transparent;
    padding: 0;
}

.theme-choice {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.4rem;
    border: 2px solid var(--line);
    border-radius: var(--radius-small);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.theme-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.theme-choice:has(input:focus-visible) {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Miniatur der Spielansicht: Kopfleiste, Spieler, Zeichenfläche, Chat. */
.theme-preview {
    display: grid;
    grid-template-columns: 1fr 3fr 1.3fr;
    grid-template-rows: 0.6rem 1fr;
    gap: 3px;
    height: 3.6rem;
    padding: 4px;
    border-radius: 6px;
}

.theme-preview > span {
    border-radius: 3px;
}

.tp-head {
    grid-column: 1 / 4;
}

.theme-choice-winterabend .theme-preview { background: #0f1f1a; }
.theme-choice-winterabend .tp-head { background: rgba(251, 247, 240, 0.18); }
.theme-choice-winterabend .tp-side,
.theme-choice-winterabend .tp-chat { background: #fbf7f0; }
.theme-choice-winterabend .tp-board { background: #ffffff; box-shadow: inset 0 -4px 0 #c8102e; }

.theme-choice-papier .theme-preview { background: #fff8e7; }
.theme-choice-papier .tp-head,
.theme-choice-papier .tp-side,
.theme-choice-papier .tp-chat,
.theme-choice-papier .tp-board { background: #ffffff; border: 1.5px solid #22223b; box-shadow: 2px 2px 0 #22223b; }
.theme-choice-papier .tp-board { box-shadow: 2px 2px 0 #22223b, inset 0 -4px 0 #f7b267; }

.theme-choice-clean .theme-preview { background: #f4f5f7; }
.theme-choice-clean .tp-head { background: #ffffff; border-bottom: 2px solid #b91c1c; }
.theme-choice-clean .tp-side,
.theme-choice-clean .tp-chat,
.theme-choice-clean .tp-board { background: #ffffff; border: 1px solid #e5e7eb; }
.theme-choice-clean .tp-board { box-shadow: inset 0 -4px 0 #5b4bdb; }

#home-choices .create-button:last-of-type,
.create-button {
    min-height: 2.75rem;
    font-weight: 600;
}

.home-choice {
    height: min(74vh, 46rem);
}

.wordlist-more {
    flex-basis: 100%;
    font-size: 0.85rem;
    color: var(--muted);
}

.wordlist-more summary {
    cursor: pointer;
    padding: 0.25rem 0;
}

.wordlist-more .wordlist-choices {
    margin-top: 0.35rem;
}

.create-buttons .create-button:last-child {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
