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

body {
    font-family: 'Arial', sans-serif;
    background: white; /* 改为白色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

.container {
    width: 360px;  /* 9:16比例的宽度 */
    height: 640px; /* 9:16比例的高度 */
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 比赛头部 - 优化设计 */
.match-header {
    background: #0f172a;
    color: #fff;
    padding: 16px 12px 12px;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06);
    animation: none;
    background-size: initial;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.teams-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
    gap: 12px;
    margin: 0 auto;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.team-name {
    font-size: 20px;
    font-weight: 700;
    margin-top: 0;
    color: #fff;
    text-shadow: none;
    letter-spacing: 0.5px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    -webkit-text-fill-color: initial;
    background: none;
    position: relative;
}
.team-name::before { content: none; }

.notice-banner {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #ff1a1a;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 4px 10px;
  display: block;
  width: 100%;
  max-width: 320px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs {
    font-size: 34px;
    font-weight: 900;
    margin: 0 10px;
    letter-spacing: 2px;
    color: #FFD700; /* 纯色，避免移动端剪裁变形 */
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    animation: none;
    position: relative;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.vs::before { content: none; }

/* 足球场容器 - 调整位置和高度 */
.football-field-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 15px 15px 40px 15px; /* 减少上方padding以适应更高的头部 */
    background: white;
    position: relative;
}

/* 足球场 */
.football-field {
    width: 320px;
    height: 480px; /* 稍微减小高度以适应9:16比例 */
    background: linear-gradient(180deg, #4CAF50 0%, #45a049 100%);
    border: 3px solid white;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 中线 */
.center-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
    transform: translateY(-50%);
}

/* 中圈 */
.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* 中点 */
.center-spot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* 球门区域 - 上方 */
.goal-area.top {
    position: absolute;
    top: 0;
    left: 50%;
    width: 120px;
    height: 40px;
    border: 2px solid white;
    border-top: none;
    transform: translateX(-50%);
}

/* 球门区域 - 下方 */
.goal-area.bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 120px;
    height: 40px;
    border: 2px solid white;
    border-bottom: none;
    transform: translateX(-50%);
}

/* 大禁区 - 上方 */
.penalty-area.top {
    position: absolute;
    top: 0;
    left: 50%;
    width: 160px;
    height: 80px;
    border: 2px solid white;
    border-top: none;
    transform: translateX(-50%);
}

/* 大禁区 - 下方 */
.penalty-area.bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 160px;
    height: 80px;
    border: 2px solid white;
    border-bottom: none;
    transform: translateX(-50%);
}

/* 罚球点 - 上方 */
.penalty-spot.top {
    position: absolute;
    top: 60px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: translateX(-50%);
}

/* 罚球点 - 下方 */
.penalty-spot.bottom {
    position: absolute;
    bottom: 60px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: translateX(-50%);
}

/* 球门线 - 上方 */
.goal-line.top {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 60px;
    height: 6px;
    background: white;
    transform: translateX(-50%);
}

/* 球门线 - 下方 */
.goal-line.bottom {
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 60px;
    height: 6px;
    background: white;
    transform: translateX(-50%);
}

/* 角球弧线 */
.corner-arc {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
}

.corner-arc.top-left {
    top: -10px;
    left: -10px;
    border-right: none;
    border-bottom: none;
}

.corner-arc.top-right {
    top: -10px;
    right: -10px;
    border-left: none;
    border-bottom: none;
}

.corner-arc.bottom-left {
    bottom: -10px;
    left: -10px;
    border-right: none;
    border-top: none;
}

.corner-arc.bottom-right {
    bottom: -10px;
    right: -10px;
    border-left: none;
    border-top: none;
}

/* 足球 */
.ball {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #2c3e50;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
}

.ball::before {
    content: '⚽';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* 动作标签 */
.ball-action {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    z-index: 25;
    transform: translate(-50%, -120%);
    white-space: normal; /* 允许换行 */
    max-width: 220px;   /* 控制最大宽度避免超出场地 */
    word-break: break-word; /* 长词也可折行 */
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.ball-action .action-content {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.ball-action .action-emoji {
    font-size: 16px;
}

.ball-action .action-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ball-action .action-team {
    font-size: 10px;
    opacity: 0.8;
}

.ball-action .action-text {
    font-size: 12px;
    font-weight: 600;
}

.ball-action .action-arrow {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.85);
}

/* 智能位置调整 */
.ball-action.near-top-goal {
    transform: translate(-50%, 20px);
}

.ball-action.near-top-goal .action-arrow {
    bottom: auto;
    top: -5px;
    border-top: none;
    border-bottom: 5px solid rgba(0, 0, 0, 0.85);
}

.ball-action.near-bottom-goal {
    transform: translate(-50%, -140%);
}

/* 特效层 */
.effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 30;
}

/* 动画效果 */
.ball.attack-animation {
    animation: attackMove 1s ease-in-out;
}

.ball.shot-animation {
    animation: shotMove 0.8s ease-out;
}

.ball.goal-animation {
    animation: goalCelebration 2s ease-out;
}

.ball.save-animation {
    animation: saveMove 0.6s ease-out;
}

.ball.possession-animation {
    animation: possessionMove 1.2s ease-in-out;
}

@keyframes attackMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes shotMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    30% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes goalCelebration {
    0% { transform: translate(-50%, -50%) scale(1); }
    25% { transform: translate(-50%, -50%) scale(1.5); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    75% { transform: translate(-50%, -50%) scale(1.4); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes saveMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.8); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes possessionMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-50%, -50%) scale(1.1); }
    66% { transform: translate(-50%, -50%) scale(0.9); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* 响应式设计已移除：为确保与脚本中固定的320x480坐标系一致，保持容器360x640、球场320x480的固定尺寸，不随视口变化。 */

/* 补充动画类，匹配脚本中的类型，避免效果缺失 */
.ball.corner-animation { animation: cornerMove 1s ease-out; }
.ball.goal_kick-animation { animation: goalKickMove 1s ease-out; }
.ball.pass-animation { animation: passMove 0.6s ease-in-out; }
.ball.kickoff-animation { animation: kickoffMove 1s ease-out; }

/* 进球特效（脚本中使用 .goal-effect） */
.goal-effect {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    padding: 6px 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    letter-spacing: 1px;
    z-index: 40;
    animation: goalEffectPop 0.8s ease-out, goalEffectFade 4s ease-in forwards;
}

@keyframes cornerMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    30% { transform: translate(-50%, -50%) scale(1.15); }
    60% { transform: translate(-50%, -50%) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes goalKickMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    25% { transform: translate(-50%, -50%) scale(1.2); }
    75% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes passMove {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes kickoffMove {
    0% { transform: translate(-50%, -50%) scale(0.9); box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
    50% { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 0 0 8px rgba(255,255,255,0.15); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

@keyframes goalEffectPop {
    0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes goalEffectFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}