/* ==========================================
   養太極 - 태극권 수련 앱
   동양적이고 고요한 분위기의 디자인
   ========================================== */

:root {
    --ink-black: #1a1a1a;
    --deep-charcoal: #2d2d2d;
    --paper-cream: #f5f0e8;
    --gold-accent: #c9a227;
    --gold-light: #e6c847;
    --jade-green: #2d5a4a;
    --jade-light: #3d7a6a;
    --vermillion: #cc3333;
    --vermillion-soft: #e05555;
    --kakao-yellow: #FEE500;
    --mist-gray: rgba(245, 240, 232, 0.1);
    
    --font-serif: 'Noto Serif KR', 'Batang', serif;
    --font-display: 'Cinzel', 'Noto Serif KR', serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
    font-family: var(--font-serif);
    background: linear-gradient(160deg, #0d0d0d 0%, #1a1a1a 50%, #0a1510 100%);
    color: var(--paper-cream);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.hidden { display: none !important; }

/* 배경 효과 */
.background-pattern {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.03;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 30px, var(--paper-cream) 30px, var(--paper-cream) 31px);
    pointer-events: none;
    z-index: 0;
}

.mist {
    position: fixed;
    width: 150%; height: 150%;
    pointer-events: none;
    z-index: 0;
}

.mist-1 {
    top: -25%; left: -25%;
    background: radial-gradient(ellipse at 30% 20%, rgba(45, 90, 74, 0.15) 0%, transparent 50%);
    animation: mistFloat 20s ease-in-out infinite;
}

.mist-2 {
    top: -25%; left: -25%;
    background: radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.08) 0%, transparent 50%);
    animation: mistFloat 25s ease-in-out infinite reverse;
}

@keyframes mistFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(3%, -2%) rotate(1deg); }
    66% { transform: translate(-2%, 3%) rotate(-1deg); }
}

/* 메인 컨테이너 */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 15px;
    min-height: 100vh;
}

/* 헤더 */
.header {
    margin-bottom: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.taiji-symbol {
    font-size: 36px;
    animation: slowSpin 30s linear infinite;
    filter: drop-shadow(0 0 15px rgba(201, 162, 39, 0.3));
}

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--gold-accent);
    text-shadow: 0 2px 15px rgba(201, 162, 39, 0.3);
}

/* 인증 섹션 */
.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-buttons {
    display: flex;
    gap: 8px;
}

.btn-login {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-kakao {
    background: var(--kakao-yellow);
    color: #3C1E1E;
}

.btn-kakao:hover {
    background: #e6cf00;
    transform: translateY(-2px);
}

.btn-email {
    background: var(--deep-charcoal);
    color: var(--paper-cream);
    border: 1px solid rgba(245, 240, 232, 0.2);
}

.btn-email:hover {
    background: #3d3d3d;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nickname-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: min(42vw, 160px);
    cursor: pointer;
    padding: 2px 4px 2px 2px;
    margin: -2px;
    border-radius: 6px;
    outline: none;
}

.nickname-wrap:hover {
    background: rgba(245, 240, 232, 0.06);
}

.nickname-wrap:focus-visible {
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.45);
}

.board-notify-dot {
    position: absolute;
    top: -1px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: #e53935;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #1a1a1c;
    pointer-events: none;
}

.board-notify-dot.hidden {
    display: none;
}

.nickname {
    color: var(--gold-accent);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.3);
    color: var(--paper-cream);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-small:hover {
    background: rgba(245, 240, 232, 0.1);
}

.btn-icon-settings {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.6);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s, transform 0.3s;
}
.btn-icon-settings:hover {
    color: var(--paper-cream);
    transform: rotate(60deg);
}

/* 랭킹 섹션 (캐릭터 포함 레이아웃) */
.ranking-section {
    background: rgba(45, 45, 45, 0.5);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(245, 240, 232, 0.08);
}

.ranking-layout {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

/* 좌측: 캐릭터 패널 */
.character-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 8px 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(245, 240, 232, 0.06);
}

.character-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#myCharacterCanvas {
    image-rendering: pixelated;
    width: 48px;
    height: 64px;
}

.character-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.character-level {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold-accent);
    letter-spacing: 0.5px;
}

.character-tier {
    font-size: 0.6rem;
    color: rgba(245, 240, 232, 0.5);
}

.character-training-time {
    font-size: 0.55rem;
    color: rgba(245, 240, 232, 0.4);
    margin-top: 2px;
}

.level-progress-bar {
    width: 56px;
    height: 4px;
    background: rgba(245, 240, 232, 0.1);
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: var(--gold-accent);
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.level-progress-text {
    font-size: 0.45rem;
    color: rgba(245, 240, 232, 0.35);
    margin-top: 1px;
}

.character-customize-btn {
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 0.55rem;
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-accent);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-serif);
}

.character-customize-btn:hover {
    background: rgba(201, 162, 39, 0.3);
}

/* 레벨별 색상 미리보기 모달 */
.level-preview-modal-content {
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
}

.level-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 8px 0;
}

.level-preview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px 8px;
    background: rgba(245, 240, 232, 0.04);
    border: 1px solid rgba(245, 240, 232, 0.08);
    border-radius: 8px;
    transition: background 0.2s;
}

.level-preview-card.current {
    background: rgba(201, 162, 39, 0.12);
    border-color: rgba(201, 162, 39, 0.4);
}

