:root {
    --color-text: var(--color-text-primary);
}

/* 로고 링크 스타일 */
.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-link:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.logo-svg {
    width: 2.5rem;
    height: 2.5rem;
    animation: rotateStar 20s linear infinite;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

@keyframes rotateStar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0;
}

/* 일관된 입력 필드 스타일 */
.styled-input,
.styled-select {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.styled-input:hover,
.styled-select:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15)) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
}

.styled-input:focus,
.styled-select:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
}

/* Ensure custom selects (time / language / others) render consistently */
.styled-select,
.language-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* explicit glassmorphism background so native white does not bleed through */
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px 18px !important;
    color: var(--color-text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-right: 2.8rem !important;
    padding-left: 0.9rem !important;
    backdrop-filter: blur(8px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
    cursor: pointer !important;
}

/* hide default IE/Edge dropdown arrow */
select::-ms-expand {
    display: none;
}

/* options fallback (not all browsers honor styling for <option>) */
select option {
    color: var(--color-text-primary) !important;
    background: rgba(20, 20, 30, 0.95) !important;
}

/* 날짜/시간 입력 필드 특별 스타일 */
input[type="date"],
input[type="time"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)) !important;
    /* prefer explicit primary text color for visibility on dark backgrounds */
    color: var(--color-text, var(--color-text-primary)) !important;
    border: 1px solid var(--color-border) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-family: 'Noto Sans KR', sans-serif !important;
    cursor: pointer !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.7);
    font-size: 1.2rem;
}

/* 입력 힌트 (예: YYYY년 MM월 DD일, HH:MM) */
.input-hint {
    font-size: 0.85rem;
    /* use the theme's secondary text color so the hint is visible on dark backgrounds */
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.75));
    margin-top: 0.4rem;
    margin-left: 0.25rem;
    font-weight: 500;
}

/* Zodiac 카드 배경 복원 및 스타일 통일 */
.zodiac-card {
    /* increase opacity a bit so cards feel more solid */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 18px rgba(8, 8, 20, 0.15);
    cursor: pointer;
}

.zodiac-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.12);
    cursor: pointer;
}

.zodiac-card:focus {
    outline: none;
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.08);
    transform: translateY(-6px);
}

.zodiac-card.selected {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.12);
    transform: translateY(-6px);
}

.zodiac-icon {
    font-size: 2.1rem;
    margin-bottom: 0.6rem;
}

.zodiac-card h3 {
    margin: 0.25rem 0 0.4rem 0;
}

.zodiac-card p.zodiac-date {
    margin: 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

/* 언어 선택 메뉴 스타일 - 커스텀 드롭다운 */
.language-switcher {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    display: inline-block;
    z-index: 100;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)) !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--color-border) !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 25px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(8px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
}

.language-toggle:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2)) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
    transform: translateY(-1px);
}

.language-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12) !important;
}

.language-toggle .language-flag {
    font-size: 1.2rem;
    line-height: 1;
}

.language-toggle .language-name {
    line-height: 1;
}

/* 언어 드롭다운 메뉴 */
.language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: rgba(10, 10, 15, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(8, 8, 20, 0.35);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.language-menu[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.language-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: var(--color-text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.4rem;
    text-align: left;
}

.language-option:last-child {
    margin-bottom: 0;
}

.language-option:hover,
.language-option:focus {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.08));
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.language-option.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.1));
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.language-option .language-flag {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.language-option .language-name {
    line-height: 1;
    flex: 1;
}

/* 기록 삭제 버튼 스타일 */
.btn-secondary {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1)) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 25px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2)) !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2) !important;
}

.btn-secondary.small {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
}

/* 별자리 그리드 4열 */
.zodiac-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--spacing-md) !important;
    margin-bottom: var(--spacing-xl) !important;
}

