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

* {
    box-sizing: border-box;
}

body {
    background-color: #FAFAFA;
    color: #333;
    font-family: 'Noto Sans KR', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    text-align: center;
}

main {
    animation: fadeIn 0.8s ease-out;
}

/* Site Header */
.site-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E0E0E0;
}

.site-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0;
    letter-spacing: 0.05em;
}

.site-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    margin: 4px 0 0 0;
    letter-spacing: 0.1em;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 600px;
    flex-wrap: wrap;
}

.category-btn {
    background: #FFF;
    border: 2px solid #E0E0E0;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.category-btn:hover {
    border-color: #1A1A1A;
    color: #1A1A1A;
}

.category-btn.active {
    background: #1A1A1A;
    border-color: #1A1A1A;
    color: #FFF;
}

/* Tab Navigation with Side Nav Buttons */
.tabs-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
}

.nav-btn {
    background: #F0F0F0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: #E0E0E0;
    color: #333;
}

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

.tabs {
    display: flex;
    gap: 8px;
    background: #F0F0F0;
    padding: 6px;
    border-radius: 50px;
    width: 520px;
    max-width: 90%;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    background: #FFF;
    color: #1A1A1A;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fortune-card {
    background: #FFFFFF;
    padding: 60px 40px;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    max-width: 520px;
    width: 90%;
    min-height: 500px;
    margin: 0 auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
    min-height: 380px;
}

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

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #1A1A1A;
    margin: 0 0 40px 0;
    font-weight: 600;
}

fortune-cookie {
    display: block;
    margin: 40px 0;
    font-size: 1.1rem;
    line-height: 1.8;
    min-height: 80px;
    color: #555;
    font-weight: 300;
    padding: 0 20px;
}

#new-fortune-btn {
    background: #1A1A1A;
    color: #FFF;
    border: none;
    padding: 16px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

#new-fortune-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

#new-fortune-btn:active {
    transform: translateY(0);
}

/* Form Styles */
.calc-mode {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}

.calc-mode label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.calc-mode input[type="radio"] {
    accent-color: #1A1A1A;
    width: 18px;
    height: 18px;
}
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #FAFAFA;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #1A1A1A;
    background: #FFF;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-group:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.form-group:has(input[type="checkbox"]) label {
    margin-bottom: 0;
    cursor: pointer;
}

.calc-btn {
    background: #1A1A1A;
    color: #FFF;
    border: none;
    padding: 16px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

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

.result-box {
    margin-top: 30px;
    padding: 24px;
    background: #F8F8F8;
    border-radius: 12px;
    text-align: left;
}

.result-box p {
    margin: 0;
    line-height: 1.8;
}

/* Saju Result Styles */
#saju-result {
    max-height: 500px;
    overflow-y: auto;
}

.saju-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E0E0E0;
}

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

.saju-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 12px 0;
}

.saju-section p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.saju-yin-yang {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.saju-gan, .saju-ji {
    display: inline-block;
    padding: 6px 12px;
    background: #FFF;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.saju-gan.positive, .saju-ji.positive {
    background: #FFF5F5;
    border-color: #FF6B6B;
    color: #C92A2A;
}

.saju-gan.negative, .saju-ji.negative {
    background: #F0F7FF;
    border-color: #4DABF7;
    color: #1864AB;
}

/* Lotto Styles */
.lotto-options {
    margin-bottom: 20px;
}

.lotto-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.lotto-game {
    width: 100%;
    padding: 16px;
    background: #FFF;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    margin-bottom: 12px;
}

.lotto-game-title {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.lotto-balls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.lotto-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFF;
}

/* Fortune Options */
.fortune-options {
    margin-bottom: 20px;
}

/* Dice Styles */
.dice-area {
    padding: 40px 0;
}

.dice {
    width: 80px;
    height: 80px;
    background: #FFF;
    border: 2px solid #333;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #1A1A1A;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.dice.rolling {
    animation: diceRoll 0.5s ease-in-out;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
    100% { transform: rotate(360deg); }
}

.dice-number {
    font-size: 2rem;
    font-weight: 600;
    color: #1A1A1A;
    margin-top: 16px;
}

.dice-options {
    margin-top: 20px;
}

.dice-results {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.dice-result-item {
    width: 50px;
    height: 50px;
    background: #FFF;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Coin Styles */
.coin-area {
    padding: 40px 0;
}

.coin {
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #8B4513;
    transition: transform 0.5s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 4px solid #DAA520;
}

.coin.flipping {
    animation: coinFlip 0.8s ease-in-out;
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg) rotate(0deg); }
    25% { transform: rotateY(180deg) rotate(90deg); }
    50% { transform: rotateY(360deg) rotate(180deg); }
    75% { transform: rotateY(540deg) rotate(270deg); }
    100% { transform: rotateY(720deg) rotate(360deg); }
}
    padding: 40px 0;
}

