@import url("https://fonts.googleapis.com/css2?family=Doto:wght,ROND@815,100&family=Noto+Color+Emoji&family=Shojumaru&display=swap");

/* 赛马榜样式变量 */
.horse-racing-container {
  --primary-color: #c93a3a;         /* 红色主题 */
  --background-color: #f3efe0;      /* 米灰色背景，偏浅 */
  --border-color: #c93a3a;          /* 边框红色 */
  --header-color: #c93a3a;          /* 表头红色 */
  --text-color: #333;               /* 文本颜色 */
  --font-main: "Doto", Arial, sans-serif;  /* 英文字体优先使用 doto */
}

/* 赛马榜容器 */
.horse-racing-container {
  margin: 20px 0;
  font-family: var(--font-main);
}

/* 翻牌容器：使用红色边框 + 圆角 + 阴影 */
.scoreboard {
  background-color: #fff;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

/* ----------- 表头 (8列均分) ----------- */
.score-header {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  text-align: center;
  background-color: var(--header-color);
  color: #fff;
  font-weight: bold;
  height: 50px;
}

.score-header div {
  line-height: 50px;
  font-size: 14px;
}

/* ----------- 数据体部分 ----------- */
.score-body {
  display: flex;
  flex-direction: column;
}

/* 每行固定 50px 高度，避免翻牌动画变形 */
.score-row {
  height: 50px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #ccc;
}

.score-row:last-child {
  /* 若想最后一行也带边框，可注释本行 */
  border-bottom: none;
}

/* ----------- 翻转容器(3D 透视) ----------- */
.flip-container {
  perspective: 800px;
  width: 100%;
  height: 100%;
}

.flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: 0.6s ease;
}

/* front/back 内容：8列均分 */
.front, .back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0; 
  left: 0;
  backface-visibility: hidden;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  text-align: center;
  font-size: 14px;
  color: var(--text-color);
}

.front > div, 
.back > div {
  padding: 0 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.back {
  background: #f9f9f9;
  transform: rotateX(180deg); 
}

.flip-container.flip .flipper {
  transform: rotateX(180deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .score-header div,
  .front > div,
  .back > div {
    font-size: 12px;
  }
  
  .score-header,
  .score-row {
    height: 45px;
  }
  
  .score-header div {
    line-height: 45px;
  }
} 