* {
    font-family: "Noto Sans JP", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    box-sizing: border-box;
}

    *:focus {
        outline: none;
    }

.material-symbols-outlined {
    font-size: inherit;
    line-height: 1;
    user-select: none;
    vertical-align: middle;
}

body {
    background: #eee;
    height: 100%;
    margin: 0;
    overflow: hidden auto;
    padding: 0;
    position: absolute;
    width: 100%;
}

.page {
    display: none;
    height: 100%;
    position: absolute;
    width: 100%;
}

    .page.show {
        display: block;
    }

.center-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    left: 50%;
    overflow: hidden;
    position: relative;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(400px, 100%);
}

.vertical-layout {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.horizontal-layout {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.button {
    background-color: #666;
    box-shadow: 0 2px 4px #0006;
    color: #fffe;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    height: 36px;
    line-height: 36px;
    margin: 0 4px;
    overflow: hidden;
    padding: 0 8px;
    position: relative;
    text-align: center;
    user-select: none;
    vertical-align: middle;
}

    .button:hover {
        background-color: #777;
    }

    .button.button-small {
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 8px;
    }

.button-red {
    background-color: #c62828;
}

    .button-red:hover {
        background-color: #d32f2f;
    }

.button-purple {
    background-color: #6a1b9a;
}

    .button-purple:hover {
        background-color: #7b1fa2;
    }

.button-blue {
    background-color: #1565c0;
}

    .button-blue:hover {
        background-color: #1976d2;
    }

.button-cyan {
    background-color: #00838f;
}

    .button-cyan:hover {
        background-color: #0097a7;
    }

.button-green {
    background-color: #2e7d32;
}

    .button-green:hover {
        background-color: #388e3c;
    }

.button-yellow {
    background-color: #f9a825;
}

    .button-yellow:hover {
        background-color: #fbc02d;
    }

.ripple-effect-black,
.ripple-effect-white {
    overflow: hidden;
    position: relative;
}

.ripple {
    animation: ripple-animation 1s ease-out;
    border-radius: 50%;
    pointer-events: none;
    position: absolute;
    transform: scale(0);
}

.ripple-effect-black .ripple {
    background-color: #0002;
}

.ripple-effect-white .ripple {
    background-color: #fff2;
}

@keyframes ripple-animation {
    to {
        opacity: 0;
        transform: scale(4);
    }
}

.subject {
    font-size: 24px;
    margin: 8px 0;
}

.interactable-textfield {
    height: 48px;
    margin: 8px 0;
    position: relative;
    text-align: left;
}

    .interactable-textfield input,
    .interactable-textfield textarea {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: none;
        border: none;
        border-bottom: 2px solid #666;
        border-radius: 0;
        bottom: 0;
        box-sizing: border-box;
        font-size: 20px;
        margin: 0;
        outline: none;
        padding: 0;
        position: absolute;
        resize: none;
        top: 16px;
        transition: all 0.3s ease;
        width: 100%;
    }

        .interactable-textfield input:focus, .interactable-textfield textarea:focus {
            border-bottom-color: #39f;
        }

    .interactable-textfield .placeholder {
        bottom: 0;
        color: #0006;
        font-size: 20px;
        line-height: 32px;
        pointer-events: none;
        position: absolute;
        top: 16px;
        transition: all 0.3s ease;
        width: 100%;
    }

    .interactable-textfield input:not(:placeholder-shown):focus + .placeholder,
    .interactable-textfield textarea:not(:placeholder-shown):focus + .placeholder {
        color: #39f;
    }

    .interactable-textfield input:not(:placeholder-shown) + .placeholder,
    .interactable-textfield textarea:not(:placeholder-shown) + .placeholder {
        bottom: 32px;
        font-size: 12px;
        line-height: 16px;
        top: 0;
    }

.interactable-integer {
    display: flex;
    gap: 4px;
    margin: 8px;
}

    .interactable-integer .decrement,
    .interactable-integer .increment {
        background-color: #39f;
        border-radius: 50%;
        box-sizing: border-box;
        color: transparent;
        cursor: pointer;
        height: 24px;
        line-height: 24px;
        position: relative;
        text-align: center;
        user-select: none;
        width: 24px;
    }
    
    .interactable-integer .decrement:before,
    .interactable-integer .increment:before {
        background-color: #fff;
        content: '';
        height: 4px;
        left: 5px;
        position: absolute;
        top: 10px;
        width: 14px;
    }

    .interactable-integer .increment:after {
        background-color: #fff;
        content: '';
        height: 14px;
        left: 10px;
        position: absolute;
        top: 5px;
        width: 4px;
    }

    .interactable-integer input {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: none;
        border: none;
        border-bottom: 2px solid #666;
        border-radius: 0;
        box-sizing: border-box;
        font-size: 16px;
        line-height: 22px;
        margin: 0;
        outline: none;
        padding: 0;
        transition: all 0.3s ease;
        width: 80px;
    }

        .interactable-integer input:focus {
            border-bottom-color: #39f;
        }

.interactable-decimal {
    display: flex;
    gap: 4px;
    margin: 8px;
}

    .interactable-decimal .decrement,
    .interactable-decimal .increment {
        background-color: #39f;
        border-radius: 50%;
        box-sizing: border-box;
        color: transparent;
        cursor: pointer;
        height: 24px;
        line-height: 24px;
        position: relative;
        text-align: center;
        user-select: none;
        width: 24px;
    }
    
    .interactable-decimal .decrement:before,
    .interactable-decimal .increment:before {
        background-color: #fff;
        content: '';
        height: 4px;
        left: 5px;
        position: absolute;
        top: 10px;
        width: 14px;
    }

    .interactable-decimal .increment:after {
        background-color: #fff;
        content: '';
        height: 14px;
        left: 10px;
        position: absolute;
        top: 5px;
        width: 4px;
    }

    .interactable-decimal input {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: none;
        border: none;
        border-bottom: 2px solid #666;
        border-radius: 0;
        box-sizing: border-box;
        font-size: 16px;
        line-height: 22px;
        margin: 0;
        outline: none;
        padding: 0;
        transition: all 0.3s ease;
        width: 80px;
    }

        .interactable-decimal input:focus {
            border-bottom-color: #39f;
        }

.interactable-switch {
    cursor: pointer;
    display: block;
    font-size: 16px;
    user-select: none;
}

    .interactable-switch input[type=checkbox] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #eee;
        border: 2px solid #777;
        border-radius: 12px;
        box-sizing: border-box;
        cursor: pointer;
        display: block;
        height: 24px;
        margin: 8px;
        position: relative;
        right: 0;
        transition: all 0.3s ease;
        width: 40px;
    }

        .interactable-switch input[type=checkbox]:before {
            background-color: #777;
            border-radius: 8px;
            content: "";
            height: 16px;
            left: 2px;
            position: absolute;
            top: 2px;
            transition: all 0.3s ease;
            width: 16px;
        }

        .interactable-switch input[type=checkbox]:after {
            background-color: transparent;
            border-bottom: 2px solid #659;
            border-left: 2px solid #659;
            content: "";
            height: 4px;
            left: 2px;
            opacity: 0;
            position: absolute;
            top: 6px;
            transform: rotate(-45deg);
            transition: all 0.3s ease;
            width: 8px;
        }

        .interactable-switch input[type=checkbox]:checked {
            border: 2px solid transparent;
            background-color: #659;
        }

            .interactable-switch input[type=checkbox]:checked:before {
                background-color: #fff;
                left: 18px;
            }

            .interactable-switch input[type=checkbox]:checked:after {
                left: 21px;
                opacity: 1;
            }

.interactable-checkbox {
    align-items: center;
    display: flex;
    height: 24px;
    position: relative;
}

    .interactable-checkbox label {
        cursor: pointer;
        flex: 1;
        padding-right: 8px;
    }

    .interactable-checkbox input[type=checkbox] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #fff;
        border: 2px solid #666;
        border-radius: 2px;
        box-sizing: border-box;
        height: 16px;
        position: relative;
        transition: all 0.3s ease;
        width: 16px;
    }

        .interactable-checkbox input[type=checkbox]:before {
            background-color: transparent;
            border-bottom: 2px solid #fff;
            border-left: 2px solid #fff;
            content: '';
            height: 4px;
            left: 1px;
            opacity: 0;
            position: absolute;
            top: 2px;
            transform: rotate(-45deg);
            transition: all 0.3s ease;
            width: 8px;
        }

        .interactable-checkbox input[type=checkbox]:checked {
            background-color: #659;
        }

            .interactable-checkbox input[type=checkbox]:checked:before {
                opacity: 1;
            }