.coin {
    font-size: 5rem;
    transition: transform 0.5s ease;
}

.coin.flipping {
    animation: coinFlip 0.8s ease-in-out;
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(900deg); }
    100% { transform: rotateY(0deg); }
}

.coin-result-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1A1A1A;
    margin-top: 16px;
}

/* Random Draw Styles */
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #FAFAFA;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    resize: vertical;
    min-height: 120px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #1A1A1A;
    background: #FFF;
}

.random-winners {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.winner-item {
    padding: 12px 20px;
    background: #FFF5F5;
    border: 2px solid #FF6B6B;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #C92A2A;
}

/* Ladder Styles */
.ladder-container {
    margin-top: 20px;
}

.ladder-result-item {
    padding: 8px 12px;
    background: #F0F7FF;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
}

footer a {
    color: #666;
    text-decoration: underline;
}

footer a:hover {
    color: #333;
}

.footer-links {
    margin-top: 10px;
    font-size: 0.75rem;
}

/* Policy Page Styles */
.policy-card {
    background: #FFFFFF;
    padding: 60px 40px;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    max-width: 700px;
    width: 90%;
    text-align: left;
}

.policy-card header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #E0E0E0;
    padding-bottom: 30px;
}

.policy-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #1A1A1A;
    margin: 0;
    font-weight: 600;
}

.policy-card .subtitle {
    font-size: 0.9rem;
    color: #888;
    margin-top: 8px;
}

.policy-content section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #F0F0F0;
}

.policy-content section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.policy-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 12px 0;
}

.policy-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.8;
    margin: 0;
}

.policy-content p + p {
    margin-top: 8px;
}

.back-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #E0E0E0;
}

.back-link a {
    color: #1A1A1A;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: #666;
}

/* Character Counter Styles */
.count-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.count-stat {
    background: #FFF;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.count-stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.count-stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1A1A1A;
}

/* WebP Converter Styles */
.webp-options {
    margin-bottom: 20px;
}

.file-upload {
    margin: 20px 0;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: block;
    padding: 20px;
    background: #F8F8F8;
    border: 2px dashed #E0E0E0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1rem;
    color: #555;
}

.file-upload-label:hover {
    border-color: #1A1A1A;
    background: #FFF;
}

.webp-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.webp-item {
    background: #FFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.webp-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.webp-item .filename {
    font-size: 0.8rem;
    color: #666;
    word-break: break-all;
    margin-bottom: 4px;
}

.webp-item .size-info {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
}

.webp-item .download-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1A1A1A;
    color: #FFF;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.webp-item .download-btn:hover {
    background: #333;
}

/* Copy Button */
.copy-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: #1A1A1A;
    color: #FFF;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #333;
}

.copy-btn.copied {
    background: #4CAF50;
}

@media (max-width: 480px) {
    .fortune-card {
        padding: 40px 24px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    fortune-cookie {
        font-size: 1rem;
    }

    .tabs {
        width: 100%;
        padding: 4px;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    
    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}
