/* ============================================================
   styles-v2/interaction.css — phase 3.2 human interaction layer.
   Reuses theme.css tokens only.  No fonts, images or external assets.
   ============================================================ */

/* ── legal targets / selection / disabled states ─────────────── */

.gh2-location__slot.gh2-legal,
.gh2-location__card-slot.gh2-legal {
  position: relative;
  outline: 2px solid var(--gh2-lamp);
  outline-offset: 2px;
  box-shadow: var(--gh2-glow-lamp), inset 0 0 18px rgba(232, 201, 138, 0.12);
  cursor: pointer;
  transition: outline-color 120ms ease, box-shadow 120ms ease;
}

.gh2-location__slot.gh2-legal::after,
.gh2-location__card-slot.gh2-legal::after {
  content: '落点';
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 3;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--gh2-ink-0);
  color: var(--gh2-lamp);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.gh2-location__slot.gh2-legal--dual::after {
  content: '明/暗';
  color: var(--gh2-cult-glow);
}

.gh2-location__slot.gh2-legal:hover,
.gh2-location__card-slot.gh2-legal:hover {
  outline-color: var(--gh2-parchment);
  box-shadow: 0 0 22px rgba(232, 201, 138, 0.42);
}

.gh2-card.gh2-targetable,
.gh2-leader-zone.gh2-targetable {
  outline: 2px solid var(--gh2-cult-glow);
  outline-offset: 2px;
  cursor: pointer;
  box-shadow: var(--gh2-glow-cult);
}

.gh2-card.gh2-selected {
  outline: 2px solid var(--gh2-lamp);
  outline-offset: 3px;
  transform: translateY(-8px);
  box-shadow: 0 0 24px rgba(232, 201, 138, 0.45), var(--gh2-shadow);
  z-index: 4;
}

.gh2-card.gh2-marked {
  outline: 2px solid var(--gh2-cult);
  outline-offset: 3px;
  transform: translateY(-8px);
  box-shadow: 0 0 22px rgba(67, 162, 145, 0.5), var(--gh2-shadow);
  z-index: 4;
}

.gh2-card.gh2-dim {
  opacity: 0.45;
  filter: saturate(0.6);
}

.gh2-card.gh2-dim:hover {
  opacity: 0.82;
}

.gh2-location__slot.gh2-dim {
  opacity: 0.4;
}

.gh2-leader-zone.gh2-disabled {
  opacity: 0.5;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.gh2-shell.gh2-locked .gh2-location,
.gh2-shell.gh2-locked .gh2-hand,
.gh2-shell.gh2-locked .gh2-leader-zone {
  pointer-events: none;
}

.gh2-shell.gh2-ai-thinking .gh2-midline__dial {
  border-color: var(--gh2-cult);
  box-shadow: var(--gh2-glow-cult);
}

/* ── control console ─────────────────────────────────────────── */

.gh2-play-controls {
  max-width: 1600px;
  margin: 14px auto 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--gh2-line);
  border-radius: var(--gh2-radius);
  background: linear-gradient(180deg, var(--gh2-ink-3), var(--gh2-ink-1));
  box-shadow: var(--gh2-shadow);
}

.gh2-play-controls__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--gh2-font-display);
  font-size: 15px;
  color: var(--gh2-parchment);
  letter-spacing: 0.04em;
}

.gh2-play-controls__head small {
  font-family: var(--gh2-font-ui);
  font-size: 10px;
  color: var(--gh2-silver-faint);
}

.gh2-play-controls__mark {
  padding: 2px 7px;
  border: 1px solid var(--gh2-lamp-dim);
  border-radius: 3px;
  color: var(--gh2-lamp);
  font-family: var(--gh2-font-ui);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.gh2-play-controls__status {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--gh2-silver-dim);
  font-size: 12px;
  line-height: 1.6;
}

.gh2-play-controls__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gh2-play-btn {
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid var(--gh2-line);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gh2-ink-4), var(--gh2-ink-2));
  color: var(--gh2-silver);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.gh2-play-btn:hover:not(.gh2-disabled):not(:disabled) {
  border-color: var(--gh2-lamp);
  color: var(--gh2-parchment);
  box-shadow: var(--gh2-glow-lamp);
}

.gh2-play-btn--primary {
  border-color: var(--gh2-lamp-dim);
  color: var(--gh2-lamp);
}

.gh2-play-btn.gh2-disabled,
.gh2-play-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.gh2-play-controls__log {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--gh2-silver-faint);
  font-size: 11px;
  line-height: 1.7;
}

/* ── toast ───────────────────────────────────────────────────── */

.gh2-toast-stack {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 90vw);
  pointer-events: none;
}

