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

body, html {
    width: 100%;
    height: 100%;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1e1e2e;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    overflow-y: auto; /* Allow scrolling */
    -webkit-overflow-scrolling: touch;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    padding: 20px;
}

/* 显示面板 */
.display-panel {
    flex: 1;
    background: #2a2a3b;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-info {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-size: 1.2rem;
    color: #a0a0b0;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e2e;
    border-radius: 15px;
    padding: 15px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.team-label {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 5px;
}

.team-name {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    word-break: break-all;
    width: 100%;
}

.aff-team .team-name { color: #ff6b6b; }
.neg-team .team-name { color: #6b6bff; }

.team-time {
    font-size: 2.5rem;
    font-family: monospace;
    font-weight: bold;
    opacity: 0.5;
    transition: all 0.2s;
}

.team-time.active {
    opacity: 1;
    transform: scale(1.1);
}

.aff-team .team-time.active { color: #ff6b6b; text-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
.neg-team .team-time.active { color: #6b6bff; text-shadow: 0 0 10px rgba(107, 107, 255, 0.5); }

.team-time.danger {
    color: #e74c3c !important;
    animation: pulse 1s infinite;
}

.vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: #f1c40f;
    opacity: 0.8;
}

/* 控制面板 */
.control-panel {
    flex: 1;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    height: 100%;
}

.btn {
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent; /* Remove default tap highlight */
}

.btn:active {
    transform: scale(0.92) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn .icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.btn-aff { background: linear-gradient(135deg, #ff4757, #ff6b81); grid-column: 1; grid-row: 1 / span 2; }
.btn-neg { background: linear-gradient(135deg, #5f27cd, #341f97); grid-column: 2; grid-row: 1 / span 2; }

.btn-stop { background: linear-gradient(135deg, #e17055, #d63031); grid-column: 1 / span 2; grid-row: 3; font-size: 1.3rem; }
.btn-stop .icon { font-size: 2.2rem; }

.btn-nav { background: #34495e; grid-row: 4; }
.btn-reset { background: #f39c12; grid-column: 1 / span 2; grid-row: 5; margin-top: 5px; } /* Added reset as full width at bottom */

/* 底部栏 */
.bottom-bar {
    margin-top: 15px;
    margin-bottom: 10px;
    height: 60px;
    display: flex;
    flex-shrink: 0;
}

.btn-setting {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-setting .icon {
    margin-right: 10px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}