:root {
  --pc-cream: #EED7B0;
  --pc-brown: #B88762;
  --pc-ink: #000;
  --pc-text-on-wood: #241408;
  --pc-panel-bg: rgba(18, 11, 6, 0.86);
}

/* ─── Page ──────────────────────────────────────────────────────────────── */

html, body {
  width: 100%;
  height: 100%;
}

body {
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  overscroll-behavior: none;
}

canvas {
  touch-action: none;
  transform-origin: center center;
}

.pc-turn {
  border: none !important;
  pointer-events: none;
  transition: background 0.35s ease, opacity 0.35s ease;
}

.pc-turn--hidden {
  opacity: 0;
}

.pc-turn--near {
  background: linear-gradient(
    to top,
    rgba(238, 215, 176, 0.44) 0%,
    rgba(238, 215, 176, 0.17) 22%,
    rgba(238, 215, 176, 0) 50%
  );
}

.pc-turn--far {
  background: linear-gradient(
    to bottom,
    rgba(184, 135, 98, 0.40) 0%,
    rgba(184, 135, 98, 0.15) 22%,
    rgba(184, 135, 98, 0) 50%
  );
}

.pc-turn--mine { /*animate turn*/
  animation: pc-turn-pulse 2.6s ease-in-out infinite;
}

@keyframes pc-turn-pulse {
  0%, 100% { opacity: 0.72; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-turn--mine { animation: none; opacity: 1; }
}

#site-nav {
  position: fixed;
  top: 6px;
  left: 16px;
  z-index: 1000;
}

#site-nav a,
#game-nav a {
  background: none;
}

#game-nav {
  position: fixed;
  top: 6px;
  right: 16px;
  z-index: 1000;
}

.pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--pc-panel-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  font-family: 'Syne Mono', monospace;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

.pc-overlay[hidden] {
  display: none;
}

.pc-title {
  font-size: 26px;
  letter-spacing: 1px;
}

.pc-hint {
  font-size: 14px;
  font-weight: normal;
  opacity: 0.75;
  margin-top: 4px;
}

.pc-sub {
  font-size: 15px;
  font-weight: normal;
}

.pc-error {
  color: #ff9a94;
  max-width: 420px;
}

.pc-spacer {
  height: 6px;
}

.pc-btn {
  padding: 10px 28px;
  font-family: 'Syne Mono', monospace;
  font-size: 16px;
  font-weight: bold;
  color: var(--pc-text-on-wood);
  background: var(--pc-cream);
  border: 2px solid var(--pc-ink);
  border-radius: 0;
  cursor: pointer;
}

.pc-btn:hover {
  filter: brightness(1.08);
}

.pc-btn--secondary {
  background: var(--pc-brown);
}

.pc-input {
  padding: 10px 18px;
  font-family: 'Syne Mono', monospace;
  font-size: 18px;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  width: 180px;
  color: var(--pc-text-on-wood);
  background: var(--pc-cream);
  border: 2px solid var(--pc-ink);
  border-radius: 0;
}

.pc-code {
  font-size: 36px;
  letter-spacing: 8px;
  color: var(--pc-text-on-wood);
  background: var(--pc-cream);
  border: 2px solid var(--pc-ink);
  border-radius: 0;
  padding: 10px 20px;
}

.pc-timer {
  font-size: 15px;
  font-weight: normal;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.pc-note {
  font-size: 13px;
  font-weight: normal;
  opacity: 0.8;
  max-width: 380px;
  line-height: 1.5;
}

.pc-note a,
.pc-credit a {
  color: var(--pc-cream);
  background: none;
}

.pc-credit {
  margin-top: 6px;
  padding: 14px 20px;
  max-width: 460px;
  line-height: 1.55;
  color: #fff;
  border: 2px solid var(--pc-ink);
  border-radius: 0;
  background: rgba(184, 135, 98, 0.16);
}

.pc-credit__title {
  font-size: 17px;
  font-weight: bold;
  color: var(--pc-cream);
}

.pc-credit__body {
  font-size: 13px;
  font-weight: normal;
  opacity: 0.9;
  margin-top: 6px;
}

.pc-status {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(94vw, 640px);
  padding: 12px 26px;
  text-align: center;
  font-family: 'Syne Mono', monospace;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #fff;
  background: var(--pc-panel-bg);
  border-style: solid;
  border-width: 0 2px 2px 2px;
  border-color: var(--pc-brown);
  border-radius: 0;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.pc-status.is-visible {
  opacity: 1;
}

.pc-status--warn {
  border-color: var(--pc-cream);
  color: #fff4d6;
}

.pc-status--danger {
  border-color: #e2564f;
  color: #ffe3e1;
}
