* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    background: linear-gradient(160deg, #1a0a2e, #16213e, #0f3460);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* ── 인증 바 ── */
.auth-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(245, 175, 25, 0.08);
    border: 1px solid rgba(245, 175, 25, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: flex-end;
}

.auth-bar .user-info {
    margin-right: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f5af19;
}

.auth-bar .token-balance {
    font-size: 0.82rem;
    color: #4CAF50;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
}

.auth-bar button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.auth-bar .charge-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* ── 모달 ── */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 32px 28px;
    width: 90%;
    max-width: 380px;
    z-index: 1;
}

.modal-content h3 {
    color: #f5af19;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content .form-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
}

.modal-content .form-group input:focus {
    border-color: #f5af19;
}

.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: #f5af19; }

.modal-submit-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}

.modal-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
    color: #888;
}

.modal-switch a {
    color: #f5af19;
    text-decoration: none;
}

.error-text {
    color: #e74c3c;
    font-size: 0.82rem;
    margin-bottom: 8px;
    min-height: 20px;
}

/* ── 토큰샵 모달 ── */
.token-shop-content {
    text-align: center;
    max-width: 400px;
}

.token-shop-content .paywall-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.token-shop-content .paywall-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f5af19;
    margin-bottom: 6px;
}

.token-shop-content .paywall-desc {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── 토큰샵 ── */
.token-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.token-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.product-label {
    font-size: 0.88rem;
    color: #e0e0e0;
}

.product-price {
    font-size: 0.82rem;
    color: #f5af19;
    font-weight: 600;
}

.token-product:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(118, 75, 162, 0.4);
}

.product-buy {
    font-size: 0.75rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* ── 입력 화면 ── */
.hero {
    text-align: center;
    padding: 20px 0 10px;
}

.banner-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 4px 20px rgba(245, 175, 25, 0.3));
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-char {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.welcome-text h2 {
    font-size: 1.3rem;
    color: #f5af19;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.5;
}

/* ── 폼 카드 ── */
.form-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #bbb;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

input[type="date"],
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.calendar-toggle, .night-ja-wrap {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #bbb;
    cursor: pointer;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
    accent-color: #f5af19;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.night-ja-wrap {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(245, 175, 25, 0.08);
    border: 1px solid rgba(245, 175, 25, 0.2);
    border-radius: 8px;
}

.leap-month-label {
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

input[type="date"]:focus,
select:focus {
    border-color: #f5af19;
}

select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

#start-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    margin-top: 4px;
}

#start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245, 175, 25, 0.35);
}

#start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── 띠 동물 갤러리 ── */
.zodiac-strip {
    display: flex;
    gap: 6px;
    padding: 20px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.zodiac-strip::-webkit-scrollbar {
    display: none;
}

.zodiac-strip img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.zodiac-strip img:hover {
    transform: scale(1.2);
    border-color: #f5af19;
}

/* ── 채팅 화면 ── */
#chat-screen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f5af19;
}

.chat-header h3 {
    font-size: 1rem;
    color: #f5af19;
}

.chat-header .status {
    font-size: 0.75rem;
    color: #888;
}