.interactable-radiogroup {
    display: block;
}

    .interactable-radiogroup input[type=radio] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border: 2px solid #666;
        border-radius: 10px;
        box-sizing: border-box;
        height: 20px;
        margin: 4px;
        position: relative;
        transition: all 0.3s ease;
        vertical-align: middle;
        width: 20px;
    }

        .interactable-radiogroup input[type=radio]:checked {
            border-color: #659;
        }

        .interactable-radiogroup input[type=radio]:before {
            background-color: #659;
            border-radius: 6px;
            content: '';
            height: 12px;
            left: 2px;
            position: absolute;
            top: 2px;
            transform: scale(0);
            transition: all 0.3s ease;
            width: 12px;
        }

        .interactable-radiogroup input[type=radio]:checked:before {
            transform: scale(1);
        }

    .interactable-radiogroup label,
    .interactable-radiogroup .label {
        cursor: pointer;
        display: inline-block;
        line-height: 36px;
        padding-right: 8px;
        user-select: none;
        vertical-align: middle;
    }

        .interactable-radiogroup .label input[type=radio] {
            pointer-events: none;
        }

#page-lobby {
    display: none;
    flex-direction: column;
}

    #page-lobby.show {
        display: flex;
    }

#page-lobby header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px;
}

#lobby-header-icon {
    display: block;
    width: 32px;
}

