/* ========================================
   Lottery System - Public Styles
   Responsive, works without JavaScript
   Compatible with modern & older browsers
   ======================================== */

/* --- Reset & Base --- */
*, *:before, *:after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #13233C;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.3;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Sections --- */
.section {
    background: #eaecef;
    margin: 15px 0;
    padding: 25px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.section-title {
    font-size: 1.5rem;
    color: #222;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #13233C;
    display: inline-block;
}

.section-desc {
    color: #666;
    margin-bottom: 20px;
}

/* --- Site Header --- */
.site-header {
    background: #13233C;
    color: #fff;
    padding: 30px 0;
    text-align: center;
}

.site-title {
    font-size: 2rem;
    margin: 0 0 5px;
    font-weight: 700;
    text-align: center;
}

.site-title img {
    display: inline-block;
    max-height: 80px;
    width: auto;
    vertical-align: middle;
}

/* --- Stats Bar --- */
.stats-bar {
    background: #fff;
    padding: 22px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border-bottom: 1px solid #eee;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 8px 24px;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: #13233C;
    line-height: 1.2;
}

.stat-date {
    font-weight: 600;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .stats-bar {
        padding: 14px 0;
    }
    .stat-item {
        padding: 6px 16px;
        border-right: none;
        flex: 1 0 45%;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .stat-name {
        font-size: 1rem;
    }
}

/* --- Status Card --- */
.status-card {
    margin: 25px 0;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
}

.status-card .container {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 24px;
}

.status-icon-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.35);
}

.status-card-icon {
    font-size: 2.6rem;
    line-height: 1;
}

