* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* กรอบมือถือ */
.phone-container {
    width: 360px;
    height: 740px;
    background: #000;
    border-radius: 45px;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 4px solid #333;
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: #f5f5f7;
    border-radius: 35px;
    overflow: hidden;
    position: relative;
    background-image: url('https://via.placeholder.com/360x740'); /* ภาพ Wallpaper */
    background-size: cover;
}

/* หน้าจอและระบบสลับแอป */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.app-page {
    background: white;
    z-index: 10;
}

/* รอยบากด้านบน */
.notch {
    width: 120px;
    height: 25px;
    background: black;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 35px 20px 10px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* ไอคอนแอป */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: white;
    font-size: 12px;
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin-bottom: 5px;
}

.chat-bg { background-color: #34c759; }
.gallery-bg { background-color: #007aff; }
.music-bg { background-color: #ff2d55; }

/* โครงสร้างหน้าต่างแอป */
.app-header {
    background: #f8f8f8;
    padding: 40px 15px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.app-header button {
    border: none;
    background: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
}

/* ระบบแชท */
.chat-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
}

.received {
    background: #e9e9eb;
    align-self: flex-start;
}

.sent {
    background: #007aff;
    color: white;
    align-self: flex-end;
}

/* แถบ Home Bar */
.home-bar {
    width: 130px;
    height: 5px;
    background: #ccc;
    border-radius: 3px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 101;
}
