:root {
    color-scheme: only dark;
    --accent-rgb: 88, 166, 255;
    --card-bg: rgba(30, 35, 45, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --bg-color: #0d1117;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(22, 27, 34, 0.8);
    --dropdown-bg: rgba(30, 35, 45, 0.75);

    --bg-gradient-1: rgba(88, 166, 255, 0.05);
    --bg-gradient-2: rgba(46, 160, 67, 0.05);

    --winner-color: rgba(46, 160, 67, 0.15);
    --winner-border: rgba(46, 160, 67, 0.4);
    --winner-text: #3fb950;

    --loser-color: rgba(248, 81, 73, 0.1);
    --loser-border: rgba(248, 81, 73, 0.3);
    --loser-text: #ff7b72;
    --calendar-filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

[data-theme="light"] {
    color-scheme: only light;
    --accent-rgb: 9, 105, 218;
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.06);
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --accent: #0969da;
    --accent-glow: rgba(9, 105, 218, 0.2);
    --navbar-bg: rgba(246, 248, 250, 0.85);
    --dropdown-bg: rgba(255, 255, 255, 0.4);
    --bg-gradient-1: rgba(9, 105, 218, 0.04);
    --bg-gradient-2: rgba(46, 160, 67, 0.04);
    --shadow-color: rgba(0, 0, 0, 0.06);
    --winner-color: rgba(46, 160, 67, 0.1);
    --winner-border: rgba(46, 160, 67, 0.3);
    --winner-text: #1a7f37;
    --loser-color: rgba(248, 81, 73, 0.08);
    --loser-border: rgba(248, 81, 73, 0.25);
    --loser-text: #cf222e;
    --calendar-filter: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 2rem;
    transition: background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 50%, var(--bg-gradient-1) 0%, transparent 70%),
        radial-gradient(circle at 85% 30%, var(--bg-gradient-2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    background-attachment: fixed;
    /* GPU acceleration to prevent seams */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

[data-theme="light"] body::before {
    opacity: 0.6;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

/* Custom Floating Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    background-clip: padding-box;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Floating Navbar (Center) */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 35, 45, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    height: 52px;
    padding: 0 0.4rem;
    z-index: 2000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    min-width: fit-content;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Compact Mode (겹침 감지 시 자동 축소) ─── */
.navbar.compact,
.theme-bar.compact,
.floating-logo.compact {
    height: 46px !important;
}

.floating-logo.compact {
    font-size: 0.95rem !important;
    padding: 0 1.1rem !important;
}

.navbar.compact .nav-links a {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

.theme-controls.compact .theme-toggle,
.theme-controls.compact .settings-btn {
    width: 34px !important;
    height: 34px !important;
}


/* Theme Controls Wrapper (Right) */
.theme-controls {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme Bar (Right) */
.theme-bar {
    display: flex;
    align-items: center;
    background: rgba(30, 35, 45, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    height: 52px;
    padding: 0 0.4rem;
    gap: 0.5rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .navbar,
[data-theme="light"] .theme-bar {
    background: var(--navbar-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
}

.nav-links a:hover,
.theme-toggle:hover,
.settings-btn:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.nav-links a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .nav-links a.active {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .settings-btn:hover,
[data-theme="light"] .nav-links a.active:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.nav-links a.active:hover {
    color: var(--accent);
}

.theme-toggle,
.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    overflow: hidden;
}

.settings-btn i {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 20px 3rem 20px;
    animation: fadePageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadePageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin-bottom: 5rem;
    padding: 3rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}


.profile-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.hero-content {
    text-align: center;
}

.title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

[data-theme="light"] .title {
    background: linear-gradient(120deg, #1f2328, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Section Common */
.section-title {
    font-size: 2.2rem;
    font-weight: 850;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -1px;
}

/* Balance Game Section */
.balance-section {
    margin-bottom: 5rem;
    max-width: 900px;
    margin: 0 auto 5rem auto;
}

.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    position: relative;
}

.balance-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    backdrop-filter: blur(20px);
}

.balance-card.winner {
    background: var(--winner-color);
    border-color: var(--winner-border);
    transform: scale(1.05);
    z-index: 2;
}

.balance-card.winner .choice-text {
    color: var(--winner-text);
}

.balance-card.loser {
    background: var(--loser-color);
    border-color: var(--loser-border);
    opacity: 0.6;
}

.choice-text {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.percentage {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.vs-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    box-shadow: 0 0 20px var(--accent-glow);
    z-index: 3;
}

/* Featured Section */
.featured-section {
    margin-bottom: 5rem;
    max-width: 900px;
    margin: 0 auto 5rem auto;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    max-width: 900px;
    margin: 0 auto;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.video-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--accent-glow);
    border-color: var(--accent);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Discord Wide Widget (Desktop focused, responsive) */
/* Discord Section - Base (Narrow View) */
.discord-section {
    margin-bottom: 5rem;
    max-width: 900px;
    margin: 0 auto 5rem auto;
    position: relative;
    z-index: 1;
}

.discord-plate-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 활동 시 그라데이션 전환 (Narrow View용) */
.discord-plate-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
    pointer-events: none;
}

.discord-section.theme-spotify .discord-plate-content::before {
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 1;
}

[data-theme="light"] .discord-section.theme-spotify .discord-plate-content::before {
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.08) 0%, rgba(30, 215, 96, 0.2) 100%);
}

.discord-section.theme-gaming .discord-plate-content::before {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 1;
}

[data-theme="light"] .discord-section.theme-gaming .discord-plate-content::before {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(88, 101, 242, 0.25) 100%);
}

.discord-section.theme-spotify .discord-plate-content {
    border-color: rgba(30, 215, 96, 0.5);
    box-shadow: 0 8px 32px rgba(30, 215, 96, 0.15);
}

.discord-section.theme-gaming .discord-plate-content {
    border-color: rgba(88, 101, 242, 0.5);
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.2);
}



.discord-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

/* 아바타 오른쪽 전체 영역 */
.discord-header-right {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 1rem;
    min-width: 0;
    max-height: 110px; /* 아바타 높이로 고정하여 더 커지지 않게 함 */
}

/* 닉네임 + 버튼 세로 정렬 */
.discord-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.8rem;
    flex-shrink: 0;
    min-width: 0;
}

.discord-avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.discord-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
}

.status-indicator-large {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 5px solid rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.status-indicator-large.online {
    background-color: #43b581;
}

.status-indicator-large.idle {
    background-color: #faa61a;
}

.status-indicator-large.dnd {
    background-color: #f04747;
}

.status-indicator-large.offline {
    background-color: #747f8d;
}

.discord-user-info h3 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.04rem;
    line-height: 1.0;
}

.discord-header-separator {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    padding-left: 0.2rem;
}

.discord-copy-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.3rem;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .discord-copy-btn-compact {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.discord-copy-btn-compact:hover {
    background: rgba(88, 101, 242, 0.2);
    color: var(--text-primary);
    border-color: rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

.discord-copy-btn-compact i {
    transform: translateY(1px);
}

.discord-custom-status {
    font-size: 1.05rem;
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
    backdrop-filter: blur(10px);
    overflow: hidden;
    /* 오른쪽 남은 공간 전체를 꽉 채우는 큰 박스 */
    flex: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.discord-status-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

[data-theme="light"] .discord-custom-status {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

.discord-body {
    background: rgba(255, 255, 255, 0.08); /* 불투명도 상향 */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .discord-body {
    background: rgba(255, 255, 255, 0.65); /* 라이트 모드 시인성 강화 */
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 15px rgba(255, 255, 255, 0.4);
}

.activity-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.activity-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    line-height: 1;
}

.activity-time-banner {
    display: flex;
    align-items: center;
    background: rgba(67, 181, 129, 0.2);
    color: #43b581;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 800;
    border: 1.5px solid rgba(67, 181, 129, 0.5);
    line-height: 1;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .activity-time-banner {
    background: #e6f6ed;
    color: #22844f;
    border-color: rgba(67, 181, 129, 0.4);
    box-shadow: 0 2px 6px rgba(67, 181, 129, 0.15);
}

.activity-content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.activity-image-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    display: none;
}

.activity-large-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.activity-small-image {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    object-fit: cover;
}

.discord-activity-name {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 800;
    margin-bottom: 0.2rem;
    letter-spacing: -0.02rem;
}

.discord-activity-details-text,
.discord-activity-state-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    opacity: 0.9;
    line-height: 1.4;
}

.discord-party-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-weight: 600;
}

.spotify-progress-container {
    margin-top: 1rem;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Instagram Section */
.instagram-section {
    margin-bottom: 5rem;
    max-width: 900px;
    margin: 0 auto 5rem auto;
}

.insta-profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 5rem;
}

.insta-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.insta-profile-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.insta-card-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.insta-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #E1306C;
    padding: 2px;
}

.insta-card-info h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

[data-theme="light"] .insta-card-info h3 {
    color: #000000;
}

.insta-card-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .insta-card-btn {
    background: rgba(0, 0, 0, 0.05);
}

.insta-profile-card:hover .insta-card-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* GitHub Section */
.github-section {
    margin-bottom: 5rem;
    max-width: 900px;
    margin: 0 auto 5rem auto;
}

.github-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 900px;
    margin: 0 auto;
}

.github-list-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.2rem 2rem;
    margin-bottom: 0;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.github-list-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.github-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.github-card-content h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.repo-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.repo-stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.lang-badge.html {
    background: rgba(227, 76, 38, 0.15);
    color: #e34c26;
}

.lang-badge.javascript {
    background: rgba(241, 224, 90, 0.1);
    color: #f1e05a;
}

.lang-badge.python {
    background: rgba(53, 114, 165, 0.15);
    color: #3572a5;
}

.lang-badge.java {
    background: rgba(176, 114, 25, 0.15);
    color: #b07219;
}

.lang-badge.kotlin {
    background: rgba(169, 123, 255, 0.15);
    color: #a97bff;
}

/* GitHub Contribution Calendar */
.github-contribution-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-top: 3rem;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}



.contribution-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

/* GitHub Calendar Library Customization */
.calendar {
    border: none !important;
    min-height: 120px;
}

.calendar .width-full > .float-left {
    display: none !important; /* Hide original legend and stats */
}

.calendar .contrib-details {
    display: none !important;
}

/* Square styling */
.calendar rect.DayJS-day {
    rx: 2px;
    ry: 2px;
}

/* Dark mode colors for the calendar squares */
[data-theme="dark"] .calendar rect.DayJS-day[data-level="0"] { fill: #161b22; }
[data-theme="dark"] .calendar rect.DayJS-day[data-level="1"] { fill: #0e4429; }
[data-theme="dark"] .calendar rect.DayJS-day[data-level="2"] { fill: #006d32; }
[data-theme="dark"] .calendar rect.DayJS-day[data-level="3"] { fill: #26a641; }
[data-theme="dark"] .calendar rect.DayJS-day[data-level="4"] { fill: #39d353; }

/* Light mode colors for the calendar squares */
[data-theme="light"] .calendar rect.DayJS-day[data-level="0"] { fill: #ebedf0; }
[data-theme="light"] .calendar rect.DayJS-day[data-level="1"] { fill: #9be9a8; }
[data-theme="light"] .calendar rect.DayJS-day[data-level="2"] { fill: #40c463; }
[data-theme="light"] .calendar rect.DayJS-day[data-level="3"] { fill: #30a14e; }
[data-theme="light"] .calendar rect.DayJS-day[data-level="4"] { fill: #216e39; }

/* Text colors in calendar */
.calendar text.wday, 
.calendar text.month {
    fill: var(--text-secondary) !important;
    font-size: 10px;
    font-weight: 600;
}

.contribution-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contribution-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-squares {
    display: flex;
    gap: 3px;
}

.legend-squares .square {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Legend colors match themes */
[data-theme="dark"] .square.level-0 { background: #161b22; }
[data-theme="dark"] .square.level-1 { background: #0e4429; }
[data-theme="dark"] .square.level-2 { background: #006d32; }
[data-theme="dark"] .square.level-3 { background: #26a641; }
[data-theme="dark"] .square.level-4 { background: #39d353; }

[data-theme="light"] .square.level-0 { background: #ebedf0; }
[data-theme="light"] .square.level-1 { background: #9be9a8; }
[data-theme="light"] .square.level-2 { background: #40c463; }
[data-theme="light"] .square.level-3 { background: #30a14e; }
[data-theme="light"] .square.level-4 { background: #216e39; }

.profile-link-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 3rem;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .profile-btn {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 20px;
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.visitor-counter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Works Section (App Page) */
.works-section {
    padding: 2rem 0;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.work-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.work-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px var(--accent-glow);
}

.work-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .work-icon-wrapper {
    background: rgba(0, 0, 0, 0.03);
}

.work-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
}

/* Specific Card Theme (Optional) */
.entry-card .work-icon-wrapper {
    background: #fff;
}

.search-card:hover {
    border-color: #2ea043;
}

.python-card:hover {
    border-color: #3572a5;
}

/* Floating Logo */
.floating-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    height: 52px;
    padding: 0 1.5rem;
    background: rgba(30, 35, 45, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 900;
    z-index: 2000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 1px;
}

[data-theme="light"] .floating-logo {
    background: var(--navbar-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.floating-logo:hover {
    color: var(--accent);
}

/* Settings Dropdown Styles */
.settings-dropdown {
    position: fixed;
    top: 5.5rem;
    right: 2rem;
    z-index: 3000;
    background: rgba(30, 35, 45, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 1.5rem;
    width: 250px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}

.settings-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

[data-theme="light"] .settings-dropdown {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.dropdown-header {
    margin-bottom: 1.2rem;
}

.dropdown-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.setting-item label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.custom-select {
    width: 100%;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1rem;
}

.custom-select option {
    background-color: #1e232d !important;
    color: #f0f6fc !important;
}

[data-theme="light"] .custom-select {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23656d76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="light"] .custom-select option {
    background-color: #ffffff !important;
    color: #1f2328 !important;
}

[data-theme="light"] .settings-btn.active i {
    transform: translateY(0.5px);
}

.settings-btn.active i {
    transform: translateY(0.5px);
}

/* --- Perfect Tight Bento Grid (1 -> 3 -> 5 Columns) --- */
@media (min-width: 1250px) {
    /* 그리드 아이템 기본 설정 */
    .hero,
    .featured-section,
    .discord-section,
    .instagram-section,
    .github-section {
        margin: 0 !important; /* margin: auto 가 그리드 확장을 막는 현상 원천 차단 */
        max-width: none !important; /* 강제 최대 너비 해제 */
        display: flex;
        flex-direction: column;
    }

    /* 데스크톱에서 모든 섹션을 판(Plate)으로 만들기 (제목이 하얀 박스 안에 들어감) */
    .featured-section,
    .github-section,
    .discord-section,
    .instagram-section {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 32px;
        padding: 2.5rem;
        box-shadow: 0 8px 32px var(--shadow-color);
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }

    /* 벤토 모드에서는 외부 섹션이 판이 되므로 내부 판 스타일 제거 (깃허브 카드는 제외) */
    .discord-plate-content, .insta-profile-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        overflow: visible !important;
        backdrop-filter: none !important;
    }

    /* 벤토 모드에서 내부 판의 중복 그라데이션 제거 */
    .discord-plate-content::before {
        display: none !important;
    }

    /* 깃허브 카드 복구 및 벤토 최적화 */
    .github-section .github-list-card {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(10px);
        box-shadow: none !important;
    }

    [data-theme="light"] .github-section .github-list-card {
        background: rgba(0, 0, 0, 0.05) !important;
        border-color: rgba(0, 0, 0, 0.12) !important;
    }

    /* 내부 박스(상태메시지, 활동)를 더 고급스러운 글래스모피즘으로 */
    .discord-custom-status, .discord-body {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(20px) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    }

    [data-theme="light"] .discord-custom-status, 
    [data-theme="light"] .discord-body {
        background: rgba(255, 255, 255, 0.25) !important;
        border-color: rgba(255, 255, 255, 0.6) !important;
        backdrop-filter: blur(15px) !important;
    }

    /* 벤토 모드에서의 테마 그라데이션 (외부 섹션에 적용) */
    .discord-section::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        opacity: 0;
        transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: -1;
    }

    .discord-section.theme-spotify::before {
        background: linear-gradient(135deg, rgba(30, 215, 96, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
        opacity: 1;
    }

    [data-theme="light"] .discord-section.theme-spotify::before {
        background: linear-gradient(135deg, rgba(30, 215, 96, 0.08) 0%, rgba(30, 215, 96, 0.2) 100%);
    }

    .discord-section.theme-gaming::before {
        background: linear-gradient(135deg, rgba(88, 101, 242, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
        opacity: 1;
    }

    [data-theme="light"] .discord-section.theme-gaming::before {
        background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(88, 101, 242, 0.25) 100%);
    }

    .discord-section.theme-spotify { border-color: rgba(30, 215, 96, 0.5); }
    .discord-section.theme-gaming { border-color: rgba(88, 101, 242, 0.5); }

    /* 판 위에 올라가는 내부 위젯들은 자체 배경 및 그림자 제거 */
    .featured-section .video-container {
        box-shadow: none;
        border: none;
        background: transparent;
        padding-bottom: 56.25%;
        border-radius: 16px;
    }

    .github-section .github-contribution-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 0;
    }

    .github-section .github-contribution-card:hover {
        background: transparent;
        box-shadow: none;
        border-color: transparent;
    }

    .github-section .github-list-card {
        background: rgba(128, 128, 128, 0.07);
        border: 1px solid rgba(128, 128, 128, 0.15);
        box-shadow: none;
        border-radius: 16px;
        padding: 1.2rem 1.5rem;
        margin-bottom: 0;
    }

    [data-theme="light"] .github-section .github-list-card {
        background: rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .github-section .github-list-card:hover {
        background: rgba(128, 128, 128, 0.14);
        transform: translateY(-3px);
        box-shadow: none;
        border-color: var(--accent);
    }

    [data-theme="light"] .github-section .github-list-card:hover {
        background: rgba(0, 0, 0, 0.09);
    }

    /* 위젯 내부 요소들이 그리드 셀에 꽉 차도록 설정 */
    .discord-wide-widget, 
    .insta-profile-card,
    .github-contribution-card,
    .video-container,
    .github-list,
    .hero-content {
        height: 100%;
        width: 100%;
        max-width: none !important;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* 디스코드 판 내부 위젯 배경/그림자 제거 */
    .discord-section .discord-wide-widget {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* 인스타 판 내부 위젯 - 셀 전체 채우기 */
    .instagram-section .social-links-grid {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .instagram-section .insta-profile-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        flex-grow: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .instagram-section .insta-profile-card:hover {
        transform: none;
        box-shadow: none;
        border-color: transparent;
    }

    .instagram-section .insta-card-btn {
        margin-top: 1rem;
    }

    .hero {
        width: 100%;
        max-width: none !important;
    }

    .section-title {
        text-align: center;
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .featured-section .video-container {
        width: 100%;
        flex-grow: 1;
        display: flex;
    }

    .featured-section .video-container iframe {
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 32px;
    }

    .featured-section .profile-link-container {
        display: flex !important; /* YouTube 버튼 복구 */
        margin-top: 1.5rem;
        justify-content: center;
    }
}

/* --- 3열 레이아웃 (데스크톱 기본) --- */
/* 패널 사이즈 형식:
   [Discord 1x2] [심호령 1x1] [Insta 1x1 ]
   [           ] [YouTube    2x1     ]
   [GitHub              3x1         ]
*/
@media (min-width: 1250px) {
    .container {
        max-width: 1600px;
        padding-left: 3rem;
        padding-right: 3rem;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
        justify-content: stretch;
        padding-top: 8rem;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* 1x2: 왼쪽 세로 길게 */
    .discord-section {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    /* 1x1: 중앙 상단 */
    .hero {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch; /* 인스타와 높이 맞춤 */
    }

    /* 1x1: 오른쪽 상단 (심호령과 동일 행) */
    .instagram-section {
        grid-column: 3;
        grid-row: 1;
    }

    /* 2x1: 중앙+오른쪽 가로 넓게 */
    .featured-section {
        grid-column: 2 / 4;
        grid-row: 2;
    }

    /* 3x1: 하단 전체 가로 */
    .github-section {
        grid-column: 1 / 4;
        grid-row: 3;
    }

    /* 벤토 그리드 내부 레이아웃 최적화 (세로형 압축 및 크기 조정) */
    .discord-header, .insta-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem;
    }

    .discord-header-right {
        flex-direction: column;
        align-items: center;
        max-height: none;
        gap: 1.2rem;
        width: 100%;
    }

    .discord-user-info {
        align-items: center;
    }

    /* 인스타그램 위젯 벤토 그리드 최적화 (크게 키우기) */
    .instagram-section .insta-profile-card {
        height: 100%;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 1rem !important;
    }

    .instagram-section .insta-card-body {
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        height: 100%;
    }

    .instagram-section .insta-card-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .instagram-section .insta-card-avatar {
        width: 110px;
        height: 110px;
        border-width: 3px;
        padding: 3px;
    }

    .instagram-section .insta-card-info h3 {
        font-size: 2.2rem;
        font-weight: 900;
    }

    .instagram-section .insta-card-btn {
        font-size: 1.1rem;
        padding: 0.8rem 2.5rem;
        border-radius: 30px;
    }
}



/* Responsive */
@media (max-width: 1249px) {


    .floating-logo,
    .navbar,
    .theme-controls {
        top: 1rem;
    }

    .floating-logo {
        left: 1rem;
    }

    .theme-controls {
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-top: 5rem;
    }

    .title {
        font-size: 2.8rem;
    }

    body::before {
        background-attachment: scroll;
        position: absolute;
        /* Simplify gradient on mobile to prevent tiling bugs */
        background-image: radial-gradient(circle at 50% 40%, var(--bg-gradient-1) 0%, transparent 80%);
    }



    .floating-logo,
    .navbar,
    .theme-controls {
        top: 0.8rem;
    }

    .discord-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    .discord-header-right {
        flex-direction: column;
        align-items: center;
        max-height: none;
        width: 100%;
        gap: 1.2rem;
    }
    .discord-user-info {
        align-items: center;
        width: 100%;
    }
    .discord-custom-status {
        width: 100%;
        max-width: 100%;
        flex: none;
        margin: 0;
    }
}

@media (max-width: 480px) {

    .floating-logo,
    .navbar,
    .theme-controls {
        top: 0.6rem;
    }
}

