body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

#tug-app {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.tug-header {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto 20px;
  max-width: 1200px;
  position: relative;
  z-index: 2;
}

.tug-header h1 {
  font-size: clamp(1.2rem, min(4vw, 5vh), 2.2rem);
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.tug-header p {
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.timer {
  color: var(--accent-yellow);
  font-size: clamp(1.8rem, min(5vw, 8vh), 3.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  margin-left: auto;
  min-width: clamp(60px, 10vw, 100px);
  text-align: right;
  background: var(--bg-surface);
  padding: 4px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
}

.arena {
  display: flex;
  height: min(calc(100dvh - 96px), 680px);
  margin: 0 auto;
  max-width: 1200px;
  position: relative;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-medium);
}

.tug-side {
  align-items: center;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  min-width: 50%;
  padding: 24px;
  position: relative;
  z-index: 1;
  transition: filter 150ms ease, transform 100ms ease;
}

.left-side {
  background: var(--zone-left-bg);
  border-right: 2px dashed rgba(77, 171, 247, 0.35);
}

.right-side {
  background: var(--zone-right-bg);
  border-left: 2px dashed rgba(255, 107, 107, 0.35);
}

.tug-side:active {
  filter: brightness(0.97);
  transform: scale(0.995);
}

.player-label,
.team-label,
.tug-side > span:last-child {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--bg-surface-translucent);
  color: var(--text-primary);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
}

.tug-side strong {
  font-size: clamp(3.2rem, min(14vw, 18vh), 8.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-weight: 900;
  color: var(--text-primary);
}

.rope {
  align-items: center;
  background: var(--rope-color);
  border-radius: var(--radius-full);
  display: flex;
  height: 14px;
  left: 8%;
  pointer-events: none;
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 3;
}

.rope::before {
  background: var(--rope-mark-color);
  content: "";
  height: 28px;
  left: 50%;
  position: absolute;
  width: 4px;
  border-radius: 2px;
  transform: translateX(-50%);
}

#marker {
  background: var(--accent-pink);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 6px 20px var(--accent-pink-glow);
  height: 38px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: 38px;
  transition: transform 120ms ease;
}

.tug-console {
  align-items: center;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 18px;
  left: 50%;
  padding: 32px 36px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 440px);
  z-index: 3;
  color: var(--text-primary);
}

.tug-console header h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.tug-console header p {
  color: var(--text-muted);
  font-weight: 600;
  margin: 6px 0 10px;
}

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.hidden {
  display: none !important;
}

.game-status-msg,
#message {
  align-items: center;
  display: flex;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.start-button {
  align-self: center;
  background: linear-gradient(135deg, var(--accent-pink) 0%, #FA5252 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 24px var(--accent-pink-glow);
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  margin-inline: auto;
  min-height: 56px;
  padding: 12px 32px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  width: min(300px, 80vw);
}

.start-button:hover,
.start-button:focus-visible {
  box-shadow: 0 14px 32px var(--accent-pink-glow);
  outline: none;
  transform: translateY(-3px);
}

.start-button:active {
  transform: translateY(1px) scale(0.98);
}

@media (max-width: 640px) {
  #tug-app {
    padding: 14px;
  }
  .arena {
    height: calc(100dvh - 96px);
  }
  .tug-side {
    padding: 12px;
  }
  .tug-side > span:last-child {
    font-size: 0.72rem;
    padding: 4px 10px;
  }
  .tug-header {
    gap: 10px;
  }
  .tug-console {
    padding: 24px 20px;
  }
}
