.play .ad-main > .ad-card,
.pl-columns { margin-bottom: 1.2rem; }

/* Play area dashboard: tiles, one section at a time */
.pl-off { display: none !important; }
.pl-dash {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.pl-dash[hidden] { display: none; }
.pl-dash-tile {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.3rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.pl-dash-tile:hover,
.pl-dash-tile:focus-visible { transform: translateY(-2px); border-color: var(--gold); }
.pl-dash-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(201, 164, 92, 0.14);
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}
.pl-dash-tile strong { font-size: 1.05rem; }
.pl-dash-tile small { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.pl-dash-badge { margin-top: 0.2rem; font-size: 0.78rem; font-weight: 600; color: #7fcf9a; }
.pl-section-bar { margin-bottom: 1rem; }
.pl-section-bar[hidden] { display: none; }
.pl-in-section .pl-columns { grid-template-columns: 1fr; }
@media (max-width: 600px) {
  .pl-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .pl-dash-tile { padding: 0.8rem; }
}

.pl-training {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  text-decoration: none;
  border-color: rgba(201, 164, 92, 0.6);
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.12), var(--surface) 60%);
}

.pl-training:hover { border-color: var(--gold); }

/* Live games: 6 boards at a time */
.pl-live-source { margin: 0; font-size: 0.85rem; }
.pl-live-status { margin: 0 0 0.6rem; }
.pl-live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pl-live-tile {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.pl-live-head { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-live-site { font-weight: 600; color: var(--text); }
.pl-live-site.lichess { color: #7fcf9a; }
.pl-live-site.chesscom { color: #9cc56b; }
.pl-live-site.lotus { color: var(--gold-light); }
.pl-live-over { color: var(--gold-light); }
.pl-live-player { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; min-height: 1.3em; }
.pl-live-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-live-name.me { color: var(--gold-light); font-weight: 600; }
.pl-live-name small { color: var(--muted); }
.pl-live-clock { font-variant-numeric: tabular-nums; font-weight: 600; padding: 0 0.35rem; border-radius: 5px; }
.pl-live-clock.on { background: rgba(127, 207, 154, 0.2); color: #7fcf9a; }
.pl-live-board .cb-board { box-shadow: none; }
.pl-live-board .cb-coord { display: none; }
.pl-live-foot { font-size: 0.8rem; color: var(--muted); }
.pl-live-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0 0.4rem; }
.pl-live-page { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 900px) { .pl-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pl-live-grid { grid-template-columns: 1fr; } }

/* Sharing live games (public link) */
.pl-share { width: min(620px, calc(100% - 1.5rem)); }
.pl-share .field input,
.pl-share .field select { width: 100%; height: 38px; padding: 0 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.pl-share-result:empty { display: none; }
.pl-share-ok { margin: 0.8rem 0 0.4rem; color: #7fcf9a; font-weight: 600; }
.pl-share-link { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pl-share-link input { flex: 1; min-width: 220px; height: 36px; padding: 0 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 0.85rem; }
.pl-share-sub { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.pl-watch-title { font-size: 1.5rem; margin: 0 0 0.3rem; }

/* Followed Lichess players and their studies */
.pl-follow-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }
.pl-follow-form input { flex: 1; min-width: 160px; height: 36px; }
.pl-follow-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.45rem; background: rgba(255, 255, 255, 0.2); }
.pl-follow-dot.online { background: #7fcf9a; }
.pl-follow-dot.playing { background: #e0a100; box-shadow: 0 0 0 3px rgba(224, 161, 0, 0.25); }
.pl-follow-playing { color: #e0c060; }
.pl-studies-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pl-studies { width: min(720px, calc(100% - 1.5rem)); }
.pl-studies-list { display: grid; gap: 0.4rem; max-height: 55vh; overflow-y: auto; margin: 0.8rem 0; }
.pl-studies-link { display: flex; gap: 0.5rem; }
.pl-studies-link input { flex: 1; height: 36px; padding: 0 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }

/* Lichess and Chess.com games */
.pl-online-title { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.pl-online-status { margin: 0 0 0.4rem; }
.pl-outcome.won { color: #7fcf9a; }
.pl-outcome.lost { color: #e88b8b; }
.pl-opening { font-size: 0.82rem; color: var(--muted); max-width: 16rem; }
.pl-online-actions { white-space: nowrap; }
.pl-online-more { margin-top: 0.6rem; }
.pl-online-actions .ad-link { margin-right: 0.4rem; }

.pl-replay { width: min(860px, calc(100% - 1.5rem)); }
.pl-replay h2 { font-size: 1.15rem; }
.pl-replay-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 1rem; margin-top: 0.8rem; }
.pl-replay-board { width: min(100%, 60vh); }
.pl-replay-side { display: grid; gap: 0.6rem; align-content: start; }
.pl-replay .pl-replay-moves { display: flex; flex-wrap: wrap; align-content: flex-start; max-height: 50vh; gap: 0.15rem; }
@media (max-width: 700px) {
  .pl-replay-body { grid-template-columns: 1fr; }
  .pl-replay .pl-replay-moves { max-height: 25vh; }
}
.pl-training > span:nth-child(2) { display: grid; gap: 0.2rem; flex: 1; }
.pl-training strong { font-size: 1.1rem; }
.pl-training small { color: var(--muted); font-size: 0.85rem; }
.pl-training-bot { font-size: 2.2rem; }

@media (max-width: 600px) {
  .pl-training { flex-wrap: wrap; }
  .pl-training .btn { width: 100%; text-align: center; }
}

.pl-alert {
  display: grid;
  gap: 0.5rem;
  border-color: rgba(201, 164, 92, 0.6);
}

.pl-alert h2 {
  font-size: 1.15rem;
  margin: 0.2rem 0 0;
}

.pl-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: start;
}

.pl-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.pl-options .field { margin-bottom: 0.4rem; min-width: 150px; }
.pl-rated { margin: 0 0 0.6rem; }
.pl-rated:has(input:disabled) { opacity: 0.55; }

.pl-move-time { margin-left: 0.3rem; font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.pl-mark { margin-left: 0.1rem; font-weight: 700; }
.pl-move.inaccuracy .pl-mark { color: #e0c060; }
.pl-move.mistake .pl-mark { color: #e09040; }
.pl-move.blunder .pl-mark { color: #e05555; }

.pl-engine { margin: 0.8rem 0 0.4rem; }
.pl-graph { display: block; width: 100%; height: 70px; border-radius: 6px; cursor: pointer; }
.pl-graph-bg { fill: #2b2d33; }
.pl-graph-white { fill: #e8e2d4; }
.pl-graph-mid { stroke: rgba(201, 164, 92, 0.6); stroke-width: 0.5; }
.pl-graph-now { stroke: var(--gold); stroke-width: 1.4; }
.pl-graph-mistake { fill: #e09040; }
.pl-graph-blunder { fill: #e05555; }
.pl-engine-line { margin: 0.5rem 0 0.2rem; font-size: 0.92rem; }
.pl-engine-summary { margin: 0; font-size: 0.8rem; color: var(--muted); }
.pl-engine-run select {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0 0.5rem;
}
.pl-engine-add { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.pl-think-seconds { width: 5.5rem; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; padding: 0 0.5rem; }
.pl-engine-add select {
  flex: 1 1 220px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 0 0.6rem;
}
.pl-engine-grant p { margin: 0.4rem 0 0; }

.pl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.8rem;
}

.pl-filters input,
.pl-filters select {
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}

#pl-f-name { flex: 1 1 180px; min-width: 0; }
.pl-f-date { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.pl-f-date input { color-scheme: dark; }

.pl-start-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.pl-start { display: flex; align-items: center; gap: 0.4rem; }
.pl-start-btn { white-space: nowrap; }
.pl-start-btn.set { border-color: var(--gold); color: var(--gold-light); }

.pl-position-dialog { width: min(440px, calc(100% - 1.5rem)); }
.pl-position-dialog h2 { margin: 0 0 0.3rem; }
.pl-position-board { width: min(100%, 360px); margin: 0.6rem auto 0; }
.pl-position-dialog .cr-editor { width: 100%; margin-top: 0.7rem; }

.pl-bots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}

.pl-bot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pl-bot:hover { border-color: var(--gold); }

.pl-bot-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 1.4rem;
  color: var(--gold-light);
}

.pl-bot strong { display: block; font-size: 0.92rem; }
.pl-bot small { display: block; font-size: 0.75rem; color: var(--muted); }

.pl-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.8rem 0 0.4rem;
}

.pl-people {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.pl-people .cr-muted { margin: 0; font-size: 0.88rem; }

.pl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

.pl-row small { color: var(--muted); }
.pl-row-actions { display: flex; gap: 0.4rem; }

.pl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #7fcf9a;
}

.pl-ranking tr.pl-me td { color: var(--gold-light); }
.pl-up { color: #7fcf9a; }
.pl-down { color: #e06c6c; }

#pl-games-filter { max-width: 220px; }

.pl-pair-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.pl-pair-form .field { margin-bottom: 0.5rem; min-width: 170px; flex: 1 1 170px; }
.pl-pair-form .btn { margin-bottom: 0.5rem; }

/* Game */
.pl-board-col {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.pl-player {
  min-width: 260px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.pl-board-col .as-board-wrap,
.pl-player { width: min(100%, calc(100svh - 72px - 12rem)); }

.pl-player.active { border-color: var(--gold); }

.pl-name { font-weight: 600; }

.pl-clock {
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.6rem;
  border-radius: 6px;
  background: var(--bg);
}

.pl-player.active .pl-clock { background: rgba(201, 164, 92, 0.2); color: var(--gold-light); }
.pl-clock.low { color: #e06c6c !important; }

.pl-nav {
  display: flex;
  gap: 0.35rem;
}

.pl-nav button {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.pl-nav button:hover { border-color: var(--gold); }

.pl-moves {
  position: relative;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 0.1rem;
  font-size: 0.92rem;
}

.pl-move-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr 1fr;
  align-items: center;
}

.pl-move-no { color: var(--muted); }

.pl-move {
  justify-self: start;
  padding: 0.15rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.pl-move:hover { background: rgba(255, 255, 255, 0.06); }
.pl-move.current { background: rgba(201, 164, 92, 0.25); color: var(--gold-light); }
.pl-move.commented::after { content: " 💬"; font-size: 0.75rem; }

.pl-review {
  display: grid;
  gap: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.pl-review .cr-note-label { margin: 0; }
.pl-comment { margin: 0; }
.pl-comment.empty { color: var(--muted); font-size: 0.88rem; }

.pl-review textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.pl-analysis {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gold-light);
}

.pl-analysis:empty { display: none; }

@media (max-width: 900px) {
  .pl-columns { grid-template-columns: 1fr; }
  .pl-board-col .as-board-wrap,
  .pl-player { width: min(100%, 520px); }
}