.gh2-toast {
  padding: 9px 13px;
  border: 1px solid var(--gh2-line);
  border-left-width: 3px;
  border-radius: 4px;
  background: var(--gh2-ink-2);
  color: var(--gh2-silver);
  box-shadow: var(--gh2-shadow);
  font-size: 12px;
  line-height: 1.55;
  animation: gh2-toast-in 160ms ease-out;
}

.gh2-toast--info { border-left-color: var(--gh2-silver-faint); }
.gh2-toast--good { border-left-color: var(--gh2-cult); color: var(--gh2-cult-glow); }
.gh2-toast--warn { border-left-color: var(--gh2-lamp); color: var(--gh2-lamp); }
.gh2-toast--error { border-left-color: var(--gh2-danger); color: #e5a99c; }

@keyframes gh2-toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── target / result modal ───────────────────────────────────── */

.gh2-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 10, 0.74);
  backdrop-filter: blur(2px);
}

.gh2-modal[hidden] {
  display: none;
}

.gh2-modal__panel {
  width: min(560px, 94vw);
  max-height: 80vh;
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid var(--gh2-lamp-dim);
  border-radius: var(--gh2-radius);
  background: linear-gradient(180deg, var(--gh2-ink-3), var(--gh2-ink-1));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7), var(--gh2-glow-lamp);
}

.gh2-modal__title {
  margin-bottom: 6px;
  color: var(--gh2-parchment);
  font-family: var(--gh2-font-display);
  font-size: 20px;
}

.gh2-modal__hint {
  margin-bottom: 14px;
  color: var(--gh2-silver-dim);
  font-size: 12px;
  line-height: 1.6;
}

.gh2-modal__options {
  display: grid;
  gap: 8px;
}

.gh2-modal__option,
.gh2-modal__cancel,
.gh2-modal__restart {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gh2-line);
  border-radius: 4px;
  background: var(--gh2-ink-2);
  color: var(--gh2-silver);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}

.gh2-modal__option:hover,
.gh2-modal__restart:hover {
  border-color: var(--gh2-lamp);
  color: var(--gh2-lamp);
  box-shadow: var(--gh2-glow-lamp);
}

.gh2-modal__foot {
  margin-top: 14px;
  border-top: 1px solid var(--gh2-line-soft);
  padding-top: 12px;
}

.gh2-modal__cancel,
.gh2-modal__restart {
  text-align: center;
}

.gh2-modal__restart {
  border-color: var(--gh2-lamp-dim);
  color: var(--gh2-lamp);
}

/* ── end-of-night summary modal ─────────────────────────────── */
.gh2-modal__panel--night {
  border-color: rgba(143, 224, 205, 0.5);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7), var(--gh2-glow-cult);
}
.gh2-night-summary__rows {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
  list-style: none;
}
.gh2-night-summary__rows li {
  padding: 8px 12px;
  border: 1px solid var(--gh2-line-soft);
  border-radius: 4px;
  background: var(--gh2-ink-2);
  color: var(--gh2-silver);
  font-size: 13px;
  line-height: 1.5;
}
.gh2-night-summary__wins { color: var(--gh2-lamp); font-size: 13px; }
.gh2-modal__continue {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gh2-lamp-dim);
  border-radius: 4px;
  background: rgba(232, 201, 138, 0.14);
  color: var(--gh2-lamp);
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.gh2-modal__continue:hover {
  border-color: var(--gh2-lamp);
  box-shadow: var(--gh2-glow-lamp);
}

@media (max-width: 760px) {
  .gh2-play-controls__buttons { gap: 6px; }
  .gh2-play-btn { padding: 5px 10px; font-size: 12px; }
  .gh2-toast-stack { right: 10px; top: 10px; }
}

/* ── enemy intent chip (human-vs-AI only) ────────────────────── */

.gh2-intent {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--gh2-cult);
  border-radius: 6px;
  background: rgba(67, 162, 145, 0.12);
}
.gh2-intent__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gh2-cult-glow);
}
.gh2-intent__text {
  font-size: 13px;
  font-weight: 700;
  color: #eaf6f1;
}

/* ── chaos bag popup (auto-dismiss, non-blocking) ────────────── */

.gh2-chaos-pop {
  position: fixed;
  left: 50%;
  top: 32%;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 220px;
  padding: 16px 26px;
  border: 1px solid var(--gh2-lamp-dim);
  border-radius: 10px;
  background: rgba(8, 16, 18, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), var(--gh2-glow-lamp);
  transform: translateX(-50%);
  animation: gh2-chaos-pop-in 0.18s ease-out;
}
.gh2-chaos-pop__title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gh2-lamp);
}
.gh2-chaos-pop__text {
  font-family: var(--gh2-font-display);
  font-size: 22px;
  color: #f1e7cf;
}
.gh2-chaos-pop__mod {
  font-size: 15px;
  font-weight: 700;
  color: var(--gh2-cult-glow);
}

@keyframes gh2-chaos-pop-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