.level-preview-card canvas {
    image-rendering: pixelated;
}

.level-preview-tier {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold-accent);
    margin-top: 6px;
}

.level-preview-range {
    font-size: 0.6rem;
    color: rgba(245, 240, 232, 0.6);
    margin-top: 2px;
}

.level-preview-hours {
    font-size: 0.55rem;
    color: rgba(245, 240, 232, 0.4);
    margin-top: 3px;
    text-align: center;
    line-height: 1.3;
}

.level-preview-card.current .level-preview-hours {
    color: rgba(201, 162, 39, 0.7);
}

@media (max-width: 480px) {
    .level-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .level-preview-modal-content {
        max-width: 95vw;
    }
}

/* 우측: 랭킹 패널 (축소) */
.ranking-panel {
    flex: 1;
    min-width: 0;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ranking-header h3 {
    font-size: 0.85rem;
    color: var(--gold-accent);
}

.ranking-period {
    font-size: 0.65rem;
    color: rgba(245, 240, 232, 0.5);
}

.ranking-chart-container {
    height: 80px;
    margin-bottom: 6px;
}

.ranking-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.7rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.ranking-item.me {
    background: rgba(201, 162, 39, 0.2);
    border: 1px solid var(--gold-accent);
}

.ranking-position {
    font-weight: 600;
    color: var(--gold-accent);
    font-size: 0.7rem;
}

.ranking-name {
    color: var(--paper-cream);
    font-size: 0.7rem;
}

.ranking-time {
    color: rgba(245, 240, 232, 0.6);
    font-size: 0.65rem;
}

.ranking-level-badge {
    font-size: 0.55rem;
    color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.15);
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.ranking-char-icon {
    image-rendering: pixelated;
    width: 24px;
    height: 32px;
    flex-shrink: 0;
}

/* 캐릭터 커스터마이징 모달 */
.character-modal-content {
    max-width: 360px;
}

.char-preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#charPreviewCanvas {
    image-rendering: pixelated;
    width: 96px;
    height: 128px;
}

.char-preview-info {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--gold-accent);
}

.char-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.char-opt-group label {
    display: block;
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.6);
    margin-bottom: 6px;
}

.char-opt-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.char-opt-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    color: var(--paper-cream);
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-serif);
}

.char-opt-btn:hover {
    border-color: rgba(201, 162, 39, 0.5);
}

.char-opt-btn.active {
    border-color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold-accent);
}

.char-face-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
}

.char-hair-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
}

.char-hair-btn span {
    font-size: 0.6rem;
}

.char-hair-preview {
    image-rendering: pixelated;
}

.char-save-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
}

/* 관리자 레벨 관리 */
.admin-level-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.72rem;
}

.admin-level-row label {
    color: rgba(245, 240, 232, 0.6);
    font-size: 0.68rem;
    white-space: nowrap;
}

.admin-level-row input[type="number"] {
    width: 56px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 4px;
    color: var(--paper-cream);
    font-size: 0.7rem;
    font-family: var(--font-serif);
}

.admin-level-row select {
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 4px;
    color: var(--paper-cream);
    font-size: 0.7rem;
    font-family: var(--font-serif);
}

.admin-level-row .admin-act-btn {
    padding: 3px 8px;
    font-size: 0.65rem;
}

.admin-level-auto {
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.65rem;
}

/* 관리자 탭 */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.admin-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-family: var(--font-serif);
    background: rgba(245, 240, 232, 0.06);
    color: rgba(245, 240, 232, 0.5);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-tab.active {
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-accent);
    border-color: rgba(201, 162, 39, 0.3);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* 접속 로그 */
.admin-accesslog-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.admin-accesslog-select {
    flex: 1;
    min-width: 100px;
    padding: 5px 8px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--paper-cream);
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: 6px;
    font-family: var(--font-serif);
}

.admin-accesslog-summary {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(201, 162, 39, 0.08);
    border-radius: 8px;
    flex-wrap: wrap;
}

.accesslog-stat {
    font-size: 0.7rem;
    color: rgba(245, 240, 232, 0.6);
}

.accesslog-stat strong {
    color: var(--gold-accent);
    font-size: 0.8rem;
}

.admin-accesslog-list {
    max-height: 400px;
    overflow-y: auto;
}

.accesslog-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(245, 240, 232, 0.05);
    font-size: 0.68rem;
}

.accesslog-item:hover {
    background: rgba(245, 240, 232, 0.03);
}

.accesslog-date {
    color: rgba(245, 240, 232, 0.4);
    min-width: 72px;
    flex-shrink: 0;
}

.accesslog-nick {
    color: var(--paper-cream);
    font-weight: 600;
    min-width: 70px;
}

.accesslog-event {
    min-width: 60px;
    flex-shrink: 0;
}

.accesslog-device {
    color: rgba(245, 240, 232, 0.5);
    min-width: 70px;
}

.accesslog-screen {
    color: rgba(245, 240, 232, 0.3);
    font-size: 0.6rem;
}

/* 탭 네비게이션 */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(245, 240, 232, 0.6);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.tab-btn:hover {
    background: rgba(245, 240, 232, 0.05);
    color: var(--paper-cream);
}

.tab-btn.active {
    background: var(--jade-green);
    color: var(--paper-cream);
    box-shadow: 0 4px 15px rgba(45, 90, 74, 0.4);
}