#lobby-header-text {
    color: #000c;
    font-family: "Oswald", sans-serif;
    font-size: 24px;
}

#page-lobby main {
    flex: 1;
    padding: 8px;
    position: relative;
}

#page-lobby footer {
    background-color: #444;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

#page-lobby footer .external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    text-align: center;
}


#page-lobby footer .external-links .link-item {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


#page-lobby footer .external-links .link-item .text {
    color: #fff;
    font-size: 14px;
}

#page-lobby footer .external-links .link-item .link-bar {
    align-items: center;
    border-radius: 16px;
    box-sizing: border-box;
    display: flex;
    padding: 4px 16px;
    text-decoration: none;
}

#page-lobby footer .external-links .link-item .link-bar.link-bar-x {
    background-color: #000;
    color: #fff;
}

#page-lobby footer .external-links .link-item .link-bar.link-bar-discord {
    background-color: #5865f2;
    color: #fff;
}

#page-lobby footer .external-links .link-item .link-bar.link-bar-fanbox {
    background-color: #fff;
    color: #000e;
}

#page-lobby footer .external-links .link-item .link-bar .icon {
    height: 16px;
    margin-right: 8px;
    vertical-align: top;
    width: auto;
}

#page-lobby footer .other-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    text-align: center;
}

#page-lobby footer .other-links a {
    color: #fff;
}

#form-lobby {
    display: flex;
    flex-direction: column;
    height: 300px;
}

#form-lobby-tab-bar {
    display: flex;
}

#form-lobby-join,
#form-lobby-create {
    padding: 8px;
}

#form-lobby-join {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    margin: 0 32px;
}

#form-lobby-create {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    margin: 0 32px;
}

.tab-bar {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

    .tab-bar .tab-bar-item {
        background-color: #c33;
        border-bottom: 4px solid transparent;
        color: #fff9;
        cursor: pointer;
        flex: 1;
        padding: 16px 4px;
        text-align: center;
        user-select: none;
    }

        .tab-bar .tab-bar-item.selected {
            border-color: #0006;
            color: #fffe;
        }

.tab-container {
    display: none;
}

    .tab-container.show {
        display: block;
    }

    .tab-container.tab-container-flex.show {
        display: flex;
    }

#form-login {
    padding: 32px;
    text-align: center;
}

#room-header {
    align-items: center;
    background-color: #36f;
    display: flex;
    height: 48px;
    position: absolute;
    width: 100%;
}

#room-header-left {
    align-items: center;
    color: #fff;
    display: flex;
    flex: 1;
    gap: 16px;
    margin: 0 8px;
}

#room-id {
    margin-left: 28px;
    position: relative;
}

#room-id:before {
    background-image: url('image/icon64.png');
    background-size: cover;
    border-radius: 4px;
    content: "";
    display: block;
    height: 24px;
    left: -28px;
    position: absolute;
    width: 24px;
}

#room-header-right {
    color: #fff;
    display: flex;
}

    #room-header-right .header-nav {
        align-items: center;
        box-sizing: border-box;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        height: 48px;
        justify-content: center;
        padding: 0;
        user-select: none;
        width: 56px;
    }

        #room-header-right .header-nav.hide {
            display: none;
        }

        #room-header-right .header-nav:hover {
            background-color: #fff3;
        }

        #room-header-right .header-nav .icon {
            font-size: 24px;
        }

        #room-header-right .header-nav .label {
            font-size: 10px;
        }

#room-main-content {
    bottom: 0;
    position: absolute;
    top: 48px;
    width: 100%;
}

#room-left-panel {
    background-color: #fff;
    bottom: 0;
    box-shadow: 0 4px 8px #0006;
    display: flex;
    flex-direction: column;
    left: 0;
    position: absolute;
    top: 0;
    transition: all 0.3s ease;
    width: 400px;
    z-index: 100;
}

#chat-log-container {
    flex-grow: 1;
    overflow: hidden scroll;
}

#chat-log {
    height: 100%;
}

    #chat-log .chat-item {
        background-color: #fff;
        border-bottom: 1px solid #999;
        padding: 4px;
    }

        #chat-log .chat-item .name {
            color: #393;
            font-size: 16px;
            font-weight: bold;
        }

        #chat-log .chat-item.host .name {
            color: #c00;
        }

        #chat-log .chat-item .text {
            font-size: 16px;
            padding-left: 8px;
        }

#chat-input {
    border-top: 1px solid #000;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

#chat-input-option {
    cursor: pointer;
    display: none;
    margin-bottom: 8px;
    user-select: none;
}

    #chat-input-option.show {
        display: flex;
    }

#team-chat-checkbox {
    cursor: pointer;
}

