:root {
    --primary: #FF2E93;
    --secondary: #FF8E53;
    --dark: #0F0F13;
    --dark-alt: #1C1C24;
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.7);
    --nope-color: #FF3B30;
    --like-color: #34C759;
    --super-color: #007AFF;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --font: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--dark);
    color: var(--text-main);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Tło ambientowe */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -50px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.screen-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    z-index: 1;
    background: transparent;
}

.screen-view.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

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

/* Glassmorphism utility */
.glass-panel {
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* ================= DESKTOP OVERLAY ================= */
#desktop-overlay {
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.desktop-message {
    padding: 50px 40px;
    text-align: center;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(255, 46, 147, 0.5);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(255, 46, 147, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 46, 147, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 46, 147, 0); }
}

.desktop-message h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ff4b4b, #ff7b7b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-message p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ================= LOADER VIEW ================= */
#loader-view {
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    z-index: 1000;
}

.loader-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-icon-flame {
    font-size: 4rem;
    background: linear-gradient(45deg, #ff4b4b, #ff2d7a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 2;
    animation: pulseFlame 1.5s infinite;
}

.loader-pulse-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #ff4b4b;
    animation: expandRing 1.5s infinite;
    z-index: 1;
}

@keyframes pulseFlame {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.1); }
    100% { transform: scale(0.95); }
}

@keyframes expandRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* ================= SWIPE VIEW ================= */
.glass-header {
    background: rgba(15, 15, 19, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-flame {
    color: var(--primary);
    -webkit-text-fill-color: initial;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.profile-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.card-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    overflow: hidden;
}

.tinder-card {
    position: absolute;
    width: calc(100% - 40px);
    max-width: 420px;
    height: 65vh;
    border-radius: 24px;
    background: #000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
    overflow: hidden;
    cursor: grab;
    transform-origin: 50% 100%;
    will-change: transform;
}

.tinder-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 40%, transparent 100%);
    pointer-events: none;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 25px;
    color: var(--text-main);
    pointer-events: none;
}

.card-info h2 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.card-info .age {
    font-weight: 400;
    font-size: 2rem;
}

.verified {
    color: #3897f0;
    font-size: 1.2rem;
    text-shadow: none;
}

.location {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.8);
}

.bio {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Znaczki LIKE / NOPE */
.stamp {
    position: absolute;
    top: 50px;
    padding: 8px 20px;
    border: 5px solid;
    border-radius: 12px;
    font-size: 2.8rem;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.stamp-like {
    color: var(--like-color);
    border-color: var(--like-color);
    left: 30px;
    transform: rotate(-15deg);
    text-shadow: 0 0 10px rgba(52, 199, 89, 0.4);
    box-shadow: 0 0 20px rgba(52, 199, 89, 0.2), inset 0 0 10px rgba(52, 199, 89, 0.2);
}

.stamp-nope {
    color: var(--nope-color);
    border-color: var(--nope-color);
    right: 30px;
    transform: rotate(15deg);
    text-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.2), inset 0 0 10px rgba(255, 59, 48, 0.2);
}

/* Przyciski akcji */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 10px 20px 40px;
    z-index: 10;
}

