/* PlayChess overrides
   - Keep global.css as the base aesthetic
   - This file is ONLY layout + PlayChess-specific components
*/

.playchessPage .playchessMain {
  padding-top: 18px;
  padding-bottom: 34px;
}

/* Make dropdown actually function visually */
.nav-dropdown { display: none; }
.nav-dropdown.open { display: block; }

.playchessHero .mutedNote {
  display: inline-block;
  margin-left: 10px;
  opacity: 0.72;
}

.playchessHeaderActions .btn {
  white-space: nowrap;
}

/* --- Controls block --- */
.playchessControls {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.pcField label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.pcField input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
}

.pcField input:focus {
  border-color: rgba(0,0,0,0.24);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.pcHint {
  margin-top: 6px;
  font-size: 0.86rem;
  opacity: 0.72;
}

.pcButtons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

/* Buttons: align with global vibe, without editing global.css */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover { box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn.danger {
  background: rgba(255, 91, 107, 0.10);
  border-color: rgba(255, 91, 107, 0.40);
}

.btn.ghost {
  background: transparent;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* --- Main grid --- */
.playchessGrid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

/* Card */
.pcCard {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 18px;

  /* Soft tint */
  background: linear-gradient(
    180deg,
    rgba(131,163,185,0.14),
    rgba(107, 173, 218, 0.14)
  );

  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
  overflow: hidden;
}

.pcCardHead {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pcCardTitle {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.pcPills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  font-size: 0.86rem;
}

#connPill {
  border-color: rgba(49,208,170,0.55);
  background: rgba(49,208,170,0.12);
}

/* Board */
.boardWrap {
  padding: 14px;
}

/* app.js expects #board to be a grid container */
#board{
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr); /* ✅ THIS is the missing piece */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
}

.square{
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}

/* ✅ Your tile art */
.square.light{
  background: url("assets/board/light.png") center/cover no-repeat;
}
.square.dark{
  background: url("assets/board/dark.png") center/cover no-repeat;
}


.square.selected { outline: 3px solid rgba(0,0,0,0.55); outline-offset: -3px; }
.square.target::after,
.square.capture::after {
  content: "";
  width: 26%;
  height: 26%;
  border-radius: 999px;
  position: absolute;
  opacity: 0.55;
}
.square.target::after { background: rgba(0,0,0,0.35); }
.square.capture::after { background: rgba(255, 91, 107, 0.65); }

.piece {
  width: 82%;
  height: 82%;
  object-fit: contain;
  pointer-events: none;
  image-rendering: auto;
}

.pcLocalStatus {
  padding: 0 14px 14px;
  min-height: 20px;
  font-weight: 700;
  opacity: 0.82;
}

/* Sidebar */
.pcSide {
  padding-bottom: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.k {
  font-weight: 900;
  opacity: 0.75;
}

.v {
  font-weight: 600;
}

/* app.js writes move lines inside #moves */
.moves {
  max-height: 420px;
  overflow: auto;
  padding-right: 10px;
}

.moveLine {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.12);
}

.moveNo{
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  opacity: 0.55;
   font-weight: 900;
}


.moveText{
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
   font-weight: 700;
}


.small {
  font-size: 0.9rem;
  opacity: 0.78;
}

/* app.js injects PGN/public tools: make them look consistent */
.pgnTools {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.publicToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  font-weight: 700;
}

.publicToggle input {
  width: 16px;
  height: 16px;
}

/* Extra help */
.pcHelp {
  padding: 12px 14px;
}

.pcHelpTitle {
  font-weight: 900;
  margin-bottom: 6px;
}

.pcHelp ul {
  margin: 0;
  padding-left: 18px;
  opacity: 0.85;
}

.pcHelp li { margin: 6px 0; }

/* Responsive */
@media (max-width: 980px) {
  .playchessControls {
    grid-template-columns: 1fr;
  }
  .playchessGrid {
    grid-template-columns: 1fr;
  }
  #board {
    max-width: 560px;
  }
}

@media (max-width: 520px) {
  .pcCardHead { flex-direction: column; align-items: flex-start; }
  .pcPills { justify-content: flex-start; }
  .pcButtons { gap: 8px; }
  .btn { width: 100%; }
}

.announceHelp{
  margin: 6px 0 10px;
  font-size: 0.86rem;
  opacity: 0.72;
}