/* AbildskovUndervisning - abildskovundervisning.dk */
/* =====================================================
   TABELMESTER
   Spilspecifik styling
===================================================== */


/* =====================================================
   SPØRGSMÅL
===================================================== */

.tabelmester-question {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 180px;

    box-sizing: border-box;

    color: #ff0000;

    font-size: clamp(
        2.5rem,
        7vw,
        5rem
    );

    font-weight: bold;

    text-align: center;

    letter-spacing: 2px;

}


/* =====================================================
   SVARFELT
   Forberedt til næste version
===================================================== */

.tabelmester-answer {

    min-width: 120px;

    padding: 10px 18px;

    box-sizing: border-box;

    color: #ff0000;

    background: #000000;

    border: 2px solid #770000;

    border-radius: 8px;

    font-family: inherit;

    font-size: clamp(
        2rem,
        5vw,
        3.5rem
    );

    text-align: center;

}


/* =====================================================
   AKTIVT SVARFELT
===================================================== */

.tabelmester-answer.active {

    border-color: #ff0000;

    box-shadow:
        0 0 8px rgba(255, 0, 0, 0.45);

}


/* =====================================================
   FORUDFYLDT SVAR
===================================================== */

.tabelmester-prefilled {

    color: #ff0000;

    opacity: 0.75;

}


/* =====================================================
   STATUS
===================================================== */

.tabelmester-status {

    color: #ff0000;

    font-size: 1rem;

    text-align: center;

}


/* =====================================================
   FÆRDIG
===================================================== */

.tabelmester-complete {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 15px;

    width: 100%;

    min-height: 250px;

    color: #ff0000;

    text-align: center;

}


.tabelmester-complete-title {

    margin: 0;

    font-size: clamp(
        2rem,
        6vw,
        4rem
    );

}


.tabelmester-complete-text {

    margin: 0;

    font-size: 1.2rem;

}


/* =====================================================
   RESPONSIV
===================================================== */

@media (max-width: 600px) {

    .tabelmester-question {

        min-height: 140px;

        font-size: clamp(
            2rem,
            11vw,
            3.5rem
        );

    }


    .tabelmester-answer {

        min-width: 90px;

    }

}
/* =====================================================
   TabelMester Board
===================================================== */

/* =====================================================
   TabelMester Board
===================================================== */

.tabelmester-board {

    display: grid;

    grid-template-columns:
        repeat(11, minmax(0, 1fr));

    grid-template-rows:
        repeat(11, minmax(0, 1fr));

    /*
    -----------------------------------------------------
        Størrelsen bestemmes både af bredde og højde.

        Det er vigtigt, fordi GameShell også bruger
        plads til titel, timer og status.
    -----------------------------------------------------
    */

    /* Fit both the available game area and the viewport while staying square. */
    width: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);
    height: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);
    aspect-ratio: 1;

    margin:
        0 auto;

    flex-shrink: 0;

    border:
        2px solid currentColor;

}


/* =====================================================
   Alle celler
===================================================== */

.tabelmester-cell {

    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 0;
    min-height: 0;

    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;

    font-size: clamp(
        14px,
        2.2vw,
        26px
    );

    font-weight: bold;

    user-select: none;

}


.tabelmester-question-cell {

    font-size: clamp(
        14px,
        2.2vw,
        26px
    );

    overflow: hidden;

}


/* =====================================================
   Headerfelter
===================================================== */

/* =====================================================
   Tydelig markering af tabel-overskrifter
===================================================== */

.tabelmester-header {

    font-weight: bold;

}


/* Øverste række */

.tabelmester-header[data-column] {

    border-top: 3px solid #ff0000;
    border-bottom: 3px solid #ff0000;

}


/* Venstre kolonne */

.tabelmester-header[data-row] {

    border-left: 3px solid #ff0000;
    border-right: 3px solid #ff0000;

}


/* Hjørnet */

.tabelmester-corner {

    border:
        3px solid #ff0000;

}

/* =====================================================
   Øverste venstre hjørne
===================================================== */

.tabelmester-corner {

    font-size: clamp(
        18px,
        2.5vw,
        30px
    );

}


/* =====================================================
   Spørgsmålsfelter
===================================================== */

.tabelmester-question-cell {

    cursor: default;

}


/* =====================================================
   Aktivt felt
===================================================== */

.tabelmester-question-cell.active {

    animation:
        tabelmester-blink
        1.2s
        ease-in-out
        infinite;

}


/* =====================================================
   Besvaret felt
===================================================== */

