/* Pagina Partide — static/styles/pages/partide.css */
.partide-container { max-width: 1200px; margin: 0 auto; }
.partide-heading { text-align: center; margin-bottom: 2rem; }
.partide-title { font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0; color: var(--color-text); }
.partide-subtitle { margin: .7rem 0 0; opacity: .75; }

.viewer { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 2rem; align-items: start; margin-bottom: 2.5rem; }
.viewer-board-col { width: 100%; }
.board-frame { position: relative; width: 100%; aspect-ratio: 1; box-sizing: border-box; padding: 1.8% 1.8% 5.6% 5.6%; background: #284d4d; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.45); container-type: inline-size; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; outline: 1px solid rgba(0,0,0,.6); touch-action: pan-y; user-select: none; }
.board-ranks, .board-files { position: absolute; display: flex; color: #fff; font-weight: 700; font-size: 3.3cqw; font-family: var(--font-body, Montserrat, sans-serif); pointer-events: none; }
.board-ranks { left: 0; top: 1.8%; bottom: 5.6%; width: 5.6%; flex-direction: column; }
.board-files { bottom: 0; left: 5.6%; right: 1.8%; height: 5.6%; }
.board-ranks span, .board-files span { flex: 1; display: flex; align-items: center; justify-content: center; }
.sq { min-width: 0; min-height: 0; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.sq.light { background: #e4f0ef; }
.sq.dark { background: #549c99; }
.sq.last.light { background: #f1ec9a; }
.sq.last.dark { background: #b9c45a; }
.pc { width: 100%; height: 100%; display: block; pointer-events: none; }

.player-bar { display: flex; justify-content: space-between; align-items: center; padding: .55rem .2rem; font-weight: 700; letter-spacing: .02em; }
.player-bar .pb-name::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .55rem; vertical-align: -1px; border: 1px solid rgba(184,146,58,.8); }
.player-bar[data-c="w"] .pb-name::before { background: #f5f3ef; }
.player-bar[data-c="b"] .pb-name::before { background: #1a1a1a; }
.pb-elo { opacity: .65; font-weight: 600; font-size: .85rem; }

.controls { display: flex; gap: .5rem; justify-content: center; margin-top: .4rem; }
.controls button { flex: 1; max-width: 76px; height: 46px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--color-text); font-size: 1.1rem; cursor: pointer; transition: all .15s; }
.controls button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.controls button:disabled { opacity: .3; cursor: default; }

.game-info { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.gi-players { font-family: var(--font-heading); font-size: clamp(1.15rem, 2.2vw, 1.55rem); font-weight: 600; line-height: 1.25; }
.gi-players i { font-style: normal; color: var(--gold); margin: 0 .25rem; }
.gi-players small { font: 600 .72rem var(--font-body, Montserrat, sans-serif); opacity: .6; margin-left: .15rem; }
.gi-meta { opacity: .7; font-size: .86rem; margin-top: .4rem; }
.gi-result { display: inline-block; margin-top: .6rem; padding: .15rem .8rem; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; font-weight: 700; letter-spacing: .05em; }

.moves { max-height: 440px; overflow-y: auto; padding: .6rem .5rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); line-height: 1.55; scroll-behavior: smooth; }
.mv-num { display: inline-block; opacity: .5; font-size: .64rem; margin: 0 .1rem 0 .3rem; font-weight: 600; }
.mv { background: none; border: none; color: inherit; font: 600 .7rem var(--font-body, Montserrat, sans-serif); padding: 0 .2rem; border-radius: 6px; cursor: pointer; }
.mv:hover { background: rgba(184,146,58,.2); }
.mv.on { background: var(--gold); color: #111; }
.mv-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin: 0 .1rem 2px; vertical-align: middle; }
.mv-end { margin-left: .8rem; font-size: .75rem; font-weight: 800; color: var(--gold); }

.comment-box { margin-top: .8rem; padding: .8rem 1rem; border-left: 3px solid var(--gold); background: rgba(184,146,58,.1); border-radius: 0 10px 10px 0; font-style: italic; line-height: 1.55; white-space: pre-wrap; }
.side-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: .7rem; }
.btn-ghost { background: none; border: 1px solid var(--border-color); color: var(--color-text); padding: .38rem .7rem; border-radius: 999px; cursor: pointer; font: 600 .72rem var(--font-body, Montserrat, sans-serif); white-space: nowrap; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.games-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.games-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.35rem; margin: 0; }
.game-search { padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--color-text); min-width: 260px; font-size: .9rem; }
.games-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .7rem; }
.game-row { text-align: left; display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .85rem 1rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); color: inherit; cursor: pointer; transition: all .15s; }
.game-row:hover, .game-row.active { border-color: var(--gold); transform: translateY(-1px); }
.game-row.active { box-shadow: 0 0 0 1px var(--gold) inset; }
.gr-players { font-size: .98rem; } .gr-players i { font-style: normal; color: var(--gold); margin: 0 .3rem; }
.gr-result { font-weight: 800; color: var(--gold); }
.gr-info { grid-column: 1 / -1; font-size: .78rem; opacity: .65; }
.no-match { opacity: .7; }
.credit { margin-top: 2rem; font-size: .7rem; opacity: .45; text-align: center; }

@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; gap: 1.2rem; }
  .moves { max-height: 200px; }
  .partide-container { padding: 1.4rem .9rem 2rem; }
  .game-search { min-width: 0; width: 100%; }
  .games-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .noutati-page { padding-left: .6rem; padding-right: .6rem; }
}

/* comentarii în lista de mutări */
.mv-com { display: block; margin: .25rem .4rem .45rem 1.6rem; padding: .45rem .8rem; border-left: 3px solid var(--gold); background: rgba(184,146,58,.12); border-radius: 0 8px 8px 0; font-style: italic; font-size: .7rem; line-height: 1.4; font-weight: 500; white-space: pre-wrap; cursor: pointer; }
.mv-com.on { background: rgba(184,146,58,.3); }
.mv-com.intro { margin-left: .4rem; }
.mv-end { display: inline-block; }

/* notație cu figurine (SVG, apar pe orice dispozitiv) */
.fg { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.2em; margin-right: .05em; }
.mv .fg { filter: drop-shadow(0 0 1px rgba(255,255,255,.35)); }
.mv.on .fg { filter: none; }
.btn-ghost .fg { width: 1.2em; height: 1.2em; vertical-align: -.25em; }
.btn-ghost.active { border-color: var(--gold); color: var(--gold); }

/* variante */
.var { display: block; margin: .15rem 0 .35rem 1rem; padding: .15rem 0 .15rem .6rem; border-left: 2px solid rgba(184,146,58,.45); opacity: .92; }
.var.d2 { margin-left: .8rem; border-left-color: rgba(184,146,58,.3); }
.var.d3 { margin-left: .6rem; border-left-color: rgba(184,146,58,.2); }
.var .mv { font-weight: 500; }
.var .mv-num { font-size: .6rem; }
.var-par { color: var(--gold); opacity: .8; font-weight: 700; font-size: .75rem; margin: 0 .1rem; }
.ann { color: var(--gold); margin-left: .05rem; }
.mv.on .ann { color: #111; }

/* alegere continuări (listă „Variante”) */
.choice-bar { display: flex; flex-direction: column; margin-top: .7rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); overflow: hidden; }
.cb-label { padding: .45rem .8rem; font-size: .72rem; font-weight: 700; color: var(--gold); border-bottom: 1px solid var(--border-color); }
.cb-label small { opacity: .7; font-weight: 600; margin-left: .4rem; }
.cb { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid rgba(128,128,128,.15); color: inherit; padding: .5rem .8rem; font: 600 .8rem var(--font-body, Montserrat, sans-serif); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb:last-child { border-bottom: none; }
.cb:hover { background: rgba(184,146,58,.12); }
.cb.sel { background: rgba(184,146,58,.28); box-shadow: inset 3px 0 0 var(--gold); }
.cb .fg { width: 1.05em; height: 1.05em; }
.mv.pre:not(.on) { outline: 1px dashed var(--gold); }
