.game-header {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0 22px 0;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .game-header {
    gap: 12px;
  }
}

.slot-panel {
  width: 100%;
  background-color: #342D2F;
}

.slot-header {
  width: 100%;
  text-align: center;
}

.slot-header img{
  display: inline-block;
  height: 70px;
}

@media (min-width: 640px) {
  .slot-header img{
    margin: 10px;
    height: 80px;
  }
}

.reel-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 16px;
}

.reel-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

@media (min-width: 640px) {
  .reel-column {
    gap: 14px;
  }
}

.reel-window-frame {
  min-width: 0;
  padding: 10px 2px;
  background: #342D2F;
}

.reel-window {
  position: relative;
  background: #EBE2D4;
  border: 1px solid #342D2F;
  padding: 6px;
  height: 220px;
  max-height: 220px;
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .reel-window {
    padding: 10px;
    height: 276px;
    max-height: 276px;
  }
}

.reel-track {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  width: 100%;
  will-change: transform;
  /* requestAnimationFrameで毎フレーム直接transformを設定するため、CSSトランジションは使用しない */
}

@media (min-width: 640px) {
  .reel-track {
    gap: 10px;
  }
}

.reel-cell {
  height: 90px;
  padding: 10px 4px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 700;
}

@media (min-width: 640px) {
  .reel-cell {
    height: 110px;
    padding: 10px 8px;
    font-size: 1.1rem;
  }
}

.reel-cell img {
  max-width: 100%;
  max-height: 80px; /* セル高さ90px - 上下余白10px*2。%指定はグリッド内で解決されないため実寸で指定する */
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (min-width: 640px) {
  .reel-cell img {
    max-height: 90px; /* セル高さ110px - 上下余白10px*2 */
  }
}

/* ストップエリア（非表示） */
.reel-center-line {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 96px;
  transform: translateY(-50%);
  border-top: 2px solid rgba(15, 23, 42, 0.16);
  border-bottom: 2px solid rgba(15, 23, 42, 0.16);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.04));
}

@media (min-width: 640px) {
  .reel-center-line {
    height: 116px;
  }
}

.reel-button-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 18px;
}

.reel-button {
  position: relative;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 0;
  margin: 0 auto;
  background: #342D2F;
  border: none;
  transition: none;
  /* 正方形を階段状の八角形に切り抜いてドット表現にする */
  clip-path: polygon(
    30% 0%, 70% 0%, 70% 10%, 90% 10%, 90% 30%, 100% 30%, 100% 70%,
    90% 70%, 90% 90%, 70% 90%, 70% 100%, 30% 100%, 30% 90%, 10% 90%,
    10% 70%, 0% 70%, 0% 30%, 10% 30%, 10% 10%, 30% 10%
  );
}

.reel-button:hover {
  background: #342D2F;
}

/* リール回転中の色。停止したら即座に元の色へ戻る */
.reel-button--active,
.reel-button--active:hover {
  background: #dc2626;
}

.reel-button::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  background: #EBE2D4;
}

@media (min-width: 640px) {
  .reel-button {
    width: 50px;
    height: 50px;
    min-height: 50px;
  }

  .reel-button::after {
    top: 10px;
    left: 10px;
    width: 8px;
    height: 8px;
  }
}

#slot-screen {
  min-height: 100vh;
}

#slot-screen.screen--active {
  display: flex;
  flex-direction: column;
}

.reel-start {
  width: 100%;
  flex: 1 0 auto;
  padding: 20px 0;
  background-color: #50474A;
  text-align: center;
}

/* CSSボタン（不使用）
.reel-start-button {
  width: 100%;
  max-width: 320px;
}

.reel-start-button--result {
  background-color: #dc2626;
}
*/

/* 画像版ボタン */
.reel-start-button {
  width: 100%;
  aspect-ratio: 512 / 334;
  max-width: 200px;
  height: auto;
  padding: 0;
  font-size: 20px;
  border: none;
  background-color: transparent;
  background-image: url("../img/slot/reel_button_enable.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  clip-path: none;
  transition: none;
}

@media (min-width: 500px) {
  .reel-start-button {
    max-width: 240px;
  }
}

/* まわすボタン無効画像 */
.reel-start-button--disabled {
  background-image: url("../img/slot/reel_button_disable.png");
  color: #EBE2D4;
}

/* 結果を見る！状態への切り替え時の背景色付与（画像版では使用しないためコメントアウト）
.reel-start-button--result {
  background-color: rgba(220, 38, 38, 0.35);
}
*/

.game-footer {
  width: calc(100% - 32px);
  max-width: 468px;
  position: fixed;
  left: max(16px, calc((100vw - 500px) / 2 + 16px));
  bottom: 16px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
}
