/* ゲームページ専用の装飾。配色は ../style.css の CSS 変数を継承する。 */

.game-page { max-width: 62rem; }

.game-title { font-size: 1.5rem; margin: 0 0 0.4rem; letter-spacing: 0.02em; }
.game-lead { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.4rem; }

/* ---------------------------------------------------------------- 画面 */
.game-shell { margin: 0 0 2.6rem; }

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 620;
  background: #0b1030;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}
.canvas-wrap canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
  touch-action: none;
}

/* ---------------------------------------------------------------- 操作バー */
.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 0.9rem 0 0;
}
.bar-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 0.35rem;
}
.bar-label:first-child { margin-left: 0; }

.gbtn {
  font: inherit;
  font-size: 0.88rem;
  line-height: 1;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.gbtn:hover { border-color: var(--accent); color: var(--accent); }
.gbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.game-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 0.7rem 0 0;
}

.rotate-hint { display: none; }
@media (pointer: coarse) and (orientation: portrait) {
  .rotate-hint {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0.45rem 0 0;
  }
}

/* ---------------------------------------------------------------- タッチパッド */
.touchpad {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin: 1rem 0 0;
  user-select: none;
  -webkit-user-select: none;
}
.touchpad[hidden] { display: none; }

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 3.4rem);
  grid-template-rows: repeat(3, 3.4rem);
  gap: 0.3rem;
}
.dpad .du { grid-area: 1 / 2; }
.dpad .dl { grid-area: 2 / 1; }
.dpad .dd { grid-area: 3 / 2; }
.dpad .dr { grid-area: 2 / 3; }

.actbtns {
  display: grid;
  grid-template-columns: repeat(2, 3.6rem);
  gap: 0.45rem;
}

.tbtn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  min-height: 3.4rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--fg);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.tbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tbtn.jp { background: rgba(120, 190, 255, 0.22); }
.tbtn.jk { background: rgba(255, 214, 92, 0.24); }
.tbtn.jh { background: rgba(255, 140, 110, 0.24); }
.tbtn.js { background: rgba(190, 140, 255, 0.24); }
.tbtn.small {
  font-size: 0.78rem;
  font-weight: 400;
  min-width: 2.6rem;
  min-height: 2.6rem;
  border-radius: 10px;
}

.smallbtns {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 720px) {
  .dpad { grid-template-columns: repeat(3, 3rem); grid-template-rows: repeat(3, 3rem); }
  .actbtns { grid-template-columns: repeat(2, 3.2rem); }
  .tbtn { min-width: 3rem; min-height: 3rem; }
}

/* ---------------------------------------------------------------- 解説 */
.game-help h2 {
  font-size: 1.2rem;
  margin: 2.6rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.game-help h3 { font-size: 1rem; margin: 1.6rem 0 0.5rem; }
.game-note { color: var(--muted); font-size: 0.92rem; }

.help-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0 2rem;
}

.help-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  margin: 0.4rem 0 1rem;
}
.help-table th, .help-table td {
  border: 1px solid var(--border);
  padding: 0.45em 0.7em;
  text-align: left;
  vertical-align: top;
}
.help-table th { background: var(--code-bg); font-weight: 700; white-space: nowrap; }
.help-table.moves th { white-space: nowrap; }
.help-table.moves td:nth-child(n+3), .help-table.moves th:nth-child(n+3) { text-align: right; }

kbd {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
}

ul.rights { padding-left: 1.3em; font-size: 0.94rem; }
ul.rights li { margin: 0.45em 0; }