* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ZPlay landing page */
.zplay-landing {
    min-height: 100vh;
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: center;
    gap: 64px;
    padding: 56px;
    color: #fffdf3;
    position: relative;
    overflow: hidden;
}

body:has(.zplay-landing) {
    font-family: Georgia, 'Times New Roman', serif;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 235, 145, 0.28) 0 2px, transparent 3px),
        radial-gradient(circle at 80% 11%, rgba(255, 235, 145, 0.4) 0 1px, transparent 2px),
        linear-gradient(150deg, #135f71 0%, #193b69 48%, #172655 100%);
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.zplay-intro { position: relative; z-index: 1; }
.zplay-kicker { color: #f8c765; font-family: 'Segoe UI', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.zplay-intro h1 { font-size: 76px; font-weight: 700; line-height: 0.95; margin: 12px 0 20px; text-shadow: 3px 4px 0 #0c294b; }
.zplay-tagline { color: #d9f0ec; font-size: 21px; line-height: 1.45; max-width: 480px; }

.portal-scene { height: 270px; max-width: 560px; margin-top: 34px; position: relative; overflow: hidden; }
.star { width: 7px; height: 7px; border-radius: 50%; background: #fff2b1; box-shadow: 0 0 15px 3px #fff2b1; position: absolute; }
.star-one { top: 28px; left: 15%; }.star-two { top: 52px; left: 73%; }.star-three { top: 110px; left: 87%; }
.cloud { width: 155px; height: 34px; border-radius: 50%; background: rgba(213, 244, 236, 0.16); filter: blur(1px); position: absolute; }
.cloud-one { top: 105px; left: 4%; }.cloud-two { top: 48px; right: 5%; transform: scale(0.7); }
.island { width: 340px; height: 92px; border-radius: 50% 50% 46% 46%; background: #4f9b5c; box-shadow: inset 0 14px #8aca69, inset 0 -22px #276a53, 0 18px 0 -8px #1a5460; position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); }
.portal { width: 94px; height: 124px; border: 12px solid #f7cc62; border-radius: 50% 50% 16px 16px; background: radial-gradient(ellipse at 35% 30%, #c4fff1, #44c6c7 45%, #3765a4 72%); box-shadow: 0 0 0 7px #33577a, 0 0 30px 8px rgba(133, 242, 208, 0.65); position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%); }
.tree { width: 15px; height: 68px; border-radius: 10px; background: #704c35; position: absolute; bottom: 45px; }
.tree::before { content: ''; width: 65px; height: 56px; border-radius: 55% 45% 52% 48%; background: #2c8057; box-shadow: inset 8px 6px #56aa62; position: absolute; left: -25px; top: -38px; }
.tree-one { left: 48px; transform: scale(0.8); }.tree-two { right: 46px; transform: scale(1.1); }

.auth-panel { padding: 26px; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 8px; background: rgba(12, 32, 66, 0.68); box-shadow: 8px 10px 0 rgba(6, 23, 49, 0.25); font-family: 'Segoe UI', sans-serif; text-align: center; }
.auth-panel p { color: #e0f5ed; font-size: 18px; line-height: 1.5; margin-bottom: 16px; }.auth-panel strong { color: #f9ce68; }
#user-profile p { font-size: 20px; font-weight: 600; } #user-name { font-size: 24px; overflow-wrap: anywhere; }
.auth-button { width: 100%; min-height: 46px; border: 0; border-radius: 4px; background: #f5c65c; color: #17365c; cursor: pointer; font: 700 16px 'Segoe UI', sans-serif; letter-spacing: 0.2px; box-shadow: 0 3px 0 #c28d2f; transition: transform 150ms ease, box-shadow 150ms ease; }
.auth-button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #c28d2f; }.auth-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c28d2f; }.auth-button.secondary { background: #d4ede5; box-shadow: 0 4px 0 #78a79e; }

.community-area { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(250px, 0.68fr) minmax(0, 1.32fr); gap: 18px; font-family: 'Segoe UI', sans-serif; }
.community-area[hidden] { display: none; }
.community-panel { min-height: 220px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 8px; background: rgba(9, 31, 61, 0.76); box-shadow: 6px 8px 0 rgba(6, 23, 49, 0.2); padding: 14px; }
.panel-heading { padding-bottom: 16px; border-bottom: 1px solid rgba(222, 245, 237, 0.22); }.panel-kicker { color: #f8c765; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }.panel-heading h2 { color: #fffdf3; font-family: Georgia, 'Times New Roman', serif; font-size: 25px; line-height: 1.2; margin-top: 5px; }
.directory-search-input { width: 100%; min-height: 42px; margin-top: 16px; border: 1px solid rgba(222, 245, 237, 0.52); border-radius: 4px; background: rgba(255, 255, 255, 0.92); color: #17365c; font: 14px 'Segoe UI', sans-serif; padding: 0 12px; }.directory-search-input:focus { outline: 3px solid rgba(248, 199, 101, 0.45); border-color: #f8c765; }.online-users-list { display: grid; gap: 8px; margin-top: 16px; max-height: 248px; overflow-y: auto; padding-right: 4px; }.user-badge { display: flex; align-items: center; width: 100%; min-height: 56px; gap: 12px; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: rgba(214, 245, 237, 0.08); color: #e0f5ed; cursor: pointer; font: 600 14px 'Segoe UI', sans-serif; text-align: left; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease; }.user-badge:hover, .user-badge.selected { border-color: #f8c765; background: rgba(248, 199, 101, 0.16); transform: translateX(3px); }.user-badge img { flex: 0 0 40px; border-radius: 50%; background: #d4ede5; }.user-badge.online img { animation: online-avatar-pulse 1.6s ease-in-out infinite; }.user-copy { display: grid; min-width: 0; }.user-name { color: #fffdf3; }.user-meta { color: #d9f0ec; font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.user-list-empty { color: #d9f0ec; font-size: 14px; line-height: 1.5; padding: 12px 4px; }
.chat-panel { display: grid; grid-template-rows: auto minmax(100px, 1fr) auto; gap: 10px; }.chat-messages { display: flex; flex-direction: column; gap: 8px; min-height: 100px; max-height: 180px; overflow-y: auto; padding: 4px 2px; }.chat-message { display: grid; gap: 6px; max-width: min(82%, 460px); border-radius: 5px; padding: 8px 10px; color: #17365c; font-size: 13px; line-height: 1.35; }.chat-message.system { align-self: center; background: rgba(212, 237, 229, 0.2); color: #d9f0ec; text-align: center; }.chat-message.incoming { align-self: flex-start; background: #d4ede5; border: 1px solid #9bc9bc; }.chat-message.outgoing { align-self: flex-end; background: #f8c765; border: 1px solid #d9a943; }.chat-message.deleted { opacity: 0.82; font-style: italic; }.chat-message-body { overflow-wrap: anywhere; }.chat-message-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.chat-message-meta { color: rgba(23, 54, 92, 0.72); font-size: 11px; min-height: 1em; }.chat-message-actions { display: inline-flex; gap: 6px; }.chat-action-button { border: 1px solid rgba(23, 54, 92, 0.18); border-radius: 4px; background: rgba(255, 255, 255, 0.58); color: #17365c; cursor: pointer; font: 600 11px 'Segoe UI', sans-serif; padding: 4px 8px; }.chat-action-button:hover { background: rgba(255, 255, 255, 0.82); }.chat-action-button:disabled { cursor: not-allowed; opacity: 0.55; }.chat-action-button.primary { background: #17365c; border-color: #17365c; color: #fffdf3; }.chat-action-button.primary:hover { background: #204b80; }.chat-action-button.danger { color: #8f1f18; }.chat-edit-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }.chat-edit-input { min-width: 0; min-height: 34px; border: 1px solid rgba(23, 54, 92, 0.24); border-radius: 4px; background: rgba(255, 255, 255, 0.95); color: #17365c; font: 13px 'Segoe UI', sans-serif; padding: 0 10px; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }.chat-form input { min-width: 0; min-height: 44px; border: 1px solid rgba(222, 245, 237, 0.52); border-radius: 4px; background: rgba(255, 255, 255, 0.92); color: #17365c; font: 14px 'Segoe UI', sans-serif; padding: 0 12px; }.chat-form input:focus { outline: 3px solid rgba(248, 199, 101, 0.45); border-color: #f8c765; }.send-button { min-width: 70px; border: 0; border-radius: 4px; background: #f5c65c; color: #17365c; cursor: pointer; font: 700 14px 'Segoe UI', sans-serif; padding: 0 14px; }.send-button:disabled, .chat-form input:disabled { cursor: not-allowed; opacity: 0.55; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
    .zplay-landing { grid-template-columns: 1fr; gap: 26px; padding: 40px 24px; }.zplay-intro h1 { font-size: 58px; }.zplay-tagline { font-size: 18px; }.portal-scene { height: 210px; margin-top: 20px; }.island { transform: translateX(-50%) scale(0.78); }.auth-panel { padding: 28px 22px; }.community-area { grid-column: auto; grid-template-columns: 1fr; }.community-panel { min-height: 0; }.online-users-list { max-height: 230px; }.chat-messages { min-height: 180px; }
}

.chat-message-read-status { color: #16803c; font-size: 15px; font-weight: 800; min-width: 1em; line-height: 1; }.chat-message-read-status.read { display: inline-block; color: #16803c; text-shadow: 0 0 5px rgba(22, 128, 60, 0.35); }.chat-icon-button { width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0; font-size: 15px; line-height: 1; }

@keyframes online-avatar-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(80, 220, 133, 0.2); }
    50% { box-shadow: 0 0 0 5px rgba(80, 220, 133, 0.55); }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: 500px;
}

.screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Welcome Screen */
#welcomeScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.welcome-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.welcome-content h1 {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.welcome-content p {
    font-size: 16px;
    line-height: 1.6;
    margin: 30px 0;
    max-width: 500px;
}

/* Form Screens */
.form-content {
    text-align: center;
    padding: 60px 40px;
    width: 100%;
}

.form-content h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
}

.form-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.form-content input {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.form-content input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    font-size: 18px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-style {
    background: #f0f0f0;
    color: #333;
    padding: 10px 20px;
    border: 2px solid #ddd;
    margin: 5px;
}

.btn-style:hover {
    border-color: #667eea;
    background: #f8f8f8;
}

.btn-style.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 15px 0;
}

.color-btn {
    width: 50px;
    height: 50px;
    border: 3px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.color-btn.active {
    border-color: #333;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #333;
}

/* Customization Screen */
#customizationScreen {
    padding: 40px;
    background: #f8f9fa;
}

.customization-container {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
}

.customization-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.customization-left h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.character-preview {
    width: 250px;
    height: 250px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

.customization-right {
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
    padding-right: 20px;
}

.customization-right::-webkit-scrollbar {
    width: 8px;
}

.customization-right::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.customization-right::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.option-group {
    margin-bottom: 30px;
}

.option-group h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.customization-right .btn-primary {
    width: 100%;
    margin-top: 20px;
}

/* Game Start Screen */
#gameStartScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-start-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.game-start-content h2 {
    font-size: 36px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.character-large {
    width: 300px;
    height: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 15px;
    margin: 0 auto;
}

.game-start-content p {
    font-size: 18px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Game Screen */
#gameScreen {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    padding: 40px;
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

.game-container h1 {
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
}

#playerStats {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

#gameContent {
    text-align: center;
    padding: 30px 0;
}

#gameContent p {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customization-container {
        flex-direction: column;
        gap: 20px;
    }

    .customization-right {
        max-height: none;
        padding-right: 0;
    }

    .character-preview {
        width: 200px;
        height: 200px;
    }

    .character-large {
        width: 250px;
        height: 250px;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .color-picker {
        gap: 8px;
    }

    .color-btn {
        width: 40px;
        height: 40px;
    }

    .welcome-content h1 {
        font-size: 36px;
    }

    .welcome-content h2 {
        font-size: 18px;
    }

    .btn-style {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .screen {
        min-height: auto;
    }

    .container {
        min-height: auto;
    }

    .form-content {
        padding: 40px 20px;
    }

    .welcome-content {
        padding: 30px 20px;
    }

    .welcome-content h1 {
        font-size: 28px;
    }

    .welcome-content h2 {
        font-size: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 16px;
    }

    .character-preview {
        width: 150px;
        height: 150px;
    }

    .character-large {
        width: 200px;
        height: 200px;
    }
}

footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 100px;
}