#chat-input-main {
    display: flex;
}

#chat-input-textarea {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #666;
    border-radius: 8px 0 0 8px;
    flex-grow: 1;
    margin: 0;
    outline: none;
    padding: 0;
    resize: none;
}

#chat-input-button {
    background-color: #ddd;
    border: 1px solid #666;
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    padding: 16px;
    user-select: none;
}

    #chat-input-button:hover {
        background-color: #bbb;
    }

#room-right-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    left: 400px;
    position: absolute;
    right: 0;
    transition: left 0.3s ease;
}

#question-proposer {
    background-color: #fff;
    border-bottom: 1px solid #000;
    display: none;
    flex-direction: column;
}

    #question-proposer.show {
        display: flex;
    }

#question-proposer-controller {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

#question-proposer-result {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 0 8px 8px;
}

#question-proposer-result-question {
    border-radius: 8px;
    box-shadow: 0 2px 4px #0006;
    flex: 7;
    overflow: hidden;
}

#question-proposer-result-question-caption {
    background-color: #0c0;
    box-shadow: 0 2px 4px #0006;
    color: #fff;
    padding: 2px;
    text-align: center;
}

#question-proposer-result-question-text {
    padding: 4px;
}

#question-proposer-result-answer {
    border-radius: 8px;
    box-shadow: 0 2px 4px #0006;
    flex: 3;
    overflow: hidden;
}

#question-proposer-result-answer-caption {
    background-color: #c00;
    box-shadow: 0 2px 4px #0006;
    color: #fff;
    padding: 2px;
    text-align: center;
}

#question-proposer-result-answer-text {
    padding: 4px;
}

#media-controller {
    background-color: #fff;
    border-bottom: 1px solid #000;
    display: none;
    flex-direction: column;
    flex-wrap: wrap;
}

    #media-controller.show {
        display: flex;
    }

#media-controller-top {
    align-items: center;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 8px;
}

    #media-controller-top .interactable-checkbox {
        height: auto;
        padding: 2px 0;
    }

.media-controller-option {
    position: relative;
}

#media-controller-files {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
}

#media-drop-zone {
    align-items: center;
    border: 2px dashed #aaa;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 4px;
    justify-content: center;
    min-height: 100px;
    padding: 8px;
    width: 100px;
}

    #media-drop-zone .material-symbols-outlined {
        color: #aaa;
        font-size: 28px;
    }

    #media-drop-zone.drag-over {
        background-color: #eef;
        border-color: #36f;
    }

.media-drop-text {
    color: #aaa;
    font-size: 11px;
    text-align: center;
}

.media-file-item {
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 4px;
    padding: 4px;
    position: relative;
    width: 100px;
}

.media-file-delete-btn {
    align-items: center;
    background: rgba(200, 0, 0, 0.75);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: bold;
    height: 18px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 3px;
    top: 3px;
    user-select: none;
    width: 18px;
    z-index: 1;
}

.media-file-delete-btn:hover {
    background: rgba(200, 0, 0, 1);
}

.media-file-load-count {
    background: linear-gradient(to right, #4caf50 var(--progress, 0%), rgba(0, 0, 0, 0.55) var(--progress, 0%));
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    text-align: center;
    width: 100%;
}

.media-file-preview {
    background: #ddd;
    border-radius: 4px;
    height: 60px;
    object-fit: cover;
    width: 100%;
}

.media-file-icon {
    align-items: center;
    background: #ddd;
    border-radius: 4px;
    color: #888;
    display: flex;
    font-size: 28px;
    height: 60px;
    justify-content: center;
    width: 100%;
}

.media-file-name {
    font-size: 10px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.media-file-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    width: 100%;
}

    .media-file-buttons .button {
        font-size: 11px;
        height: 22px;
        line-height: 22px;
        margin: 0;
        padding: 0 6px;
    }

#sound-player {
    background-color: #fff;
    border-bottom: 1px solid #000;
    display: none;
    min-height: 32px;
}

    #sound-player.show {
        display: flex;
        align-items: center;
    }

#sound-player-content {
    align-items: center;
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    width: 100%;
}

    #sound-player-content .material-symbols-outlined {
        font-size: 24px;
    }

    #sound-player-content input[type=range] {
        flex: 1;
    }

#image-viewer {
    background-color: #fff;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    border-bottom: 1px solid #000;
    display: none;
    height: 300px;
}

    #image-viewer.show {
        display: block;
    }

#players-container {
    flex-grow: 1;
    overflow: hidden scroll;
    position: relative;
}

#timer {
    align-items: center;
    color: #000c;
    display: none;
    font-size: 24px;
    gap: 8px;
    left: 8px;
    position: absolute;
    top: 8px;
}

#timer.show {
    display: flex;
}

#timer .button {
    font-size: 24px;
    padding: 0 4px;
}

#timer-text {
    color: #000e
}

#timer.stop #timer-text {
    color: #c33e;
}

