@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700;800&family=Nanum+Myeongjo:wght@400;700&display=swap');

/* ── CSS 변수 ── */
:root {
    --bg-outer:         #6b93ad;
    --bg-box:           linear-gradient(145deg, #b8dcea 0%, #8ec8db 50%, #74b8cc 100%);
    --bg-box-border:    #5a9ab5;
    --accent:           #1a6fa8;
    --accent-2:         #2980b9;
    --accent-hover:     #3498db;
    --accent-light:     #e8f4fb;
    --accent-text:      #1a5f94;
    --tab-active-color: #1a5f94;
    --inner-border:     #b0d4e3;
    --left-bg:          #f7fbfd;
    --logo-highlight:   #ffd93d;
    --card-shadow:      0 2px 12px rgba(0,0,0,0.08);
    --card-hover-shadow: 0 6px 24px rgba(0,0,0,0.13);
    --radius:           10px;
    --radius-sm:        6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-outer);
    background-image:
        radial-gradient(ellipse at 15% 25%, rgba(255,255,255,0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 75%, rgba(0,0,0,0.10) 0%, transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Nanum Gothic', '돋움', Dotum, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    transition: background-color 0.45s ease;
}

/* ── 상단 헤더 ── */
.site-header { width: 1000px; margin-bottom: 10px; }
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.42);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px; padding: 11px 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-slogan {
    font-size: 11px; color: rgba(255,255,255,0.7);
    white-space: nowrap; letter-spacing: 0.3px;
}
.logo {
    font-size: 22px; font-weight: 800;
    color: #fff; letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.3);
    text-decoration: none;
}
.logo span { color: var(--logo-highlight); }

/* ── 음악 바 ── */
.music-bar {
    display: flex; align-items: center; gap: 10px; flex: 1;
    justify-content: center;
    background: rgba(0,0,0,0.38);
    border-radius: 22px; padding: 7px 16px;
    border: 1px solid rgba(255,255,255,0.18);
    max-width: 300px;
}
.music-note { font-size: 14px; flex-shrink: 0; }
#music-title {
    font-size: 12px; color: #fff; font-weight: 700;
    flex: 1; overflow: hidden;
    white-space: nowrap; min-width: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
    position: relative;
}
#music-title .marquee-inner {
    display: inline-block;
    animation: marquee-scroll 14s linear infinite;
    padding-right: 40px;
}
#music-title .marquee-inner.short {
    animation: none;
}
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
#music-play-btn {
    background: rgba(255,255,255,0.22); border: none; color: #fff;
    cursor: pointer; font-size: 11px; width: 26px; height: 26px;
    border-radius: 50%; display: none; align-items: center;
    justify-content: center; transition: background 0.15s; flex-shrink: 0;
}
#music-play-btn:hover { background: rgba(255,255,255,0.38); }
.music-divider { color: rgba(255,255,255,0.3); font-size: 10px; }
#music-set-btn {
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
    color: #fff; cursor: pointer; font-size: 11px; font-weight: 700;
    font-family: 'Nanum Gothic','돋움',sans-serif;
    white-space: nowrap; padding: 4px 12px; border-radius: 12px;
    transition: all 0.15s;
}
#music-set-btn:hover { background: rgba(255,255,255,0.32); }

/* 오른쪽 헤더 */
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-theme-wrap { display: flex; align-items: center; gap: 6px; }
.theme-label { font-size: 11px; color: rgba(255,255,255,0.55); }
.top-links { display: flex; align-items: center; }
#btn-logout {
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
    color: #fff; font-size: 11px; cursor: pointer; font-weight: 700;
    font-family: 'Nanum Gothic','돋움',sans-serif;
    padding: 5px 10px; border-radius: 12px; transition: all 0.15s;
}
#btn-logout:hover { background: rgba(255,255,255,0.32); }

