:root {
    --ww-teal: #2f6363;
    --ww-teal-dark: #1f4848;
    --ww-teal-light: #e5f2f0;
    --ww-red: #df1729;
    --ww-red-dark: #a51b25;
    --ww-coral: #ff4655;
    --ww-cream: #fff8ec;
    --ww-ink: #173033;
    --ww-white: #ffffff;
    --ww-shadow: 0 24px 70px rgba(10, 35, 35, 0.25);
}

.weet-wurm-launcher,
.weet-wurm-launcher * {
    box-sizing: border-box;
}


/* Belangrik: WordPress/tema CSS kan die HTML hidden-attribuut omseil wanneer ons eie display:grid/flex gebruik. */
.weet-wurm-launcher [hidden] {
    display: none !important;
}

.weet-wurm-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--ww-teal-light), #fff 55%, #ffe9e6);
    border: 2px solid rgba(47, 99, 99, 0.16);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(31, 72, 72, 0.14);
    overflow: hidden;
}

.weet-wurm-card h2,
.weet-wurm-card h3,
.weet-wurm-shell h3,
.weet-wurm-shell h4 {
    margin: 0 0 8px;
    color: var(--ww-ink);
    line-height: 1.1;
}

.weet-wurm-card p,
.weet-wurm-shell p {
    color: #375a5d;
    margin: 0 0 14px;
}

.weet-wurm-kicker {
    font-weight: 800;
    color: var(--ww-red) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    margin-bottom: 8px !important;
}

.weet-wurm-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.weet-wurm-btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.weet-wurm-btn:hover,
.weet-wurm-mobile-controls button:hover {
    transform: translateY(-1px);
}

.weet-wurm-btn-primary {
    background: var(--ww-red);
    color: var(--ww-white);
    box-shadow: 0 10px 20px rgba(223, 23, 41, 0.25);
}

.weet-wurm-btn-primary:hover {
    background: var(--ww-red-dark);
}

.weet-wurm-btn-secondary {
    background: var(--ww-teal);
    color: var(--ww-white);
}

.weet-wurm-btn-secondary:hover {
    background: var(--ww-teal-dark);
}

.weet-wurm-card-owl {
    width: 150px;
    max-width: 34%;
    flex: 0 0 auto;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.12));
}

.weet-wurm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.weet-wurm-modal.is-open {
    display: block;
}

.weet-wurm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 31, 33, 0.72);
    backdrop-filter: blur(4px);
}

.weet-wurm-modal-dialog {
    position: relative;
    width: min(1050px, calc(100vw - 34px));
    max-height: calc(100vh - 34px);
    margin: 17px auto;
    background: var(--ww-cream);
    border-radius: 30px;
    box-shadow: var(--ww-shadow);
    overflow: hidden;
}

.weet-wurm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 0;
    background: var(--ww-white);
    color: var(--ww-ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.weet-wurm-shell {
    padding: 26px;
    max-height: calc(100vh - 34px);
    overflow-y: auto;
}

.weet-wurm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-right: 42px;
}

.weet-wurm-scorebar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.weet-wurm-scorebar span {
    background: var(--ww-white);
    color: var(--ww-teal-dark);
    padding: 9px 13px;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(31, 72, 72, 0.09);
}

.weet-wurm-player-panel {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 22px;
    align-items: center;
    background: var(--ww-white);
    border-radius: 22px;
    padding: 22px;
    border: 2px solid rgba(47, 99, 99, 0.11);
}

.weet-wurm-small-owl {
    width: 120px;
}

.weet-wurm-name-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.weet-wurm-name-row input {
    flex: 1 1 220px;
    min-height: 44px;
    border-radius: 999px;
    border: 2px solid rgba(47, 99, 99, 0.24);
    padding: 0 16px;
    font-size: 16px;
}

.weet-wurm-error {
    color: var(--ww-red) !important;
    font-weight: 700;
    min-height: 20px;
}

.weet-wurm-game-area {
    display: grid;
    grid-template-columns: minmax(280px, 580px) 1fr;
    gap: 18px;
    align-items: start;
}

.weet-wurm-canvas-wrap {
    position: relative;
    width: min(100%, 560px);
    margin: 0 auto;
    background: linear-gradient(180deg, #f7fffd, #d9eeea);
    border: 5px solid var(--ww-teal);
    border-radius: 26px;
    padding: 12px;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.6), 0 15px 30px rgba(31, 72, 72, 0.16);
}

.weet-wurm-canvas-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    background: repeating-linear-gradient(45deg, #eefaf8, #eefaf8 16px, #e4f4f1 16px, #e4f4f1 32px);
    border-radius: 16px;
}

.weet-wurm-overlay {
    position: absolute;
    inset: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 22px;
    border-radius: 16px;
    background: rgba(255, 248, 236, 0.92);
    backdrop-filter: blur(3px);
}

.weet-wurm-game-over-owl {
    width: 115px;
    max-width: 35%;
    margin-bottom: 4px;
}

.weet-wurm-save-status {
    font-weight: 800;
    color: var(--ww-teal-dark) !important;
}

.weet-wurm-mobile-controls {
    background: var(--ww-white);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 12px 26px rgba(31, 72, 72, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.weet-wurm-mobile-controls div {
    display: flex;
    gap: 8px;
}

.weet-wurm-mobile-controls button {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 0;
    background: var(--ww-teal);
    color: var(--ww-white);
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(47, 99, 99, 0.22);
}

.weet-wurm-mobile-controls button[data-ww-dir="down"] {
    background: var(--ww-red);
}

.weet-wurm-leaderboard {
    background: var(--ww-white);
    border-radius: 22px;
    padding: 18px;
    border: 2px solid rgba(47, 99, 99, 0.12);
}

.weet-wurm-leaderboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.weet-wurm-leaderboard ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.weet-wurm-leaderboard li {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    background: var(--ww-teal-light);
    border-radius: 15px;
    color: var(--ww-ink);
    font-weight: 800;
}

.weet-wurm-leaderboard small {
    display: block;
    color: #577174;
    font-weight: 700;
}

@media (max-width: 760px) {
    
/* Belangrik: WordPress/tema CSS kan die HTML hidden-attribuut omseil wanneer ons eie display:grid/flex gebruik. */
.weet-wurm-launcher [hidden] {
    display: none !important;
}

.weet-wurm-card {
        padding: 22px;
    }

    .weet-wurm-card-owl {
        width: 110px;
    }

    .weet-wurm-modal-dialog {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .weet-wurm-shell {
        max-height: 100vh;
        padding: 18px;
    }

    .weet-wurm-header {
        align-items: flex-start;
        flex-direction: column;
        padding-right: 44px;
    }

    .weet-wurm-player-panel,
    .weet-wurm-game-area {
        grid-template-columns: 1fr;
    }

    .weet-wurm-player-panel {
        text-align: center;
    }

    .weet-wurm-small-owl {
        margin: 0 auto;
    }

    .weet-wurm-mobile-controls {
        position: sticky;
        bottom: 10px;
    }

    .weet-wurm-leaderboard-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    
/* Belangrik: WordPress/tema CSS kan die HTML hidden-attribuut omseil wanneer ons eie display:grid/flex gebruik. */
.weet-wurm-launcher [hidden] {
    display: none !important;
}

.weet-wurm-card {
        display: block;
        text-align: center;
    }

    .weet-wurm-card-owl {
        max-width: 130px;
        margin: 16px auto 0;
        display: block;
    }

    .weet-wurm-card-actions,
    .weet-wurm-name-row {
        justify-content: center;
    }
}
