:root {
    --primary-red: #e11d2e;
    --header-red-start: #e02020;
    --header-red-end: #c01010;
    --bg-gray: #f5f5f5;
    --text-dark: #333333;
    --text-gray: #666666;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --active-bg: #fff5f5;
    --active-border: #e11d2e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    padding-bottom: 140px;
    /* Space for footer */
}

/* Header */
.app-header {
    background: linear-gradient(to right, var(--header-red-start), var(--header-red-end));
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left,
.header-right {
    width: 60px;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
    font-size: 12px;
}

.header-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-selector {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.game-icon {
    background: white;
    color: var(--primary-red);
    font-size: 10px;
    padding: 1px 3px;
    border-radius: 2px;
    margin-right: 4px;
}

.game-name {
    font-size: 14px;
    font-weight: bold;
}

.game-title {
    font-size: 10px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

/* Sub Header */
.sub-header {
    background: var(--primary-red);
    color: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    font-size: 14px;
}

.nav-item {
    opacity: 0.8;
    padding-bottom: 4px;
    position: relative;
}

.nav-item.active {
    opacity: 1;
    font-weight: bold;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
}

/* Info Bar */
.info-bar {
    background: white;
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.countdown-section {
    flex: 1;
    padding: 10px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.issue-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.timer {
    font-size: 20px;
    color: var(--primary-red);
    font-weight: bold;
}

.result-section {
    flex: 1.5;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.result-header {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-balls {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.ball-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.ball-mini.red {
    background: #e11d2e;
}

.ball-mini.blue {
    background: #3b82f6;
}

.ball-mini.green {
    background: #22c55e;
}

.plus-mini {
    color: var(--text-gray);
    font-weight: bold;
}

.zodiac-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-gray);
}

.zodiac-item {
    width: 20px;
    text-align: center;
}

/* Content Area */
.content-area {
    background: white;
}

.betting-tabs {
    display: flex;
    overflow-x: auto;
    background: #f0f0f0;
    padding: 10px 5px;
    gap: 10px;
}

.tab-item {
    white-space: nowrap;
    padding: 6px 16px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-gray);
    border: 1px solid transparent;
}

.tab-item.active {
    color: var(--primary-red);
    border-color: var(--primary-red);
    background: #fff5f5;
}

.tab-content {
    display: none;
    padding: 10px;
}

.tab-content.active {
    display: block;
}

.section-title {
    text-align: center;
    font-size: 14px;
    color: var(--text-gray);
    margin: 10px 0;
    position: relative;
}

.section-title::before,
.section-title::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 1px;
    background: #ddd;
    vertical-align: middle;
    margin: 0 10px;
}

/* Grids */
.bet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bet-grid-wide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.bet-grid-zodiac {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Bet Cells */
.bet-cell {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 4px;
    text-align: center;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.bet-cell.active {
    background: var(--active-bg);
    border-color: var(--active-border);
    position: relative;
}

.bet-cell.active::after {
    content: '✓';
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary-red);
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    border-top-left-radius: 4px;
}

.cell-num {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-red);
    margin-bottom: 2px;
}

.cell-odds {
    font-size: 10px;
    color: var(--text-gray);
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.input-row {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--primary-red);
    border-radius: 4px;
    overflow: hidden;
    width: 150px;
}

.input-group input {
    border: none;
    padding: 8px;
    width: 100%;
    text-align: center;
    outline: none;
}

.input-group .unit {
    background: #fff;
    padding: 0 10px;
    color: var(--text-gray);
    font-size: 12px;
}

.action-row {
    display: flex;
    height: 50px;
}

.btn-clear {
    width: 80px;
    background: #333;
    color: white;
    border: none;
    font-size: 14px;
}

.summary-info {
    flex: 1;
    background: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.summary-info .highlight {
    color: var(--primary-red);
    margin: 0 4px;
    font-size: 14px;
    font-weight: bold;
}

.btn-confirm {
    width: 100px;
    background: #999;
    /* Default disabled state */
    color: white;
    border: none;
    font-size: 16px;
}

.btn-confirm.ready {
    background: var(--primary-red);
}

/* Floating Menu */
.floating-menu {
    position: fixed;
    bottom: 160px;
    right: 10px;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    z-index: 90;
}