.tabelmester-question-cell.answered {

    opacity: 0.65;

}


/* =====================================================
   Blink
===================================================== */

@keyframes tabelmester-blink {

    0%,
    100% {

        opacity: 1;

    }

    50% {

        opacity: 0.35;

    }

}
/* =====================================================
   Spilområdet
===================================================== */

.tabelmester-board {

    box-sizing: border-box;

}


/* =====================================================
   Mindre skærme
===================================================== */

@media (max-height: 700px) {

    .tabelmester-board {

        width: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);
        height: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);

    }

}


@media (max-width: 700px) {

    .tabelmester-board {

        width: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);
        height: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 220px), 760px);

    }

    @media (max-width: 600px) and (max-height: 520px) {

        .tabelmester-board {
            width: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 280px), 760px);
            height: min(86vw, calc(100vw - 50px), calc(var(--app-vh, 100vh) - 280px), 760px);
        }

    }

}


/* =====================================================
   TabelMester - Indstillingsmenu
===================================================== */

.tabelmester-menu {

    width: min(
        92vw,
        700px
    );

    margin: 0 auto;

    /* Align spacing with Addition menu (reduced) */
    padding: 16px;

    box-sizing: border-box;

}


.tabelmester-menu-header {

    text-align: center;

    margin-bottom: 24px;

}


.tabelmester-setting-section {

    margin-bottom: 22px;

}


.tabelmester-setting-title {

    margin: 0 0 6px 0;

}


.tabelmester-setting-description {

    margin: 0 0 12px 0;

}


.tabelmester-table-buttons {

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 8px;

}


.tabelmester-table-button {

    min-height: 52px;

    font-size: 1.2rem;

    cursor: pointer;

    border: 2px solid #770000;

    background: #000000;

    color: #ff0000;

    border-radius: 6px;

    box-sizing: border-box;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;

}


.tabelmester-table-button.selected {

    transform: scale(1.03);

    border: 3px solid #ff0000;

    background: #330000;

    box-shadow:
        0 0 10px rgba(255, 0, 0, 0.45);

    font-weight: bold;

}


.tabelmester-prefill-options {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

}


/* =====================================================
   Forudfyldning
===================================================== */

.tabelmester-prefill-options {

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 8px;

}


.tabelmester-prefill-button,
.tabelmester-timer-button {

    /* Let addition-timer-button CSS govern exact sizing/hover/selected states. Keep minimal overrides here. */
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    background: #000000;
    color: #ff0000;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;

}

/* Remove conflicting min-width/min-height so addition-timer-button rules apply and sizes match exactly */
.tabelmester-timer-button { }
.tabelmester-timer-button:hover { }
.tabelmester-timer-button.selected { }



.tabelmester-prefill-button.selected,
.tabelmester-timer-button.selected {

    border-color: #ff0000;

    background: #330000;

    box-shadow:
        0 0 10px rgba(
            255,
            0,
            0,
            0.45
        );

    transform: scale(1.03);

}


/* =====================================================
   Timer
===================================================== */

.tabelmester-timer-button {

    min-width: 140px;

}


/* =====================================================
   Lille skærm
===================================================== */

@media (max-width: 600px) {

    .tabelmester-prefill-options {

        gap: 6px;

    }


    .tabelmester-prefill-button {

        min-height: 46px;

        padding:
            6px 4px;

        font-size: 1rem;

    }


    .tabelmester-timer-button {

        width: 100%;

    }

}


.tabelmester-menu-actions {

    display: flex;

    justify-content: space-between;

    gap: 12px;

    margin-top: 28px;

}

.tabelmester-menu-actions {

    display: flex;

    justify-content: space-between;

    gap: 10px;

    margin-top: 28px;

    width: 100%;

}


.tabelmester-start-button {

    flex: 1 1 0;

    min-width: 0;

}


.tabelmester-back-button {

    flex: 1 1 0;

    min-width: 0;

}


.tabelmester-start-button,
.tabelmester-back-button {

    min-height: 48px;

    padding:
        10px 24px;

    cursor: pointer;

}


.tabelmester-start-button {

    flex: 1;

}


.tabelmester-back-button {

    flex: 0 0 auto;

}


@media (max-width: 600px) {

    .tabelmester-menu {

        padding: 16px;

    }


    .tabelmester-table-buttons {

        gap: 6px;

    }


    .tabelmester-table-button {

        min-height: 46px;

    }


    .tabelmester-start-button,
    .tabelmester-back-button {

        width: 50%;

    }

}