/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 터치 최적화 */
button, a, input, [role="button"], [role="link"] {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

input[type="text"], textarea {
    -webkit-user-select: text;
    user-select: text;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #0f0a1a 0%, #1a0f2e 50%, #0a0a1a 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-emoji {
    font-size: 48px;
    animation: loader-bounce 1s ease-in-out infinite;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-text {
    font-size: 14px;
    color: #888;
    letter-spacing: 1px;
    font-weight: 500;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 배경 장식 요소 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.container {
    max-width: 620px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 언어 선택 - 우측 상단 고정 */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(243, 156, 18, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn:hover {
    background: rgba(243, 156, 18, 0.5);
    transform: scale(1.05);
}

.lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: rgba(15, 10, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

.lang-menu.hidden {
    display: none;
}

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

.lang-option {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #f5e6d3;
    transition: background 0.2s ease;
}

.lang-option:hover {
    background: rgba(243, 156, 18, 0.2);
}

.lang-option.active {
    background: rgba(243, 156, 18, 0.3);
    font-weight: 600;
}

/* Glassmorphism 헤더 */
.app-header {
    background: rgba(243, 156, 18, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(243, 156, 18, 0.1);
    margin-bottom: 20px;
}

.app-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: none;
}

.subtitle {
    font-size: 14px;
    color: #d4a574;
    font-weight: 600;
    text-shadow: none;
}

/* 히어로 배지 */
.hero-badge-section {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
}

.hero-badge {
    display: inline-block;
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #f39c12;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: slideDown 0.8s ease;
}

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

/* Glassmorphism 탭 메뉴 */
.tab-menu {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px;
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 156, 18, 0.2);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
    position: relative;
}

.tab-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow:
        0 4px 16px rgba(243, 156, 18, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.tab-btn:hover:not(.active) {
    background: rgba(243, 156, 18, 0.15);
}

/* 계산기 컨테이너 - Glassmorphism */
.calculator-container {
    background: rgba(243, 156, 18, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 156, 18, 0.2);
    border-radius: 24px;
    padding: 0;
    min-height: 500px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(243, 156, 18, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.calc-section {
    padding: 40px 35px;
}

.calc-section h2 {
    font-size: 26px;
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.info-text {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin-bottom: 35px;
    font-weight: 500;
    opacity: 0.8;
}

/* Glassmorphism 입력 필드 */
.input-group {
    margin-bottom: 28px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 20px;
    min-height: 48px;
    font-size: 16px;
    border: 2px solid rgba(243, 156, 18, 0.3);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(243, 156, 18, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.15);
    box-shadow:
        0 0 0 4px rgba(243, 156, 18, 0.2),
        0 6px 20px rgba(243, 156, 18, 0.3),
        inset 0 1px 0 rgba(243, 156, 18, 0.1);
    transform: translateY(-2px);
}

/* 통화 선택기 */
.currency-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.currency-box {
    flex: 1;
}

.arrow {
    font-size: 28px;
    color: #f39c12;
    filter: drop-shadow(0 2px 4px rgba(243, 156, 18, 0.3));
}

.swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(243, 156, 18, 0.3);
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swap-btn:hover {
    background: rgba(243, 156, 18, 0.3);
    transform: rotate(180deg);
    border-color: #f39c12;
}
.swap-btn:active {
    transform: rotate(180deg) scale(0.9);
}

/* Glassmorphism 팁 버튼 */
.tip-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tip-btn {
    padding: 14px;
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(243, 156, 18, 0.3);
    color: #f39c12;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tip-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-color: transparent;
    box-shadow:
        0 6px 20px rgba(243, 156, 18, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px) scale(1.05);
}

.tip-btn:hover:not(.active) {
    background: rgba(243, 156, 18, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* Glassmorphism 팁 정보 박스 */
.tip-info-box {
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 5px solid #f39c12;
    padding: 18px 20px;
    margin-bottom: 28px;
    border-radius: 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.15);
}

.tip-info-box strong {
    color: #f39c12;
    font-weight: 800;
}

/* 대형 버튼 - 그라데이션 강화 */
.btn {
    width: 100%;
    padding: 20px;
    min-height: 48px;
    font-size: 18px;
    font-weight: 800;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow:
        0 8px 24px rgba(243, 156, 18, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.1);
    animation: ctaPulse 2s ease-in-out infinite;
    animation-delay: 0s;
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(243, 156, 18, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 12px 32px rgba(243, 156, 18, 0.6), 0 6px 16px rgba(0, 0, 0, 0.15);
    }
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 14px 36px rgba(243, 156, 18, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Glassmorphism 결과 박스 - 강조됨 */
.result-box {
    margin-top: 40px;
    background: rgba(15, 10, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(243, 156, 18, 0.4);
    color: white;
    padding: 40px 35px;
    border-radius: 20px;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(243, 156, 18, 0.2),
        inset 0 1px 0 rgba(243, 156, 18, 0.1);
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}

.result-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center top, rgba(243, 156, 18, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-title {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.result-detail {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-timestamp {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 15px;
    font-style: italic;
}

.result-note {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 20px;
    line-height: 1.7;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glassmorphism 관세 세부 내역 */
.customs-breakdown {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 900;
    font-size: 19px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-top: 16px;
    margin-top: 6px;
}

/* 상단 광고 배너 */
.ad-banner {
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 156, 18, 0.2);
    padding: 12px;
    text-align: center;
    border-radius: 12px;
    max-width: 620px;
    margin: 0 auto 10px;
}

.ad-banner .ad-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 500;
}

/* 전면 광고 오버레이 */
.interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.interstitial-overlay.hidden {
    display: none;
}

.interstitial-content {
    background: rgba(15, 10, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ad-label {
    font-size: 0.8rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.ad-placeholder-large {
    background: rgba(243, 156, 18, 0.1);
    padding: 60px 20px;
    border-radius: 12px;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.close-ad-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.close-ad-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

/* 프리미엄 버튼 */
.premium-section {
    padding: 20px 35px;
    text-align: center;
}

.premium-btn {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #5a4000;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.premium-badge {
    background: rgba(90, 64, 0, 0.2);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
}

/* 프리미엄 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(15, 10, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.premium-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.3rem;
    margin: 0;
    color: #ffffff;
}

.modal-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.premium-analysis {
    text-align: left;
}

.premium-section-block {
    margin-bottom: 16px;
    padding: 15px;
    background: rgba(243, 156, 18, 0.05);
    border-radius: 12px;
    border-left: 3px solid #f39c12;
}

.premium-section-block h4 {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 1rem;
}

.premium-section-block p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
}

.premium-tips {
    list-style: none;
    padding: 0;
}

.premium-tips li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.premium-tips li:last-child {
    border-bottom: none;
}

/* 하단 광고 영역 */
.ad-banner-bottom {
    background: rgba(243, 156, 18, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 156, 18, 0.2);
    padding: 25px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-top: -1px;
}

.ad-placeholder {
    background: rgba(243, 156, 18, 0.1);
    border: 2px dashed rgba(243, 156, 18, 0.3);
    padding: 40px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
}

/* 경고 메시지 */
.result-warning {
    margin-top: 20px;
    padding: 16px 18px;
    background: rgba(255, 193, 7, 0.2);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #fff9e6;
}

.result-error {
    margin-top: 20px;
    padding: 16px 18px;
    background: rgba(244, 67, 54, 0.2);
    border-left: 4px solid #f44336;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #ffebee;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .app-header {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .app-header h1 {
        font-size: 26px;
    }

    .tab-menu {
        gap: 8px;
        padding: 6px;
    }

    .tab-btn {
        font-size: 12px;
        padding: 12px 10px;
        min-height: 44px;
    }

    .calculator-container {
        border-radius: 20px;
    }

    .calc-section {
        padding: 30px 24px;
    }

    .calc-section h2 {
        font-size: 22px;
    }

    .result-value {
        font-size: 36px;
    }

    .currency-selector {
        flex-direction: column;
        gap: 16px;
    }

    .arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }

    .tip-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 360px 초소형 모바일 */
@media (max-width: 360px) {
    body {
        padding: 8px;
    }

    .container {
        max-width: 360px;
    }

    .ad-banner {
        padding: 8px;
        margin-bottom: 8px;
    }

    .app-header {
        padding: 24px 16px;
        border-radius: 18px;
        margin-bottom: 12px;
    }

    .app-header h1 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 12px;
    }

    .hero-badge-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .hero-badge {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .tab-menu {
        gap: 6px;
        padding: 6px;
        margin-bottom: 12px;
    }

    .tab-btn {
        font-size: 11px;
        padding: 10px 8px;
        min-height: 44px;
        border-radius: 12px;
    }

    .calculator-container {
        border-radius: 18px;
        min-height: auto;
    }

    .calc-section {
        padding: 24px 16px;
    }

    .calc-section h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .info-text {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .input-group label {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .input-group input,
    .input-group select {
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 12px;
        min-height: 44px;
    }

    .currency-selector {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }

    .currency-box {
        flex: 1;
    }

    .arrow {
        transform: rotate(90deg);
        font-size: 20px;
    }

    .swap-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 50%;
    }

    .tip-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .tip-btn {
        padding: 12px;
        font-size: 13px;
        min-height: 44px;
        border-radius: 12px;
    }

    .tip-info-box {
        padding: 14px 16px;
        margin-bottom: 20px;
        border-radius: 12px;
        font-size: 12px;
    }

    .btn {
        padding: 14px;
        font-size: 16px;
        border-radius: 14px;
        min-height: 48px;
        width: 100%;
    }

    .result-box {
        margin-top: 24px;
        padding: 24px 16px;
        border-radius: 18px;
    }

    .result-title {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .result-value {
        font-size: 32px;
        margin-bottom: 14px;
    }

    .result-detail {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .result-timestamp {
        font-size: 11px;
        margin-top: 12px;
    }

    .result-note {
        font-size: 12px;
        margin-top: 14px;
        padding-top: 14px;
    }

    .customs-breakdown {
        padding: 16px;
        margin-top: 16px;
        border-radius: 12px;
    }

    .breakdown-item {
        padding: 10px 0;
        font-size: 13px;
    }

    .breakdown-item:last-child {
        font-size: 16px;
        padding-top: 12px;
    }

    .interstitial-overlay {
        padding: 12px;
    }

    .interstitial-content {
        padding: 30px 16px;
        max-width: 340px;
    }

    .ad-label {
        font-size: 0.75rem;
        margin-bottom: 16px;
    }

    .ad-placeholder-large {
        padding: 40px 12px;
        font-size: 11px;
        margin-bottom: 16px;
    }

    .close-ad-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .premium-section {
        padding: 12px 16px;
    }

    .premium-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .premium-badge {
        font-size: 0.7rem;
    }

    .modal-content {
        width: 90%;
        padding: 1.3rem;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .premium-section-block {
        padding: 12px;
        margin-bottom: 12px;
    }

    .premium-section-block h4 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .premium-section-block p {
        font-size: 0.85rem;
    }

    .premium-tips li {
        padding: 6px 0;
        font-size: 0.85rem;
    }

    .history-section {
        padding: 1.2rem;
        margin-top: 2rem;
    }

    .history-section h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .history-item {
        padding: 0.8rem;
    }

    .history-header {
        margin-bottom: 0.3rem;
    }

    .history-type {
        font-size: 0.85rem;
    }

    .history-time {
        font-size: 0.75rem;
    }

    .history-title {
        font-size: 0.9rem;
    }

    .history-result {
        font-size: 0.85rem;
    }

    .rec-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .rec-icon {
        font-size: 24px;
    }

    .rec-name {
        font-size: 13px;
    }

    .rec-desc {
        font-size: 11px;
    }

    .back-link, .home-link {
        font-size: 12px;
    }

    /* 터치 타겟 최소화 */
    button, a {
        min-height: 44px;
    }
}

/* 히스토리 섹션 */
.history-section {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.history-list {
    display: grid;
    gap: 0.75rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.history-item:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: var(--primary);
    transform: translateX(4px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-type {
    font-weight: 600;
    color: var(--primary);
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.history-result {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

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

/* Recommendations Section - 강화 */
.recommendations-section {
    margin: 32px 0 0;
    padding: 32px 0 30px;
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.recommendations-section::before {
    content: '✨ 추천 앱';
    display: block;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.rec-title {
    font-size: 16px;
    font-weight: 800;
    color: rgba(255,255,255,0.95);
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.5px;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

.rec-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 14px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}

.rec-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rec-card:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.rec-card:hover::before {
    opacity: 1;
}

.rec-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: bounceIcon 0.6s ease infinite;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.rec-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.rec-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.rec-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

/* Game Footer & Back Link */
.game-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

.back-link, .home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 13px;
    padding: 12px 0;
    transition: color 0.2s;
}

.back-link:hover, .home-link:hover {
    color: rgba(255,255,255,0.7);
}

/* === Accessibility Improvements === */
button:focus-visible,a:focus-visible,input:focus-visible,[role="button"]:focus-visible{outline:3px solid #f39c12;outline-offset:2px;}
button,a[href],input[type="button"],input[type="submit"],[role="button"]{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
.skip-link{position:absolute;top:-40px;left:0;background:#f39c12;color:white;padding:8px;text-decoration:none;z-index:100;}
.skip-link:focus{top:0;}
[role="dialog"]{z-index:1000;}
@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
@media (prefers-contrast: more){button{border:2px solid #f39c12;}}
.rec-card:focus-visible,.currency-option:focus-visible{outline:3px solid #f39c12;outline-offset:4px;}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
    border: 2px solid var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb:hover {
    background: #8497ee;
    opacity: 0.8;
}

/* Selection Color */
::selection {
    background: #f39c12;
    color: white;
}

::-moz-selection {
    background: #f39c12;
    color: white;
}

/* Light Theme Override - Explicit Theme Toggle */
[data-theme="light"] {
    --bg-dark: #f5f5fa;
    --bg-dark-secondary: #ffffff;
    --bg-dark-tertiary: #f0f0f5;
    --text-light: #1a1a2e;
    --text-light-secondary: #5a5a70;
    --border-light: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f5f5fa 0%, #ffffff 100%);
    color: var(--text-light);
}

[data-theme="light"] body::before,
[data-theme="light"] body::after {
    background: radial-gradient(circle, rgba(243, 156, 18, 0.05) 0%, transparent 70%);
}

[data-theme="light"] .app-loader {
    background: #f5f5fa;
}

[data-theme="light"] .loader-spinner {
    border-color: rgba(243, 156, 18, 0.1);
    border-top-color: #f39c12;
}

[data-theme="light"] .loader-text {
    color: var(--text-light-secondary);
}

[data-theme="light"] .lang-btn {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
}

[data-theme="light"] .lang-btn:hover {
    background: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .lang-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .lang-option {
    color: var(--text-light);
}

[data-theme="light"] .lang-option:hover {
    background: rgba(243, 156, 18, 0.1);
}

[data-theme="light"] .lang-option.active {
    background: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .ad-banner {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .ad-text {
    color: var(--text-light-secondary);
}

[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-header h1 {
    color: var(--text-light);
}

[data-theme="light"] .subtitle {
    color: var(--text-light-secondary);
}

[data-theme="light"] .hero-badge {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

[data-theme="light"] .tab-menu {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .tab-btn {
    color: var(--text-light-secondary);
}

[data-theme="light"] .tab-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

[data-theme="light"] .tab-btn:hover:not(.active) {
    background: rgba(243, 156, 18, 0.1);
}

[data-theme="light"] .calculator-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .calc-section h2 {
    color: var(--text-light);
}

[data-theme="light"] .info-text {
    color: var(--text-light-secondary);
}

[data-theme="light"] .input-group label {
    color: var(--text-light);
}

[data-theme="light"] .input-group input,
[data-theme="light"] .input-group select {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
}

[data-theme="light"] .input-group input:focus,
[data-theme="light"] .input-group select:focus {
    border-color: #f39c12;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.1);
}

[data-theme="light"] .input-group input::placeholder {
    color: var(--text-light-secondary);
}

[data-theme="light"] .currency-selector .arrow {
    color: #f39c12;
}

[data-theme="light"] .swap-btn {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
}

[data-theme="light"] .swap-btn:hover {
    background: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .tip-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

[data-theme="light"] .tip-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

[data-theme="light"] .tip-btn:hover:not(.active) {
    background: rgba(243, 156, 18, 0.1);
}

[data-theme="light"] .tip-info-box {
    background: rgba(243, 156, 18, 0.08);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
}

[data-theme="light"] .tip-info-box strong {
    color: #f39c12;
}

[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(243, 156, 18, 0.3);
}

[data-theme="light"] .btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(243, 156, 18, 0.1);
}

[data-theme="light"] .result-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .result-box::before {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}

[data-theme="light"] .result-title {
    color: var(--text-light-secondary);
}

[data-theme="light"] .result-value {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .result-detail {
    color: var(--text-light-secondary);
}

[data-theme="light"] .result-timestamp {
    color: var(--text-light-secondary);
}

[data-theme="light"] .result-note {
    color: var(--text-light-secondary);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .customs-breakdown {
    background: rgba(243, 156, 18, 0.05);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .breakdown-item {
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-light);
}

[data-theme="light"] .breakdown-item:last-child {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .interstitial-overlay {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .interstitial-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.2);
}

[data-theme="light"] .ad-label {
    color: var(--text-light-secondary);
}

[data-theme="light"] .ad-placeholder-large {
    background: rgba(243, 156, 18, 0.08);
    color: var(--text-light-secondary);
}

[data-theme="light"] .premium-section {
    background: transparent;
}

[data-theme="light"] .premium-btn {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #5a4000;
}

[data-theme="light"] .modal {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-color: rgba(243, 156, 18, 0.2);
}

[data-theme="light"] .modal-header h3 {
    color: var(--text-light);
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

[data-theme="light"] .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .premium-section-block {
    background: rgba(243, 156, 18, 0.05);
    border-color: rgba(243, 156, 18, 0.2);
}

[data-theme="light"] .premium-section-block h4 {
    color: var(--text-light);
}

[data-theme="light"] .premium-section-block p {
    color: var(--text-light-secondary);
}

[data-theme="light"] .premium-tips li {
    color: var(--text-light-secondary);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ad-banner-bottom {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .ad-placeholder {
    background: rgba(243, 156, 18, 0.08);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light-secondary);
}

[data-theme="light"] .result-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #856404;
}

[data-theme="light"] .result-error {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #c62828;
}

[data-theme="light"] .history-section {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .history-section h3 {
    color: var(--text-light);
}

[data-theme="light"] .history-item {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .history-item:hover {
    background: rgba(243, 156, 18, 0.08);
}

[data-theme="light"] .history-type {
    color: #f39c12;
}

[data-theme="light"] .history-time {
    color: var(--text-light-secondary);
}

[data-theme="light"] .history-title {
    color: var(--text-light);
}

[data-theme="light"] .history-result {
    color: var(--text-light-secondary);
}

[data-theme="light"] .empty-message {
    color: var(--text-light-secondary);
}

[data-theme="light"] .recommendations-section {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.05) 0%, rgba(243, 156, 18, 0.02) 100%);
    border-color: rgba(243, 156, 18, 0.15);
}

[data-theme="light"] .recommendations-section::before {
    color: var(--text-light-secondary);
}

[data-theme="light"] .rec-title {
    color: var(--text-light);
}

[data-theme="light"] .rec-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(243, 156, 18, 0.15);
    color: var(--text-light);
}

[data-theme="light"] .rec-card:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(243, 156, 18, 0.25);
}

[data-theme="light"] .rec-desc {
    color: var(--text-light-secondary);
}

[data-theme="light"] .back-link,
[data-theme="light"] .home-link {
    color: var(--text-light-secondary);
}

[data-theme="light"] .back-link:hover,
[data-theme="light"] .home-link:hover {
    color: var(--text-light);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 56px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

[data-theme="light"] .theme-toggle {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
    color: var(--text-light);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(243, 156, 18, 0.15);
}