#timer-icon,
#timer-play,
#timer-pause,
#timer-reset {
    display: none;
}

#timer-icon.show,
#timer-play.show,
#timer-pause.show,
#timer-reset.show {
    display: block;
}

#players {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.no-team {
    align-content: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.team {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px #0006;
    display: flex;
    flex-direction: column;
    margin: 8px;
}

.team-header {
    align-items: center;
    border-bottom: 1px solid #0003;
    display: flex;
    flex-direction: column;
}

    .team-header .name {
        font-size: 24px;
        text-align: center;
    }

        .team-header .name.editable {
            cursor: text;
        }

    .team-header .name-edit {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: #99f;
        border: none;
        border-radius: 0;
        bottom: 0;
        box-sizing: border-box;
        margin: 0;
        outline: none;
        padding: 0;
        display: none;
        font-size: 24px;
        text-align: center;
    }

        .team-header .name-edit.show {
            display: block;
        }

    .team-header .values {
        display: flex;
        flex-direction: row;
        justify-content: center;
    }

        .team-header .values .correct,
        .team-header .values .score,
        .team-header .values .wrong {
            flex-grow: 1;
            font-size: 28px;
            font-weight: bold;
            padding: 0 16px;
            text-align: center;
        }

        .team-header .values .correct {
            color: #66c;
        }

        .team-header .values .score {
            color: #393;
        }

        .team-header .values .wrong {
            color: #c33;
        }

.team-players {
    background-color: #fff6;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 60px;
}

.player {
    margin: 8px;
    position: relative;
    width: 160px;
}

    .player .buzzer-order {
        background-color: #fff;
        border-radius: 16px;
        box-shadow: 0 2px 4px #0006;
        box-sizing: border-box;
        font-size: 15px;
        height: 28px;
        padding: 2px;
        position: relative;
        text-align: center;
        width: 28px;
        z-index: 10;
    }

    .player.pushed .buzzer-order {
        background-color: #f93;
    }

    .player .buzzer-time {
        color: #666;
        font-size: 12px;
        left: 32px;
        position: absolute;
        top: 8px;
    }

    .player .chat-label {
        color: #666;
        font-size: 12px;
        right: 0;
        position: absolute;
        top: 8px;
    }

    .player .player-card {
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px #0006;
        overflow: hidden;
        position: relative;
        width: 100%;
    }

    .player.waiting-for-answer .player-card {
        background-color: #ff9;
    }

    .player .player-card .name {
        color: #393;
        padding: 2px;
        text-align: center;
    }

    .player.waiting-for-answer .player-card .name {
        font-weight: bold;
        text-decoration: underline;
    }

    .player .player-card .values {
        align-items: center;
        display: flex;
        position: relative;
    }

        .player .player-card .values .correct,
        .player .player-card .values .score,
        .player .player-card .values .wrong {
            flex-grow: 1;
            font-size: 28px;
            font-weight: bold;
            text-align: center;
        }

        .player .player-card .values .correct {
            color: #66c;
        }

        .player .player-card .values .score {
            color: #393;
        }

        .player .player-card .values .wrong {
            color: #c33;
        }

        .player .player-card .values .player-overlay {
            background-color: #0003;
            bottom: 0;
            left: 100%;
            position: absolute;
            top: 0;
            transition: left 0.3s ease;
            width: 100%;
        }

            .player .player-card .values .player-overlay.show {
                left: 0;
            }

    .player .player-card .board {
        background-color: #999;
        border: 2px solid #999;
        border-radius: 4px;
        margin: 4px;
        padding: 4px;
        text-align: center;
        min-height: 40px;
        display: block;
        height: 87px;
    }

        .player .player-card .board.show {
            background-color: #fff;
        }

        .player .player-card .board.opened {
            border-color: #4CAF50;
        }

        .player .player-card .board.not-submitted {
            opacity: 0.4;
        }

        .player .player-card .board-text {
            font-size: 12px;
            word-wrap: break-word;
            max-height: 80px;
            overflow-y: auto;
            user-select: text;
            cursor: text;
        }

        .player .player-card .board-image {
            max-width: 100%;
            height: auto;
            border-radius: 2px;
        }

        .player .player-card .board-placeholder {
            color: #999;
            font-size: 14px;
            line-height: 40px;
        }

    .player .player-card .board-open-button {
        display: block;
        margin: 4px;
    }

    .player .player-card .judge-buttons {
        display: none;
        flex-direction: row;
        gap: 4px;
        justify-content: center;
        padding: 4px;
    }

        .player .player-card .judge-buttons.show {
            display: flex;
        }

        .player .player-card .judge-buttons .button {
            font-size: 11px;
            height: 24px;
            line-height: 24px;
            margin: 0;
            padding: 0 8px;
        }

        .player .player-card .judge-buttons .button .icon {
            display: block;
            font-size: 16px;
            line-height: 24px;
        }

