/* 分机候场页样式（从 templates/team/lobby.html 外置，2026-11-24）。
 * 本文件不含 Jinja 模板语法。
 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 560px;
    width: 90%;
}
.header {
    text-align: center;
    margin-bottom: 28px;
}
.header .icon {
    font-size: 56px;
    margin-bottom: 12px;
}
.header h1 {
    color: #333;
    margin: 0 0 8px 0;
    font-size: 28px;
}
.header .subtitle {
    color: #999;
    font-size: 14px;
}
.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}
.enter-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.3s;
    white-space: nowrap;
}
.enter-btn:hover {
    opacity: 0.9;
}
.enter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.hint-box {
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    color: #874d00;
    font-size: 14px;
    line-height: 1.6;
}
.hint-box .hint-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.error-msg {
    color: #ff4d4f;
    font-size: 14px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
    text-decoration: none;
}
.back-link:hover {
    color: #667eea;
}

/* 自由加入弹窗按钮 + 选择比赛卡片 */
.br-freejoin-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    font-size: 16px;
    font-weight: 700;
}
.br-freejoin-btn:hover {
    opacity: 0.92;
}
.view-btn {
    padding: 12px 20px;
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.view-btn:hover {
    background: #f0f2ff;
}
.join-comp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.join-comp-card:hover {
    border-color: #667eea;
    background: #f7f8ff;
}
.join-comp-emoji {
    font-size: 28px;
}
.join-comp-info {
    flex: 1;
}
.join-comp-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.join-comp-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.join-comp-arrow {
    font-size: 22px;
    color: #ccc;
}
.join-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 12px 0;
}

/* 自由加入弹窗 */
.br-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}
.br-modal-mask.show { display: flex; }
.br-modal-card {
    background: white;
    border-radius: 14px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.br-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.br-modal-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 16px;
}
.br-modal-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}
.br-modal-card input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.br-modal-err {
    color: #ff4d4f;
    font-size: 13px;
    min-height: 18px;
    margin-top: 8px;
}
.br-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.br-modal-actions .enter-btn {
    flex: 1;
}
.br-success-link {
    background: #f7f7fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #555;
    word-break: break-all;
    margin-top: 12px;
}

/* 已加入比赛 — 一键返回继续参赛 */
.returned-join {
    background: #f0f5ff;
    border: 1px solid #adc6ff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 16px;
    transition: border-color 0.2s;
}
.returned-join:hover {
    border-color: #667eea;
}
.returned-join .rj-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.returned-join .rj-emoji {
    font-size: 26px;
}
.returned-join .rj-info {
    flex: 1;
}
.returned-join .rj-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}
.returned-join .rj-sub {
    font-size: 12px;
    color: #874d00;
    margin-top: 2px;
}
.returned-join .rj-btn {
    margin-top: 10px;
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.returned-join .rj-btn:hover {
    opacity: 0.92;
}

/* 手机端：根据屏幕宽度，将「进入/查看」按钮移到输入框下方，总宽度与输入框对齐 */
@media (max-width: 640px) {
    .input-group {
        flex-wrap: wrap;
    }
    .input-group input {
        flex: 1 1 100%;
    }
    .input-group .enter-btn,
    .input-group .view-btn {
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    .container {
        padding: 24px 16px;
    }
}