/* ── 테마 스와치 ── */
.theme-picker { display: flex; gap: 6px; align-items: center; }
.theme-swatch {
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
    border: 2.5px solid rgba(255,255,255,0.3);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: inline-block;
}
.theme-swatch:hover { transform: scale(1.35); border-color: rgba(255,255,255,0.8); }
.theme-swatch.active {
    border-color: #fff; transform: scale(1.3);
    box-shadow: 0 0 6px rgba(255,255,255,0.7);
}

/* ── 메인 래퍼 ── */
.wrapper {
    display: flex; align-items: stretch; width: 1000px;
    filter: drop-shadow(0 8px 28px rgba(0,0,0,0.22));
}

/* ── 배경 박스 ── */
.background-box {
    background: var(--bg-box);
    border-radius: 14px 0 0 14px;
    padding: 18px;
    border: 1px solid var(--bg-box-border);
    border-right: none;
    display: flex; flex-direction: column;
    width: 940px; min-height: 580px;
    animation: fadeInUp 0.4s ease;
    transition: background 0.45s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 타이틀 바 ── */
.title-bar {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 10px 10px 0 0;
    padding: 11px 18px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.title-bar h1 {
    color: #fff; font-size: 15px; font-weight: 800;
    letter-spacing: 0.3px; text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.title-bar .url-text { color: rgba(255,255,255,0.55); font-size: 11px; }

/* ── 내부 흰 박스 ── */
.inner-box {
    background: #fff;
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--inner-border);
    border-top: none;
    display: flex; flex: 1;
    overflow: hidden;
}

/* ── 왼쪽 컬럼 ── */
.left-column {
    width: 230px; min-width: 230px;
    border-right: 1px solid #eef2f5;
    padding: 18px 16px;
    display: flex; flex-direction: column; gap: 12px;
    background: var(--left-bg);
}

.visitor-count {
    text-align: center; color: #888; font-size: 11px;
    padding: 7px 0 10px;
    border-bottom: 1px solid #eef2f5;
    letter-spacing: 0.5px;
}
.visitor-count .today { color: #e8380d; font-weight: 800; font-size: 15px; }
.visitor-count .total { color: #666; font-weight: 700; }

.profile-img {
    background: linear-gradient(135deg, var(--accent-light), var(--inner-border));
    height: 185px;
    border: 1.5px solid var(--inner-border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s;
}
.profile-img:hover { box-shadow: var(--card-hover-shadow); }
/* 수정 — 이미지 없을 때만 표시 */
.profile-img:not(:has(img))::after { content: '📷'; font-size: 36px; opacity: 0.3; }

.profile-name {
    text-align: center; font-weight: 800; font-size: 14px;
    color: var(--accent-text); cursor: pointer;
    padding: 2px 4px; border-radius: 4px;
    transition: background 0.15s;
}
.profile-name:hover { background: var(--accent-light); }

.intro-text {
    flex: 1; border: 1.5px dashed #dce8ef;
    border-radius: 8px; padding: 10px 12px;
    color: #555; line-height: 1.8; font-size: 12px;
    background: #fff; cursor: pointer; min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.intro-text:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,128,185,0.08); }

.mini-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn {
    flex: 1; min-width: calc(50% - 3px);
    padding: 7px 4px; text-align: center; font-size: 11px;
    color: var(--accent-text); font-weight: 700;
    border: 1.5px solid var(--inner-border);
    border-radius: 8px; background: var(--accent-light);
    cursor: pointer; transition: all 0.18s;
}
.mini-btn:hover {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(41,128,185,0.25);
}

/* ── 오른쪽 컬럼 ── */
.right-column {
    flex: 1; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    overflow: hidden;
}

/* ── 미니룸 ── */
.miniroom {
    flex: 2; min-height: 240px;
    background: linear-gradient(160deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1.5px solid #a5d6a7; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #81c784; font-size: 12px;
    position: relative; overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.04);
}
.miniroom-label {
    position: absolute; top: 10px; left: 12px;
    font-size: 11px; color: #4caf50; font-weight: 800;
    background: rgba(255,255,255,0.6); padding: 2px 8px;
    border-radius: 8px;
}
.miniroom::before {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 36px;
    background: repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0px, rgba(0,0,0,0.03) 8px, transparent 8px, transparent 16px);
}

/* ── 사진 미리보기 ── */
.photo-preview-box {
    border: 1.5px solid #e8eef2; border-radius: 10px;
    overflow: hidden; background: #fff;
    box-shadow: var(--card-shadow);
}

/* ── 게시판 영역 ── */
.board-area { flex: 1; display: flex; gap: 10px; min-height: 0; }

.board-box {
    flex: 1; border: 1.5px solid #e8eef2;
    border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column;
    background: #fff; box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s;
}
.board-box:hover { box-shadow: var(--card-hover-shadow); }

.board-header {
    background: linear-gradient(90deg, var(--accent-light) 0%, #f0f8fd 100%);
    padding: 8px 12px; font-weight: 800; font-size: 12px;
    color: var(--accent-text); border-bottom: 1.5px solid #e8eef2;
    display: flex; justify-content: space-between; align-items: center;
}
.board-header .more {
    font-size: 11px; color: #aac4d8; font-weight: 700;
    cursor: pointer; text-decoration: none; transition: color 0.15s;
}
.board-header .more:hover { color: var(--accent-text); }

.board-content { padding: 8px 12px; flex: 1; }
.board-content ul { list-style: none; padding: 0; }
.board-content li {
    padding: 5px 0; color: #555; font-size: 12px;
    border-bottom: 1px solid #f4f6f8;
    display: flex; justify-content: space-between; align-items: center;
    transition: color 0.15s;
}
.board-content li:hover { color: var(--accent); }
.board-content li:last-child { border-bottom: none; }
.board-content .item-text {
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; max-width: 150px;
}
.board-content .item-date { color: #c0d0db; font-size: 11px; flex-shrink: 0; }

/* ── 탭 ── */
.tabs { display: flex; flex-direction: column; gap: 4px; width: 60px; }
.tab {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: rgba(255,255,255,0.9); padding: 13px 0;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-left: none; border-radius: 0 10px 10px 0;
    text-align: center; cursor: pointer; width: 60px; font-size: 12px;
    font-weight: 700; box-shadow: 3px 3px 8px rgba(0,0,0,0.15);
    font-family: 'Nanum Gothic','돋움',sans-serif;
    transition: all 0.18s; text-decoration: none; display: block;
}
.tab.active {
    background: #fff; color: var(--tab-active-color);
    border-color: var(--inner-border);
    border-left: 3px solid #fff; margin-left: -2px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.1);
}
.tab:hover:not(.active) {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-2));
    transform: translateX(4px);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.18);
}

/* ── 하단 푸터 ── */
.site-footer { width: 1000px; margin-top: 10px; }
.site-footer-inner {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px; padding: 11px 20px;
}
.footer-copy { font-size: 11px; color: #fff; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.footer-links { display: flex; gap: 18px; }
.footer-links a {
    color: rgba(255,255,255,0.5); font-size: 11px;
    text-decoration: none; transition: color 0.15s;
}
.footer-links a:hover { color: rgba(255,255,255,0.88); }

/* ── 음악 모달 ── */
.music-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 200;
    justify-content: center; align-items: center;
}
.music-modal {
    background: #fff; border-radius: 14px; width: 400px;
    overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    animation: fadeInUp 0.22s ease;
}
.music-modal-header {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center;
}
.music-modal-header h3 { color: #fff; font-size: 14px; font-weight: 800; }
.music-modal-close {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    font-size: 16px; cursor: pointer; width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.music-modal-close:hover { background: rgba(255,255,255,0.35); }
.music-modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.music-modal-body label { font-size: 12px; color: #666; display: block; margin-bottom: 5px; font-weight: 700; }
.music-modal-body input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 13px; font-family: 'Nanum Gothic','돋움',sans-serif; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.music-modal-body input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
}
.music-hint {
    font-size: 11px; color: #999; line-height: 1.7;
    background: #f7fafc; padding: 10px 14px; border-radius: 8px;
    border: 1px solid #e8f0f5;
}
#music-msg { font-size: 12px; color: #e74c3c; display: none; }
.music-modal-footer {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 0 22px 18px;
}
.btn-music-save {
    padding: 9px 22px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 800;
    font-family: 'Nanum Gothic','돋움',sans-serif; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-music-save:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-music-cancel {
    padding: 9px 16px; background: #f0f2f5; border: none;
    border-radius: 8px; font-size: 13px; cursor: pointer;
    font-family: 'Nanum Gothic','돋움',sans-serif; color: #666;
    transition: background 0.15s;
}
.btn-music-cancel:hover { background: #e4e8ec; }
#yt-player-container { position: absolute; top: -9999px; left: -9999px; }

/* ────────────────────────────────
   📱 모바일 반응형
──────────────────────────────── */
@media (max-width: 1050px) {
    .site-header, .wrapper, .site-footer, .bottom-bar { width: 100%; max-width: 100%; }
    .background-box { width: calc(100% - 52px); }
}

@media (max-width: 768px) {
    body { font-size: 12px; justify-content: flex-start; padding: 8px; }

    .site-header { margin-bottom: 6px; }
    .site-header-inner {
        flex-wrap: wrap; gap: 10px; padding: 10px 14px; border-radius: 10px;
    }
    .header-left { width: 100%; justify-content: space-between; }
    .header-slogan { display: none; }
    .music-bar { max-width: 100%; width: 100%; order: 3; }
    .header-right { width: 100%; justify-content: flex-end; }
    .theme-label { display: none; }

    .wrapper { flex-direction: column; }
    .background-box {
        width: 100%; border-radius: 10px; border: 1px solid var(--bg-box-border);
        padding: 10px; min-height: auto;
    }

    .inner-box { flex-direction: column; }

    .left-column {
        width: 100%; min-width: unset;
        border-right: none; border-bottom: 1px dashed #ddd;
        padding: 12px; flex-direction: row; flex-wrap: wrap; gap: 8px;
    }
    .visitor-count { width: 100%; }
    .profile-img { width: 80px; height: 80px; flex-shrink: 0; }
    .profile-name { font-size: 13px; align-self: center; }
    .intro-text { flex: 1; min-width: 150px; min-height: 60px; }
    .mini-btns { width: 100%; }

    .right-column { padding: 10px; gap: 8px; }
    .miniroom { min-height: 140px; }
    .board-area { flex-direction: column; gap: 8px; }
    .photo-preview-box { display: none; }

    /* 탭 - 가로 스크롤 */
    .tabs {
        flex-direction: row; width: 100%;
        overflow-x: auto; gap: 4px;
        padding: 6px 0; margin-top: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .tab {
        width: auto; min-width: 52px; padding: 8px 10px;
        border-radius: 8px; border: 1.5px solid var(--accent);
        border-left: 1.5px solid var(--accent);
        margin-left: 0; white-space: nowrap; flex-shrink: 0;
        font-size: 11px;
    }
    .tab.active { margin-left: 0; border-left: 1.5px solid var(--inner-border); }
    .tab:hover:not(.active) { transform: none; }

    .site-footer { margin-top: 6px; }
    .site-footer-inner { flex-direction: column; gap: 6px; text-align: center; padding: 10px; border-radius: 10px; }
    .footer-links { justify-content: center; flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 480px) {
    .profile-img { width: 70px; height: 70px; }
    .board-header { font-size: 11px; }
    .board-content li { font-size: 11px; }
    .title-bar h1 { font-size: 13px; }
    .music-bar { padding: 6px 10px; }
    #music-title { font-size: 11px; }
}