.tab-icon {
    font-size: 1.3rem;
}

.tab-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.tab-hotkey {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    color: rgba(245, 240, 232, 0.5);
}

/* 탭 콘텐츠 */
.tab-contents {
    min-height: 300px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* 수련 버튼 그리드 */
.training-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.training-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 25px 15px;
    background: linear-gradient(145deg, var(--deep-charcoal), #252525);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.training-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--jade-green), var(--jade-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.training-btn:hover::before {
    opacity: 0.2;
}

.training-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--jade-green);
}

.training-btn:active {
    transform: translateY(-2px);
}

.training-icon {
    font-size: 2.5rem;
    z-index: 1;
}

.training-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--paper-cream);
    z-index: 1;
}

.training-info {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.6);
    z-index: 1;
}

.training-hotkey {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(201, 162, 39, 0.2);
    border: 1px solid var(--gold-accent);
    border-radius: 4px;
    color: var(--gold-accent);
}

/* 수련 오버레이 */
.training-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.training-modal {
    text-align: center;
    padding: 40px;
}

.training-modal-header {
    margin-bottom: 30px;
}

.training-modal-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}
.training-modal-icon .taichi-icon {
}

.training-modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--gold-accent);
}

.training-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 타이머 관련 스타일 */
.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.timer-ring {
    position: relative;
    width: 220px;
    height: 220px;
}

.timer-ring.large {
    width: 280px;
    height: 280px;
}

.progress-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--deep-charcoal);
    stroke-width: 6;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--jade-green);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(45, 90, 74, 0.5));
}

.progress-ring-fill.prep {
    stroke: #6b8cce;
    filter: drop-shadow(0 0 8px rgba(107, 140, 206, 0.5));
}

.progress-ring-fill.rest {
    stroke: var(--gold-accent);
    filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.5));
}

.progress-ring-fill.countdown {
    stroke: var(--vermillion);
    filter: drop-shadow(0 0 8px rgba(204, 51, 51, 0.5));
}

.timer-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-phase {
    font-size: 0.85rem;
    color: var(--jade-light);
    letter-spacing: 0.15em;
    margin-bottom: 5px;
}

.timer-phase.prep { color: #6b8cce; }
.timer-phase.rest { color: var(--gold-accent); }
.timer-phase.countdown { color: var(--vermillion-soft); }

.timer-time {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    color: var(--paper-cream);
}

.timer-ring.large .timer-time {
    font-size: 4rem;
}

.timer-time.pulse {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-round {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.5);
    margin-top: 5px;
}

/* 컨트롤 버튼 */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 25px;
}

.btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 75px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-serif);
    background: var(--deep-charcoal);
    color: var(--paper-cream);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.btn-text {
    font-size: 0.7rem;
}

.btn-start {
    background: linear-gradient(145deg, var(--jade-green), #1d4a3a);
}

.btn-pause {
    background: linear-gradient(145deg, #4a4a2d, #3a3a1d);
}

.btn-reset {
    background: linear-gradient(145deg, #4a2d2d, #3a1d1d);
}

/* 설정 섹션 */
.settings {
    background: rgba(45, 45, 45, 0.5);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(245, 240, 232, 0.08);
}

.settings-title {
    font-size: 0.9rem;
    color: var(--gold-accent);
    margin-bottom: 15px;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-label {
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.adj-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--paper-cream);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.adj-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--gold-accent);
}

.setting-input {
    width: 45px;
    height: 30px;
    text-align: center;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--paper-cream);
    font-family: var(--font-display);
    font-size: 0.9rem;
    -moz-appearance: textfield;
}

.setting-input::-webkit-outer-spin-button,
.setting-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* 전체 설정 섹션 */
.global-settings-section {
    margin-bottom: 18px;
}

.global-settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(45, 45, 45, 0.5);
    border: 1px solid rgba(245, 240, 232, 0.12);
    border-radius: 12px;
    color: rgba(245, 240, 232, 0.75);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.global-settings-toggle:hover {
    background: rgba(45, 45, 45, 0.7);
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}

.global-settings-toggle.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    color: var(--gold-accent);
}

.global-settings-toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.global-settings-toggle.is-open .global-settings-toggle-icon {
    transform: rotate(90deg);
}

.global-settings-body {
    background: rgba(45, 45, 45, 0.5);
    border: 1px solid rgba(245, 240, 232, 0.12);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 18px 16px;
}

.global-settings-body.hidden {
    display: none;
}

.global-settings-group-title {
    font-size: 0.85rem;
    color: var(--gold-accent);
    margin: 0 0 12px;
    font-weight: 500;
}

.global-settings-body .sound-toggle {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: 14px;
}

.global-settings-body .sound-settings {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.sound-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(245, 240, 232, 0.1);
}

.sound-settings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(245, 240, 232, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sound-preset-row .setting-label,
.sound-volume-row .setting-label {
    min-width: 100px;
}

.sound-preset-row,
.sound-volume-row {
    align-items: center;
}

.sound-select {
    flex: 1;
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    background: rgba(0, 0, 0, 0.45);
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
}

.sound-select:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.sound-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.sound-volume-control input[type="range"] {
    flex: 1;
    max-width: 180px;
    accent-color: var(--jade-green);
}

.sound-volume-pct {
    min-width: 40px;
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.65);
    font-variant-numeric: tabular-nums;
}

