html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}



/* Algemeen layout */
body {
    margin: 0;
    background: #e0e0e0;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(var(--vh, 1vh) * 100);
}

/* Telefoonframe */
/* Groter toestel */
.phone-frame {
    background: #333;
    border-radius: 50px;
    padding: 12px;
    width: min(440px, 100vw);
    height: min(900px, calc(var(--vh, 1vh) * 100));
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}



.inner-screen {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    height: 100%;
    max-height: 100%;
    max-height: calc(var(--vh, 1vh) * 100);
}





.side-buttons .volume,
.side-buttons .volume2,
.side-buttons .power {
    position: absolute;
    width: 5px;
    background: #666;
    border-radius: 2px;
}

/* Tegen linkerrand */
.side-buttons .volume {
    left: -4px;
    top: 120px;
    height: 60px;
}

.side-buttons .volume2 {
    left: -4px;
    top: 190px;
    height: 40px;
}

/* Tegen rechterrand */
.side-buttons .power {
    right: -4px;
    top: 200px;
    height: 40px;
}



.screen {
    background-color: #fdfdfd;
    border-radius: 40px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}


/* Bovenbalk */
.header {
    background-color: #7b1e3b;
    color: white;
    text-align: center;
    font-weight: bold;
    padding: 8px;
    font-size: 17px;
    z-index: 1;
}

/* Chatweergave */
.chat-container {
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f5f5f5;
}


/* Systeembericht */
.message.system {
    background-color: #f1d7dc;
    color: #7b1e3b;
    padding: 10px 14px;
    border-radius: 16px;
    align-self: flex-start;
    font-weight: bold;
    font-size: 15px;
    max-width: 75%;
}

/* Gebruikerbericht */
.message.user {
    background-color: #7b1e3b;
    color: white;
    padding: 10px 14px;
    border-radius: 16px;
    border-top-right-radius: 0;
    align-self: flex-end;
    font-size: 15px;
    max-width: 75%;
}

/* Media in berichten */
.message img,
.message video {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 6px;
}

/* Knoppen voor keuzes */
.options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #fafafa;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
}


button {
    background-color: #7b1e3b;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #5a0f27;
}

.message {
    animation: fadeIn 0.4s ease-out;
    background-color: #f1f0f0;
    padding: 10px 14px;
    border-radius: 16px;
    margin: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background-color: #09c570;
}

.message.system {
    align-self: flex-start;
    background-color: #ffffff;
}

.message-content img.chat-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Canvas vult de inner-screen netjes */
#tetris-canvas {
    width: 100%;
    height: 100%;
    background-color: white;
    display: block;
}

/* Alleen afgeronde hoeken in staande modus */
.phone-frame:not(.rotate) .inner-screen {
    border-radius: 40px;
}

/* Verwijder border-radius in landscape/Tetris */
.phone-frame.rotate .inner-screen {
    border-radius: 0 !important;
}

#lockscreen {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: #7b1e3b;
    color: white;
    padding: 60px 80px;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.login-box input {
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    margin-top: 10px;
}

.login-box button {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    background-color: white;
    color: #7b1e3b;
    border: none;
    cursor: pointer;
    width: 100%;
}

.login-box #error {
    color: yellow;
    margin-top: 10px;
}



@media (max-width: 768px) {
    .phone-frame {
        width: 95vw;
        height: calc(var(--vh, 1vh) * 95);
        border-radius: 30px;
        padding: 8px;
    }

    .inner-screen {
        border-radius: 30px;
    }

    .login-box {
        width: 90vw;
        padding: 40px 20px;
    }

    .header {
        font-size: 16px;
        padding: 6px;
    }

    .chat-container {
        padding: 10px;
        gap: 8px;
    }

    .message,
    .message.user,
    .message.system {
        font-size: 14px;
        padding: 8px 12px;
        max-width: 85%;
    }

    .options {
        padding: 8px;
        flex-direction: column;
        align-items: center;
    }

    button {
        font-size: 14px;
        padding: 8px 16px;
    }

    .side-buttons .volume,
    .side-buttons .volume2,
    .side-buttons .power {
        display: none;
    }
}

@media (max-width: 480px) {
    .phone-frame {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 0;
    }

    .inner-screen,
    .screen {
        border-radius: 0 !important;
    }

    .login-box {
        padding: 30px 15px;
    }

    .login-box h2 {
        font-size: 18px;
    }

    .login-box p {
        font-size: 14px;
    }

    .message,
    .message.user,
    .message.system {
        font-size: 13px;
    }

    button {
        font-size: 13px;
        padding: 8px 14px;
    }
}

@media (min-width: 768px) {
    .phone-frame.rotate {
        transform: rotate(90deg);
        transform-origin: center center;
        transition: transform 1s ease-in-out;
    }

    .phone-frame.rotate .inner-screen {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border-radius: 0 !important;
    }

    .phone-frame.rotate .screen {
        width: 100%;
        height: 100%;
    }

    .phone-frame.rotate canvas#tetris-canvas {
        width: 100%;
        height: 100%;
        display: block;
    }
}