:root {
    --bg-color: #FAFAFA;
    --text-color: #262626;
    --accent-color: #0095F6;
    --like-red: #ED4956;
    --glitch-color-1: #FF0033;
    --glitch-color-2: #00FFCC;
    --novel-bg: #050505;
    --novel-text: #E0E0E0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* ======================== */
/*     SNS Layer            */
/* ======================== */
.sns-container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    transition: filter 0.3s, transform 0.1s;
}

/* Profile Header */
.profile-header {
    padding: 20px;
    border-bottom: 1px solid #DBDBDB;
    display: flex;
    gap: 20px;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) border-box;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
}

.badge {
    color: var(--accent-color);
    margin-left: 5px;
    font-size: 0.9rem;
}

.stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.bio {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
}

/* Stories */
.stories {
    display: flex;
    gap: 15px;
    padding: 12px 20px;
    overflow-x: auto;
    border-bottom: 1px solid #DBDBDB;
    scrollbar-width: none;
}

.stories::-webkit-scrollbar {
    display: none;
}

.story-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.ring.viewed {
    background: #DBDBDB;
}

.story-name {
    font-size: 0.75rem;
    color: #262626;
}

/* ======================== */
/*     Feed Posts            */
/* ======================== */
.feed {
    padding-bottom: 70px;
}

.feed-post {
    border-bottom: 1px solid #EFEFEF;
}

.feed-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

.feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #FF9EAA, #89CFF0);
    flex-shrink: 0;
}

.feed-username {
    font-weight: bold;
    font-size: 0.9rem;
    flex: 1;
}

.feed-time {
    font-size: 0.75rem;
    color: #999;
}

.feed-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: #EEE;
}

/* Placeholder gradients */
.placeholder-bar {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d) !important;
}

.placeholder-gym {
    background: linear-gradient(135deg, #a8ff78, #78ffd6) !important;
}

.placeholder-cafe {
    background: linear-gradient(135deg, #FF9EAA, #FFCCD2) !important;
}

/* Like Actions */
.feed-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
}

.like-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.15s;
    color: var(--text-color);
}

.like-btn:hover {
    transform: scale(1.1);
}

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

.like-btn.liked {
    color: var(--like-red);
    animation: heart-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heart-pop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    60% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.like-count {
    font-size: 0.85rem;
    font-weight: bold;
}

.feed-caption {
    padding: 0 15px 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 50px;
    background: white;
    border-top: 1px solid #DBDBDB;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.1s;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-item.active {
    color: var(--text-color);
}

/* ======================== */
/*     Glitch Effect        */
/* ======================== */
.glitch-active .feed-image {
    animation: glitch-img 0.3s infinite;
    filter: invert(1) contrast(2);
}

@keyframes glitch-img {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-3px, 3px);
    }

    40% {
        transform: translate(-3px, -3px);
    }

    60% {
        transform: translate(3px, 3px);
    }

    80% {
        transform: translate(3px, -3px);
    }

    100% {
        transform: translate(0);
    }
}

/* ======================== */
/*     Novel Layer          */
/* ======================== */
.novel-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(160deg, #0a0a0f 0%, #111118 30%, #0d0d12 60%, #08080c 100%);
    color: #c8c4bc;
    z-index: 2000;
    padding: 60px 24px 80px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Shippori Mincho', serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in;
    box-sizing: border-box;
}

.novel-container.active {
    opacity: 1;
    pointer-events: auto;
}

.novel-content {
    max-width: 560px;
    margin: 0 auto;
    line-height: 2.2;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    word-break: break-all;
    overflow-wrap: break-word;
    padding: 0 4px;
}

.chapter {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chapter:last-child {
    border-bottom: none;
}

.chapter h2 {
    font-family: 'Shippori Mincho', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #8a7565;
    letter-spacing: 0.15em;
    border-bottom: 1px solid rgba(138, 117, 101, 0.3);
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.chapter p {
    margin: 0 0 1.2em;
    color: #b0aca5;
}

.highlight {
    color: #7eb8a8;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(126, 184, 168, 0.2);
}

.back-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.35);
    padding: 10px 24px;
    cursor: pointer;
    font-family: 'Shippori Mincho', serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    z-index: 2001;
    transition: all 0.3s;
    border-radius: 2px;
}

.back-button:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.hidden {
    display: none;
}