* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 30px 16px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #effaf2;
    color: #1e293b;

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

main {
    width: 100%;
    max-width: 420px;
}

.hidden {
    display: none !important;
}


/* GİRİŞ EKRANI */

#loginScreen {
    width: 100%;
    padding: 38px 32px 32px;

    background: white;
    border-radius: 24px;

    text-align: center;

    box-shadow:
        0 20px 45px rgba(15, 80, 40, 0.13);
}

.logo {
    margin-bottom: 6px;
    font-size: 54px;
}

h1 {
    margin: 0;
    color: #166534;
    font-size: 32px;
}

.date {
    margin: 8px 0 24px;
    color: #64748b;
    font-weight: bold;
}

.welcome-text {
    margin: 24px 0 20px;
    line-height: 1.5;
}

#username {
    width: 100%;
    height: 54px;
    padding: 0 16px;

    border: 2px solid #d7e5da;
    border-radius: 14px;
    outline: none;

    font-size: 16px;
}

#username:focus {
    border-color: #22c55e;
}

#joinBtn {
    width: 100%;
    height: 50px;
    margin-top: 14px;

    border: none;
    border-radius: 14px;

    background: #22c55e;
    color: white;

    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

#joinBtn:hover {
    background: #16a34a;
}


/* GERİ SAYIM */

#countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.time-box {
    padding: 14px 5px;

    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
}

.time-box span {
    display: block;

    color: #166534;
    font-size: 24px;
    font-weight: bold;
}

.time-box small {
    display: block;
    margin-top: 5px;

    color: #64748b;
    font-size: 11px;
}


/* SOHBET EKRANI */

#chatScreen {
    width: 100%;
    height: 610px;
    padding: 28px 32px 24px;

    display: flex;
    flex-direction: column;

    background: white;
    border-radius: 24px;

    box-shadow:
        0 20px 45px rgba(15, 80, 40, 0.13);
}

.chat-header {
    position: relative;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-header h2 {
    max-width: 240px;
    margin: 0;

    color: #166534;
    font-size: 24px;
}

#welcomeMessage {
    margin: 5px 0 0;

    color: #64748b;
    line-height: 1.35;
}


/* AYARLAR */

.settings {
    position: relative;
    flex-shrink: 0;
}

#settingsBtn {
    width: 40px;
    height: 40px;
    padding: 0;

    border: none;
    border-radius: 50%;

    background: #ecfdf5;

    font-size: 19px;
    cursor: pointer;
}

#settingsBtn:hover {
    background: #d1fae5;
}

.settings-menu {
    position: absolute;
    top: 48px;
    right: 0;
    z-index: 20;

    width: 175px;
    padding: 10px;

    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 13px;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.14);
}

.settings-menu p {
    margin: 0 0 8px;
    padding: 7px 8px 10px;

    border-bottom: 1px solid #e2e8f0;

    color: #475569;
    font-size: 14px;
    font-weight: bold;

    overflow-wrap: anywhere;
}

#logoutBtn {
    width: 100%;
    padding: 10px;

    border: none;
    border-radius: 9px;

    background: transparent;
    color: #dc2626;

    text-align: left;
    font-weight: bold;
    cursor: pointer;
}

#logoutBtn:hover {
    background: #fef2f2;
}


/* MESAJ ALANI */

.messages {
    flex: 1;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 6px;

    padding: 18px 4px;
}

.message {
    width: fit-content;
    max-width: 78%;
    padding: 12px 14px;

    border-radius: 18px;
    overflow-wrap: anywhere;
}

.message strong {
    display: block;
    margin-bottom: 6px;

    color: #166534;
    font-size: 14px;
}

.message p {
    margin: 0;
    line-height: 1.4;
}

.message small {
    display: block;
    margin-top: 7px;

    color: #64748b;
    font-size: 11px;
    text-align: right;
}

.message.received {
    align-self: flex-start;
    background: #f1f5f9;
}

.message.sent {
    align-self: flex-end;
    background: #dcfce7;
}


/* MESAJ GÖNDERME FORMU */

.message-form {
    display: flex;
    gap: 10px;

    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

#messageInput {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 15px;

    border: 2px solid #22c55e;
    border-radius: 14px;
    outline: none;

    font-size: 16px;
}

#sendBtn {
    width: 52px;
    height: 50px;
    flex-shrink: 0;

    border: none;
    border-radius: 14px;

    background: #22c55e;
    color: white;

    font-size: 22px;
    cursor: pointer;
}

#sendBtn:hover {
    background: #16a34a;
}


/* TELEFON EKRANLARI */

@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    main {
        max-width: none;
    }

    #loginScreen,
    #chatScreen {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    #loginScreen {
        padding: 38px 20px;
    }

    #chatScreen {
        height: 100vh;
        padding: 22px 18px 16px;
    }

    .time-box span {
        font-size: 21px;
    }

    .time-box small {
        font-size: 10px;
    }

    .chat-header h2 {
        font-size: 22px;
    }
}