.reset-btn {
    margin-left: auto;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: transparent;
    color: #aaa;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.reset-btn:hover {
    border-color: #f5af19;
    color: #f5af19;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ── 메시지 버블 ── */
.message {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.message .msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
}

.message.user .msg-avatar {
    display: none;
}

.msg-body {
    max-width: 80%;
}

.msg-body .name {
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 4px;
}

.message.user .msg-body .name {
    text-align: right;
}

.msg-body .bubble {
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.7;
    font-size: 0.92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.user .bubble {
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

/* ── 로딩 ── */
.loading-container {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

.loading-container .msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-container .loading-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
    color: #aaa;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f5af19;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* ── 사주 차트 ── */
.saju-chart {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
    margin-top: 4px;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.chart-zodiac {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f5af19;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f5af19;
}

.chart-sub {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2px;
}

.pillars-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pillar-labels {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 2px;
    margin-right: 4px;
}

.pillar-labels div {
    height: 52px;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    color: #777;
}

.pillar {
    text-align: center;
    min-width: 56px;
}

.pillar-label {
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 6px;
    font-weight: 600;
}

.pillar-cell {
    width: 56px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 8px;
}

.pillar-cell.empty {
    color: #666;
    font-size: 0.8rem;
}

.pillar-cell .char {
    font-size: 1.2rem;
    font-weight: 700;
}

.pillar-cell .elem {
    font-size: 0.65rem;
    margin-top: 1px;
}

/* ── 사주 테이블 차트 ── */
.saju-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.saju-table th {
    font-size: 0.75rem;
    color: #aaa;
    font-weight: 600;
    padding: 6px 4px;
    text-align: center;
}

.saju-table td {
    text-align: center;
    padding: 4px 2px;
}

.saju-table .row-label {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
    text-align: right;
    padding-right: 8px;
    width: 50px;
}

.saju-table .pillar-td {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 4px;
}

.saju-table .pillar-char {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.saju-table .pillar-elem {
    font-size: 0.65rem;
    display: block;
    margin-top: 2px;
}

.saju-table .sipsung-td {
    font-size: 0.72rem;
    color: #ccc;
    padding: 3px 2px;
}

.saju-table .info-td {
    font-size: 0.72rem;
    color: #aaa;
    padding: 3px 2px;
}

.saju-table .stem-row .pillar-td {
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.saju-table .branch-row .pillar-td {
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.saju-table .sipsung-row:nth-of-type(2) .sipsung-td {
    padding-bottom: 2px;
}

.saju-table .jjg-row td, .saju-table .unsung-row td {
    border-top: 1px solid rgba(255,255,255,0.06);
}

.elem-bar-chart {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.elem-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #bbb;
}

.elem-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── 스테이지 푸터 & 버튼 ── */
.stage-footer {
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.free-question-info {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 14px;
}

.stage-divider {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 auto 14px;
}

.detail-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    margin: 0 auto;
}

.ai-detail-btn {
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    width: 100%;
}

.ai-detail-btn.yearly,
.ai-detail-btn.monthly,
.ai-detail-btn.compat {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.ai-detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(118, 75, 162, 0.4);
}

.ai-detail-btn.used {
    background: rgba(255, 255, 255, 0.06);
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-detail-btn.used:hover {
    transform: none;
    box-shadow: none;
}

.ai-btn-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #777;
}

/* ── 상세보기 확인 버튼 ── */
.confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
}

.confirm-btn:hover {
    transform: translateY(-1px);
}

.confirm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.confirm-btn.yes {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.confirm-btn.no {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
}

.confirm-btn.cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    flex: 0.6;
}

/* ── 궁합 모달 ── */
.compat-modal {
    padding: 16px 0;
    animation: fadeIn 0.3s ease;
}

.compat-inner {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 20px;
}

.compat-inner h3 {
    color: #fc5c7d;
    font-size: 1rem;
    margin-bottom: 4px;
}

.compat-inner p {
    color: #aaa;
    font-size: 0.8rem;
    margin-bottom: 14px;
}

.compat-form .form-group {
    margin-bottom: 10px;
}

.compat-form .form-row {
    display: flex;
    gap: 10px;
}

.compat-form .form-row .form-group {
    flex: 1;
}

.compat-form label {
    display: block;
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 4px;
}

.compat-form input, .compat-form select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #e0e0e0;
    font-size: 0.85rem;
}

.compat-buttons {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.compat-cancel {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    font-size: 0.85rem;
}

.compat-submit {
    flex: 2;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #fc5c7d, #6a82fb);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ── 페이월 ── */
.paywall {
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.paywall-inner {
    text-align: center;
    background: rgba(118, 75, 162, 0.1);
    border: 1px solid rgba(118, 75, 162, 0.25);
    border-radius: 16px;
    padding: 28px 20px;
}

.paywall-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.paywall-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 6px;
}

.paywall-desc {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ── 오행 바 ── */
.element-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
}

.element-bar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
}

.element-bar img:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* ── 채팅 입력 ── */
.chat-input {
    display: flex;
    gap: 10px;
    padding: 12px 0;
}

.chat-input input {
    flex: 1;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input input:focus {
    border-color: #f5af19;
}

.chat-input button {
    padding: 13px 22px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chat-input button:hover {
    opacity: 0.9;
}

.hidden {
    display: none !important;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

/* ── 운세 카드 ── */
.fortune-intro {
    margin-bottom: 8px;
}

.fortune-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.fortune-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}

.fortune-card:hover {
    border-color: rgba(245, 175, 25, 0.3);
}

.fortune-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fortune-icon {
    font-size: 1.1rem;
}

.fortune-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f5af19;
}

.fortune-card-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: #ccc;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── 관리자 버튼 ── */
.admin-btn {
    padding: 6px 12px;
    border: 1px solid rgba(245, 175, 25, 0.4);
    border-radius: 6px;
    background: rgba(245, 175, 25, 0.1);
    color: #f5af19;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-btn:hover {
    background: rgba(245, 175, 25, 0.25);
}

/* ── 푸터 ── */
.footer {
    text-align: center;
    padding: 20px 0 10px;
    font-size: 0.78rem;
    color: #666;
}

.footer a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #f5af19;
}

.footer span {
    margin: 0 8px;
    color: #555;
}

/* ── 알림 팝업 ── */
.notification-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.notification-body {
    position: relative;
    background: linear-gradient(160deg, #1e1040, #1a2444);
    border: 1px solid rgba(245, 175, 25, 0.3);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    z-index: 1;
}

.notification-body h3 {
    color: #f5af19;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.notification-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    text-align: left;
}

.notification-item .notif-title {
    color: #f5af19;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.notification-item .notif-message {
    color: #ccc;
    font-size: 0.84rem;
    line-height: 1.5;
}

.notification-close-btn {
    margin-top: 14px;
    padding: 10px 32px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5af19, #e07b00);
    color: #1a0800;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.notification-close-btn:hover {
    opacity: 0.9;
}

/* ── 이전 대화 배너 ── */
.prev-sessions-banner {
    background: rgba(245, 175, 25, 0.06);
    border: 1px solid rgba(245, 175, 25, 0.2);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.prev-sessions-title {
    color: #f5af19;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.prev-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.prev-session-item:hover {
    background: rgba(245, 175, 25, 0.1);
    border-color: rgba(245, 175, 25, 0.3);
}

.prev-session-info {
    color: #e0e0e0;
    font-size: 0.85rem;
    font-weight: 500;
}

.prev-session-meta {
    color: #888;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-left: 12px;
}

.prev-sessions-dismiss {
    text-align: center;
    margin-top: 8px;
    color: #666;
    font-size: 0.78rem;
    cursor: pointer;
}

.prev-sessions-dismiss:hover {
    color: #aaa;
}

/* ── 토큰 소모 뱃지 ── */
/* ── 차단 배너 ── */
.ban-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #5c1a1a, #3d0f0f);
    border-bottom: 2px solid rgba(231, 76, 60, 0.5);
    animation: banSlideDown 0.3s ease-out;
}

@keyframes banSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.ban-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.ban-text {
    flex: 1;
    color: #f87171;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}

.ban-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.ban-close:hover {
    color: #e0e0e0;
}

.token-cost-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(245, 175, 25, 0.1);
    border: 1px solid rgba(245, 175, 25, 0.2);
    border-radius: 20px;
    font-size: 0.72rem;
    color: #f5af19;
    font-weight: 600;
}

/* ── 상품 메뉴 그리드 ── */
.product-section { margin-bottom: 10px; }
.product-section-title {
    font-size: 0.68rem; color: #888; padding: 4px 0 4px;
    text-transform: uppercase; letter-spacing: 1px;
}
.product-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.product-grid.single { grid-template-columns: 1fr; }
.product-btn {
    display: flex !important; align-items: center; gap: 8px;
    padding: 10px 12px !important; border-radius: 12px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    text-align: left !important; transition: all 0.2s;
    width: 100% !important; justify-content: flex-start !important;
}
.product-btn:hover:not(.used) {
    background: rgba(245,175,25,0.08) !important;
    border-color: rgba(245,175,25,0.3) !important;
}
.product-btn .product-icon { font-size: 1.1rem; flex-shrink: 0; }
.product-btn .product-label {
    flex: 1; font-size: 0.78rem; font-weight: 600; color: #ddd;
}
.product-btn .product-cost {
    font-size: 0.65rem; color: #f5af19; font-weight: 700;
    background: rgba(245,175,25,0.12); padding: 2px 8px;
    border-radius: 10px; flex-shrink: 0;
}
.product-btn.used .product-label { color: #666; }
.product-btn.used .product-cost { color: #4CAF50; background: rgba(76,175,80,0.1); }
.product-grid.single .product-btn {
    background: linear-gradient(135deg, rgba(245,175,25,0.1), rgba(241,39,17,0.06)) !important;
    border-color: rgba(245,175,25,0.25) !important;
}
.product-grid.single .product-btn .product-label { color: #f5af19; }

/* ── 약관 동의 모달 ── */
.terms-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.terms-modal-content {
    background: linear-gradient(160deg, #1a0a2e, #16213e);
    border: 1px solid rgba(245,175,25,0.3); border-radius: 16px;
    padding: 28px 24px; max-width: 400px; width: 90%;
}
.terms-modal-title {
    font-size: 1.2rem; font-weight: 700; color: #f5af19; margin-bottom: 12px;
}
.terms-modal-body {
    font-size: 0.88rem; color: #ccc; line-height: 1.6; margin-bottom: 16px;
}
.terms-check {
    display: flex; align-items: center; gap: 8px; font-size: 0.85rem;
    color: #bbb; margin-bottom: 10px; cursor: pointer;
}
.terms-check a { color: #f5af19; text-decoration: underline; }
.terms-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: #f5af19; }
.terms-modal-buttons { display: flex; gap: 8px; margin-top: 16px; }
.terms-btn {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.terms-btn.agree {
    background: linear-gradient(135deg, #f5af19, #f12711); color: #fff;
}
.terms-btn.decline {
    background: rgba(255,255,255,0.08); color: #888; border: 1px solid rgba(255,255,255,0.15);
}

/* ── 모바일 반응형 (360px 이하) ── */
@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr !important; gap: 4px; }
    .product-btn { padding: 8px 10px !important; }
    .product-btn .product-label { font-size: 0.72rem; }
    .product-btn .product-cost { font-size: 0.6rem; padding: 2px 6px; }
}

.fact-check-badge {
    margin-top: 6px;
    padding: 3px 10px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 16px;
    font-size: 0.68rem;
    color: #4CAF50;
    font-weight: 600;
    display: inline-block;
}

/* ── 프리미엄 5토큰 UI ── */
.premium-container {
    border: 1px solid rgba(245, 175, 25, 0.3);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(245,175,25,0.06) 0%, rgba(10,10,26,1) 100%);
    overflow: hidden;
    margin: 8px 0 12px;
}
.premium-header {
    background: linear-gradient(135deg, rgba(245,175,25,0.15), rgba(241,39,17,0.08));
    padding: 14px 18px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(245,175,25,0.15);
}
.premium-header .p-icon { font-size: 1.3rem; }
.premium-header .p-title { font-weight: 700; color: #f5af19; font-size: 0.92rem; }
.premium-header .p-sub { color: #999; font-size: 0.72rem; }
.p-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0 18px; }
.p-section-title { font-size: 0.73rem; color: #999; padding: 12px 18px 6px; }

/* 미니 사주 차트 */
.p-mini-chart { display: flex; justify-content: center; gap: 6px; padding: 14px 10px 8px; }
.p-mini-pillar { text-align: center; width: 56px; }
.p-mini-pillar .label { font-size: 0.62rem; color: #888; margin-bottom: 3px; }
.p-mini-pillar .stem {
    background: rgba(245,175,25,0.12); border: 1px solid rgba(245,175,25,0.25);
    border-radius: 7px 7px 0 0; padding: 7px 3px; font-size: 0.9rem; font-weight: 700;
}
.p-mini-pillar .branch {
    background: rgba(33,150,243,0.1); border: 1px solid rgba(33,150,243,0.2);
    border-radius: 0 0 7px 7px; padding: 7px 3px; font-size: 0.9rem; font-weight: 700;
    border-top: none;
}
.p-mini-pillar .elem { font-size: 0.58rem; color: #999; margin-top: 2px; }

/* 오행 바 */
.p-elem-chart { padding: 10px 18px 14px; }
.p-elem-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.p-elem-label { width: 22px; font-size: 0.78rem; text-align: center; font-weight: 600; }
.p-elem-bar-bg { flex: 1; height: 12px; background: rgba(255,255,255,0.05); border-radius: 6px; overflow: hidden; }
.p-elem-bar { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-right: 5px; font-size: 0.58rem; color: rgba(255,255,255,0.8); }
.p-elem-bar.wood { background: linear-gradient(90deg, #2d7d32, #4CAF50); }
.p-elem-bar.fire { background: linear-gradient(90deg, #c62828, #e74c3c); }
.p-elem-bar.earth { background: linear-gradient(90deg, #e6a800, #FFC107); }
.p-elem-bar.metal { background: linear-gradient(90deg, #999, #ccc); }
.p-elem-bar.water { background: linear-gradient(90deg, #1565C0, #2196F3); }

/* 신살 배지 */
.p-sinsal-badges { padding: 0 18px 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.p-sinsal-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px; padding: 3px 10px; font-size: 0.72rem;
}
.p-sinsal-dot { width: 5px; height: 5px; border-radius: 50%; }
.p-sinsal-dot.good { background: #4CAF50; }
.p-sinsal-dot.warn { background: #FFC107; }
.p-sinsal-dot.danger { background: #e74c3c; }

/* 합충형파 */
.p-interactions { padding: 0 18px 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.p-interaction-item {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.04); border-radius: 8px; padding: 5px 10px; font-size: 0.75rem;
}
.p-type-chung { color: #e74c3c; font-weight: 700; }
.p-type-hap { color: #4CAF50; font-weight: 700; }
.p-type-hyung { color: #FFC107; font-weight: 700; }
.p-type-pa { color: #FF9800; font-weight: 700; }
.p-type-hae { color: #9C27B0; font-weight: 700; }

/* 주제별 카드 */
.p-topic-card {
    margin: 0 10px 8px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; overflow: hidden;
}
.p-topic-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.p-topic-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.p-topic-icon.general { background: rgba(245,175,25,0.15); }
.p-topic-icon.money { background: rgba(76,175,80,0.15); }
.p-topic-icon.love { background: rgba(233,30,99,0.15); }
.p-topic-icon.health { background: rgba(33,150,243,0.15); }
.p-topic-icon.people { background: rgba(156,39,176,0.15); }
.p-topic-icon.advice { background: rgba(255,152,0,0.15); }
.p-topic-icon.career { background: rgba(0,188,212,0.15); }
.p-topic-title { font-weight: 600; font-size: 0.85rem; flex: 1; }
.p-topic-body { padding: 10px 14px 14px; font-size: 0.82rem; line-height: 1.7; color: #ccc; }

/* 대운 타임라인 */
.p-daeun-section { padding: 10px 14px 16px; }
.p-daeun-timeline { display: flex; overflow-x: auto; gap: 0; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.p-daeun-timeline::-webkit-scrollbar { height: 2px; }
.p-daeun-timeline::-webkit-scrollbar-thumb { background: rgba(245,175,25,0.3); border-radius: 2px; }
.p-daeun-item { flex-shrink: 0; text-align: center; width: 54px; position: relative; }
.p-daeun-item .age { font-size: 0.62rem; color: #888; margin-bottom: 3px; }
.p-daeun-item .pillar-text {
    font-size: 0.78rem; font-weight: 600; padding: 5px 3px; border-radius: 7px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.p-daeun-item.current .pillar-text {
    background: rgba(245,175,25,0.15); border-color: rgba(245,175,25,0.4); color: #f5af19;
}
.p-daeun-item .elem-text { font-size: 0.58rem; color: #777; margin-top: 2px; }
.p-daeun-badge { font-size: 0.52rem; color: #f5af19; margin-top: 1px; }

/* ── 반응형 ── */
@media (max-width: 500px) {
    .banner-img {
        max-height: 120px;
    }

    .welcome-char {
        width: 70px;
        height: 70px;
    }

    .welcome-text h2 {
        font-size: 1.1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .zodiac-strip img {
        width: 42px;
        height: 42px;
    }

    .pillar-cell {
        width: 48px;
        height: 46px;
    }

    .pillar-cell .char {
        font-size: 1rem;
    }

    .pillars-row {
        gap: 5px;
    }

    .msg-body {
        max-width: 90%;
    }
}