.sound-preview-title {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.45);
    margin: 0 0 8px 0;
}

.sound-preview-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-sound-preview {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-family: var(--font-serif);
    border-radius: 8px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(245, 240, 232, 0.85);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-sound-preview:hover {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    justify-content: center;
}

.toggle-label input { display: none; }

.toggle-slider {
    width: 40px;
    height: 22px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 11px;
    position: relative;
    transition: var(--transition-smooth);
    border: 1px solid rgba(245, 240, 232, 0.2);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--paper-cream);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-label input:checked + .toggle-slider {
    background: var(--jade-green);
}

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

.toggle-text {
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.8);
}

/* 통계 */
.stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 25px 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--gold-accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(245, 240, 232, 0.5);
}

/* 회원 게시판 */
.board-section {
    background: rgba(45, 45, 45, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid rgba(245, 240, 232, 0.08);
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.board-header h3 {
    font-size: 0.95rem;
    color: var(--gold-accent);
}

.btn-write-post {
    padding: 8px 16px;
    background: var(--jade-green);
    border: none;
    border-radius: 8px;
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-write-post:hover {
    background: var(--jade-light);
}

.board-login-notice {
    text-align: center;
    padding: 20px;
    color: rgba(245, 240, 232, 0.5);
    font-size: 0.85rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: min(75vh, 900px);
    overflow-y: auto;
}

.posts-loading {
    text-align: center;
    padding: 20px;
    color: rgba(245, 240, 232, 0.5);
    font-size: 0.85rem;
}

.post-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    border-left: 3px solid var(--jade-green);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.post-author {
    font-weight: 500;
    color: var(--gold-accent);
    font-size: 0.85rem;
}

.post-date {
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.4);
}

.post-content {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.85);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.post-delete-btn {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
}

.post-delete-btn:hover {
    color: var(--vermillion);
}

.btn-load-more {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    color: rgba(245, 240, 232, 0.6);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-load-more:hover {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}

/* 게시글 페이지네이션 */
.posts-pagination {
    margin-top: 14px;
}

.posts-pagination.hidden {
    display: none;
}

.pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-nav {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(245, 240, 232, 0.25);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(245, 240, 232, 0.85);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    font-family: var(--font-serif);
    transition: var(--transition-smooth);
}

.pagination-nav:hover:not(:disabled) {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}

.pagination-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-num {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: 8px;
    background: transparent;
    color: rgba(245, 240, 232, 0.65);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.pagination-num:hover:not(.is-active) {
    border-color: rgba(245, 240, 232, 0.35);
    color: var(--paper-cream);
}

.pagination-num.is-active {
    background: rgba(74, 124, 89, 0.35);
    border-color: var(--jade-green);
    color: var(--gold-accent);
    font-weight: 600;
    cursor: default;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: rgba(245, 240, 232, 0.35);
    font-size: 0.9rem;
}

/* 댓글 */
.post-comments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(245, 240, 232, 0.1);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.comment-empty {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.35);
    margin: 0;
}

.comment-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.65);
    font-weight: 500;
}

.comment-date {
    font-size: 0.7rem;
    color: rgba(245, 240, 232, 0.35);
}

.comment-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.35);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px 4px;
}

.comment-delete-btn:hover {
    color: var(--vermillion);
}

.comment-body {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.8);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-form-wrap.hidden {
    display: none;
}

.comment-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 52px;
}

.comment-input:focus {
    outline: none;
    border-color: rgba(74, 124, 89, 0.6);
}

.btn-comment-send {
    align-self: flex-end;
    padding: 6px 14px;
    background: rgba(74, 124, 89, 0.45);
    border: 1px solid var(--jade-green);
    border-radius: 8px;
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-comment-send:hover {
    background: var(--jade-green);
}

.comment-login-hint {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.4);
    margin: 0;
}

.comment-login-hint.hidden {
    display: none;
}

/* 글쓰기 모달 */
.post-modal-content {
    max-width: 450px;
}

.post-modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
}

.post-modal-content textarea:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.post-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.4);
    margin: 5px 0 15px;
}

.no-posts {
    text-align: center;
    padding: 30px;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.9rem;
}

/* 푸터 */
.footer {
    text-align: center;
    padding: 15px;
    margin-top: auto;
}

.footer p {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.4);
}

.footer-quote {
    color: var(--gold-accent) !important;
    font-size: 0.9rem !important;
    margin-bottom: 5px;
}

.footer-contact {
    color: rgba(245, 240, 232, 0.6) !important;
    font-size: 0.85rem !important;
    margin-bottom: 10px;
}

.hotkey-hint {
    margin-top: 8px;
    font-size: 0.7rem !important;
    color: rgba(245, 240, 232, 0.3) !important;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--deep-charcoal);
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    position: relative;
    border: 1px solid rgba(245, 240, 232, 0.1);
    margin: auto;
}

.modal-content h2 {
    text-align: center;
    color: var(--gold-accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-content input {
    padding: 12px 15px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.btn-primary {
    padding: 12px;
    background: var(--jade-green);
    border: none;
    border-radius: 8px;
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    background: var(--jade-light);
}

.modal-divider {
    text-align: center;
    color: rgba(245, 240, 232, 0.4);
    margin: 15px 0;
    font-size: 0.85rem;
}

.full-width {
    width: 100%;
}

.modal-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.6);
}

.modal-switch a {
    color: var(--gold-accent);
    text-decoration: none;
}

/* 완료 축하 */
.celebration {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    padding: 35px 50px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--gold-accent);
    box-shadow: 0 0 50px rgba(201, 162, 39, 0.3);
    z-index: 1500;
    animation: celebrationIn 0.5s var(--transition-bounce);
}

