/* 「あっちむいてほい」固有の盤面。共通UIは ../css/game-common.css。 */

.game-area { width: 100%; }

.pd-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.pd-prompt {
  margin: 0;
  min-height: 4.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* 十字配置: 上 / 左・右 / 下。位置は問題ごとに変えない。 */
.pd-cross {
  --cell: 92px;
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  gap: 6px;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.pd-up { grid-column: 2; grid-row: 1; }
.pd-left { grid-column: 1; grid-row: 2; }
.pd-center { grid-column: 2; grid-row: 2; }
.pd-right { grid-column: 3; grid-row: 2; }
.pd-down { grid-column: 2; grid-row: 3; }

.pd-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-center::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
}

.pd-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffef8;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  box-sizing: border-box;
  box-shadow: 0 2px 0 rgba(52, 75, 64, 0.12);
}
.pd-btn:disabled { cursor: default; }
.pd-arrow { display: block; width: 44px; height: 44px; pointer-events: none; -webkit-user-drag: none; }
.pd-up .pd-arrow { transform: rotate(0deg); }
.pd-right .pd-arrow { transform: rotate(90deg); }
.pd-down .pd-arrow { transform: rotate(180deg); }
.pd-left .pd-arrow { transform: rotate(270deg); }
.pd-label { font-size: 20px; font-weight: 800; line-height: 1; }

@media (hover: hover) {
  .pd-btn:not(:disabled):hover { border-color: rgba(50, 102, 77, 0.55); background: #f4f8ec; }
}
.pd-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
html.is-keyboard-nav .pd-btn:focus-visible { outline: 3px solid #d88635; outline-offset: 2px; }

.pd-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(52, 75, 64, 0.3);
}
.pd-btn.is-correct { border-color: var(--green); background: #e3f0e3; box-shadow: 0 0 0 1px var(--green); }
.pd-btn.is-correct .pd-badge { display: flex; background: var(--green); }
.pd-btn.is-correct .pd-badge::before { content: "○"; }
.pd-btn.is-wrong { border: 2px dashed #b42318; background: #fbe9e6; }
.pd-btn.is-wrong .pd-badge { display: flex; background: #b42318; }
.pd-btn.is-wrong .pd-badge::before { content: "×"; }
.pd-btn.is-dim { opacity: 0.55; }

@media (max-width: 430px) {
  .pd-prompt { font-size: 17px; min-height: 4.8em; }
  .pd-cross { --cell: 86px; gap: 5px; }
  .pd-arrow { width: 38px; height: 38px; }
  .pd-label { font-size: 18px; }
}
@media (max-width: 359px) {
  .pd-cross { --cell: 78px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .pd-wrap { gap: 4px; }
  .pd-prompt { min-height: 2.9em; font-size: 15px; }
  .pd-cross { --cell: 56px; gap: 4px; }
  .pd-arrow { width: 26px; height: 26px; }
  .pd-label { font-size: 14px; }
}

/* 題名が長いので、スマホ幅では見出しを少し小さくして右のボタンに隠れないようにする */
@media (max-width: 430px) {
  .game-title-row h1 { font-size: 15.5px; min-width: 0; }
}