@media (max-width: 1024px) {
    .zodiac-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .zodiac-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .zodiac-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* 홈 페이지 상단 일일 격언 위젯 */
#home-quote {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.06), rgba(236, 72, 153, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.08);
    color: var(--color-text);
    font-size: 0.98rem;
}

#home-quote .quote {
    margin: 0 0 0.5rem 0;
    font-style: italic;
}

#home-quote .quote-source {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.55);
}

/* visually hidden for accessibility labels */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* styled-select focus / invalid states */
.styled-select {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(236, 72, 153, 0.04)) !important;
    color: var(--color-text, var(--color-text-primary)) !important;
    border: 1px solid var(--color-border) !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.18s ease !important;
}

.styled-select:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08) !important;
}

/* browser treats empty select as invalid when required; style it */
select:invalid,
.styled-select.invalid {
    border-color: #e04848 !important;
    box-shadow: 0 2px 8px rgba(224, 72, 72, 0.12) !important;
}

/* saved preference indicator */
.styled-select.saved {
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.08) !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
}

/* Custom hour dropdown (toggle + large button menu) */
.custom-hour-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-hour-dropdown .dropdown-toggle {
    width: 100%;
    text-align: left;
}

.hour-button-menu {
    position: absolute;
    z-index: 120;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    /* make menu more opaque to block background bleed-through */
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.6rem;
    box-shadow: 0 10px 30px rgba(8, 8, 20, 0.35);
    backdrop-filter: blur(12px) saturate(130%);
    max-height: 240px;
    overflow: auto;
    transform-origin: top center;
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0;
    pointer-events: none;
}

.hour-button-menu[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hour-button-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
}

/* hide scrollbar but keep scroll capability (WebKit & Firefox fallbacks) */
.hour-button-menu::-webkit-scrollbar {
    width: 8px;
}

.hour-button-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.hour-button-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* force overlay behavior on opened menus to cover underlying content */
.hour-button-menu[aria-hidden="false"] {
    position: absolute;
    z-index: 9999;
    background: rgba(10, 10, 15, 0.98);
}

.hour-btn {
    min-width: 64px;
    padding: 0.85rem 0.85rem;
    /* larger buttons */
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hour-btn:hover,
.hour-btn:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.08);
}

.hour-btn.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.08));
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.12);
}

/* when dropdown is open visually hide the main submit button but preserve layout height */
.saju-form.dropdown-open .btn-primary {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    /* preserve space but avoid reflow issues by keeping display */
    height: 0.01px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* hide the hidden native input visually but keep it accessible to JS */
input[type="hidden"]#birth-time {
    display: none !important;
}

/* language select: emphasize pill rounding */
.language-switcher select {
    border-radius: 999px !important;
}

/* Custom date picker styles */
.custom-date-picker {
    position: relative;
    width: 100%;
}

.custom-date-picker .date-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.custom-date-picker .date-display .styled-select {
    flex: 1;
    min-height: 44px;
}

.custom-date-picker input#birth-date {
    flex: 1.2;
    text-align: center;
    /* 토글 버튼과 동일한 높이로 맞춤 */
    min-height: 44px !important;
    height: 44px !important;
    padding: 0.6rem 1.2rem !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.5 !important;
}

.date-menu {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 0.6rem;
    /* make date menu opaquer and overlay other content */
    background: rgba(10, 10, 15, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.6rem;
    z-index: 9998;
    box-shadow: 0 14px 36px rgba(8, 8, 20, 0.45);
    max-height: 300px;
    overflow: auto;
    opacity: 0;
    pointer-events: none;

    /* hide webkit scrollbars for hour and date menus */
    .hour-button-menu::-webkit-scrollbar,
    .date-menu::-webkit-scrollbar {
        display: none;
    }

    transition: opacity .15s ease;
}

.date-menu[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

/* scrollbar tweaks for date menus */
.date-menu::-webkit-scrollbar {
    width: 8px;
}

.date-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.date-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
    scroll-behavior: smooth;
}

.date-grid {
    display: grid;
    gap: 0.5rem;
}

.date-grid .date-btn {
    min-width: 56px;
    padding: 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--color-text-primary);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.date-grid .date-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.08);
}

