@font-face {
    font-family: 'minecraft';
    src: url("fonts/MinecraftRegular.otf");
}
@font-face {
    font-family: 'minecraft';
    src: url("fonts/MinecraftBold.otf");
    font-weight: bold;
}
@font-face {
    font-family: 'minecraft';
    src: url("fonts/MinecraftItalic.otf");
    font-style: italic;
}
@font-face {
    font-family: 'minecraft';
    src: url("fonts/MinecraftBoldItalic.otf");
    font-weight: bold;
    font-style: italic;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    color: white;
    background-color: black;
    background-image: url("/static/dirt.webp");
    font-family: "minecraft", monospace;
    font-weight: 400;
    font-style: normal;
    text-shadow: 0.1em 0.1em 0 #3f3f3f;
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.75);
    width: min(100%, 980px);
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 24px;
    padding-top: 16px;
    z-index: 10;
    
    h2 {
        margin-top: 0.5em;
        margin-bottom: 0;
    }
    p {
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }
    img {
        margin-top: 1.5em;
        margin-bottom: 1.5em;
    }
}

input {
    font-family: inherit;
    color: white;
    background-color: black;
    border: 2px solid white;
}
input[type="text"] {
    padding: 10px;
    width: min(100%, 320px);
    box-sizing: border-box;
}

button, .a-button {
    font-family: inherit;
    color: white;
    background-color: #6f6f6f;
    border: 1px solid black;
    padding: 10px 15px;
    margin-top: 10px;
    text-decoration: none;
    text-shadow: inherit;
    font-size: inherit;
}
button:hover, .a-button:hover {
    background-color: #6f6fff;
}

.details-summary {
    margin-top: 0.5em;
    margin-bottom: 0;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
}

.server-status {
    width: min(100%, 520px);
    border: 2px solid #ffffff;
    padding: 12px;
    box-sizing: border-box;
    margin-top: 12px;
    margin-bottom: 8px;
    background: rgba(20, 20, 20, 0.65);
}
.server-player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0;
    list-style-type: none;
    padding: 0;
    margin: 12px 0 0 0;
    width: 100%;
}

.server-player-list li {
    background-color: black;
    border: 2px solid white;
    padding: 8px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -2px;
    margin-bottom: -2px;
}

.mc-form {
    display: grid;
    grid-template-columns: max-content minmax(220px, 1fr);
    gap: 10px 16px;
    align-items: center;
    width: min(100%, 520px);
    margin: 12px auto 0;
}

.mc-form label {
    text-align: right;
}

.mc-form input[type="text"] {
    width: 100%;
}

.mc-form button {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 180px);
    box-sizing: border-box;
    margin-top: 2px;
}

.page-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(100%, 180px);
    margin-top: 10px;
    margin-bottom: 10px;
}

.page-actions .a-button {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    text-align: center;
}

.rules-list {
    text-align: center;
    display: inline-block;
    list-style-type: none;
    padding-inline-start: 0;
}
.rule-title {
    font-weight: bold;
    margin-top: 0.67em;
}
.rule-details {
    font-style: italic;
    margin-top: 0.420em;
}

.rules-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.65);
    z-index: 30;
}
.rules-modal[hidden] {
    display: none;
}
.rules-modal__panel {
    width: min(100%, 670px);
    background: #1a1a1a;
    border: 2px solid #ffffff;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
    padding: 16px;
    box-sizing: border-box;
    text-align: center;
}
.rules-modal__panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}
.rules-modal__panel p {
    margin-top: 0;
    margin-bottom: 0px;
    line-height: 1.4;
}
.rules-modal__checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    text-align: left;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}
.rules-modal__checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #6f6fff;
}
.rules-modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.rules-modal__actions button {
    margin-top: 0;
    width: 100%;
}
.rules-modal__cancel {
    background-color: #4f4f4f;
}
.rules-modal__actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    body {
        justify-content: flex-start;
        padding: 8px;
    }
    main {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    h1 {
        margin-top: 0.4em;
        margin-bottom: 0.4em;
        font-size: clamp(1.35rem, 7vw, 1.9rem);
    }
    p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .mc-form {
        grid-template-columns: 1fr;
        width: 100%;
    }
    .mc-form label {
        text-align: left;
    }
    .mc-form button {
        grid-column: 1;
    }
    .mc-form button,
    .page-actions .a-button {
        width: min(100%, 180px);
    }

    .rules-modal {
        padding: 8px;
    }
    .rules-modal__panel {
        padding: 12px;
    }
    .rules-modal__actions {
        grid-template-columns: 1fr;
    }
}

.login-button {
    padding: 20px 40px;
    font-size: 24px;
    cursor: pointer;
    text-align: center;
}

.color-yellow {
    color: #ffff55;
}
.color-green {
    color: #55ff55;
}
.color-red {
    color: #ff5555;
}

.error-banner {
    background-color: #f0d0d0;
    color: #670019;
    text-shadow: none;
    padding: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0.1em solid #a02020;
}
.message-banner {
    background-color: #d0d0f0;
    color: #001967;
    text-shadow: none;
    padding: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0.1em solid #2020a0;
}

.selection-unit {
    display: inline-block;
    user-select: all;
    -webkit-user-select: all;
    cursor: text;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chicken-jockey {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 30vh;
    width: 100%;
    object-fit: fill;
    pointer-events: none;
}

table {
    border-collapse: collapse;
    margin-top: 10px;
}
th, td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
}
