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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    background: #87CEEB;
}

#scene-container {
    width: 100%;
    height: 100vh;
}

/* Top Bar */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #2F3542;
}

.top-bar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

#search-input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 200px;
    outline: none;
    transition: border-color 0.3s;
}

#search-input:focus {
    border-color: #FF4757;
}

#filter-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
}

#settings-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s;
}

#settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* FAB */
#fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF4757, #FF6B9D);
    border: none;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 99;
}

#fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 71, 87, 0.6);
}

#fab:active {
    transform: scale(0.95);
}

#toggle-feed {
    position: fixed;
    bottom: 30px;
    right: 110px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 99;
}

#toggle-feed:hover {
    transform: scale(1.1);
    border-color: #FF4757;
}

/* Activity Feed */
#activity-feed {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    z-index: 98;
    overflow-y: auto;
}

#activity-feed.collapsed {
    transform: translateX(100%);
}

.feed-header {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#close-feed {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

#activity-list {
    padding: 10px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #f5f5f5;
}

.activity-icon {
    font-size: 24px;
}

.activity-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.member-counter {
    padding: 20px;
    text-align: center;
    border-top: 2px solid #e0e0e0;
    color: #666;
    font-size: 14px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2F3542;
}

.content-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.type-btn:hover {
    border-color: #FF4757;
}

.type-btn.active {
    background: #FF4757;
    color: white;
    border-color: #FF4757;
}

.input-area {
    margin-bottom: 20px;
}

.input-area.hidden {
    display: none;
}

#note-text {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    resize: vertical;
    outline: none;
}

#note-text:focus {
    border-color: #FF4757;
}

.char-count {
    text-align: right;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

#image-upload {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

#image-preview {
    margin: 15px 0;
    text-align: center;
}

#image-caption {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

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

.sticker-option {
    padding: 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
}

.sticker-option:hover {
    border-color: #FF4757;
    transform: scale(1.1);
}

.sticker-option.selected {
    background: #FFF740;
    border-color: #FF4757;
}

.form-controls {
    margin-bottom: 20px;
}

#author-name {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    outline: none;
}

#author-name:focus {
    border-color: #FF4757;
}

.color-picker {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker label {
    font-size: 14px;
    font-weight: 500;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

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

.color-btn.active {
    border-color: #2F3542;
    transform: scale(1.15);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#cancel-btn {
    background: #e0e0e0;
    color: #2F3542;
}

#cancel-btn:hover {
    background: #d0d0d0;
}

#staple-btn, #close-settings {
    background: #FF4757;
    color: white;
}

#staple-btn:hover, #close-settings:hover {
    background: #e63946;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

/* Stapler Animation */
#stapler-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 300;
    pointer-events: none;
}

#stapler-animation.hidden {
    display: none;
}

.stapler {
    font-size: 64px;
    animation: staple 0.8s ease-out;
}

@keyframes staple {
    0% {
        transform: translateY(-100px) rotate(-45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(0) rotate(0deg) scale(1.2);
        opacity: 1;
    }
    70% {
        transform: translateY(10px) scale(0.8);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
}

/* Settings */
.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    width: 100%;
    margin-top: 10px;
}

/* Detail Modal */
.detail-view {
    max-width: 600px;
}

.close-detail {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-header h3 {
    color: #2F3542;
    margin-bottom: 5px;
}

.detail-header small {
    color: #666;
}

.detail-text {
    font-size: 18px;
    line-height: 1.6;
    color: #2F3542;
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
}

.detail-sticker {
    font-size: 128px;
    text-align: center;
    margin: 40px 0;
}

.reactions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.react-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.react-btn:hover {
    transform: scale(1.2);
    border-color: #FF4757;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 12px;
    color: #666;
    z-index: 97;
}

footer a {
    color: #FF4757;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    #top-bar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .top-bar-left, .top-bar-right {
        width: 100%;
        justify-content: center;
    }
    
    #search-input {
        width: 100%;
        margin: 5px 0;
    }
    
    #activity-feed {
        width: 100%;
    }
    
    #fab {
        bottom: 80px;
        right: 20px;
    }
    
    #toggle-feed {
        bottom: 80px;
        right: 90px;
    }
}