/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --phone-width: 390px;
    --phone-height: 844px;
    --phone-radius: 50px;
    --notch-width: 160px;
    --notch-height: 34px;
    --bg-dark: #0a0a0f;
    --bg-phone: #1a1a2e;
    --accent: #e94560;
    --accent2: #0f3460;
    --accent3: #16213e;
    --green: #25d366;
    --blue: #007aff;
    --bubble-send: #007aff;
    --bubble-recv: #2a2a3e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-dim: #555566;
    --border-color: #2a2a3e;
    --shadow-heavy: 0 25px 80px rgba(0,0,0,0.8), 0 0 40px rgba(233,69,96,0.15);
    --glass: rgba(255,255,255,0.06);
    --glass-border: rgba(255,255,255,0.1);
}

@font-face {
    font-family: 'SF Pro';
    src: local('Inter'), local('SF Pro Display'), local('-apple-system');
}

body {
    font-family: 'Inter', 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== PHONE FRAME ===== */
.phone-frame {
    width: var(--phone-width);
    height: var(--phone-height);
    background: #000;
    border-radius: var(--phone-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    border: 3px solid #222;
    display: flex;
    flex-direction: column;
}

.phone-frame::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--phone-radius) + 3px);
    background: linear-gradient(145deg, rgba(255,255,255,0.15), transparent 50%, rgba(255,255,255,0.05));
    pointer-events: none;
    z-index: 100;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--notch-width);
    height: var(--notch-height);
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 50;
}

.phone-notch::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #1a1a2e;
    border-radius: 50%;
    border: 2px solid #333;
}

.phone-home-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    z-index: 50;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    z-index: 10;
}
.screen.active { display: flex; }

/* ===== MAIN MENU ===== */
.menu-phone { }
.menu-wallpaper {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(233,69,96,0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(15,52,96,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(22,33,62,0.8) 0%, transparent 70%),
        linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.menu-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.menu-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 30px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(233,69,96,0.5));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.menu-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #e94560 50%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-shadow: none;
}

.menu-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.menu-btn {
    width: 100%;
    padding: 16px 24px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(233,69,96,0.2);
}

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

.start-btn:hover { border-color: var(--accent); }
.howto-btn:hover { border-color: var(--blue); }
.credits-btn:hover { border-color: gold; }
.exit-btn:hover { border-color: #ff4444; }

.btn-icon { font-size: 20px; }

/* ===== HOW TO PLAY ===== */
.howto-screen, .credits-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
}

.howto-header, .credits-header, .news-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 55px 16px 16px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.howto-header h2, .credits-header h2, .news-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.back-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    font-family: inherit;
}

.howto-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 40px;
}

.howto-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.howto-section h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--accent);
}

.howto-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.howto-section strong { color: #fff; }

/* ===== CREDITS ===== */
.credits-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px 50px;
    text-align: center;
}

.credits-logo { font-size: 48px; margin-bottom: 12px; }
.credits-content h3 { font-size: 20px; margin-bottom: 4px; }
.credits-studio { color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.credits-divider { width: 60px; height: 1px; background: var(--border-color); margin: 20px auto; }
.credits-line { color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.credits-name { font-size: 16px; font-weight: 600; margin-top: 4px; }
.credits-disclaimer { color: var(--text-dim); font-size: 12px; font-style: italic; margin-top: 10px; line-height: 1.6; }

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px 6px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    position: relative;
    z-index: 40;
}

.status-carrier { font-size: 12px; color: var(--text-secondary); }
.status-icons { font-size: 12px; }

/* ===== CONTACTS VIEW ===== */
.game-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(180deg, #0d0d1a 0%, #1a1a2e 100%);
}
.game-view.active { display: flex; }

.contacts-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.contacts-header h2 {
    font-size: 28px;
    font-weight: 800;
    flex: 1;
}

.menu-return-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
}

