/* ==========================================================================
   フォント定義
   ========================================================================== */
@font-face {
  font-family: 'DSEG7-Classic';
  src: url('DSEG7Classic-Italic.woff2') format('woff2'),
       url('DSEG7Classic-Italic.woff') format('woff'),
       url('DSEG7Classic-Italic.ttf') format('truetype');
}

/* 表示部全体の数字フォント指定 */
.digit,
.digit-bg,
.digit-fg,
.digit-layer {
  font-family: 'DSEG7-Classic', monospace !important;
}

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

/* 全体設定（スマホ対策含む） */
html, body {
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Courier New', Courier, monospace;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* 電卓本体外枠 */
.game-container {
  background-color: #cfd0c8;
  border: 4px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* 液晶画面エリア */
.lcd-screen {
  background-color: #8fa082;
  border: 3px inset #6e7e62;
  border-radius: 4px;
  padding: 12px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
}

/* SCORE / STAGE 表示部 */
.info-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #202b18;
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 1px dashed #6e7e62;
  padding-bottom: 4px;
}

/* 8桁7セグメントディスプレイ枠 */
.display-digits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 65px;
  background-color: #829375;
  padding: 0 6px;
  border-radius: 3px;
  overflow: hidden;
}

/* 桁枠の基本設定 */
.digit-wrapper {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 55px;
  text-align: center;
  border: none !important;
}

#digit-0, #digit-1, #digit-wrapper-0 {
  border-right: none !important;
  margin-right: 0 !important;
  padding-right: 0 !important;
}

/* 消灯セグメント（一番奥） */
.digit-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font-family: 'DSEG7-Classic', monospace;
  font-size: 2.8rem;
  color: rgba(0, 0, 0, 0.08);
  text-align: center;
  line-height: 1;
  z-index: 1;
}

/* 前景文字 */
.digit-fg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font-family: 'DSEG7-Classic', monospace;
  font-size: 2.8rem;
  line-height: 1;
  color: #11150f;
  z-index: 2;
}

/* 7セグ重ね合わせ用スタイル（残機用） */
.digit-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  font-family: 'DSEG7-Classic', monospace;
  font-size: 2.8rem;
  line-height: 1;
  text-align: center;
}

.layer-base {
  color: #11150f;
  z-index: 2;
}

.layer-mask {
  color: #829375;
  z-index: 3;
  -webkit-text-stroke: 0.8px #829375;
}

/* ==========================================================================
   コントローラー・ボタン部（レイアウト修復箇所）
   ========================================================================== */
.controls {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* AIM と FIRE を横並びにするラッパー */
.action-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* 全ボタン共通スタイル */
.btn, button {
  padding: 12px 6px;
  font-size: 0.9rem;
  font-weight: bold;
  border: 2px solid #444;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px #777;
  transition: all 0.05s ease;
  
  /* スマホ用対策 */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.btn:active, button:active {
  box-shadow: 0 1px #777;
  transform: translateY(3px);
}

/* STARTボタン（赤色・横一杯） */
#btn-start, .btn-system {
  background-color: #c0392b;
  color: white;
  width: 100%;
}

/* AIM・FIREボタン（横並びで均等幅） */
#btn-aim, #btn-fire, .btn-action {
  flex: 1;
  background-color: #e0e0e0;
  color: #222;
}

/* FIREボタンの色付け（青色） */
#btn-fire, .btn-action.fire {
  background-color: #2980b9;
  color: white;
}

/* ライセンス・著作権表記エリア */
.credits {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  font-family: sans-serif;
}

.credits p {
  margin: 2px 0;
}