body {
    background-color: #f5f5f5;
}

.navbar.fixed-top {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

.main-content {
    padding: 10px;
    padding-bottom: 20px;
}

.lottery-input-box {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 8px;
}

.lottery-input-red {
    width: 45px;
    flex: 0 0 45px;
}

.lottery-input-blue {
    width: 50px;
    flex: 0 0 50px;
}

.ball-3d {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin: 2px;
}

.ball-red {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    margin: 1px;
}

.ball-blue {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    margin: 1px;
}

.rules-box {
    font-size: 0.85rem;
    line-height: 1.4;
}

.rules-box p {
    margin-bottom: 0.25rem;
}

.chart-container {
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    min-width: 100%;
    gap: 2px;
}

.bar-chart-small {
    min-width: 320px;
}

.bar-chart-red {
    min-width: 660px;
}

.bar-chart-blue {
    min-width: 340px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 20px;
	height: 90px;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 20px;
    min-height: 2px;
    background: linear-gradient(to top, #6c757d, #adb5bd);
    border-radius: 3px 3px 0 0;
    position: relative;
    transition: all 0.3s ease;
}

.bar-hot {
    background: linear-gradient(to top, #dc3545, #ff6b6b);
}

.bar::after {
    content: attr(data-count);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

.bar-label {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
}

.alert-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 200px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.table th, .table td {
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
}

.card {
    margin-bottom: 10px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-header {
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 0.75rem;
}

.offcanvas-body .list-group-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.offcanvas-body .list-group-item.ps-4 {
    padding-left: 2rem !important;
}

.btn-agree {
    text-decoration: none;
    font-size: 1.2rem;
}

.btn-agree.agreed {
    color: #28a745 !important;
}

.btn-agree i {
    transition: transform 0.2s ease;
}

.btn-agree:active i {
    transform: scale(1.2);
}

.tab-switch-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 1050;
    display: flex;
    flex-direction: row;
    padding: 0;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    min-height: 50px;
    box-sizing: border-box;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.tab-switch-item {
    flex: 1;
    text-align: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: #f8f9fa;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 50px;
    box-sizing: border-box;
}

.tab-switch-item:first-child {
    border-right: 1px solid #e9ecef;
}

.tab-switch-item.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
}

.tab-switch-item.active .tab-icon {
    color: #fff;
}

.tab-switch-item.active .tab-text {
    color: #fff;
    font-weight: 600;
}

.tab-switch-item.ssq-active {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: #fff;
}

.tab-switch-item.ssq-active .tab-icon {
    color: #fff;
}

.tab-switch-item.ssq-active .tab-text {
    color: #fff;
    font-weight: 600;
}

.tab-icon {
    font-size: 20px;
    color: #6c757d;
    transition: all 0.2s ease;
    line-height: 1;
}

.tab-switch-item:last-child .tab-icon {
    color: #6c757d;
}

.tab-text {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-switch-item.active .tab-text,
.tab-switch-item.ssq-active .tab-text {
    color: #fff;
}

.user-name-link {
    color: #0d6efd;
    text-decoration: none;
    cursor: pointer;
}

.user-name-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.modal-body {
    padding-bottom: 30px;
}

.chart-container {
    margin-bottom: 20px;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

.tab-switch-bar {
    visibility: visible !important;
    opacity: 1 !important;
}
