/**
 * UI组件样式
 */

/* UI层：全屏浮动在canvas之上 */
#uiLayer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* UI 隐藏状态 */
#uiLayer.ui-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* UI 隐藏时，交互元素仍然可见（如按钮） */
#uiLayer.ui-hidden .ui-corner {
    opacity: 0;
    visibility: hidden;
}

/* UI 隐藏时，全屏消息仍然可见 */
#uiLayer.ui-hidden #matchResult,
#uiLayer.ui-hidden #halftimeMessage,
#uiLayer.ui-hidden #goalMessage,
#uiLayer.ui-hidden #cardSelection {
    opacity: 1;
    visibility: visible;
}

/* UI角落容器 */
.ui-corner {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ui-top-left {
    top: 20px;
    left: 20px;
    align-items: flex-start;
}

.ui-top-right {
    top: 20px;
    right: 20px;
    align-items: flex-end;
}

.ui-bottom-left {
    bottom: 20px;
    left: 20px;
    align-items: flex-start;
}

.ui-bottom-right {
    bottom: 20px;
    right: 20px;
    align-items: flex-end;
}

/* 种子显示 */
#seedDisplay {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid rgba(243, 156, 18, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    min-width: 110px;
}

#seedDisplay .seed-label {
    color: #f39c12;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
}

#seedDisplay .seed-value {
    font-family: 'Courier New', monospace;
    color: #ecf0f1;
    user-select: all;
    cursor: text;
    font-size: 11px;
    word-break: break-all;
}

/* 比赛计时器 */
#matchTimer {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
}

.match-time {
    font-size: 18px;
    font-weight: bold;
    color: #f39c12;
}

.match-phase {
    font-size: 9px;
    color: #bdc3c7;
    letter-spacing: 0.5px;
}

/* 进球记录 */
#goalRecords {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    min-width: 140px;
    max-width: 160px;
    max-height: 240px;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
}

#goalRecords::-webkit-scrollbar {
    width: 6px;
}

#goalRecords::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#goalRecords::-webkit-scrollbar-thumb {
    background: rgba(243, 156, 18, 0.6);
    border-radius: 3px;
}

.goal-record-title {
    font-size: 12px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px solid rgba(243, 156, 18, 0.3);
    padding-bottom: 8px;
}

.goal-record-item {
    font-size: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.goal-record-team.blue {
    color: #3498db;
}

.goal-record-team.red {
    color: #e74c3c;
}

/* 跟随按钮 */
#followButton {
    padding: 12px 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#followButton:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

#followButton.active {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.8), rgba(44, 62, 80, 0.8));
    border-color: rgba(52, 152, 219, 0.5);
}

/* 球队信息面板 */
.team-info {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    min-width: 140px;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.team-info.blue-team {
    border-left: 4px solid #3498db;
}

.team-info.red-team {
    border-right: 4px solid #e74c3c;
    border-left: none;
}

.team-name-label {
    font-size: 10px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.team-info.blue-team .team-name-label {
    color: #3498db;
}

.team-info.red-team .team-name-label {
    color: #e74c3c;
}

.team-name {
    font-size: 11px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 6px;
}

.team-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-card-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.team-card-item .icon {
    font-size: 14px;
}

.team-card-item .name {
    color: #ecf0f1;
    flex: 1;
}

.team-card-item .rarity {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.team-card-item .rarity.common {
    background: rgba(149, 165, 166, 0.3);
    color: #bdc3c7;
}

.team-card-item .rarity.rare {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.team-card-item .rarity.epic {
    background: rgba(155, 89, 182, 0.3);
    color: #9b59b6;
}

.team-card-item .rarity.legendary {
    background: rgba(243, 156, 18, 0.3);
    color: #f39c12;
}

/* UI隐藏时的全屏遮罩 */
.ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ui-overlay-text {
    color: rgba(236, 240, 241, 0.8);
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    /* background: rgba(243, 156, 18, 0.2); */
    /* border: 2px solid rgba(243, 156, 18, 0.5); */
    border-radius: 10px;
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    animation: overlayPulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

@keyframes overlayPulse {
    0%, 100% {
        opacity: 0.9;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}