.btn {
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-inner {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-super .btn-inner {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
}

.btn:active .btn-inner {
    transform: scale(0.85);
}

.btn-nope .btn-inner {
    color: var(--nope-color);
}
.btn-like .btn-inner {
    color: var(--like-color);
}
.btn-super .btn-inner {
    color: var(--super-color);
}

.btn-nope:hover .btn-inner { border-color: var(--nope-color); box-shadow: 0 0 20px rgba(255, 59, 48, 0.3); }
.btn-like:hover .btn-inner { border-color: var(--like-color); box-shadow: 0 0 20px rgba(52, 199, 89, 0.3); }


/* ================= MATCH VIEW ================= */
#match-view {
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 100;
}

.match-title {
    font-family: var(--font);
    font-weight: 800;
    font-style: italic;
    font-size: 4.5rem;
    background: linear-gradient(to right, #11998e, #38ef7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(56, 239, 125, 0.4));
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.match-subtitle {
    font-size: 1.2rem;
    margin-bottom: 50px;
    color: var(--text-muted);
    animation: fadeIn 1s 0.5s forwards;
    opacity: 0;
}

.match-avatars {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    width: 100%;
}

.avatar-wrapper {
    position: relative;
    z-index: 2;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--dark);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    position: relative;
    z-index: 2;
}

.avatar-you {
    transform: translateX(25px);
    animation: slideRight 0.6s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.avatar-him {
    transform: translateX(-25px);
    animation: slideLeft 0.6s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--like-color);
    z-index: 1;
    animation: matchPulse 2s infinite;
}

.match-heart {
    position: absolute;
    z-index: 3;
    font-size: 3rem;
    color: var(--primary);
    background: var(--dark);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    animation: heartBeat 1s 0.8s both;
}

@keyframes slideRight { from { transform: translateX(-100px); opacity: 0; } to { transform: translateX(25px); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(-25px); opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes matchPulse { 0% { width: 100%; height: 100%; opacity: 1; } 100% { width: 200%; height: 200%; opacity: 0; } }
@keyframes heartBeat { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

.match-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeIn 1s 1s both;
}

.btn-primary, .btn-secondary {
    width: 100%;
    max-width: 320px;
    padding: 18px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.glass-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(255, 46, 147, 0.4);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:active {
    background: rgba(255,255,255,0.1);
}

/* ================= CHAT VIEW ================= */
#chat-view {
    background: var(--dark);
    z-index: 200;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
}

.chat-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.chat-user-details {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-status {
    font-size: 0.8rem;
    color: var(--like-color);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--dark);
}

.message-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    max-width: 85%;
}

.received-wrapper {
    align-self: flex-start;
}

.sent-wrapper {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.message {
    padding: 14px 18px;
    border-radius: 22px;
    font-size: 1.05rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.message.received {
    background: var(--dark-alt);
    color: var(--text-main);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    animation: slideInLeft 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.message.sent {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-main);
    border-bottom-right-radius: 6px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

.chat-choices-area {
    display: flex;
    flex-direction: column;
    padding: 20px 20px;
    gap: 15px;
    align-items: center;
    background: var(--dark-alt);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    position: relative;
    min-height: 250px;
}

.choice-btn {
    padding: 16px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 90%;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
}

.choice-yes {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-main);
    z-index: 2;
}

.choice-yes:active {
    transform: scale(0.95);
}

.choice-no {
    background: var(--nope-color);
    border: none;
    color: var(--text-main);
    font-weight: 600;
    z-index: 10;
}

.hirocon-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 800;
    margin-bottom: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s, background 0.2s;
}

.hirocon-link:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.25);
}

.hirocon-link i {
    font-size: 1.5rem;
    color: var(--primary);
}

.chinese-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 5px;
}

.chinese-text small {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
}

/* ================= CALENDAR VIEW ================= */
#calendar-view {
    background: var(--dark);
    z-index: 300;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-container {
    padding: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: var(--dark-alt);
    font-size: 1.1rem;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

.wrong-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.8);
    color: var(--nope-color);
    font-size: 10rem;
    opacity: 0;
    pointer-events: none;
    z-index: 400;
    transition: opacity 0.3s;
}

.wrong-overlay.active {
    opacity: 1;
    animation: wrongShake 0.4s;
}

@keyframes wrongShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-15px); }
    50% { transform: translateX(15px); }
    75% { transform: translateX(-15px); }
    100% { transform: translateX(0); }
}

.calendar-icon-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    margin-top: 15px;
    display: inline-block;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.4));
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile fallback: hide desktop overlay on phones */
@media (max-width: 1024px) {
    #desktop-overlay {
        display: none !important;
    /* ... */
}

/* ================= EXTRAS ================= */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 6px 4px;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ambient-bg.heartbeat-bg .blob-1,
.ambient-bg.heartbeat-bg .blob-2 {
    animation: heartbeatFloat 4s infinite alternate ease-in-out;
}
@keyframes heartbeatFloat {
    0% { transform: scale(1) translate(0, 0); opacity: 0.6; }
    50% { transform: scale(1.3) translate(15px, -15px); opacity: 0.9; }
    100% { transform: scale(0.9) translate(-15px, 15px); opacity: 0.7; }
}

.calendar-icon-btn:active {
    transform: scale(0.9);
}