@keyframes celebrationIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.celebration h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--gold-accent);
    margin-bottom: 10px;
}

.celebration p {
    color: rgba(245, 240, 232, 0.8);
    margin: 5px 0;
}

.celebration-close {
    margin-top: 20px;
    padding: 10px 30px;
    background: var(--jade-green);
    border: none;
    border-radius: 8px;
    color: var(--paper-cream);
    font-family: var(--font-serif);
    cursor: pointer;
}

/* 태극권 아이콘 */
.taichi-icon {
    width: 48px;
    height: 48px;
    color: var(--gold-accent);
    filter: drop-shadow(0 2px 4px rgba(201, 162, 39, 0.3));
}

.training-btn .taichi-icon {
    width: 56px;
    height: 56px;
}


/* 수련 추가 버튼 */
.add-training-btn,
.add-routine-btn {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    background: transparent;
    border: 2px dashed rgba(245, 240, 232, 0.2);
    border-radius: 12px;
    color: rgba(245, 240, 232, 0.5);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.add-training-btn:hover,
.add-routine-btn:hover {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.1);
}

/* 수련 버튼 편집 모드 */
.training-btn {
    position: relative;
}

.training-btn .edit-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(245, 240, 232, 0.3);
    border-radius: 6px;
    color: rgba(245, 240, 232, 0.7);
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 10;
}

.training-btn:hover .edit-btn {
    opacity: 1;
}

.training-btn .edit-btn:hover {
    background: var(--gold-accent);
    color: var(--ink-black);
}

/* 프리셋 모달 */
.preset-modal-content {
    max-width: 400px;
    padding: 20px;
}

.preset-modal-content p {
    text-align: center;
    color: rgba(245, 240, 232, 0.6);
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.7);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 아이콘 성별 탭 */
.icon-gender-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.icon-gender-tab {
    flex: 1;
    padding: 7px 0;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}
.icon-gender-tab.active {
    border-color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-accent);
}
.icon-group-label {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 4px 0 2px;
    border-bottom: 1px solid rgba(245,240,232,0.08);
    margin-bottom: 2px;
}

/* 아이콘 선택기 */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.icon-option {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(245, 240, 232, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px;
}

.icon-option:hover {
    border-color: rgba(245, 240, 232, 0.5);
    background: rgba(245, 240, 232, 0.1);
}

.icon-option.selected {
    border-color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.2);
}

.icon-option .taichi-icon {
    width: 36px;
    height: 36px;
}


/* 프리셋 액션 버튼 */
.preset-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.preset-actions .btn-primary {
    flex: 1;
}

.btn-danger {
    padding: 12px 20px;
    background: var(--vermillion);
    border: none;
    border-radius: 8px;
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-danger:hover {
    background: var(--vermillion-soft);
}

.btn-reset-presets {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    color: rgba(245, 240, 232, 0.5);
    font-family: var(--font-serif);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-reset-presets:hover {
    border-color: var(--vermillion);
    color: var(--vermillion);
}

/* 반응형 */
@media (max-width: 480px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .title { font-size: 1.5rem; }
    
    .training-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .training-btn {
        padding: 20px 10px;
    }
    
    .training-icon { font-size: 2rem; }
    .training-name { font-size: 0.9rem; }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-ring {
        width: 180px;
        height: 180px;
    }
    
    .timer-time { font-size: 2.5rem; }
}

/* ==================== 나의 루틴 ==================== */
.routine-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.routine-card {
    background: rgba(245, 240, 232, 0.04);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.routine-card:hover {
    background: rgba(245, 240, 232, 0.08);
    border-color: rgba(45, 90, 74, 0.4);
}
.routine-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.routine-card-name {
    font-family: var(--font-korean);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--paper-cream);
}
.routine-card-meta {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.5);
}
.routine-card-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.routine-card-actions button {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.4);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.routine-card-actions button:hover {
    color: var(--paper-cream);
    background: rgba(245, 240, 232, 0.1);
}

/* 플로우 차트 */
.routine-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
}
.flow-node {
    flex-shrink: 0;
}
.flow-node-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(245, 240, 232, 0.12);
    border-radius: 10px;
    padding: 10px 14px 8px;
    min-width: 90px;
    gap: 4px;
    transition: border-color 0.2s, background 0.2s;
}
.routine-card:hover .flow-node-card {
    border-color: rgba(45, 90, 74, 0.5);
}
.flow-icon, .flow-node-card .taichi-icon {
    width: 36px;
    height: 36px;
    color: var(--gold-accent);
    filter: drop-shadow(0 1px 3px rgba(201, 162, 39, 0.3));
}
.flow-node-name {
    font-family: var(--font-korean);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--paper-cream);
    text-align: center;
    line-height: 1.2;
}
.flow-node-time {
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.45);
}
.flow-repeat {
    font-size: 0.72rem;
    color: var(--gold-accent);
    font-weight: 600;
}
.flow-arrow {
    display: inline-flex;
    align-items: center;
    color: rgba(245, 240, 232, 0.3);
    font-size: 1.1rem;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
}