.date-grid .date-btn.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.08));
    border-color: rgba(139, 92, 246, 0.5);
}

/* grid layouts */
#year-grid.date-grid {
    grid-template-columns: repeat(6, 1fr);
}

#month-grid.date-grid {
    grid-template-columns: repeat(6, 1fr);
}

#day-grid.date-grid {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 600px) {

    #year-grid.date-grid,
    #month-grid.date-grid,
    #day-grid.date-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* show one additional visible row in year menu to visually match hour menu height */
#year-menu {
    /* allow more rows to be visible before scrolling */
    max-height: 360px;
}

/* Cross-browser: hide scrollbars but keep scrolling enabled for hour and date menus */
.hour-button-menu::-webkit-scrollbar,
.date-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.hour-button-menu,
.date-menu {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 사주팔자 기둥을 가로(행) 방향으로 표시 */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md, 1.5rem);
    margin-bottom: var(--spacing-lg, 2rem);
}

/* 각 기둥을 세로 방향으로 쌓기 - 박스 스타일 적용 */
.pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(8, 8, 20, 0.2);
    backdrop-filter: blur(10px);
}

.pillar:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

/* 기둥 라벨 스타일 강화 */
.pillar-label {
    font-size: 0.95rem !important;
    color: var(--color-text-secondary) !important;
    margin-bottom: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    opacity: 0.9 !important;
}

/* 기둥 값(천간/지지) 스타일 강화 */
.pillar-value {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: var(--color-secondary) !important;
    margin: 0.3rem 0 !important;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}

/* 반응형: 모바일에서는 2열로 */
@media (max-width: 768px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 작은 모바일에서는 1열로 */
@media (max-width: 480px) {
    .pillars-grid {
        grid-template-columns: 1fr;
    }
}

/* 사주 분석하기 버튼 호버 시 커서 포인터 */
.btn-primary {
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    cursor: pointer !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4) !important;
}

/* 공유하기 버튼 스타일 개선 - 가로 정렬 및 세련된 디자인 */
/* 매우 구체적인 셀렉터로 우선순위 최상위 */
.result-card .action-buttons,
.action-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 1rem !important;
    margin-top: 1.5rem !important;
}

/* 최고 우선순위: 모든 공유 버튼을 가로 배치 */
button.btn-share,
.btn-share,
[data-type="saju"].btn-share,
[data-type="zodiac"].btn-share,
[data-type="combined"].btn-share,
.action-buttons .btn-share,
.result-card button.btn-share {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    text-align: center !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(236, 72, 153, 0.9)) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 25px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    white-space: nowrap !important;
    /* 이모지와 텍스트를 한 줄로 강제 */
    line-height: 1.5 !important;
    vertical-align: middle !important;
}

/* 버튼 내부의 모든 요소를 inline으로 강제 - 이모지 포함 */
button.btn-share::before,
.btn-share::before {
    content: none !important;
}

button.btn-share *,
.btn-share *,
.btn-share span,
.btn-share::first-line {
    display: inline !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* 이모지를 인라인으로 강제 */
.btn-share {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-writing-mode: horizontal-tb !important;
    writing-mode: horizontal-tb !important;
}

.btn-share:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5) !important;
    background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(236, 72, 153, 1)) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-share:active {
    transform: translateY(-1px) scale(0.98) !important;
}

/* 12띠 그리드 4열 */
.ddi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--spacing-md) !important;
    margin-bottom: var(--spacing-xl) !important;
}

.ddi-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 18px rgba(8, 8, 20, 0.15);
    cursor: pointer;
}

.ddi-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.12);
    cursor: pointer;
}

.ddi-card:focus {
    outline: none;
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.08);
    transform: translateY(-6px);
}

