/* ========================================
   Thisgun Saju - 사주팔자 운세 스타일
   Version 2.0.0
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700;900&display=swap');

#nalkkul-saju-app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Noto Serif KR', serif;
    color: #e0d5c1;
}

/* Section base */
.saju-section {
    background: #1a1a2e;
    border: 2px solid #DAA520;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.saju-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(218,165,32,0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(139,0,0,0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Header */
.saju-header {
    text-align: center;
    margin-bottom: 30px;
}

.saju-header h2 {
    font-size: 2.5em;
    color: #DAA520;
    margin: 0 0 5px;
    text-shadow: 0 0 20px rgba(218,165,32,0.3);
    letter-spacing: 0.3em;
}

.saju-header h3 {
    font-size: 1.4em;
    color: #e0d5c1;
    margin: 0 0 10px;
    font-weight: 400;
}

.saju-subtitle {
    color: #a09880;
    font-size: 0.95em;
    margin: 0;
}

/* Form */
.saju-form {
    max-width: 500px;
    margin: 0 auto;
}

.saju-form-group {
    margin-bottom: 20px;
}

.saju-form-group label {
    display: block;
    color: #DAA520;
    font-size: 0.95em;
    margin-bottom: 8px;
    font-weight: 700;
}

.saju-form-group input[type="text"],
.saju-form-group select {
    width: 100%;
    padding: 12px 15px;
    background: #16213e;
    border: 1px solid #DAA520;
    border-radius: 8px;
    color: #e0d5c1;
    font-size: 1em;
    font-family: 'Noto Serif KR', serif;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.saju-form-group input[type="text"]:focus,
.saju-form-group select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(218,165,32,0.3);
}

.saju-date-selectors {
    display: flex;
    gap: 10px;
}

.saju-date-selectors select {
    flex: 1;
}

/* Gender */
.saju-gender-group {
    display: flex;
    gap: 20px;
}

.saju-radio-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    background: #16213e;
    border: 1px solid #DAA520;
    border-radius: 8px;
    flex: 1;
    justify-content: center;
    transition: all 0.3s;
    color: #e0d5c1 !important;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
}

.saju-radio-label:has(input:checked) {
    background: rgba(139,0,0,0.4);
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(218,165,32,0.3);
}

.saju-radio-label input[type="radio"] {
    accent-color: #DAA520;
}

/* Submit Button */
.saju-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    border: 2px solid #DAA520;
    border-radius: 8px;
    font-size: 1.2em;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

.saju-submit-btn:hover {
    background: linear-gradient(135deg, #a00000, #700000);
    box-shadow: 0 0 20px rgba(139,0,0,0.5);
    transform: translateY(-2px);
}

.saju-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.saju-loading {
    text-align: center;
    padding: 40px;
}

.saju-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(218,165,32,0.2);
    border-top: 4px solid #DAA520;
    border-radius: 50%;
    animation: sajuSpin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes sajuSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.saju-loading p {
    color: #DAA520;
    font-size: 1.1em;
}

/* ========================================
   Tab Toggle
   ======================================== */

.saju-tab-container {
    display: flex;
    margin-bottom: 20px;
    border: 1px solid #DAA520;
    border-radius: 8px;
    overflow: hidden;
}

.saju-tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: #16213e;
    color: #a09880;
    border: none;
    font-size: 1.05em;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.saju-tab-btn:first-child {
    border-right: 1px solid #DAA520;
}

.saju-tab-btn.active {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
}

.saju-tab-btn:hover:not(.active) {
    background: #1e2d50;
    color: #DAA520;
}

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

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

/* ========================================
   Accordion
   ======================================== */

.saju-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    user-select: none;
}

.saju-accordion-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    flex: 1;
}

.saju-accordion-icon {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    margin-left: 10px;
}

.saju-accordion-icon::before,
.saju-accordion-icon::after {
    content: '';
    position: absolute;
    background: #DAA520;
    transition: transform 0.3s;
}

