* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
}

/* 크레딧 바 */
.credit-bar {
    display: none;
}

.credit-label {
    color: #fff;
    font-size: 14px;
}

.credit-amount {
    color: #ffd700;
    font-size: 20px;
    font-weight: bold;
    flex: 1;
}

.buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 계산기 */
.calculator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.calculator h1 {
    color: #fff;
    text-align: center;
    font-size: 24px;
    margin-bottom: 5px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 12px;
    margin-bottom: 20px;
}

.display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 80px;
}

.expression {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    text-align: right;
    word-break: break-all;
    min-height: 25px;
}

.result {
    color: #4ade80;
    font-size: 28px;
    font-weight: bold;
    text-align: right;
    margin-top: 10px;
    min-height: 35px;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn {
    padding: 20px;
    font-size: 22px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn.number {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn.number:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn.operator {
    background: rgba(102, 126, 234, 0.3);
    color: #a5b4fc;
}

.btn.operator:hover {
    background: rgba(102, 126, 234, 0.5);
}

.btn.clear {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.btn.clear:hover {
    background: rgba(239, 68, 68, 0.5);
}

.btn.equals {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #fff;
}

.btn.equals:hover {
    transform: scale(1.05);
}

.btn.zero {
    grid-column: span 2;
}

.cost-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.charge-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.charge-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: modalIn 0.3s ease;
}

.modal.small {
    max-width: 350px;
    text-align: center;
}

.modal.small p {
    color: #ffd700;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 30px;
    cursor: pointer;
}

.modal h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 30px;
}

.plans {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.plan {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.plan:hover,
.plan.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.plan.popular {
    border-color: #ffd700;
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.plan-credits {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.plan-price {
    color: #4ade80;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
}

.plan-per {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* 결제 폼 */
.payment-form h3 {
    color: #fff;
    margin-bottom: 15px;
}

.selected-plan {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.pay-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.pay-btn:hover {
    transform: scale(1.02);
}

/* 성공 애니메이션 */
.success-animation {
    text-align: center;
    padding: 40px;
}

.success-animation .checkmark {
    font-size: 60px;
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