#player-controller {
    align-content: center;
    background-color: #fff;
    border-top: 1px solid #000;
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 80px;
}

    #player-controller:focus {
        background-color: #ffc;
    }

    #player-controller.show {
        display: flex;
    }

#buzzer-button {
    background-color: #fff;
    border: 1px solid #33c;
    border-radius: 8px;
    color: #33c;
    cursor: pointer;
    font-size: 20px;
    margin: 16px;
    padding: 8px 16px;
    position: relative;
    user-select: none;
}

    #buzzer-button:hover {
        background-color: #33c;
        color: #fff;
    }

#player-controller #buzzer-button-badge {
    background-color: #06C;
    border-radius: 12px;
    color: #fff;
    display: none;
    font-size: 14px;
    height: 24px;
    line-height: 24px;
    padding: 0 8px;
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
}

    #player-controller:focus #buzzer-button-badge {
        display: block;
    }

#host-controller,
#judge-controller {
    background-color: #fff;
    border-top: 1px solid #000;
    display: none;
    gap: 8px;
    padding: 8px;
}

#host-controller {
    min-height: 80px;
}

    #host-controller.show {
        display: block;
    }

    #judge-controller.show {
        display: flex;
        flex-direction: column;
    }

#host-answer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 4px;
}

.host-answer-item {
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

    .host-answer-item .answer-player-name {
        font-size: 13px;
        font-weight: bold;
        min-width: 40px;
    }

    .host-answer-item .button {
        font-size: 12px;
        height: 28px;
        line-height: 28px;
        margin: 0 2px;
        padding: 0 10px;
    }

#host-action-buttons {
    align-items: center;
    height: 100%;
}

#host-answer-buttons,
#host-action-buttons,
#host-board-controls {
    display: none;
    justify-content: center;
}

    #host-answer-buttons.show,
    #host-action-buttons.show,
    #host-board-controls.show {
        display: flex;
    }

#judge-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.player.offline .player-card {
    opacity: 0.4;
}

.player .player-card .values .player-overlay .won,
.player .player-card .values .player-overlay .lost,
.player .player-card .values .player-overlay .lose-turn {
    display: none;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
}

.player.won .player-card .values .player-overlay {
    background-color: rgba(255, 215, 0, 0.85);
    left: 0;
}

    .player.won .player-card .values .player-overlay .won {
        display: block;
    }

.player.lost .player-card .values .player-overlay {
    background-color: rgba(100, 100, 100, 0.85);
    left: 0;
    color: #fff;
}

    .player.lost .player-card .values .player-overlay .lost {
        display: block;
    }

.player.lose-turn .player-card .values .player-overlay {
    background-color: rgba(200, 200, 200, 0.75);
    left: 0;
}

    .player.lose-turn .player-card .values .player-overlay .lose-turn {
        display: block;
    }

#chat-toggle-button {
    bottom: 0;
    cursor: pointer;
    display: none;
    flex-direction: column;
    height: 80px;
    justify-content: center;
    left: 0;
    position: absolute;
    text-align: center;
    user-select: none;
    width: 64px;
}

    #chat-toggle-button:hover {
        background-color: #0003;
    }

#chat-toggle-button-icon {
    font-size: 32px;
}

#chat-toggle-button-label {
    font-size: 14px;
}

#board-toggle-button {
    bottom: 0;
    cursor: pointer;
    display: none;
    flex-direction: column;
    height: 80px;
    justify-content: center;
    position: absolute;
    right: 0;
    text-align: center;
    user-select: none;
    width: 64px;
}

    #board-toggle-button.show {
        display: flex;
    }

    #board-toggle-button:hover {
        background-color: #0003;
    }

#board-toggle-button-icon {
    font-size: 32px;
}

#board-toggle-button-label {
    font-size: 14px;
}

