.matka-container {
    max-width: 40rem; /* 更新从23.4375rem到40rem (640px) */
    margin: 0 auto;
    /* 修改容器背景为奶油色 */
    background: #FFEACF;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.matka-container button {
    width: auto;
}


/* 内容区域 */
.matka-content {
    padding: 0.5rem;
    padding-bottom: 6rem; /* 恢复原始的底部间距 */
}

/* 结果历史 */
.matka-result-history {
    /* 修改为纯白色背景 */
    background: white;
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 添加轻微阴影 */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    border: 1px solid #FB9612
}

.matka-result-text {
    color: #592F03;
    font-size: 0.875rem;
}

.matka-result-number {
    color: #ff6b00;
    font-weight: bold;
}

.matka-arrow {
    color: #666;
    font-size: 1.25rem;
}

/* 游戏类型区域 */
.matka-game-type-section {
    background: #FFF7ED;
    border-radius: 1rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0px 2px 8px 0px #00000033;
}

.matka-game-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.matka-game-type-title {
    color: #592F03;
    font-weight: bold;
    font-size: 1rem;
    margin: 0.5rem 0;
}

.matka-game-rules {
    background: #FB9612;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
}

/* 游戏选项 */
.matka-game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2.8rem, 1fr));
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.matka-game-option {
    /* 修改为纯白色背景 */
    background: #FFEACF;
    border-radius: 0.5rem;
    padding: 0.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.75rem;
    /* 添加轻微阴影 */
    box-shadow: 2px 2px 4px 0px #C99A5E40 inset;
    color: #D69A5B;
}

.matka-game-option.active {
    background: #FB9612;
    color: white;
}

.matka-game-option:hover {
    transform: translateY(-0.125rem);
}

.matka-option-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    display: block;
}

/* 投注金额区域 */
.matka-bet-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 新增投注区域分割线样式 */
.matka-bet-divider {
    height: 0.0625rem;
    background: #D69A5B;
    margin: 1rem 0;
}

/* 结果展示区域 */
.matka-results-section {
    /* 修改为纯白色背景 */
    background: #FFF7ED;
    border-radius: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    /* 添加轻微阴影 */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

.matka-results-tabs {
    display: flex;
    /* 移除底部边框，改为在标签内部处理 */
    padding: 0.5rem;
    gap: 0.25rem;
}

.matka-results-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.875rem;
    transition: all 0.2s;
    /* 添加圆角效果 */
    border-radius: 0.5rem;
    position: relative;
}

.matka-results-tab.active {
    /* 修改激活标签样式为橙色背景和白色文字 */
    background: #FB9612;
    color: white;
}

.matka-results-tab:not(.active) {
    /* 修改非激活标签样式为浅灰色背景和橙色文字 */
    color: #FB9612;
}

.matka-results-content {
    padding: 0;
}

.matka-results-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    table-layout: fixed;
}

.matka-results-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #D69A5B;
    font-weight: normal;
    border-bottom: 1px solid #eee;
}

.matka-results-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #592F03;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.matka-results-table tr:last-child td {
    border-bottom: none;
}

.matka-results-table .matka-digit-cell {
    font-weight: bold;
    color: #592F03;
}