.routine-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.9rem;
}

/* 루틴 편집 모달 */
.routine-modal-content {
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
}
.routine-name-row {
    margin-bottom: 16px;
}
.routine-name-row label {
    display: block;
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.6);
    margin-bottom: 4px;
}
.routine-name-row input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 240, 232, 0.2);
    color: var(--paper-cream);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}
.routine-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.routine-steps-header h3 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--paper-cream);
}
.btn-add-step {
    background: rgba(45, 90, 74, 0.3);
    border: 1px dashed rgba(45, 90, 74, 0.6);
    color: var(--jade-green);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-smooth);
}
.btn-add-step:hover {
    background: rgba(45, 90, 74, 0.5);
}

.routine-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 40px;
}
.routine-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 8px;
    padding: 8px 10px;
}
.step-number {
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.4);
    min-width: 18px;
    text-align: center;
}
.step-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--paper-cream);
}
.step-repeat-control {
    display: flex;
    align-items: center;
    gap: 4px;
}
.step-repeat-control button {
    background: rgba(245, 240, 232, 0.08);
    border: 1px solid rgba(245, 240, 232, 0.15);
    color: var(--paper-cream);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-repeat-val {
    font-size: 0.85rem;
    min-width: 28px;
    text-align: center;
    color: var(--gold-accent);
}
.step-actions button {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.35);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
}
.step-actions button:hover {
    color: #e74c3c;
}
.step-move-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.step-move-btns button {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.3);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
}
.step-move-btns button:hover {
    color: var(--paper-cream);
}

.routine-summary {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.5);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

.routine-modal-actions {
    display: flex;
    gap: 10px;
}
.routine-modal-actions .btn-primary {
    flex: 1;
}
.routine-modal-actions .btn-secondary {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}
.routine-modal-actions .btn-secondary:hover {
    background: rgba(231, 76, 60, 0.35);
}

/* 수련 선택 모달 */
.step-preset-modal-content {
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}
.step-preset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.step-preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(245, 240, 232, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--paper-cream);
    font-size: 0.9rem;
}
.step-preset-item:hover {
    background: rgba(45, 90, 74, 0.3);
    border-color: rgba(45, 90, 74, 0.5);
}
.step-preset-item .preset-tab-label {
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.4);
}
.step-picker-heading {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.5);
    margin: 0 0 8px;
    font-weight: 500;
}
.step-picker-divider {
    border-top: 1px solid rgba(245, 240, 232, 0.1);
    margin: 12px 0;
}
.step-new-preset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed rgba(201, 162, 39, 0.35);
    border-radius: 10px;
    background: transparent;
    color: var(--gold-accent);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.step-new-preset-btn:hover {
    border-color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.1);
}
.step-new-icon {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 루틴 실행 오버레이 추가 정보 */
.routine-progress-bar {
    display: flex;
    gap: 3px;
    margin-top: 12px;
    padding: 0 20px;
}
.routine-progress-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(245, 240, 232, 0.15);
    transition: background 0.3s;
}
.routine-progress-dot.done {
    background: var(--jade-green);
}
.routine-progress-dot.active {
    background: var(--gold-accent);
}
.routine-step-label {
    text-align: center;
    margin-top: 8px;
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.5);
}

/* ==================== 개인 프로필 모달 ==================== */
.profile-modal-content {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}
.profile-header {
    text-align: center;
    margin-bottom: 20px;
}
.profile-header h2 {
    font-family: var(--font-korean);
    color: var(--gold-accent);
    margin: 0 0 12px;
}
.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 30px;
}
.profile-stat {
    text-align: center;
}
.profile-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--paper-cream);
    font-weight: 500;
}
.profile-stat-label {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.5);
}
.profile-chart-wrap h3,
.profile-logs-wrap h3 {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.7);
    margin: 16px 0 8px;
    font-weight: 500;
}
.profile-chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 8px;
}
.profile-log-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.82rem;
}
.profile-log-date {
    color: rgba(245, 240, 232, 0.45);
    min-width: 70px;
    font-size: 0.75rem;
}
.profile-log-type {
    flex: 1;
    color: var(--paper-cream);
}
.profile-log-time {
    color: var(--gold-accent);
    font-weight: 500;
    min-width: 55px;
    text-align: right;
}
.profile-log-rounds {
    color: rgba(245, 240, 232, 0.45);
    min-width: 30px;
    text-align: right;
    font-size: 0.75rem;
}
.profile-log-empty {
    text-align: center;
    padding: 20px;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.85rem;
}

/* 랭킹 아이템 클릭 가능 */
.ranking-item[data-user-id] {
    cursor: pointer;
    transition: background 0.2s;
}
.ranking-item[data-user-id]:hover {
    background: rgba(245, 240, 232, 0.08);
}

/* 통계 섹션 클릭 가능 */
.stats[role="button"] {
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 8px;
}
.stats[role="button"]:hover {
    opacity: 0.8;
}

.ranking-empty {
    text-align: center;
    padding: 12px;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.82rem;
}

/* ==================== 나의 수련기록 모달 ==================== */
.record-modal-content {
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px;
}
.record-modal-content h2 {
    margin-bottom: 14px;
}

/* 탭 */
.record-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 18px;
}
.record-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(245, 240, 232, 0.55);
    font-family: var(--font-serif);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.record-tab:hover { color: var(--paper-cream); }
