* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 4px;

    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: 4px;
}

.box-grid {
    flex: 1 1 auto;

    display: grid;

    /* ALWAYS 8 columns */
    grid-template-columns: repeat(8, minmax(0, 1fr));

    /* ALWAYS 2 rows that fill remaining height */
    grid-template-rows: repeat(2, minmax(0, 1fr));

    gap: 4px;

    width: 100%;
    height: 100%;

    min-height: 0;
    min-width: 0;
}

.box {
    display: flex;
    flex-direction: column;

    min-height: 0;

    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px;
}

.box h2 {
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid #ddd;

    flex-shrink: 0;
}

.box ul {
    list-style: none;

    flex: 1;
    overflow: hidden;

    font-size: clamp(0.75rem, 0.55vw, 1.0rem);

    line-height: 1.9;
}

.box li {
    margin: 0;
    break-inside: avoid;
    white-space: nowrap;
}

.qb {
    color: green;
    font-weight: bold;
}

.rb {
    color: blue;
}

.wr,
.te {
    color: red;
}

.def,
.k {
    color: black;
}

@media (max-width: 1600px) {
    .box-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        height: 100%;
    }

    body {
        overflow: hidden;
    }
}

@media (max-width: 900px) {
    .box-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .box-grid {
        grid-template-columns: 1fr;
    }
}