body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}
.bg-purple {
    background: #6e45e2 !important;
}
.bg-white {
    background: #fff !important;
}
.bg-dark {
    background: #07071a !important;
}

/* Animated canvas background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}
.bg-dark p {
    color: #e0e0e0;
}

/* Common Layout */
.page-wrapper {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Demo Header */
.site-header {
    background: #dc3545;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}
.site-logo-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}

/* Home Page specific */
.custom-btn {
    width: 270px;
    height: 60px;
    color: #fff;
    border-radius: 5px;
    padding: 10px 25px;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    box-shadow:inset 2px 2px 2px 0px rgba(255,255,255,.5),
               7px 7px 20px 0px rgba(0,0,0,.1),
               4px 4px 5px 0px rgba(0,0,0,.1);
    outline: none;
}
.btn-1 {
    background: #27ae60;
    background: linear-gradient(0deg, rgb(187 0 221) 0%, rgb(187 0 221) 100%);
    border: none;
}
.btn-1:hover {
    background: rgb(0,3,255);
    background: linear-gradient(0deg, rgba(0,3,255,1) 0%, rgba(2,126,251,1) 100%);
}

/* Form Container */
.responsive-form-container {
    margin-top: 20px;
    padding: 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.responsive-form-container .form-col {
    flex: 1;
    min-width: 80px;
}
.responsive-form-container .date-col {
    flex: 2;
    min-width: 150px;
}
.btn-custom {
    display: inline-block;
    width: 100%;
    padding: 10px 5px;
    text-align: center;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

/* 2D Results specific */
.time-header-container { width: 100%; background: #27ae60; padding: 5px; margin-top: 15px; }
.time-header-title { margin: 2px; font-size: 16px; color: #fff; text-align: center; }
.number-grid { display: grid; grid-template-columns: repeat(10, 1fr); background: #fff; width: 100%; }
.number-cell { background: #e67e22; color: #fff; font-size: 22px; text-align: center; padding: 7px 4px; border: 1px solid #fff; }

/* 2D Extra Results - rows of 10, horizontally scrollable, no gaps between rows */
.number-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.number-grid-wrap .number-grid { grid-template-columns: repeat(10, minmax(44px, 1fr)); min-width: max-content; margin: 0; width: auto; }
.number-grid-wrap .number-grid + .number-grid { border-top: none; }

/* 3D Results specific */
.result-table { width: 100%; border-collapse: collapse; background: #f3f3f3; }
.result-table th, .result-table td { border: 1px solid #bdbdbd; text-align: center; padding: 12px; font-size: 18px; font-weight: bold; }
.play-head { background: #d4a017; color: #000; }
.head-box { display: inline-block; width: 55px; height: 45px; line-height: 45px; border-radius: 10px; color: #fff; font-size: 22px; }
.a, .b, .c { background: #28a745; }
.time { background: #efefef; color: #222; width: 140px; }
.box-a { background: #ffff00; color: #111; }
.box-b { background: #39ef2d; color: #111; }
.box-c { background: #e65aa4; color: #111; }

/* 4D Chart */
.chart-table {
    width: 100%;
    border-collapse: collapse;
}
.chart-table .ct-time-th {
    background: #1a1a1a;
    color: #FFD700;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #333;
    white-space: nowrap;
    min-width: 70px;
}
.chart-table .ct-num-th {
    background: #d4a017;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid #333;
    min-width: 44px;
}
.chart-table .ct-time-td {
    background: #1a1a1a;
    color: #FFD700;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid #333;
    white-space: nowrap;
}
.chart-table .gd {
    background: #e67e22;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 6px 2px;
    border: 1px solid #d35400;
}
.chart-table tr:nth-child(even) .gd {
    background: #d35400;
}
.group-btn-row {
    display: flex;
    gap: 8px;
    padding: 10px 10px 6px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .group-btn-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .group-btn-row::-webkit-scrollbar { display: none; }
}

.group-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #FFD700;
    background: transparent;
    color: #FFD700;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.group-btn.active {
    background: #FFD700;
    color: #000;
}

@media (max-width: 768px) {
    .number-grid { grid-template-columns: repeat(5, 1fr); }
    .number-grid-wrap .number-grid { grid-template-columns: repeat(10, minmax(44px, 1fr)); }
}
@media (max-width: 600px) {
    .result-table th, .result-table td { padding: 8px 4px; font-size: 14px; }
    .head-box { width: 40px; height: 35px; line-height: 35px; font-size: 16px; }
    .time { width: auto; }
}
@media (max-width: 480px) {
    .number-grid { grid-template-columns: repeat(4, 1fr); }
    .number-grid-wrap .number-grid { grid-template-columns: repeat(10, minmax(44px, 1fr)); }
}

/* 4D Results specific colors */
.container-4d .time-header-container,
.wrapper-4d .time-header-container {
    background: #800080;
}
.container-4d .time-header-title,
.wrapper-4d .time-header-title {
    color: #fff;
}
.container-4d .number-grid,
.wrapper-4d .number-grid {
    background: #FFFDD0;
}
.container-4d .number-cell,
.wrapper-4d .number-cell {
    background: #FFFDD0;
    color: #000;
    border: 1px solid #333;
    font-weight: bold;
}
.container-4d .number-cell .edit-mode-only input {
    background: #FFFDD0;
    color: #000;
}