.record-tab.active {
    background: var(--jade-green);
    color: var(--paper-cream);
}
.record-tab-content { display: none; }
.record-tab-content.active { display: block; }

/* 요약 */
.record-summary-row {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 18px;
}
.record-summary-item { text-align: center; }
.record-summary-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-accent);
    font-weight: 600;
}
.record-summary-label {
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.5);
}

/* 차트 섹션 */
.record-chart-section {
    margin-bottom: 20px;
}
.record-chart-section h3 {
    font-size: 0.88rem;
    color: rgba(245, 240, 232, 0.7);
    margin: 0 0 8px;
    font-weight: 500;
}
.record-chart-container {
    position: relative;
    height: 180px;
}
.record-donut-container {
    height: 220px;
}

/* ---- 달력 ---- */
.record-calendar-wrap {
    margin-bottom: 18px;
}
.record-cal-tz {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(245, 240, 232, 0.35);
    margin-bottom: 6px;
}
.record-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 4px;
}
.record-cal-title {
    font-size: 0.95rem;
    color: var(--paper-cream);
    font-weight: 500;
    min-width: 110px;
    text-align: center;
}
.record-cal-arrow {
    background: none;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 6px;
    color: rgba(245, 240, 232, 0.7);
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-cal-arrow:hover {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}
.record-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.4);
    margin-bottom: 4px;
}
.record-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.record-cal-cell {
    text-align: center;
    padding: 5px 0 3px;
    border-radius: 6px;
    min-height: 42px;
    cursor: pointer;
    transition: background 0.15s;
}
.record-cal-cell:hover {
    background: rgba(245, 240, 232, 0.06);
}
.record-cal-cell.today {
    border: 1px solid rgba(201, 162, 39, 0.4);
}
.record-cal-cell.has-training {
    background: rgba(45, 90, 74, 0.25);
}
.record-cal-cell.selected {
    background: rgba(45, 90, 74, 0.5);
    border: 1px solid var(--jade-green);
}
.record-cal-day {
    display: block;
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.7);
    line-height: 1;
}
.record-cal-cell.empty .record-cal-day { visibility: hidden; }
.record-cal-min {
    display: block;
    font-size: 0.62rem;
    color: var(--gold-accent);
    margin-top: 2px;
    line-height: 1;
}

/* ---- 로그 리스트 ---- */
.record-log-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.record-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.82rem;
}
.record-log-date {
    color: rgba(245, 240, 232, 0.45);
    min-width: 85px;
    font-size: 0.75rem;
}
.record-log-type {
    flex: 1;
    color: var(--paper-cream);
}
.record-log-dur {
    color: var(--gold-accent);
    font-weight: 500;
    min-width: 55px;
    text-align: right;
}
.record-log-rounds {
    color: rgba(245, 240, 232, 0.45);
    min-width: 30px;
    text-align: right;
    font-size: 0.75rem;
}
.record-log-empty {
    text-align: center;
    padding: 24px;
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.85rem;
}

/* 페이징 */
.record-log-paging {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.record-log-paging button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(245, 240, 232, 0.15);
    border-radius: 6px;
    background: transparent;
    color: rgba(245, 240, 232, 0.6);
    font-family: var(--font-serif);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.record-log-paging button:hover:not(.is-active):not(:disabled) {
    border-color: rgba(245, 240, 232, 0.35);
    color: var(--paper-cream);
}
.record-log-paging button.is-active {
    background: rgba(74, 124, 89, 0.35);
    border-color: var(--jade-green);
    color: var(--gold-accent);
    font-weight: 600;
    cursor: default;
}
.record-log-paging button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ==================== 언어 토글 ==================== */
.lang-toggle {
    display: flex;
    gap: 2px;
    margin-right: 8px;
}
.lang-btn {
    padding: 3px 8px;
    border: 1px solid rgba(245, 240, 232, 0.25);
    background: transparent;
    color: rgba(245, 240, 232, 0.5);
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-smooth);
}
.lang-btn.active {
    background: rgba(201, 162, 39, 0.2);
    border-color: var(--gold-accent);
    color: var(--gold-accent);
}

/* ==================== 쪽지 ==================== */
.msg-modal-content {
    max-width: 460px;
    max-height: 80vh;
    overflow-y: auto;
}
.msg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}
.msg-tab {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    background: transparent;
    color: rgba(245, 240, 232, 0.6);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}
.msg-tab.active {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.1);
}
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msg-item {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border-left: 3px solid transparent;
}
.msg-item.msg-unread {
    border-left-color: var(--gold-accent);
    background: rgba(201, 162, 39, 0.05);
}
.msg-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.82rem;
}
.msg-item-header strong {
    color: var(--gold-accent);
}
.msg-date {
    color: rgba(245, 240, 232, 0.4);
    font-size: 0.75rem;
}
.msg-item-body {
    color: var(--paper-cream);
    font-size: 0.85rem;
    line-height: 1.4;
}
.msg-notify-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    display: inline-block;
    margin-left: 2px;
}
@keyframes msg-shake {
    0%,100% { transform: rotate(0deg); }
    10% { transform: rotate(-14deg); }
    20% { transform: rotate(12deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(8deg); }
    50% { transform: rotate(-6deg); }
    60% { transform: rotate(4deg); }
    70% { transform: rotate(-2deg); }
    80% { transform: rotate(1deg); }
}
.msg-inbox-unread {
    animation: msg-shake 0.8s ease-in-out infinite;
    position: relative;
}
.msg-inbox-unread::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: #e74c3c;
    border-radius: 50%;
}
.btn-send-msg {
    display: inline-block;
    margin: 8px auto;
    padding: 6px 16px;
    border: 1px solid var(--gold-accent);
    background: transparent;
    color: var(--gold-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-smooth);
}
.btn-send-msg:hover {
    background: rgba(201, 162, 39, 0.15);
}