#window-board {
    background-color: #fff;
    bottom: 100px;
    box-shadow: 0 4px 8px #0006;
    display: block;
    height: 400px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: 80px;
    transition: opacity 0.3s ease;
    width: 480px;
    z-index: 200;
}

    #window-board.show {
        opacity: 1;
        pointer-events: auto;
    }

    #window-board .window-board-content {
        display: none;
    }

    #window-board .window-board-content.show {
        display: block;
    }
    
    #window-board .window-board-content .caption {
        background-color: #c00;
        color: #fffe;
        cursor: move;
        font-size: 16px;
        height: 32px;
        line-height: 32px;
        position: absolute;
        text-align: center;
        top: 0;
        user-select: none;
        width: 100%;
    }
    
    #window-board .window-board-content .toolbar {
        align-items: center;
        background-color: #f5f5f5;
        border-bottom: 1px solid #ccc;
        display: flex;
        gap: 8px;
        height: 40px;
        padding: 4px 8px;
        position: absolute;
        top: 32px;
        width: 100%;
    }

    #window-board .window-board-content .toolbar-group {
        align-items: center;
        border-right: 1px solid #ddd;
        display: flex;
        gap: 4px;
        padding-right: 8px;
    }

        #window-board .window-board-content .toolbar-group:last-child {
            border-right: none;
        }

    #window-board .window-board-content .toolbar-button {
        align-items: center;
        background-color: #fff;
        border: 1px solid #ccc;
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        height: 32px;
        justify-content: center;
        transition: all 0.2s ease;
        user-select: none;
        width: 32px;
    }

        #window-board .window-board-content .toolbar-button:hover {
            background-color: #e8e8e8;
            border-color: #999;
        }

        #window-board .window-board-content .toolbar-button.active {
            background-color: #1565c0;
            border-color: #1565c0;
            color: #fff;
        }

        #window-board .window-board-content .toolbar-button.disabled {
            cursor: default;
            opacity: 0.35;
        }

        #window-board .window-board-content .toolbar-button.disabled:hover {
            background-color: #fff;
            border-color: #ccc;
        }

        #window-board .window-board-content .toolbar-button .material-symbols-outlined {
            font-size: 20px;
        }

    #window-board .window-board-content #board-color-picker {
        border: 1px solid #ccc;
        border-radius: 4px;
        cursor: pointer;
        height: 32px;
        width: 48px;
    }

    #window-board .window-board-content .content {
        bottom: 48px;
        position: absolute;
        top: 32px;
        width: 100%;
    }
    
    #window-board .window-board-content .toolbar ~ .content {
        top: 72px;
    }

    #window-board .resize-handle {
        position: absolute;
        z-index: 10;
    }

    #window-board .resize-n,
    #window-board .resize-s {
        cursor: ns-resize;
        height: 8px;
        left: 0;
        width: 100%;
    }

    #window-board .resize-n {
        top: 0;
    }

    #window-board .resize-s {
        bottom: 0;
    }

    #window-board .resize-w,
    #window-board .resize-e {
        cursor: ew-resize;
        height: 100%;
        top: 0;
        width: 8px;
    }

    #window-board .resize-w {
        left: 0;
    }

    #window-board .resize-e {
        right: 0;
    }

    #window-board .resize-nw,
    #window-board .resize-ne,
    #window-board .resize-sw,
    #window-board .resize-se {
        height: 16px;
        width: 16px;
    }

    #window-board .resize-nw {
        cursor: nwse-resize;
        left: 0;
        top: 0;
    }

    #window-board .resize-ne {
        cursor: nesw-resize;
        right: 0;
        top: 0;
    }

    #window-board .resize-sw {
        bottom: 0;
        cursor: nesw-resize;
        left: 0;
    }

    #window-board .resize-se {
        bottom: 0;
        cursor: nwse-resize;
        right: 0;
    }

#window-board-buttons {
    bottom: 0;
    display: flex;
    height: 48px;
    position: absolute;
    text-align: center;
    width: 100%;
}

#button-board-send {
    flex: 1;
}

#board-input-text-textfield {
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #999;
    border-radius: 8px;
    font-size: 16px;
    inset: 8px;
    outline: none;
    position: absolute;
    resize: none;
}

#board-input-nocolor-canvas,
#board-input-color-canvas {
    border: 2px solid #999;
    border-radius: 8px;
    cursor: crosshair;
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    width: 464px;
    height: 261px;
    left: 50%;
    transform: translate(-50%, -50%);
}

#modal-screen {
    display: block;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.3s ease;
    width: 100%;
    z-index: 300;
}

    #modal-screen.show {
        opacity: 1;
        pointer-events: auto;
    }

#modal-screen-back {
    background-color: #0006;
    cursor: pointer;
    height: 100%;
    position: absolute;
    width: 100%;
}

.modal-window {
    background-color: #fff;
    box-shadow: 0 4px 8px #0006;
    box-sizing: border-box;
    cursor: auto;
    display: none;
    flex-direction: column;
    gap: 16px;
    left: 50%;
    margin: 0 auto;
    min-width: min(480px, 100%);
    overflow: hidden auto;
    padding: 16px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

    .modal-window.show {
        display: flex;
    }

#modal-window-rule {
    gap: 8px;
    width: min(480px, 100%);
}

.rule-index-item {
    align-items: center;
    display: flex;
    margin: 0;
}

    .rule-index-item .content {
        flex: 1;
    }

        .rule-index-item .content .title {
            font-size: 20px;
            font-weight: bold;
        }

.rule-index-item-center {
    display: block;
    margin: 0;
    text-align: center;
}

#modal-window-player {
    width: min(320px, 100%);
}

.player-settings-item {
    align-items: center;
    display: flex;
}

.player-settings-item * {
    flex: 1;
}

.player-settings-item .title {
    flex: 3;
}

.player-settings-item .input {
    flex: 7;
}

.player-settings-item-center {
    text-align: center;
}

#modal-window-settings {
    width: min(800px, 100%);
}

