@charset "utf-8";

/* ============================================================
   LOTTO 6/45 - Complete Unified Stylesheet
   ============================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

/* ------------------------------------------------------------
   2. Lotto 3D Ball Common Colors (동행복권 공식 컬러 규격)
   ------------------------------------------------------------ */
.ball-yellow { background: radial-gradient(circle at 35% 30%, #ffdf00 0%, #f59e0b 60%, #d97706 100%); }
.ball-blue   { background: radial-gradient(circle at 35% 30%, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%); }
.ball-red    { background: radial-gradient(circle at 35% 30%, #f87171 0%, #dc2626 60%, #b91c1c 100%); }
.ball-gray   { background: radial-gradient(circle at 35% 30%, #cbd5e1 0%, #64748b 60%, #475569 100%); }
.ball-green  { background: radial-gradient(circle at 35% 30%, #a3e635 0%, #65a30d 60%, #4d7c0f 100%); }

/* ------------------------------------------------------------
   3. Header Navigation Styles (header.php)
   ------------------------------------------------------------ */
.lotto-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.lotto-navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lotto-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.lotto-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.lotto-brand-title {
    display: flex;
    flex-direction: column;
}

.brand-main {
    font-size: 19px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-main .brand-highlight {
    color: #2563eb;
}

.brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: -0.3px;
    margin-top: -2px;
}

.lotto-nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lotto-nav-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
}

.lotto-nav-item a:hover {
    color: #2563eb;
    background: #f1f5f9;
}

.lotto-nav-item.active a {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 700;
}

.lotto-nav-item.active a i {
    color: #2563eb;
}

.lotto-nav-extra {
    display: flex;
    align-items: center;
    gap: 12px;
}

.draw-schedule-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.draw-schedule-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.lotto-mobile-toggle {
    display: none;
    font-size: 22px;
    color: #334155;
    padding: 6px;
}

@media (max-width: 768px) {
    .lotto-navbar-inner {
        height: 60px;
        padding: 0 16px;
    }
    .draw-schedule-badge {
        display: none;
    }
    .lotto-mobile-toggle {
        display: block;
    }
    .lotto-nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        flex-direction: column;
        padding: 12px 16px;
        gap: 6px;
        display: none;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    }
    .lotto-nav-menu.show {
        display: flex;
    }
    .lotto-nav-item {
        width: 100%;
    }
    .lotto-nav-item a {
        width: 100%;
        padding: 10px 14px;
    }
}

/* ------------------------------------------------------------
   4. Main Winning Result Page Styles (main.php)
   ------------------------------------------------------------ */
.lotto-container {
    max-width: 980px;
    margin: 40px auto 70px auto;
    padding: 0 20px;
}

.lotto-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid #edf2f7;
    overflow: hidden;
    margin-bottom: 30px;
    transition: transform 0.2s ease;
}

.lotto-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    padding: 35px 25px;
    text-align: center;
    position: relative;
}

.lotto-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.lotto-round-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0;
}

.round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.round-btn:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(1.08);
    color: #ffffff;
}

.round-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

.lotto-round-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.lotto-round-title span {
    color: #fde047;
}

.lotto-date {
    font-size: 14px;
    color: #dbeafe;
    margin-top: 6px;
    font-weight: 400;
}

.lotto-quick-select {
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lotto-select {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: #1e3a8a;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.balls-section {
    padding: 45px 20px 40px 20px;
    text-align: center;
    background: #ffffff;
}

.balls-title {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 25px;
    letter-spacing: -0.3px;
}

.balls-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.ball-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lotto-ball {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    position: relative;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset -3px -5px 10px rgba(0, 0, 0, 0.25), inset 3px 5px 10px rgba(255, 255, 255, 0.4);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lotto-ball:hover {
    transform: translateY(-4px) scale(1.06);
}

.plus-symbol {
    font-size: 26px;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 6px;
    user-select: none;
}

.bonus-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bonus-label {
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: -0.2px;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.prize-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 26px;
    border: 1px solid #edf2f7;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.prize-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.prize-card.rank-1::before {
    background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.prize-card.rank-2::before {
    background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
}

.prize-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.rank-1 .prize-badge {
    background: #fef3c7;
    color: #b45309;
}

.rank-2 .prize-badge {
    background: #dbeafe;
    color: #1e40af;
}

.prize-amount-wrap {
    margin: 10px 0 16px 0;
}

.prize-amount-main {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.prize-amount-korean {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    margin-top: 3px;
}

.prize-detail-list {
    border-top: 1px dashed #e2e8f0;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prize-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
}

.prize-detail-row strong {
    color: #1e293b;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    margin: 30px 0;
}

.empty-state i {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #64748b;
}

@media (max-width: 640px) {
    .lotto-container {
        margin: 20px auto 40px auto;
        padding: 0 12px;
    }
    .lotto-header {
        padding: 25px 15px;
    }
    .lotto-round-title {
        font-size: 24px;
    }
    .lotto-ball {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }
    .balls-section {
        padding: 30px 10px;
    }
    .balls-wrap {
        gap: 8px;
    }
    .plus-symbol {
        font-size: 20px;
        margin: 0 2px;
    }
    .prize-amount-main {
        font-size: 22px;
    }
}

/* ------------------------------------------------------------
   5. Generator Page Styles (generator.php)
   ------------------------------------------------------------ */
.gen-container {
    max-width: 980px;
    margin: 35px auto 70px auto;
    padding: 0 20px;
}

.gen-header {
    text-align: center;
    margin-bottom: 30px;
}

.gen-badge {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.gen-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.gen-desc {
    font-size: 15px;
    color: #64748b;
}

.control-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 24px;
}

.option-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    text-align: center;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
}

.mode-tab-btn:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.mode-tab-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.count-selector {
    display: flex;
    gap: 10px;
}

.count-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
    transition: all 0.2s;
}

.count-btn.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}

.number-board-wrap {
    display: none;
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    border: 1px dashed #cbd5e1;
}

.board-guide {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.board-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-fixed { background: #2563eb; }
.legend-excluded { background: #ef4444; }

.number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.board-num-btn {
    height: 42px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    transition: all 0.15s;
    user-select: none;
}

.board-num-btn:hover {
    border-color: #2563eb;
    transform: scale(1.05);
}

.board-num-btn.fixed {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.board-num-btn.excluded {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
    text-decoration: line-through;
    opacity: 0.7;
}

.generate-cta-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

.generate-cta-btn:active {
    transform: translateY(1px);
}

.result-section {
    display: none;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.result-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.game-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-item {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.game-item:hover {
    transform: translateX(4px);
    border-color: #cbd5e1;
}

.game-label {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1e293b;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-balls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ball {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), inset -2px -4px 8px rgba(0, 0, 0, 0.25), inset 2px 4px 8px rgba(255, 255, 255, 0.4);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes popIn {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.game-meta {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    min-width: 80px;
    text-align: right;
}

.stat-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-tip-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.tip-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-balls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mini-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

@media (max-width: 640px) {
    .game-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .ball {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .game-meta {
        text-align: left;
    }
}

/* ------------------------------------------------------------
   6. Stats Page Styles (stats.php)
   ------------------------------------------------------------ */
.stats-container {
    max-width: 1040px;
    margin: 35px auto 70px auto;
    padding: 0 20px;
}

.stats-header {
    text-align: center;
    margin-bottom: 30px;
}

.stats-badge {
    display: inline-block;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.stats-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.stats-desc {
    font-size: 15px;
    color: #64748b;
}

.filter-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.filter-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.summary-card-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-card-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lotto-ball-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset -2px -4px 6px rgba(0, 0, 0, 0.25), inset 2px 4px 6px rgba(255, 255, 255, 0.4);
}

.stats-section-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.freq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.freq-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.15s, border-color 0.15s;
}

.freq-item:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.freq-info {
    flex: 1;
}

.freq-cnt {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.freq-cnt span {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.freq-bar-bg {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.freq-bar-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
}

.stat-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    padding: 10px 12px;
    border-bottom: 2px solid #edf2f7;
}

.stat-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

.stat-bar-cell {
    width: 45%;
}

.stat-progress-bg {
    width: 100%;
    height: 8px;
    background: #edf2f7;
    border-radius: 6px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

/* ------------------------------------------------------------
   7. History Page Styles (history.php)
   ------------------------------------------------------------ */
.hist-container {
    max-width: 1040px;
    margin: 35px auto 70px auto;
    padding: 0 20px;
}

.hist-header {
    text-align: center;
    margin-bottom: 30px;
}

.hist-badge {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.hist-title {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.hist-desc {
    font-size: 15px;
    color: #64748b;
}

.search-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    margin-bottom: 25px;
}

.search-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.search-input {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
}

.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 9px 20px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-btn:hover {
    background: #1d4ed8;
}

.reset-btn {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reset-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.table-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    overflow: hidden;
    margin-bottom: 25px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.hist-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    white-space: nowrap;
}

.hist-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.hist-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

.hist-table tr:hover td {
    background: #f8fafc;
}

.round-link {
    font-weight: 800;
    font-size: 15px;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.round-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.table-balls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hist-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.plus-char {
    font-size: 14px;
    font-weight: bold;
    color: #94a3b8;
    margin: 0 2px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.page-link:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.page-link.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ------------------------------------------------------------
   8. Global Footer Styling (footer.php)
   ------------------------------------------------------------ */
.footerWrap {
    flex-shrink: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 30px 20px;
    margin-top: auto;
}

.footerArea {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.leftCon address {
    font-style: normal;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

.leftCon address span {
    color: #cbd5e1;
    margin: 0 4px;
}

.leftCon .copyright {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* Family Site Selector */
.family-site-box {
    position: relative;
    display: inline-block;
}

.family-site-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 34px 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.family-site-select:hover {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
}

.family-site-select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.family-site-box .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #64748b;
    pointer-events: none;
}

/* ------------------------------------------------------------
   9. Webkit Scrollbar
   ------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 640px) {
    .footerWrap {
        padding: 24px 16px;
    }
    .footerArea {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .family-site-box,
    .family-site-select {
        width: 100%;
    }
    .leftCon address {
        font-size: 12px;
    }
    .leftCon address span {
        display: none;
    }
}

/* ------------------------------------------------------------
   8. Store & Famous Lotto Shop Styles (stores/index.php)
   ------------------------------------------------------------ */
.store-container {
    max-width: 1080px;
    margin: 35px auto 70px auto;
    padding: 0 20px;
}

.store-header {
    text-align: center;
    margin-bottom: 28px;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.store-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.store-desc {
    font-size: 15px;
    color: #64748b;
}

/* Tabs */
.store-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #e2e8f0;
    padding: 6px;
    border-radius: 14px;
}

.store-tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #64748b;
    background: transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.store-tab-btn:hover:not(.active) {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.4);
}

.store-tab-btn.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Region Filter Bar */
.store-region-bar {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 22px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.region-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.region-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.region-chip {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.region-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.region-chip.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    border-color: #1d4ed8;
}

/* Round Control Box */
.round-control-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.round-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.round-select-label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.round-select {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.round-select:focus {
    border-color: #2563eb;
}

.round-nav-btns {
    display: flex;
    gap: 8px;
}

.btn-round-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    transition: all 0.15s;
}

.btn-round-nav:hover:not(.disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-round-nav.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Round Draw Summary */
.round-draw-summary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 18px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}

.summary-round-title {
    font-size: 16px;
    color: #f8fafc;
}

.summary-round-title strong {
    color: #facc15;
    font-size: 18px;
}

.draw-dt {
    font-size: 13px;
    color: #94a3b8;
    margin-left: 6px;
}

.summary-balls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-balls .plus-sign {
    font-weight: 800;
    font-size: 18px;
    color: #94a3b8;
    margin: 0 2px;
}

/* Store Table Card */
.store-table-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #edf2f7;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    padding: 24px;
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 8px;
}

.list-count-badge {
    font-size: 15px;
    color: #334155;
    font-weight: 600;
}

.list-count-badge strong {
    color: #2563eb;
    font-weight: 800;
}

.filtered-region-tag,
.ranking-info-tag {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Store Grid (Round tab) */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.store-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.store-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.store-seq-badge {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.store-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auto-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-auto {
    background: #dbeafe;
    color: #1e40af;
}

.badge-manual {
    background: #fef3c7;
    color: #92400e;
}

.badge-semi {
    background: #e0e7ff;
    color: #3730a3;
}

.store-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

.store-info-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.store-info-row .info-label {
    color: #64748b;
    white-space: nowrap;
    width: 62px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.store-info-row .info-val {
    color: #334155;
    word-break: break-all;
    flex: 1;
}

.store-info-row .address-val {
    color: #475569;
    line-height: 1.4;
}

.store-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
    margin-top: auto;
}

.accum-win-badge {
    font-size: 12px;
    color: #dc2626;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-map-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 5px 11px;
    border-radius: 6px;
    transition: background 0.15s;
    margin-left: auto;
}

.btn-map-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Ranking Table */
.ranking-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.ranking-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.ranking-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.ranking-table tbody tr:hover {
    background: #f8fafc;
}

.top-rank-row {
    background: #fffdf5;
}

.rank-col {
    text-align: center;
}

.rank-crown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
}

.rank-crown.gold {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.rank-crown.silver {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.rank-crown.bronze {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.rank-num {
    font-weight: 700;
    color: #64748b;
    font-size: 14px;
}

.store-name-col strong {
    color: #0f172a;
    font-size: 15px;
}

.badge-win-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
}

.second-win-col {
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.region-pill {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.addr-text {
    color: #64748b;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 280px;
}

.last-round-col {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

.btn-table-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    transition: all 0.15s;
}

.btn-table-map:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Pagination */
.store-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
}

.store-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
}

.store-pagination .page-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.store-pagination .page-link.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Empty State */
.empty-store-box {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #cbd5e1;
}

.empty-text {
    font-size: 16px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .store-container {
        margin: 20px auto 40px auto;
        padding: 0 12px;
    }
    .store-title {
        font-size: 22px;
    }
    .store-tabs {
        flex-direction: column;
    }
    .store-table-card {
        padding: 16px;
    }
    .store-grid {
        grid-template-columns: 1fr;
    }
    .round-control-box {
        flex-direction: column;
        align-items: stretch;
    }
    .round-select-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    .round-select {
        width: 100%;
    }
    .round-nav-btns {
        justify-content: space-between;
    }
    .btn-round-nav {
        flex: 1;
        justify-content: center;
    }
    .round-draw-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}