.saju-accordion-icon::before {
    width: 14px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.saju-accordion-icon::after {
    width: 2px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.saju-accordion-header.open .saju-accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.saju-accordion-body {
    display: none;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(218,165,32,0.2);
}

.saju-accordion-body.open {
    display: block;
}

/* ========================================
   Result Styles
   ======================================== */

/* Result Header */
.saju-result-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(218,165,32,0.3);
}

.saju-result-header h2 {
    font-size: 2em;
    color: #DAA520;
    margin: 0 0 5px;
}

.saju-result-header .saju-user-info {
    color: #a09880;
    font-size: 0.95em;
}

/* Four Pillars Table */
.saju-pillars-container {
    margin: 25px 0;
}

.saju-pillars-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
    table-layout: fixed;
}

.saju-pillars-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    font-size: 1.1em;
    letter-spacing: 0.1em;
    border: 1px solid #DAA520;
}

.saju-pillar-cell {
    background: #16213e;
    border: 1px solid #DAA520;
    padding: 15px 10px;
    text-align: center;
    vertical-align: middle;
}

.saju-stem-cell {
    border-radius: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.saju-branch-cell {
    border-radius: 0 0 8px 8px;
    font-size: 1.8em;
    font-weight: 700;
}

.saju-char-hanja {
    display: block;
    font-size: 1em;
}

.saju-char-hangul {
    display: block;
    font-size: 0.5em;
    color: #a09880;
    margin-top: 4px;
}

.saju-element-label {
    display: inline-block;
    font-size: 0.35em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: 400;
}

/* Element colors */
.elem-wood { color: #4CAF50; }
.elem-fire { color: #f44336; }
.elem-earth { color: #FFC107; }
.elem-metal { color: #e0e0e0; }
.elem-water { color: #2196F3; }

.elem-bg-wood { background: rgba(76,175,80,0.2); color: #4CAF50; }
.elem-bg-fire { background: rgba(244,67,54,0.2); color: #f44336; }
.elem-bg-earth { background: rgba(255,193,7,0.2); color: #FFC107; }
.elem-bg-metal { background: rgba(224,224,224,0.2); color: #e0e0e0; }
.elem-bg-water { background: rgba(33,150,243,0.2); color: #2196F3; }

/* Result Section Cards */
.saju-result-card {
    background: rgba(22,33,62,0.6);
    border: 1px solid rgba(218,165,32,0.3);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.saju-result-card h3 {
    color: #DAA520;
    font-size: 1.3em;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(218,165,32,0.2);
}

.saju-result-card p {
    line-height: 1.8;
    margin: 10px 0;
    color: #d4c9b5;
}

/* Five Elements Chart */
.saju-elements-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 180px;
    padding: 20px 0;
    margin: 15px 0;
    border-bottom: 2px solid rgba(218,165,32,0.3);
}

.saju-element-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.saju-element-bar {
    width: 40px;
    border-radius: 6px 6px 0 0;
    min-height: 5px;
    transition: height 1s ease;
    position: relative;
}

.saju-element-bar.wood { background: linear-gradient(to top, #2E7D32, #4CAF50); }
.saju-element-bar.fire { background: linear-gradient(to top, #C62828, #f44336); }
.saju-element-bar.earth { background: linear-gradient(to top, #F57F17, #FFC107); }
.saju-element-bar.metal { background: linear-gradient(to top, #9E9E9E, #E0E0E0); }
.saju-element-bar.water { background: linear-gradient(to top, #1565C0, #2196F3); }

.saju-element-count {
    font-size: 0.9em;
    color: #e0d5c1;
    margin-bottom: 5px;
    font-weight: 700;
}

.saju-element-name {
    margin-top: 8px;
    font-size: 0.95em;
    color: #a09880;
}

/* Element circles row */
.saju-elements-circles {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.saju-element-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    border: 2px solid rgba(255,255,255,0.2);
}

.saju-element-circle.wood { background: radial-gradient(circle, #4CAF50, #2E7D32); color: #fff; }
.saju-element-circle.fire { background: radial-gradient(circle, #f44336, #B71C1C); color: #fff; }
.saju-element-circle.earth { background: radial-gradient(circle, #FFC107, #F57F17); color: #333; }
.saju-element-circle.metal { background: radial-gradient(circle, #E0E0E0, #9E9E9E); color: #333; }
.saju-element-circle.water { background: radial-gradient(circle, #2196F3, #0D47A1); color: #fff; }

.saju-element-circle span {
    display: block;
    font-size: 0.8em;
    opacity: 0.8;
}

/* Small element circles (for yongsin) */
.saju-element-circle-sm {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8em;
    vertical-align: middle;
    margin-right: 5px;
}

.saju-element-circle-sm.wood { background: radial-gradient(circle, #4CAF50, #2E7D32); color: #fff; }
.saju-element-circle-sm.fire { background: radial-gradient(circle, #f44336, #B71C1C); color: #fff; }
.saju-element-circle-sm.earth { background: radial-gradient(circle, #FFC107, #F57F17); color: #333; }
.saju-element-circle-sm.metal { background: radial-gradient(circle, #E0E0E0, #9E9E9E); color: #333; }
.saju-element-circle-sm.water { background: radial-gradient(circle, #2196F3, #0D47A1); color: #fff; }

/* ========================================
   Ten Gods Table
   ======================================== */

.saju-tengod-table-container {
    overflow-x: auto;
    margin: 10px 0;
}

.saju-tengod-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.saju-tengod-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 10px 8px;
    font-size: 0.95em;
    border: 1px solid rgba(218,165,32,0.4);
}

.saju-tengod-label-cell {
    background: rgba(218,165,32,0.1) !important;
    color: #DAA520;
    font-size: 0.85em;
    font-weight: 700;
    padding: 8px !important;
    text-align: center;
    width: 80px;
    border: 1px solid rgba(218,165,32,0.2);
}

.saju-tengod-cell {
    background: #16213e;
    text-align: center;
    padding: 10px 5px;
    border: 1px solid rgba(218,165,32,0.2);
    font-size: 0.95em;
}

.saju-tengod-char {
    font-size: 1.4em;
    font-weight: 700;
}

.saju-tengod-interpretations {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(218,165,32,0.2);
}

/* ========================================
   Hidden Stems Table
   ======================================== */

.saju-hidden-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.saju-hidden-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 10px 8px;
    font-size: 0.9em;
    border: 1px solid rgba(218,165,32,0.4);
    text-align: center;
}

.saju-hidden-table td {
    background: #16213e;
    padding: 8px 10px;
    border: 1px solid rgba(218,165,32,0.2);
    text-align: center;
    font-size: 0.9em;
}

.saju-hidden-pillar-name {
    background: rgba(218,165,32,0.1) !important;
    color: #DAA520;
    font-weight: 700;
}

.saju-hidden-branch {
    font-size: 1.1em !important;
    font-weight: 700;
}

/* ========================================
   대운 (Major Luck) Timeline
   ======================================== */

.saju-daeun-timeline {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 15px 0;
    margin: 15px 0;
    scrollbar-width: thin;
    scrollbar-color: #DAA520 #16213e;
}

.saju-daeun-timeline::-webkit-scrollbar {
    height: 6px;
}
.saju-daeun-timeline::-webkit-scrollbar-track {
    background: #16213e;
}
.saju-daeun-timeline::-webkit-scrollbar-thumb {
    background: #DAA520;
    border-radius: 3px;
}

.saju-daeun-period {
    flex: 0 0 auto;
    width: 75px;
    text-align: center;
    padding: 10px 5px;
    border: 1px solid rgba(218,165,32,0.2);
    border-radius: 8px;
    margin: 0 3px;
    background: #16213e;
    transition: all 0.3s;
    position: relative;
}

.saju-daeun-period.current {
    background: linear-gradient(135deg, rgba(218,165,32,0.3), rgba(139,0,0,0.3));
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(218,165,32,0.4);
    transform: scale(1.05);
}

.saju-daeun-period.past {
    opacity: 0.5;
}

.saju-daeun-age {
    font-size: 0.75em;
    color: #a09880;
    margin-bottom: 3px;
}

.saju-daeun-year {
    font-size: 0.65em;
    color: #777;
    margin-bottom: 6px;
}

.saju-daeun-chars {
    font-size: 1.3em;
    font-weight: 700;
    line-height: 1.3;
}

.saju-daeun-chars span {
    display: block;
}

.saju-daeun-hangul {
    font-size: 0.7em;
    color: #a09880;
    margin-top: 3px;
}

.saju-daeun-tengod {
    font-size: 0.75em;
    font-weight: 700;
    margin-top: 4px;
}

.saju-daeun-current-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #DAA520;
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65em;
    font-weight: 700;
    white-space: nowrap;
}

.saju-daeun-detail {
    margin-top: 20px;
    padding: 15px;
    background: rgba(218,165,32,0.05);
    border: 1px solid rgba(218,165,32,0.2);
    border-radius: 8px;
}

.saju-daeun-detail h4 {
    margin: 0 0 10px;
}

/* ========================================
   Twelve Stages Table
   ======================================== */

.saju-twelve-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.saju-twelve-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 10px 8px;
    font-size: 0.9em;
    border: 1px solid rgba(218,165,32,0.4);
    text-align: center;
}

.saju-twelve-table td {
    background: #16213e;
    padding: 10px;
    border: 1px solid rgba(218,165,32,0.2);
    text-align: center;
}

.saju-twelve-label {
    background: rgba(218,165,32,0.1) !important;
    color: #DAA520;
    font-weight: 700;
    font-size: 0.85em;
}

.saju-stage-strong {
    color: #4CAF50 !important;
}

.saju-stage-weak {
    color: #FF9800 !important;
}

.saju-stage-dormant {
    color: #9E9E9E !important;
}

/* ========================================
   Nayin Table
   ======================================== */

.saju-nayin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.saju-nayin-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 10px 8px;
    font-size: 0.9em;
    border: 1px solid rgba(218,165,32,0.4);
    text-align: center;
}

.saju-nayin-table td {
    background: #16213e;
    padding: 10px;
    border: 1px solid rgba(218,165,32,0.2);
    text-align: center;
    font-size: 0.95em;
}

/* ========================================
   공망 (Gongmang) Display
   ======================================== */

.saju-gongmang-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.saju-gongmang-branch {
    text-align: center;
}

.saju-gongmang-char {
    display: flex;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 700;
    background: rgba(139,0,0,0.3);
    border: 2px dashed rgba(218,165,32,0.5);
    margin: 0 auto 8px;
}

.saju-gongmang-name {
    font-size: 0.9em;
    color: #a09880;
}

/* ========================================
   용신 (Yongsin) Analysis
   ======================================== */

.saju-yongsin-summary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.saju-yongsin-item {
    flex: 1;
    min-width: 150px;
    background: rgba(22,33,62,0.8);
    border: 1px solid rgba(218,165,32,0.3);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.saju-yongsin-label {
    font-size: 0.85em;
    color: #a09880;
    margin-bottom: 8px;
}

.saju-yongsin-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #DAA520;
}

.saju-yongsin-guide {
    width: 100%;
    border-collapse: collapse;
}

.saju-yongsin-guide td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(218,165,32,0.1);
}

.saju-yongsin-guide td:first-child {
    color: #a09880;
    width: 120px;
}

/* ========================================
   Action buttons
   ======================================== */

.saju-result-actions {
    text-align: center;
    margin-top: 20px;
}

.saju-action-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    border: 2px solid #DAA520;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.saju-action-btn:hover {
    background: linear-gradient(135deg, #a00000, #700000);
    box-shadow: 0 0 15px rgba(139,0,0,0.4);
}

/* ========================================
   History
   ======================================== */

.saju-history-title {
    color: #DAA520;
    font-size: 1.3em;
    margin: 0 0 20px;
    text-align: center;
}

.saju-history-empty {
    text-align: center;
    color: #666;
    padding: 20px;
}

.saju-history-item {
    background: rgba(22,33,62,0.5);
    border: 1px solid rgba(218,165,32,0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.saju-history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.saju-history-summary:hover {
    background: rgba(218,165,32,0.05);
}

.saju-history-info {
    flex: 1;
}

.saju-history-info strong {
    color: #DAA520;
    margin-right: 10px;
}

.saju-history-info span {
    color: #a09880;
    font-size: 0.9em;
}

.saju-history-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.saju-history-toggle {
    background: none;
    border: 1px solid rgba(218,165,32,0.3);
    color: #DAA520;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: 'Noto Serif KR', serif;
}

.saju-history-delete {
    background: none;
    border: 1px solid rgba(139,0,0,0.5);
    color: #8B0000;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: 'Noto Serif KR', serif;
}

.saju-history-toggle:hover {
    background: rgba(218,165,32,0.1);
}

.saju-history-delete:hover {
    background: rgba(139,0,0,0.2);
}

.saju-history-detail {
    display: none;
    padding: 15px;
    border-top: 1px solid rgba(218,165,32,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.saju-history-detail.open {
    display: block;
}

/* Scrollbar */
.saju-history-detail::-webkit-scrollbar {
    width: 6px;
}
.saju-history-detail::-webkit-scrollbar-track {
    background: #16213e;
}
.saju-history-detail::-webkit-scrollbar-thumb {
    background: #DAA520;
    border-radius: 3px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 600px) {
    #nalkkul-saju-app {
        padding: 10px;
    }

    .saju-section {
        padding: 20px 15px;
    }

    .saju-header h2 {
        font-size: 1.8em;
    }

    .saju-header h3 {
        font-size: 1.1em;
    }

    .saju-date-selectors {
        flex-direction: column;
        gap: 8px;
    }

    .saju-gender-group {
        flex-direction: column;
        gap: 10px;
    }

    .saju-pillars-table th {
        font-size: 0.85em;
        padding: 8px 4px;
    }

    .saju-stem-cell,
    .saju-branch-cell {
        font-size: 1.3em;
        padding: 10px 5px;
    }

    .saju-elements-chart {
        height: 140px;
    }

    .saju-element-bar {
        width: 30px;
    }

    .saju-element-circle {
        width: 50px;
        height: 50px;
        font-size: 0.75em;
    }

    .saju-history-summary {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .saju-result-card {
        padding: 15px;
    }

    .saju-result-card h3 {
        font-size: 1.1em;
    }

    .saju-tab-btn {
        font-size: 0.9em;
        padding: 12px 10px;
    }

    .saju-tengod-label-cell {
        width: 60px;
        font-size: 0.75em;
    }

    .saju-tengod-char {
        font-size: 1.1em;
    }

    .saju-daeun-period {
        width: 65px;
    }

    .saju-daeun-chars {
        font-size: 1.1em;
    }

    .saju-gongmang-char {
        width: 55px;
        height: 55px;
        font-size: 1.4em;
    }

    .saju-yongsin-summary {
        flex-direction: column;
    }

    .saju-yongsin-item {
        min-width: auto;
    }
}

/* Animation */
@keyframes sajuFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.saju-result-card {
    animation: sajuFadeIn 0.5s ease forwards;
}

.saju-result-card:nth-child(2) { animation-delay: 0.1s; }
.saju-result-card:nth-child(3) { animation-delay: 0.2s; }
.saju-result-card:nth-child(4) { animation-delay: 0.3s; }
.saju-result-card:nth-child(5) { animation-delay: 0.4s; }
.saju-result-card:nth-child(6) { animation-delay: 0.5s; }
.saju-result-card:nth-child(7) { animation-delay: 0.6s; }
.saju-result-card:nth-child(8) { animation-delay: 0.7s; }
.saju-result-card:nth-child(9) { animation-delay: 0.8s; }

/* Decorative corner patterns */
.saju-section::after {
    content: '☰';
    position: absolute;
    top: 8px;
    right: 12px;
    color: rgba(218,165,32,0.15);
    font-size: 1.5em;
}

/* ========================================
   Premium Sections
   ======================================== */

.premium-section {
    position: relative;
    margin-top: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
    border: 2px solid rgba(218,165,32,0.4);
}

.premium-header {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.premium-header h3 {
    margin: 0;
    color: #1a1a2e;
    font-size: 1.2em;
    font-weight: 700;
}

.premium-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.premium-content-wrapper {
    position: relative;
    min-height: 200px;
}

.premium-content-preview {
    padding: 20px;
}

.premium-content-preview p {
    line-height: 1.8;
    color: #d4c9b5;
    margin: 8px 0;
}

.premium-content-preview .premium-visible-lines {
    margin-bottom: 0;
}

.premium-content-blur {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    padding: 0 20px 20px;
}

.premium-content-blur p {
    line-height: 1.8;
    color: #d4c9b5;
    margin: 8px 0;
}

.premium-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to bottom, transparent 0%, rgba(26,26,46,0.7) 30%, rgba(26,26,46,0.95) 100%);
    pointer-events: none;
    z-index: 5;
}

.premium-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    width: 80%;
}

.premium-unlock-btn {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Noto Serif KR', serif;
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(246,211,101,0.4);
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.premium-unlock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(246,211,101,0.6);
}

.premium-lock-icon {
    margin-right: 6px;
}

/* Premium sub-sections within premium content */
.premium-sub-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(218,165,32,0.15);
}

.premium-sub-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.premium-sub-section h4 {
    color: #DAA520;
    font-size: 1.05em;
    margin: 0 0 8px;
}

.premium-sub-section p {
    margin: 5px 0;
}

/* Premium 대운 detail table */
.premium-daeun-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.premium-daeun-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 8px;
    font-size: 0.85em;
    border: 1px solid rgba(218,165,32,0.4);
    text-align: center;
}

.premium-daeun-table td {
    background: #16213e;
    padding: 8px;
    border: 1px solid rgba(218,165,32,0.2);
    text-align: center;
    font-size: 0.9em;
    color: #d4c9b5;
}

.premium-daeun-table tr.current-daeun td {
    background: rgba(218,165,32,0.15);
    color: #FFD700;
    font-weight: 700;
}

/* Premium personality lists */
.premium-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.premium-list li {
    padding: 4px 0 4px 20px;
    position: relative;
    color: #d4c9b5;
    line-height: 1.6;
}

.premium-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #DAA520;
}

.premium-list.pros li::before {
    content: '✦';
    color: #4CAF50;
}

.premium-list.cons li::before {
    content: '✦';
    color: #f44336;
}

/* Six Relations table */
.premium-sixrel-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.premium-sixrel-table th {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    padding: 8px;
    font-size: 0.85em;
    border: 1px solid rgba(218,165,32,0.4);
    text-align: center;
}

.premium-sixrel-table td {
    background: #16213e;
    padding: 8px 10px;
    border: 1px solid rgba(218,165,32,0.2);
    font-size: 0.9em;
    color: #d4c9b5;
}

.premium-sixrel-present {
    color: #4CAF50 !important;
    font-weight: 700;
}

.premium-sixrel-absent {
    color: #666 !important;
}

/* Premium modal */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.premium-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.premium-modal {
    background: #1a1a2e;
    border: 2px solid #DAA520;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: sajuModalIn 0.3s ease;
}

@keyframes sajuModalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.premium-modal-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.premium-modal h3 {
    color: #DAA520;
    font-size: 1.4em;
    margin: 0 0 15px;
}

.premium-modal p {
    color: #d4c9b5;
    font-size: 1em;
    line-height: 1.6;
    margin: 0 0 25px;
}

.premium-modal-close {
    background: linear-gradient(135deg, #8B0000, #5c0000);
    color: #FFD700;
    border: 2px solid #DAA520;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.premium-modal-close:hover {
    background: linear-gradient(135deg, #a00000, #700000);
    box-shadow: 0 0 15px rgba(139,0,0,0.4);
}

/* Premium section animation */
.premium-section {
    animation: sajuFadeIn 0.5s ease forwards;
}

@media (max-width: 600px) {
    .premium-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .premium-header h3 {
        font-size: 1.05em;
    }

    .premium-unlock-btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    .premium-modal {
        padding: 30px 20px;
    }

    .premium-modal h3 {
        font-size: 1.2em;
    }

    .premium-daeun-table {
        font-size: 0.8em;
    }

    .premium-daeun-table th,
    .premium-daeun-table td {
        padding: 5px 3px;
    }
}