.ddi-card.selected {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.12);
    transform: translateY(-6px);
}

.ddi-icon {
    font-size: 2.5rem;
    margin-bottom: 0.6rem;
}

.ddi-card h3 {
    margin: 0.25rem 0 0.4rem 0;
    font-size: 1.1rem;
}

.ddi-card .ddi-years {
    margin: 0;
    opacity: 0.8;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 띠 운세 결과 헤더 */
.ddi-result-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border-radius: 14px;
}

.ddi-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.ddi-result-name {
    font-size: 1.8rem;
    margin: 0.5rem 0;
    color: var(--color-secondary);
}

.ddi-result-element {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0.3rem 0;
}

.ddi-result-personality {
    font-size: 1rem;
    opacity: 0.95;
    margin: 1rem 0 0 0;
    line-height: 1.6;
}

/* 오늘의 운세 - 선택 섹션 */
.selector-section {
    margin-bottom: 2.5rem;
}

.selector-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
    text-align: center;
}

.icon-selector {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.selector-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    backdrop-filter: blur(10px);
}

.selector-btn:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.selector-btn.selected {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-color: var(--color-secondary);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

.selector-icon {
    font-size: 2rem;
}

.selector-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.selector-btn.selected .selector-label {
    color: white;
}

/* 오늘의 운세 결과 */
.today-fortune-result {
    margin-top: 3rem;
    animation: fadeIn 0.5s ease;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
    font-weight: 700;
}

.result-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.today-date {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.today-fortune-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 오늘의 운세 카드 */
.fortune-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.fortune-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
    border-color: var(--color-primary);
}

.fortune-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fortune-icon {
    font-size: 2rem;
}

.fortune-card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--color-secondary);
}

.fortune-rating {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.2rem;
}

.fortune-message {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
    margin: 0;
}

/* 행운 뽑기 컨테이너 */
.lucky-draw-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.lucky-draw-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.lucky-draw-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.lucky-draw-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.lucky-draw-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-lucky-draw {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-lucky-draw:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
}

.btn-lucky-draw:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-lucky-draw:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.lucky-draw-count {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

.lucky-draw-count span {
    font-weight: 700;
    color: var(--color-primary);
}

/* 행운 뽑기 결과 */
.lucky-result {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(12px);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lucky-result-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.lucky-result-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
    font-weight: 700;
}

.lucky-result-message {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* 반응형: 언어 선택 버튼 모바일 위치 조정 */
@media (max-width: 768px) {
    .language-switcher {
        position: static;
        transform: none;
        margin-top: 1rem;
        display: block;
        text-align: center;
    }

    .ddi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .fortune-card {
        padding: 1.2rem;
    }

    .lucky-draw-card {
        padding: 2rem;
    }

    /* 오늘의 운세 선택 - 태블릿 */
    .icon-selector {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.6rem;
    }

    .selector-icon {
        font-size: 1.5rem;
    }

    .selector-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .ddi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .fortune-card-header h3 {
        font-size: 1.1rem;
    }

    .fortune-message {
        font-size: 0.95rem;
    }

    .lucky-draw-icon {
        font-size: 3rem;
    }

    .lucky-draw-title {
        font-size: 1.5rem;
    }

    .btn-lucky-draw {
        font-size: 1.1rem;
        padding: 0.9rem 2rem;
    }

    .lucky-result-icon {
        font-size: 4rem;
    }

    .lucky-result-title {
        font-size: 1.5rem;
    }

    /* 오늘의 운세 선택 - 모바일 */
    .icon-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .selector-btn {
        padding: 0.6rem 0.3rem;
    }

    .selector-icon {
        font-size: 1.3rem;
    }

    .selector-label {
        font-size: 0.7rem;
    }

    .result-title {
        font-size: 1.4rem;
    }

    .today-fortune-container {
        grid-template-columns: 1fr;
    }
}