.settings-item {
    display: flex;
    align-items: center;
}

    .settings-item .title {
        flex: 4;
    }

    .settings-item .input {
        flex: 6;
    }

.settings-rule-args-group {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-left: 8px;
}

.settings-rule-args-group.show {
    display: flex;
}

.settings-decide-buttons {
    text-align: center;
}

/* ============================================================
   ドラッグ&ドロップ（プレイヤー移動）
   ============================================================ */

.player[draggable="true"] {
    cursor: grab;
}

.player[draggable="true"]:active {
    cursor: grabbing;
}

.player.dragging {
    opacity: 0.4;
}

.player.drag-over-before::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: -5px;
    width: 3px;
    background: #4CAF50;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

.player.drag-over-after::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    right: -5px;
    width: 3px;
    background: #4CAF50;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

.team-players.drag-over,
.no-team.drag-over {
    background-color: rgba(76, 175, 80, 0.12);
    outline: 2px dashed #4CAF50;
    outline-offset: -2px;
    border-radius: 4px;
}

.no-team-placeholder {
    color: #aaa;
    font-size: 13px;
    padding: 12px 16px;
    text-align: center;
    width: 100%;
}

/* ============================================================
   スコア編集モーダル
   ============================================================ */

#modal-window-score-edit {
    max-height: 80vh;
    width: min(560px, 100%);
}

#score-edit-player-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.score-edit-empty {
    color: #888;
    padding: 16px;
    text-align: center;
}

.score-edit-item {
    align-items: center;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

    .score-edit-item:last-child {
        border-bottom: none;
    }

.score-edit-name {
    flex: 1;
    font-weight: bold;
    min-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-edit-fields {
    display: flex;
    gap: 8px;
}

.score-edit-field {
    align-items: center;
    display: flex;
    font-size: 11px;
    gap: 2px;
}

    .score-edit-field input[type="number"] {
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        padding: 4px;
        text-align: center;
        width: 64px;
    }

/* ============================================================
   プレイヤー管理モーダル
   ============================================================ */

#modal-window-player-manage {
    max-height: 80vh;
    width: min(560px, 100%);
}

#player-manage-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.player-manage-empty {
    color: #888;
    padding: 16px;
    text-align: center;
}

.player-manage-item {
    align-items: center;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

    .player-manage-item:last-child {
        border-bottom: none;
    }

.player-manage-name {
    flex: 1;
    font-weight: bold;
    min-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-manage-status {
    color: #888;
    font-size: 12px;
    min-width: 48px;
}

.player-manage-buttons {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 4px;
}

@media (orientation: portrait) {
    #room-left-panel {
        bottom: 80px;
        box-shadow: 0 0 0 #0000;
        transform: translateX(-100%);
        width: 100%;
    }

        #room-left-panel.show {
            transform: translateX(0%);
        }

    #room-right-panel {
        left: 0;
    }

    #chat-toggle-button {
        display: flex;
    }
    
    #host-action-buttons {
        flex-wrap: wrap;
        gap: 8px;
        margin-left: 56px;
    }
}

/* ============================================================
   Cookie同意バナー
   ============================================================ */

#cookie-banner {
    align-items: center;
    background-color: #333;
    bottom: 0;
    box-shadow: 0 -2px 8px #0004;
    color: #fff;
    display: none;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    right: 0;
    z-index: 1000;
}

    #cookie-banner.show {
        display: flex;
    }

#cookie-banner-text {
    flex: 1;
    font-size: 14px;
    min-width: 200px;
}

    #cookie-banner-text a {
        color: #9cf;
    }

#cookie-banner-buttons {
    display: flex;
    gap: 8px;
}

@media screen and (max-width: 400px) {
    #room-header-right .header-nav {
        width: 48px;
    }

    #room-header-right .header-nav .label {
        font-size: 8px;
    }

}

/* ============================================================
   ダイヤルアニメーション（正解数・スコア・誤答数）
   ============================================================ */

@keyframes dial-roll-up {
    0%   { transform: translateY(50%); opacity: 0; }
    100% { transform: translateY(0);   opacity: 1; }
}

@keyframes dial-roll-down {
    0%   { transform: translateY(-50%); opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

.dial-anim-up {
    animation: dial-roll-up 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
}

.dial-anim-down {
    animation: dial-roll-down 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
}

/* アニメーション時のはみ出しをクリップするため values にも overflow: hidden を設定 */
.player .player-card .values,
.team-header .values {
    overflow: hidden;
}

/* 正解フラッシュアニメーション */
@keyframes correct-flash {
    0%   { background-color: #ff0; }
    100% { background-color: #fff; }
}

.player .player-card.correct-flash {
    animation: correct-flash 1s ease-out;
}

/* 正誤判定結果のbox-shadow（ブザーリセットまで継続） */
.player .player-card.judge-correct {
    box-shadow: 0 0 8px 2px #3c3c;
}

.player .player-card.judge-wrong {
    box-shadow: 0 0 8px 2px #c33c;
}
