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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

@media (min-width: 768px) {
    body {
        padding: 20px;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .container {
        border-radius: 12px;
    }
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .tab {
        padding: 15px;
        font-size: 16px;
    }
}

.tab.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.page {
    display: none;
    padding: 15px;
}

@media (min-width: 768px) {
    .page {
        padding: 20px;
    }
}

.page.active {
    display: block;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 22px;
}

@media (min-width: 768px) {
    h1 {
        margin-bottom: 20px;
        font-size: 28px;
    }
}

.year-info {
    background: #f0f4ff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.year-info p {
    margin: 5px 0;
    font-size: 14px;
}

@media (min-width: 768px) {
    .year-info {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .year-info p {
        font-size: 16px;
    }
}

#current-zodiac {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
}

.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 480px) {
    .zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .zodiac-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
        margin-bottom: 20px;
    }
}

.zodiac-item {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s;
}

@media (min-width: 768px) {
    .zodiac-item {
        padding: 15px;
    }
}

.zodiac-item.current-year {
    border-color: #e74c3c;
    background: #fff5f5;
}

.zodiac-item h3 {
    color: #333;
    margin-bottom: 6px;
    font-size: 16px;
}

.zodiac-numbers {
    color: #667eea;
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .zodiac-item h3 {
        margin-bottom: 8px;
        font-size: 18px;
    }
    
    .zodiac-numbers {
        font-size: 12px;
        margin-bottom: 8px;
    }
}

.zodiac-item .multiplier {
    color: #e74c3c;
    font-size: 12px;
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .zodiac-item .multiplier {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

.zodiac-item input {
    width: 100%;
    padding: 8px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

@media (min-width: 768px) {
    .zodiac-item input {
        padding: 8px;
        font-size: 16px;
    }
}

.zodiac-item .amount {
    margin-top: 6px;
    color: #666;
    font-size: 12px;
}

@media (min-width: 768px) {
    .zodiac-item .amount {
        margin-top: 8px;
        font-size: 14px;
    }
}

.summary {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary p {
    font-size: 16px;
    margin-bottom: 12px;
}

#total-principal {
    color: #e74c3c;
    font-weight: bold;
    font-size: 20px;
}

@media (min-width: 768px) {
    .summary {
        padding: 20px;
    }
    
    .summary p {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    #total-principal {
        font-size: 24px;
    }
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .btn-primary, .btn-secondary {
        padding: 12px 30px;
        font-size: 16px;
    }
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-delete {
    margin-top: 10px;
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: #e74c3c;
    color: white;
    transition: all 0.3s;
    touch-action: manipulation;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-draw {
    margin-top: 10px;
    margin-right: 5px;
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: #f39c12;
    color: white;
    transition: all 0.3s;
    touch-action: manipulation;
}

.btn-draw:hover {
    background: #e67e22;
}

@media (min-width: 768px) {
    .btn-delete {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .btn-draw {
        padding: 8px 20px;
        font-size: 14px;
    }
}

.pending-bet-card {
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pending-bet-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
}

#pending-bet-info {
    margin-bottom: 20px;
    line-height: 1.6;
}

#pending-bet-info p {
    margin: 8px 0;
    font-size: 14px;
}

.settlement-input {
    margin: 20px 0;
    text-align: center;
}

.settlement-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.zodiac-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.zodiac-select:focus {
    outline: none;
    border-color: #5568d3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (min-width: 768px) {
    .pending-bet-card {
        padding: 25px;
    }
    
    .pending-bet-card h2 {
        font-size: 24px;
    }
    
    #pending-bet-info p {
        font-size: 16px;
    }
}

#history-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    #history-list {
        max-height: 600px;
    }
}

.history-item {
    background: #f9f9f9;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

@media (min-width: 768px) {
    .history-item {
        padding: 15px;
    }
}

.history-item.win {
    border-left-color: #27ae60;
    background: #f0fff4;
}

.history-item.lose {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.history-item p {
    margin: 5px 0;
    font-size: 14px;
    word-break: break-word;
}

@media (min-width: 768px) {
    .history-item p {
        font-size: 16px;
    }
}

.data-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.data-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .data-tab {
        padding: 10px;
        font-size: 16px;
    }
}

.data-tab.active {
    background: #667eea;
    color: white;
}

.iframe-container {
    position: relative;
    height: calc(100vh - 250px);
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .iframe-container {
        height: 600px;
    }
}

.data-iframe {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
}

.data-iframe.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-content {
        padding: 30px;
    }
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

@media (min-width: 768px) {
    .modal-content h2 {
        margin-bottom: 20px;
        font-size: 24px;
    }
}

#result-body {
    margin: 15px 0;
    line-height: 1.8;
    font-size: 14px;
}

#result-body p {
    margin: 8px 0;
}

@media (min-width: 768px) {
    #result-body {
        margin: 20px 0;
        font-size: 16px;
    }
}

.result-win {
    color: #27ae60;
    font-size: 18px;
    font-weight: bold;
}

.result-lose {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
}

@media (min-width: 768px) {
    .result-win, .result-lose {
        font-size: 20px;
    }
}