.status-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-card-label {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.status-card-desc {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 500;
    line-height: 1.4;
}

.status-open {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
}

.status-closed {
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
}

.status-finished {
    background: linear-gradient(135deg, #b71c1c, #d32f2f);
    color: #fff;
}

@media (max-width: 480px) {
    .status-card .container {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
        gap: 16px;
    }

    .status-card-label {
        font-size: 1.3rem;
    }

    .status-icon-wrap {
        width: 60px;
        height: 60px;
    }

    .status-card-icon {
        font-size: 2rem;
    }
}

/* --- Maintenance Page --- */
.maintenance-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.maintenance-page {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.maintenance-page .container {
    max-width: 600px;
    padding: 50px 30px;
    background: linear-gradient(135deg, #13233C, #1a2d4a);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    color: #fff;
    margin: 40px auto;
}

.maintenance-page h2 {
    font-size: 2rem;
    margin: 0 0 16px;
    color: #fff;
    font-weight: 800;
}

.maintenance-page p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    margin: 0;
}

.maintenance-page h2:first-child {
    margin-top: 0;
}

/* --- Legend --- */
.taken-legend,
.free-legend {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.taken-legend {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.free-legend {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* --- Number Tabs --- */
.number-tabs {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    overflow: hidden;
}

.tabs-hint {
    display: inline-block;
    margin: 2px 6px 2px 0;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
    vertical-align: middle;
}

.tab-link {
    display: inline-block;
    padding: 6px 10px;
    margin: 2px;
    background: #e0e0e0;
    color: #333;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.tab-link:hover {
    background: #13233C;
    color: #fff;
    text-decoration: none;
}

/* --- Number Block --- */
.number-block {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #d0d4dc;
}

.block-header {
    background: #13233C;
    color: #fff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #ffd600;
}

.block-range {
    font-size: 1rem;
    font-weight: 700;
}

.block-stats {
    font-size: 0.85rem;
    opacity: 0.85;
    white-space: nowrap;
}

/* --- Number Grid --- */
.number-grid {
    overflow: hidden;
    margin: 0 -2px;
    padding: 12px 10px;
}

.number-grid:before,
.number-grid:after {
    content: "";
    display: table;
    clear: both;
}

.number-cell {
    float: left;
    width: 10%;
    padding: 2px;
    text-align: center;
}

.number-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 2px 2px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    font-family: "Courier New", Courier, monospace;
    line-height: 1.2;
}

.number-cell.free .number-link {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.number-cell.taken .number-link {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.number-cell.free .number-link:hover {
    background: #c8e6c9;
}

.participant-name {
    display: block;
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    color: #c62828;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}

/* --- News Section --- */
.news-section.section {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: none;
    border-left: 6px solid #f9a825;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(249, 168, 37, 0.15);
}

.news-list {
    overflow: hidden;
}

.news-item {
    margin-bottom: 14px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(249, 168, 37, 0.2);
}

.news-item:last-child {
    margin-bottom: 0;
}

.news-title {
    font-size: 1.2rem;
    color: #bf360c;
    margin: 0 0 6px;
    font-weight: 700;
}

.news-content {
    color: #4e342e;
    line-height: 1.7;
    font-size: 0.95rem;
}

.news-content p {
    margin: 0 0 8px;
}

.news-content p:last-child {
    margin-bottom: 0;
}

.news-date {
    display: inline-block;
    font-size: 0.8rem;
    color: #bf360c;
    margin-top: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 10px;
}

/* --- Custom Text --- */
.custom-text {
    text-align: justify;
}

.custom-text h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.custom-text p {
    max-width: 700px;
    margin: 0 auto;
    color: #555;
}

/* --- Prizes Section --- */
.prizes-section {
    background: #13233C;
    padding: 45px 0 50px;
    position: relative;
    overflow: hidden;
}

.prizes-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

.prizes-title {
    color: #fff;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
}

.prizes-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.prize-card {
    background: #eaecef;
    border-radius: 16px;
    width: 230px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.prize-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #b0bec5, #e0e0e0);
}

.prize-card.won::after {
    background: linear-gradient(90deg, #43a047, #66bb6a);
}

.prize-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

.prize-card-header {
    padding: 14px 16px 0;
    text-align: center;
}

.prize-card-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #4a3000;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 14px;
    border-radius: 20px;
}

.prize-card.won .prize-card-badge {
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: #fff;
}

.prize-card-body {
    padding: 14px 16px 18px;
    text-align: center;
}

.prize-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px;
}

.prize-card-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.winner-label {
    display: inline-block;
    background: #43a047;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 3px 12px;
    border-radius: 12px;
}

.winner-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1b5e20;
}

.winner-number {
    font-size: 0.85rem;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 8px;
}

.prize-card-pending {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
    padding: 14px 0;
    line-height: 1.4;
}

/* --- Site Footer --- */
.site-footer {
    background: #13233C;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
    opacity: 0.8;
}

/* ========================================
   Responsive
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
    .number-cell {
        width: 12.5%;
    }

    .number-link {
        font-size: 0.9rem;
        padding: 2px 1px;
        height: 38px;
    }

    .participant-name {
        font-size: 0.7rem;
    }

    .site-title {
        font-size: 1.6rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .prizes-section {
        padding: 35px 0 40px;
    }

    .prizes-title {
        font-size: 1.5rem;
    }

    .prize-card {
        width: 200px;
    }

    .prizes-grid {
        gap: 16px;
    }
}

/* Phones */
@media (max-width: 480px) {
    .number-cell {
        width: 20%;
    }

    .number-link {
        font-size: 0.8rem;
        padding: 2px 1px;
        height: 36px;
    }

    .participant-name {
        font-size: 0.65rem;
    }

    .number-tabs {
        text-align: left;
    }

    .tab-link {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .site-header {
        padding: 20px 0;
    }

    .site-title {
        font-size: 1.3rem;
    }

    .section {
        padding: 15px 0;
    }

    .prizes-section {
        padding: 30px 0 35px;
    }

    .prizes-title {
        font-size: 1.4rem;
        margin-bottom: 22px;
    }

    .prize-card {
        width: 170px;
    }

    .prize-card-name {
        font-size: 0.95rem;
    }

    .prizes-grid {
        gap: 12px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .number-cell {
        width: 25%;
    }
}

/* --- Sponsor Slider --- */
.sp-section {
    max-width: 960px;
    margin: 20px auto;
    display: none !important;
}

@media (min-width: 769px) {
    .sp-section {
        display: block !important;
    }
}

.sp-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #13233C;
    margin: 0 0 8px;
    font-weight: 700;
    text-align: center;
}

.sp-wrap {
    position: relative;
}

.sp-radio {
    display: none;
}

.sp-slider {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 280px;
    background: #13233C;
    border-radius: 8px;
}

.sp-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.sp-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.sp-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(0,0,0,0.55);
    text-align: center;
    pointer-events: none;
}

.sp-text {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.4;
}

.sp-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 18px;
    background: #13233C;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    pointer-events: auto;
}

.sp-btn:hover {
    background: #1c3455;
}

/* --- Dots --- */
.sp-dots {
    display: none;
}

.sp-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(19,35,60,0.4);
    background: rgba(19,35,60,0.15);
    margin: 0 6px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.sp-dot:hover {
    background: rgba(19,35,60,0.35);
    border-color: rgba(19,35,60,0.6);
}

@media (max-width: 480px) {
    .sp-slider {
        height: 150px;
        border-radius: 0;
    }
    .sp-text {
        font-size: 0.85rem;
    }
    .sp-overlay {
        padding: 10px;
    }
    .sp-dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    .sp-wrap {
        margin: 10px 0;
    }
}

/* Small screens landscape */
@media (max-width: 600px) and (orientation: landscape) {
    .number-cell {
        width: 10%;
    }
}

/* Old browsers: show horizontal scroll for the grid if needed */
@media (max-width: 1024px) {
    .number-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
