/* Website layout: the board on the left, the GM Knight sidebar (panel.css) on the right. Same palette and fonts. */
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

body.site { padding: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 14px; }
.site-top { padding: 14px 24px 12px; }
.site-top .logo { width: 40px; height: 40px; margin: -4px 0; }

.layout {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 24px 30px;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start;
}
.stage { min-width: 0; position: sticky; top: 16px; }   /* the board stays in view while the sidebar scrolls */
.side { border-left: 1px solid var(--rule); padding-left: 24px; min-width: 0; }
.side .settings.open .settings-inner { padding-top: 0; }
.side .status { margin-top: 0; }

/* load box */
.load { display: flex; gap: 8px; }
.load input {
  flex: 1; min-width: 0; background: var(--raise); color: var(--text); border: 1px solid var(--rule); border-radius: 9px;
  padding: 10px 12px; font: inherit; transition: border-color .2s ease;
}
.load input:focus { outline: none; border-color: var(--gold); }
.btn.gold { flex: none; background: var(--gold); color: var(--gold-ink); border-color: var(--gold); padding: 9px 18px; font-weight: 500; }
.btn.gold:hover { filter: brightness(1.08); background: var(--gold); border-color: var(--gold); }
.load-row { display: flex; align-items: baseline; gap: 14px; min-height: 26px; margin-bottom: 8px; }
.load-row .link { margin-top: 8px; flex: none; }
.load-msg { color: var(--silver); font-size: 12.5px; margin-top: 8px; }
.load-msg.bad { color: #d98a3d; }

/* players above and below the board */
.player { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px; min-height: 30px; }
.pname { font: 600 17px/1.2 "Barlow Condensed", sans-serif; letter-spacing: .01em; }
.prating { color: var(--silver); font-size: 12.5px; }

/* board */
.board-wrap { position: relative; width: 100%; max-width: min(640px, calc(100vh - 250px)); min-width: 260px; aspect-ratio: 1; margin: 0 auto 0 0; }
.squares { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 4px; overflow: hidden; }
.sq { position: relative; }
.sq.light { background: #e3dccb; }
.sq.dark { background: #9c8762; }
.sq.last::after { content: ""; position: absolute; inset: 0; background: rgba(194, 161, 95, .42); }
.piece { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; user-select: none; -webkit-user-drag: none; }
.coord { position: absolute; font: 500 10.5px/1 "Barlow", sans-serif; z-index: 2; pointer-events: none; }
.coord.rank { top: 3px; left: 3px; }
.coord.file { bottom: 2px; right: 4px; }
.sq.light .coord { color: #9c8762; }
.sq.dark .coord { color: #e3dccb; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.stage .player, .stage .nav { max-width: min(640px, calc(100vh - 250px)); }

/* move buttons */
.nav { display: flex; justify-content: center; gap: 6px; padding-top: 6px; }
.nav .icon-btn { font-size: 13px; padding: 7px 12px; background: var(--raise); border: 1px solid var(--rule); color: var(--text); }
.nav .icon-btn:hover { background: var(--raise-2); }
.nav .icon-btn:disabled { opacity: .35; cursor: default; }

/* footer */
.site-foot { display: flex; gap: 18px; justify-content: center; padding: 16px; border-top: 1px solid var(--rule); color: var(--silver); font-size: 12px; }
.site-foot a { color: var(--silver); text-decoration: none; }
.site-foot a:hover { color: var(--gold); }

.toast { left: auto; right: 24px; width: 320px; }

/* phones and small screens: board on top, sidebar below */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 14px 14px 24px; gap: 18px; }
  .stage { position: static; }
  .side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 14px; }
  .board-wrap, .stage .player, .stage .nav { max-width: 100%; }
  .site-top { padding: 12px 14px 10px; }
  .toast { left: 14px; right: 14px; width: auto; }
}