.reputation-badge {
    font-size: 10px;
    padding: 4px 10px;
    background: var(--accent);
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
}

.contact-item:hover { background: rgba(255,255,255,0.04); }
.contact-item:active { background: rgba(255,255,255,0.08); }

.contact-item.paid {
    opacity: 0.35;
    pointer-events: none;
}

.contact-item.paid::after {
    content: '✓ PAID';
    position: absolute;
    right: 18px;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1px;
}

.contact-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.contact-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-meta {
    text-align: right;
    flex-shrink: 0;
}

.contact-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.contact-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    margin-top: 4px;
}

.score-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(0,0,0,0.6);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== CHAT VIEW ===== */
.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.chat-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-size: 16px;
    font-weight: 700;
}

.chat-status {
    font-size: 11px;
    color: var(--green);
}

.pay-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--green), #1da851);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.pay-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(37,211,102,0.3);
}

.pay-btn:active { transform: scale(0.95); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(15,52,96,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(233,69,96,0.08) 0%, transparent 50%),
        linear-gradient(180deg, #0d0d1a 0%, #12122a 100%);
}

.message {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.45;
    word-wrap: break-word;
    animation: msgIn 0.3s ease-out;
    position: relative;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.sent {
    align-self: flex-end;
    background: var(--bubble-send);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--bubble-recv);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message .msg-time {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
    text-align: right;
}

.message.received .msg-time { text-align: left; }

.typing-indicator {
    align-self: flex-start;
    background: var(--bubble-recv);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    animation: msgIn 0.3s ease-out;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px 30px;
    background: rgba(0,0,0,0.6);
    border-top: 1px solid var(--border-color);
}

#chat-input {
    flex: 1;
    padding: 12px 18px;
    background: var(--bubble-recv);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

#chat-input:focus { border-color: var(--blue); }
#chat-input::placeholder { color: var(--text-dim); }

.send-btn {
    width: 44px;
    height: 44px;
    background: var(--blue);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover { background: #0a84ff; transform: scale(1.05); }
.send-btn:active { transform: scale(0.9); }

/* ===== NEWS VIEW ===== */
.news-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f0e8;
    color: #1a1a1a;
}

.news-article {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-article-header {
    padding: 16px 20px;
    border-bottom: 2px solid #333;
}

.news-masthead {
    font-family: 'Georgia', serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.news-date {
    font-size: 11px;
    color: #888;
    text-align: center;
}

.news-article-body {
    padding: 20px;
}

.news-headline {
    font-family: 'Georgia', serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.news-byline {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    font-style: italic;
}

.news-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

/* ===== WIN SCREEN ===== */
.win-content {
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 50% 30%, rgba(233,69,96,0.3) 0%, transparent 60%),
        linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px 40px;
    text-align: center;
    overflow-y: auto;
}

.win-emoji { font-size: 64px; margin-bottom: 10px; }
.win-content h1 { font-size: 28px; margin-bottom: 8px; background: linear-gradient(135deg, gold, #ff6b6b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.win-subtitle { color: var(--text-secondary); margin-bottom: 16px; }
.win-stats { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.win-message { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; padding: 16px; background: var(--glass); border-radius: 12px; border: 1px solid var(--glass-border); }
.final-msg { color: var(--accent); font-weight: 700; margin-top: 12px; }

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,30,50,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: notifIn 0.4s ease-out;
    min-width: 300px;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    cursor: pointer;
}

.notification.hidden { display: none; }

@keyframes notifIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.notif-icon { font-size: 24px; }
.notif-text strong { font-size: 14px; display: block; }
.notif-text p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-height: 860px) {
    .phone-frame {
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .phone-frame::before { display: none; }
    .phone-notch { display: none; }
    .phone-home-bar { display: none; }
}

@media (max-width: 420px) {
    .phone-frame {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .phone-frame::before { display: none; }
    .phone-notch { display: none; }
    .phone-home-bar { display: none; }
}
