:root {
    --bg-color: var(--tg-theme-bg-color, #ffffff);
    --text-color: var(--tg-theme-text-color, #000000);
    --hint-color: var(--tg-theme-hint-color, #999999);
    --link-color: var(--tg-theme-link-color, #2678b6);
    --button-color: var(--tg-theme-button-color, #2678b6);
    --button-text-color: var(--tg-theme-button-text-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #f0f0f0);
    --section-bg: var(--tg-theme-section-bg-color, #ffffff);
    --section-separator: var(--tg-theme-section-separator-color, #e0e0e0);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 12px;
    -webkit-text-size-adjust: 100%;
}

.header {
    margin-bottom: 16px;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.mode-switch {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 12px;
}

.switch-label {
    font-size: 13px;
    color: var(--hint-color);
    display: block;
    margin-bottom: 8px;
}

.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--secondary-bg);
    color: var(--hint-color);
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--button-color);
    color: var(--button-text-color);
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--hint-color);
}

.game-card {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 14px;
    border-left: 4px solid var(--hint-color);
    transition: all 0.2s;
}

.game-card.approved {
    border-left-color: #34c759;
    background: #34c75910;
}

.game-card.rejected {
    border-left-color: #ff3b30;
    background: #ff3b3008;
}

.game-card.pending {
    border-left-color: #ff9500;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.game-date {
    font-size: 15px;
    font-weight: 600;
}

.status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}

.status-badge.approved {
    background: #34c75930;
    color: #34c759;
}

.status-badge.rejected {
    background: #ff3b3025;
    color: #ff3b30;
}

.status-badge.pending {
    background: #ff950025;
    color: #ff9500;
}

.game-name {
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.game-info {
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 8px;
    line-height: 1.5;
}

.game-info span {
    display: inline-block;
    margin-right: 12px;
}

.game-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.badge.reg-open {
    background: #34c75920;
    color: #34c759;
}

.badge.reg-closed {
    background: #ff3b3020;
    color: #ff3b30;
}

.badge.full {
    background: #ff950020;
    color: #ff9500;
}

.badge.teams-info {
    background: var(--secondary-bg);
    color: var(--hint-color);
}

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

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.action-btn:active {
    opacity: 0.7;
}

.action-btn.approve {
    background: #34c75920;
    color: #34c759;
}

.action-btn.reject {
    background: #ff3b3020;
    color: #ff3b30;
}

.action-btn.reset {
    background: var(--secondary-bg);
    color: var(--hint-color);
}

.action-btn.selected {
    opacity: 0.5;
    cursor: default;
}

.status-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-label.approved { color: #34c759; }
.status-label.rejected { color: #ff3b30; }
.status-label.pending { color: #ff9500; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--hint-color);
    font-size: 14px;
}

.auto-mode-notice {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 4px;
}

.teams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-card {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-info {
    flex: 1;
}

.team-name {
    font-size: 15px;
    font-weight: 600;
}

.team-email {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 2px;
}

.team-toggle {
    position: relative;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
    margin-left: 12px;
}

.team-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.team-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #e0e0e0;
    border-radius: 31px;
    transition: background 0.2s;
}

.team-toggle .slider::before {
    content: "";
    position: absolute;
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.team-toggle input:checked + .slider {
    background: #34c759;
}

.team-toggle input:checked + .slider::before {
    transform: translateX(20px);
}