/* 游戏面板区域 */
.matka-game-board {
    background: #f5e6d8; /* 浅橙色背景 */
    border-radius: 1rem;
    padding: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.matka-timer-section {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.matka-timer-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 时间显示样式 */
.matka-time-value {
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    padding: 0.5rem;
    background: #592F03; /* 深棕色背景 */
    color: #FFEE6D; /* 黄色数字 */
    width: fit-content;
}

/* 右侧文字区域 */
.matka-text-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.matka-close-btn {
    color: #592F03;
    font-size: 0.8rem;
    font-weight: bold;
}

/* 期号样式 */
.matka-issue-number {
    color: #ff8c00; /* 橙黄色 */
    font-size: 0.8rem;
    font-weight: bold;
}

/* 底部信息栏 - 固定在底部 */
.matka-collapsed-info {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 40rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(136.59deg, #FF7B23 0%, #FB9612 100%);
    color: white;
    padding: 1rem 1rem;
    border-radius: 1rem 1rem 0 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}


/* 数字选择区域样式 */
.matka-digit-selection-section {
    background: #FFF7ED;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0px 2px 8px 0px #00000033;
}

.matka-digit-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.matka-digit-type-title {
    color: #592F03;
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
}

.matka-digit-toggle-buttons {
    display: flex;
    gap: 0.5rem;
}

.matka-digit-toggle-btn {
    background: #FFEACF;
    border: 1px solid #D69A5B;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #D69A5B;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 4rem;
}

.matka-digit-toggle-btn.active {
    background: #FB9612;
    color: white;
    border-color: #FB9612;
}

.matka-digit-toggle-btn:hover {
    transform: translateY(-0.125rem);
}

.matka-digit-instruction {
    color: #592F03;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(251, 150, 18, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid #FB9612;
}

.matka-digit-input-container {
    display: flex;
    justify-content: center;
    position: relative;
}

/* 单输入框布局 */
.matka-digit-input-container.matka-single-input {
    display: flex;
}

/* 双输入框布局 */
.matka-digit-input-container.matka-dual-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.matka-input-separator {
    color: #D69A5B;
    font-weight: bold;
    font-size: 1rem;
}

/* 双输入框模式下的输入框样式 */
.matka-digit-input-container.matka-dual-input .matka-digit-input {
    flex: 1;
    max-width: 10rem;
    min-width: 8rem;
}

/* 小屏幕设备上的双输入框样式 */
@media (max-width: 480px) {
    .matka-digit-input-container.matka-dual-input .matka-digit-input {
        min-width: 7rem;
        max-width: 9rem;
        font-size: 0.875rem;
    }

    .matka-digit-input-container.matka-dual-input {
        gap: 0.5rem;
    }
}

.matka-digit-input {
    width: 100%;
    max-width: 20rem;
    padding: 0.6rem;
    border: 2px solid #D69A5B;
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
    background: white;
    color: #333;
    font-weight: bold;
}

.matka-digit-input:focus {
    outline: none;
    border-color: #FB9612;
    box-shadow: 0 0 0 3px rgba(251, 150, 18, 0.2);
}

.matka-digit-input::placeholder {
    color: #999;
    font-weight: normal;
}

/* 快速金额按钮样式 */
.matka-quick-amounts {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* 金额按钮样式 */
.matka-amount-btn {
    background: white;
    border: 1px solid #D69A5B;
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #D69A5B;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.matka-amount-btn.active {
    background: #FFEACF;
    border: 1px solid #D69A5B;
    box-shadow: 2px 2px 4px 0px #C99A5E40 inset;
}

/* 金额选择区域容器 */
.matka-amount-selection-container {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.matka-quick-amounts-wrapper {
    flex: 2;
}

.matka-amount-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.matka-input-label {
    font-size: 0.875rem;
    color: #592F03;
    font-weight: bold;
}

/* 金额输入框样式 */
.matka-amount-input {
    padding: 0.6rem;
    border: 1px solid #D69A5B;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

.matka-amount-input::placeholder {
    color: #999;
}

/* 添加余额信息样式 */
.matka-balance-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 1rem;
}

/* 添加购买按钮样式 */
.matka-buy-btn {
    border: 3px solid #FFFFFF;
    box-shadow: 2px 2px 4px 0px #00000040;
    background: linear-gradient(90deg, #E6513E 0%, #F9532E 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 1.25rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 8rem;
}

.matka-buy-btn:hover {
    background: #ee3333;
    transform: translateY(-0.125rem);
}

/* 响应式调整 */
@media (max-width: 42rem) {
    .matka-container {
        max-width: 100%;
    }
}

.matka-bet-btn {
    background: #592F03;
    color: #ffffff;
    opacity: 1;
    border-radius: 23px;
    padding: 0.5rem 1rem;
    box-shadow: 2px 2px 4px 0px #00000040;
    border: none;
    min-width: 6rem;
    font-size: 1rem;
    font-weight: bold;
}

.matka-bet-info {
    color: #FB9612;
    font-size: 1rem;
}

.matka-bet-amount {
    color: #FB9612;
    font-size: 1rem;
}

.matka-game-top {
    background: #FFF7ED;
    border-radius: 1rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0px 2px 8px 0px #00000033;
}

.matka-option-icon {
    margin: 0 auto;
    width: 2.5rem;
    height: 2.5rem;
}

.matka-game-option:nth-child(1) .matka-option-icon {
    background: url("../images/matka/img_ank.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(2) .matka-option-icon {
    background: url("../images/matka/img_jodi.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(3) .matka-option-icon {
    background: url("../images/matka/img_sp.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(4) .matka-option-icon {
    background: url("../images/matka/img_dp.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(5) .matka-option-icon {
    background: url("../images/matka/img_tp.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(6) .matka-option-icon {
    background: url("../images/matka/img_halfsg.png") no-repeat;
    background-size: cover;
}

.matka-game-option:nth-child(7) .matka-option-icon {
    background: url("../images/matka/img_fullsg.png") no-repeat;
    background-size: cover;
}

.matka-arrow-right {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #000;
    margin-left: 5px;
}

/* 候选下拉框样式 */
.matka-candidate-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #D69A5B;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.matka-candidate-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    font-family: monospace;
    font-size: 14px;
}

.matka-candidate-option:hover {
    background-color: #f5f5f5;
}

.matka-candidate-option:last-child {
    border-bottom: none;
}

/* 游戏模式按钮美化 */
.matka-game-mode-control button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.matka-game-canvas {
    height: 20vh;
    background: #ffffff;
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    align-content: flex-start;
    justify-content: center;
    align-items: center;
}