/* ============ 인증 모달 ============ */
#auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

#auth-modal.show {
    display: flex !important;
}

#auth-modal.hidden {
    display: none !important;
}

.auth-content {
    background: #1a1a2e;
    border: 2px solid #FFD700;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* 헤더 */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.auth-header h2 {
    margin: 0;
    font-size: 20px;
    color: #FFD700;
}

.auth-close {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.auth-close:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* 탭 */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.auth-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.auth-tab.active {
    color: #FFD700;
    border-bottom-color: #FFD700;
}

/* 폼 패널 */
.auth-panel {
    display: none;
    padding: 20px;
}

.auth-panel.active {
    display: block;
}

/* 입력 그룹 */
.auth-input-group {
    margin-bottom: 14px;
}

.auth-input-group label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
}

.auth-input-group label .optional {
    color: #666;
    font-weight: normal;
    font-size: 11px;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.1);
}

.auth-input::placeholder {
    color: #555;
}

/* 버튼 */
.auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

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

.auth-btn-primary {
    background: #FFD700;
    color: #1a1a2e;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #FFC107;
    transform: translateY(-1px);
}

.auth-btn-google {
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    border: 1px solid #ddd;
}

.auth-btn-google:hover:not(:disabled) {
    background: #f5f5f5;
}

.auth-btn-google svg {
    width: 18px;
    height: 18px;
}

/* 구분선 */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #555;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider::before {
    margin-right: 10px;
}

.auth-divider::after {
    margin-left: 10px;
}

/* 에러/성공 메시지 */
.auth-error {
    display: none;
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 4px;
}

.auth-success {
    display: none;
    color: #69db7c;
    font-size: 13px;
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(105, 219, 124, 0.1);
    border: 1px solid rgba(105, 219, 124, 0.2);
    border-radius: 4px;
}

/* 안내 텍스트 */
.auth-hint {
    font-size: 12px;
    color: #666;
    margin-top: 14px;
    text-align: center;
}

/* 플레이어 이름 */
.player-username {
    color: #69db7c;
    font-size: 13px;
    font-weight: bold;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 아바타 클릭 커서 */
.player-avatar {
    cursor: pointer;
}

/* 아바타 드롭다운 메뉴 */
.avatar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    min-width: 120px;
    z-index: 1100;
    overflow: hidden;
}

.avatar-dropdown.hidden {
    display: none;
}

.avatar-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.avatar-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.avatar-menu-logout {
    color: #ff6b6b;
}

.avatar-menu-logout:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* 캐릭터 꾸미기 모달 */
.costume-modal-content {
    max-width: 360px;
    max-height: 85vh;
    overflow-y: auto;
}

.costume-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.costume-preview-wrap {
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

#costume-preview {
    border-radius: 6px;
    background: #111;
}

.costume-section h3 {
    font-size: 13px;
    color: #FFD700;
    margin: 0 0 8px 0;
}

.costume-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.costume-color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

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

.costume-color-btn.costume-selected {
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.costume-item-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.costume-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.costume-item-btn.costume-selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
}

/* 검 판매 모달 */
.sell-modal-content {
    max-width: 400px;
}

.sell-modal-info {
    text-align: center;
    color: #aaa;
    margin: 0 0 12px 0;
    font-size: 13px;
}

.sell-grid {
    margin: 0 auto;
    max-width: 360px;
}

.sell-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
}

#sell-preview-text {
    font-weight: bold;
    color: #fff;
}

#sell-preview-price {
    color: #FFD700;
    font-weight: bold;
}

.sell-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.btn-sell-confirm {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: #fff;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-sell-confirm:disabled {
    background: #555;
    cursor: not-allowed;
}

.btn-sell-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
}

.btn-sell-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 상점 검 판매 섹션 */
.shop-sell {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    box-sizing: border-box;
}

.shop-sell-info {
    color: #aaa;
    font-size: 12px;
    margin: 0 0 12px 0;
}

.btn-sell-sword {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF5722, #E64A19);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-sell-sword:hover {
    transform: scale(1.02);
}

.btn-sell-sword:active {
    transform: scale(0.98);
}

/* 주식 거래소 */
.shop-stock {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    box-sizing: border-box;
}

.btn-stock-open {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-stock-open:hover { transform: scale(1.02); }
.btn-stock-open:active { transform: scale(0.98); }

.stock-modal-content {
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
}

.stock-my-gold {
    text-align: center;
    color: #FFD700;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
}

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

.stock-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
}

.stock-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stock-name {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
}

.stock-name .stock-icon {
    margin-right: 6px;
}

.stock-price-info {
    text-align: right;
}

.stock-price {
    font-weight: bold;
    font-size: 15px;
    color: #FFD700;
}

.stock-change {
    font-size: 12px;
    margin-left: 6px;
}

.stock-change.up { color: #F44336; }
.stock-change.down { color: #2196F3; }
.stock-change.same { color: #888; }

.stock-chart {
    height: 32px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.stock-chart canvas {
    width: 100%;
    height: 100%;
}

.stock-card-bottom {
    display: flex;
    gap: 6px;
    align-items: center;
}

.stock-qty-input {
    width: 50px;
    padding: 6px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    text-align: center;
    font-size: 13px;
}

.stock-holding {
    color: #aaa;
    font-size: 11px;
    flex: 1;
    text-align: right;
}

.btn-stock-buy, .btn-stock-sell {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
}

.btn-stock-buy {
    background: #F44336;
    color: #fff;
}

.btn-stock-buy:hover { background: #D32F2F; }

.btn-stock-sell {
    background: #2196F3;
    color: #fff;
}

.btn-stock-sell:hover { background: #1976D2; }

.btn-stock-buy:disabled, .btn-stock-sell:disabled {
    background: #555;
    cursor: not-allowed;
}

.stock-portfolio {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 12px;
}

.stock-section-label {
    color: #FFD700;
    font-size: 13px;
    margin: 0 0 8px 0;
}

.stock-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.stock-portfolio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    font-size: 13px;
    color: #ccc;
}

.stock-portfolio-item .stock-pf-name { color: #fff; font-weight: bold; }
.stock-portfolio-item .stock-pf-profit.up { color: #F44336; }
.stock-portfolio-item .stock-pf-profit.down { color: #2196F3; }

.stock-portfolio-total {
    text-align: right;
    color: #FFD700;
    font-weight: bold;
    font-size: 14px;
}

/* 버그 신고 버튼 */
.btn-bug-report {
    margin-top: 30px;
    padding: 10px 20px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-bug-report:hover {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.3);
}

/* 버그 신고 모달 */
.bug-modal-content {
    max-width: 400px;
}

.bug-form-group {
    margin-bottom: 14px;
}

.bug-label {
    display: block;
    font-size: 13px;
    color: #FFD700;
    margin-bottom: 6px;
    font-weight: bold;
}

.bug-select {
    width: 100%;
    padding: 8px 12px;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.bug-textarea {
    width: 100%;
    padding: 10px 12px;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.bug-textarea::placeholder {
    color: #555;
}

.bug-send-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
}

.bug-send-btn:hover {
    filter: brightness(1.1);
}

.bug-send-btn:disabled {
    background: #555;
    cursor: not-allowed;
}