/* 닉네임 클릭 가능 */
.clickable-nick {
    cursor: pointer;
    transition: color 0.2s;
}
.clickable-nick:hover {
    color: var(--gold-accent);
    text-decoration: underline;
}

/* ==================== 관리자 패널 ==================== */
.admin-modal-content {
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
}
.admin-user-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
}
.admin-user-info {
    margin-bottom: 8px;
}
.admin-user-info strong {
    color: var(--gold-accent);
    font-size: 0.95rem;
}
.admin-user-meta {
    display: block;
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.45);
    margin-top: 2px;
}
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.admin-act-btn {
    padding: 4px 10px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    background: transparent;
    color: rgba(245, 240, 232, 0.7);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-smooth);
}
.admin-act-btn:hover {
    background: rgba(245, 240, 232, 0.1);
}
.admin-act-btn.admin-warn {
    border-color: rgba(230, 180, 50, 0.4);
    color: rgba(230, 180, 50, 0.8);
}
.admin-act-btn.admin-danger {
    border-color: rgba(192, 57, 43, 0.4);
    color: rgba(192, 57, 43, 0.8);
}
.admin-act-btn.admin-danger:hover {
    background: rgba(192, 57, 43, 0.15);
}

/* ==================== 준비중 탭 ==================== */
.tab-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: rgba(245, 240, 232, 0.4);
}
.tab-placeholder-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}
.tab-placeholder p {
    font-size: 1rem;
    margin: 0;
}

/* ==================== 계보 (Lineage) ==================== */
.lineage-content {
    padding: 20px 10px;
}
.lineage-title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 6px;
    letter-spacing: 3px;
    color: var(--paper-cream);
}
.lineage-subtitle {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 30px;
}
.lineage-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
}
.lineage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}
.lineage-portrait {
    width: 100px;
    height: 125px;
    border: 2px solid rgba(200, 169, 110, 0.25);
    border-radius: 8px;
    padding: 4px;
    background: #f5f0e8;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.lineage-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.lineage-gen {
    font-size: 0.6rem;
    color: #c8a96e;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 8px;
}
.lineage-name-kr {
    font-size: 1rem;
    font-weight: 700;
    color: var(--paper-cream);
    margin: 2px 0;
}
.lineage-name-en {
    font-size: 0.65rem;
    opacity: 0.55;
}
.lineage-years {
    font-size: 0.6rem;
    opacity: 0.4;
    margin-top: 1px;
}
.lineage-rank {
    font-size: 0.6rem;
    color: #c8a96e;
    margin-top: 1px;
}
.lineage-arrow {
    display: flex;
    align-items: center;
    color: rgba(200, 169, 110, 0.35);
    font-size: 1rem;
    padding-top: 50px;
}
@media (max-width: 600px) {
    .lineage-list {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    .lineage-card {
        width: 100%;
        flex-direction: row;
        gap: 14px;
        padding: 10px 0;
    }
    .lineage-portrait {
        width: 70px;
        height: 88px;
        flex-shrink: 0;
    }
    .lineage-card > :not(.lineage-portrait) {
        text-align: left;
    }
    .lineage-gen, .lineage-name-kr, .lineage-name-en, .lineage-years, .lineage-rank {
        text-align: left;
    }
    .lineage-arrow {
        padding-top: 0;
        transform: rotate(90deg);
        font-size: 0.9rem;
    }
}

/* ==================== Admin 기능 토글 ==================== */
.admin-feature-toggles {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}
.admin-feature-toggles h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}
.admin-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    cursor: pointer;
}
.admin-toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #c8a96e;
    cursor: pointer;
}
.admin-toggle-status {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ==================== 공지 팝업 ==================== */
.admin-notice-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}
.admin-notice-section h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}
.admin-notice-status {
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.5);
    margin-bottom: 6px;
}
.notice-modal-content {
    max-width: 420px;
    text-align: center;
}
.notice-modal-content h2 {
    margin-bottom: 16px;
}
.notice-body {
    text-align: left;
    white-space: pre-wrap;
    line-height: 1.7;
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    margin-bottom: 20px;
    max-height: 50vh;
    overflow-y: auto;
    font-size: 0.95rem;
}
.notice-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.notice-actions .btn-primary {
    flex: 1;
    max-width: 160px;
}
.notice-actions .btn-secondary {
    flex: 1;
    max-width: 160px;
    padding: 10px 16px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    background: transparent;
    color: rgba(245, 240, 232, 0.6);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}
.notice-actions .btn-secondary:hover {
    background: rgba(245, 240, 232, 0.08);
}

/* 회원가입 경로 선택 */
.signup-source-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(245, 240, 232, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--paper-cream);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    appearance: auto;
}
.signup-source-select option {
    background: var(--deep-charcoal);
    color: var(--paper-cream);
}
