/* 驼铃比赛 H5 - 移动端微信适配 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: calc(100vw / 7.5);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: #f5f6f8;
  color: #1a1a2e;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: #2d6cdf; text-decoration: none; }

.container {
  max-width: 7.5rem;
  margin: 0 auto;
  padding: 0.32rem;
}

.card {
  background: #fff;
  border-radius: 0.16rem;
  padding: 0.32rem;
  margin-bottom: 0.24rem;
  box-shadow: 0 0.02rem 0.12rem rgba(0,0,0,0.06);
}

.btn {
  display: inline-block;
  padding: 0.2rem 0.48rem;
  border: none;
  border-radius: 0.12rem;
  font-size: 0.28rem;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: #2d6cdf; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-disabled { background: #ccc; color: #666; pointer-events: none; }

.tag {
  display: inline-block;
  padding: 0.06rem 0.16rem;
  border-radius: 0.08rem;
  font-size: 0.22rem;
}
.tag-registering { background: #e8f4fd; color: #2d6cdf; }
.tag-drawing { background: #fff3e0; color: #f57c00; }
.tag-playing { background: #e8f5e9; color: #388e3c; }
.tag-finished { background: #f3e5f5; color: #7b1fa2; }

.header {
  font-size: 0.36rem;
  font-weight: 600;
  margin-bottom: 0.24rem;
}

.opponent-banner {
  background: linear-gradient(135deg, #2d6cdf, #5b8def);
  color: #fff;
  border-radius: 0.16rem;
  padding: 0.32rem;
  margin-bottom: 0.24rem;
  display: flex;
  align-items: center;
  gap: 0.24rem;
}
.opponent-banner img {
  width: 0.96rem;
  height: 0.96rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 0.04rem solid rgba(255,255,255,0.6);
}
.opponent-banner .label { font-size: 0.24rem; opacity: 0.85; }
.opponent-banner .name { font-size: 0.32rem; font-weight: 600; }

/* 对阵图容器：横向滚动，禁止拉伸变形 */
.bracket-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  background: #fff;
  border-radius: 0.16rem;
  padding: 0.24rem 0;
}

.bracket-canvas {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  padding: 0.16rem 0.24rem;
  transform-origin: left top;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-shrink: 0;
  width: 2.4rem;
  margin-right: 0.48rem;
  position: relative;
}

.bracket-round-title {
  text-align: center;
  font-size: 0.22rem;
  color: #888;
  margin-bottom: 0.16rem;
  flex-shrink: 0;
}

.bracket-match {
  background: #f8f9fb;
  border: 0.02rem solid #e0e4ea;
  border-radius: 0.1rem;
  margin: 0.12rem 0;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 1.28rem;
}

.bracket-match.highlight {
  border-color: #2d6cdf;
  box-shadow: 0 0 0 0.04rem rgba(45,108,223,0.25);
}

.bracket-player {
  display: flex;
  align-items: center;
  padding: 0.12rem 0.16rem;
  font-size: 0.24rem;
  gap: 0.12rem;
  min-height: 0.64rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bracket-player.winner { background: #e8f4fd; font-weight: 600; }
.bracket-player.me { background: #fff8e1; }

.bracket-player img {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bracket-player .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.bracket-divider {
  height: 0.02rem;
  background: #e0e4ea;
}

/* SVG 连接线层 */
.bracket-lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

/* 小组赛积分表 */
.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.24rem;
}
.group-table th, .group-table td {
  padding: 0.16rem 0.12rem;
  text-align: center;
  border-bottom: 0.02rem solid #eee;
}
.group-table th { color: #888; font-weight: 500; }

/* 领奖台 */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.16rem;
  padding: 0.32rem 0;
}
.podium-item {
  text-align: center;
  flex: 1;
  max-width: 2rem;
}
.podium-item img {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.08rem;
}
.podium-bar {
  border-radius: 0.08rem 0.08rem 0 0;
  padding: 0.16rem 0.08rem;
  color: #fff;
  font-size: 0.22rem;
}
.podium-1 .podium-bar { background: #ffd700; height: 1.6rem; }
.podium-2 .podium-bar { background: #c0c0c0; height: 1.2rem; }
.podium-3 .podium-bar { background: #cd7f32; height: 0.9rem; }

.form-group { margin-bottom: 0.24rem; }
.form-group label { display: block; font-size: 0.26rem; color: #666; margin-bottom: 0.08rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.2rem;
  border: 0.02rem solid #ddd;
  border-radius: 0.1rem;
  font-size: 0.28rem;
}

.nav-bar {
  display: flex;
  gap: 0.16rem;
  margin-bottom: 0.32rem;
}
.nav-bar a {
  flex: 1;
  text-align: center;
  padding: 0.2rem;
  background: #fff;
  border-radius: 0.12rem;
  font-size: 0.26rem;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 0.24rem 0.48rem;
  border-radius: 0.12rem;
  font-size: 0.28rem;
  z-index: 9999;
  display: none;
}
