/* Steamライブラリ・ゴリラ換算シミュレーター - style.css */

:root {
  --bg-color: rgb(10, 25, 50);
  --cyan-glow: rgb(0, 180, 255);
  --cyan-dim: rgba(0, 180, 255, 0.4);
  --cyan-bg: rgba(0, 160, 255, 0.08);
  --cyan-grid: rgba(0, 180, 255, 0.07);
  --yellow-highlight: rgb(255, 200, 0);
  --text-color: rgb(200, 225, 255);
  --text-dim: rgb(140, 175, 215);
  --error-color: rgb(255, 70, 70);
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  padding: 20px;
}

/* 背景グリッド */
.blueprint-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-image: 
    linear-gradient(var(--cyan-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyan-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* 最外枠デコレーション */
.blueprint-outer-frame {
  position: relative;
  border: 1px solid var(--cyan-dim);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  background: rgba(10, 25, 50, 0.2);
}

.blueprint-outer-frame::before {
  content: "";
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid rgba(0, 180, 255, 0.15);
  pointer-events: none;
}

/* 四隅の照準（エイム）マーク */
.aim-mark {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 10;
}
.aim-mark::before,
.aim-mark::after {
  content: "";
  position: absolute;
  background-color: var(--cyan-glow);
}
/* 横線 */
.aim-mark::before {
  top: 7px; left: 0;
  width: 16px; height: 1px;
}
/* 縦線 */
.aim-mark::after {
  top: 0; left: 7px;
  width: 1px; height: 16px;
}
.aim-mark.tl { top: -8px; left: -8px; }
.aim-mark.tr { top: -8px; right: -8px; }
.aim-mark.bl { bottom: -8px; left: -8px; }
.aim-mark.br { bottom: -8px; right: -8px; }


.container {
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* ヘッダー ＋ 入力エリア */
.header {
  position: relative;
  padding: 15px 0 25px 0;
  text-align: center;
  border-bottom: 1px dashed var(--cyan-dim);
}

.title {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-color);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.input-area-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}

.input-label {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-color);
}

.input-wrapper {
  position: relative;
}

.blueprint-input {
  background: rgba(15, 35, 70, 0.6);
  border: 1px solid var(--cyan-dim);
  color: var(--yellow-highlight);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: bold;
  padding: 4px 12px;
  width: 140px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.blueprint-input:focus {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 8px rgba(0, 180, 255, 0.3);
}

.blueprint-input::-webkit-outer-spin-button,
.blueprint-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.blueprint-input[type="number"] {
  -moz-appearance: textfield;
}

.input-unit {
  font-size: 1rem;
  color: var(--text-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  margin-top: 10px;
  min-height: 1.2rem;
  transition: opacity 0.3s;
}

.error-message.hidden {
  opacity: 0;
}

/* ブループリント風枠線 */
.blueprint-border {
  position: relative;
  border: 1px solid var(--cyan-dim);
  background-color: rgba(10, 25, 50, 0.4);
}



/* メイン結果カード */
.result-card {
  position: relative;
  border: 1px solid var(--cyan-glow);
  background-color: rgba(10, 25, 50, 0.7);
  padding: 40px 30px 30px 30px;
  margin-top: 15px;
}

/* コーナー装飾 */
.card-corner-decor {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.card-corner-decor::before,
.card-corner-decor::after {
  content: "";
  position: absolute;
  background-color: var(--cyan-glow);
}
.card-corner-decor.tl { top: 4px; left: 4px; border-top: 1px solid var(--cyan-glow); border-left: 1px solid var(--cyan-glow); }
.card-corner-decor.tr { top: 4px; right: 4px; border-top: 1px solid var(--cyan-glow); border-right: 1px solid var(--cyan-glow); }
.card-corner-decor.bl { bottom: 4px; left: 4px; border-bottom: 1px solid var(--cyan-glow); border-left: 1px solid var(--cyan-glow); }
.card-corner-decor.br { bottom: 4px; right: 4px; border-bottom: 1px solid var(--cyan-glow); border-right: 1px solid var(--cyan-glow); }

/* タイトルプレート (枠線の上に重なる) */
.card-title-plate {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-color);
  border: 1px solid var(--cyan-glow);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: bold;
  padding: 4px 24px;
  letter-spacing: 2px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 5;
}

/* カードボディの3カラム構成 (中央のケース山を520pxに広げ、右カラムは縦並びで280pxに抑制) */
.card-body {
  display: grid;
  grid-template-columns: 240px 520px 280px;
  gap: 20px;
  align-items: end;
}

/* 左側カラム */
.card-left-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-count-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-label {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 3.2rem; /* はみ出し・改行防止のため4remから3.2remに微調整 */
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap; /* 改行を絶対に防止 */
}

.value-unit {
  font-size: 1.5rem;
  margin-left: 6px;
  color: #ffffff;
  font-weight: normal;
}

.package-details-block {
  padding: 16px;
  border: 1px solid rgba(200, 225, 255, 0.25); /* 白めの枠 */
}

.block-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--cyan-dim);
  padding-bottom: 6px;
}

.package-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.package-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.icon {
  width: 14px;
  height: 14px;
  color: var(--cyan-glow);
}

.item-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
}

/* 中央: ケース山のみ */
.card-center-column {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
}

.canvas-container {
  width: 520px; /* 横幅を520pxに広域拡張 */
  height: 450px; /* 縦幅を450pxに引き上げて山頂まで描ききる */
  position: relative;
}

#mountain-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 右側: 各ブロック縦積み */
.card-right-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 280px;
  align-self: end;
}

/* ゴリラコンテナ */
.gorilla-container {
  width: 250px;
  height: 180px; 
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: center; 
  margin: 5px 0;
  overflow: hidden; 
}

.gorilla-img {
  width: auto;
  height: 210px; 
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 180, 255, 0.45));
  margin-bottom: -25px; 
  margin-top: -20px; 
}

.gorilla-val-block,
.gorilla-food-block {
  padding: 16px;
  background-color: rgba(10, 25, 50, 0.5);
  border: 1px solid var(--cyan-dim);
  width: 100%;
}

.gorilla-label,
.food-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.gorilla-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 3.6rem; /* 換算比率をさらに巨大に */
  font-weight: 800;
  color: var(--yellow-highlight);
  line-height: 1;
}

.gorilla-unit {
  display: inline;
  font-size: 1.1rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: normal;
}

.food-value {
  font-family: var(--font-mono);
  font-size: 2.2rem; /* 食費をさらに巨大に */
  font-weight: 800;
  color: var(--yellow-highlight);
}

.food-unit {
  font-size: 1.2rem;
  margin-left: 4px;
  color: var(--yellow-highlight);
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
  .card-body {
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: center;
  }
  
  .card-left-column {
    align-items: center;
    text-align: center;
  }

  .package-details-block {
    width: 100%;
    max-width: 320px;
  }
  
  .card-center-column {
    order: -1; /* ビジュアルを上部に配置 */
    width: 100%;
  }

  .canvas-container {
    width: 100%;
    max-width: 480px;
    height: auto; /* PC用の固定450pxを解除 */
    aspect-ratio: 520 / 450; /* 比率を維持して縮小 */
  }

  .card-right-column {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

@media (max-width: 576px) {
  .title {
    font-size: 1.5rem;
  }

  .input-area-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .summary-value {
    font-size: 2.6rem;
  }
}
