/* Profil, Reiter "Partien": Verlauf nach Tagen. Eine feine Goldlinie laeuft
   senkrecht durch die Koenige; das Ergebnis steht an der Figur (aufrecht = Sieg,
   umgekippt = Niederlage, geteiltes Feld = Remis). Zeilen ohne Kasten, nur
   Haarlinien. Logik: src/app/profile-games.js. */

.pf-games-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 14px;
}
.pf-games-k {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mp-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mp-ink-dim);
}
.pf-games-k::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(216, 177, 90, .16), transparent); }
.pf-filter { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid rgba(216, 177, 90, .18); }
.pf-filter::-webkit-scrollbar { display: none; }
.pf-filter button {
  flex: none;
  padding: 7px 12px;
  font-family: var(--mp-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--mp-ink-dim);
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(216, 177, 90, .12);
  cursor: var(--mp-cur-pointer);
  transition: color .16s ease, background .16s ease;
}
.pf-filter button:first-child { border-left: 0; }
.pf-filter button:hover { color: var(--mp-bone); }
.pf-filter button[aria-pressed="true"] { color: var(--mp-gold-1); background: rgba(216, 177, 90, .1); }

/* ── Tage und die Linie durch die Koenige ── */
.pf-days { position: relative; }
.pf-days::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, rgba(216, 177, 90, .28), rgba(216, 177, 90, .06));
}
.pf-days.is-swap { animation: pfFade .2s ease both; }
@keyframes pfFade { from { opacity: 0; } }
.pf-day + .pf-day { margin-top: 16px; }
.pf-day-h {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 2px;
  padding: 4px 0 4px 13px;
  font-family: var(--mp-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mp-gold-1);
}
.pf-day-h i { flex: none; width: 9px; height: 9px; rotate: 45deg; background: #0b0d12; border: 1px solid var(--mp-gold-1); }
.pf-day-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(216, 177, 90, .2), transparent); }

/* ── Eine Partie ── */
.pf-game {
  position: relative;
  display: grid;
  grid-template-columns: 34px 128px minmax(0, 1fr) 96px 56px 72px;
  align-items: center;
  column-gap: 14px;
  min-height: 54px;
  padding-right: 12px;
  border-bottom: 1px solid rgba(216, 177, 90, .07);
  transition: background .16s ease;
}
.pf-day .pf-game:last-child { border-bottom: 0; }
@media (hover: hover) {
  .pf-game:hover { background: linear-gradient(90deg, rgba(216, 177, 90, .05), transparent 70%); }
}

/* Koenig in der eigenen Farbe in einer kleinen Raute. */
.pf-king { --rim: rgba(240, 232, 210, .45); position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; }
.pf-king::before {
  content: "";
  position: absolute;
  inset: 6px;
  rotate: 45deg;
  border: 1.5px solid var(--rim);
  background: #0b0d12;
}
.pf-king img { position: relative; width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.pf-game.is-win .pf-king { --rim: #84e8b0; }
.pf-game.is-win .pf-king::before { background: color-mix(in srgb, #84e8b0 12%, #0b0d12); }
.pf-game.is-loss .pf-king { --rim: rgba(239, 149, 138, .8); }
.pf-game.is-loss .pf-king img { rotate: 90deg; translate: 1px 3px; opacity: .78; }
.pf-game.is-draw .pf-king::before { background: linear-gradient(45deg, rgba(240, 232, 210, .2) 50%, #0b0d12 50%); }
.pf-king.is-ghost { width: 46px; height: 46px; }
.pf-king.is-ghost::before { border: 1px dashed rgba(216, 177, 90, .32); background: none; }

.pf-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--mp-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--mp-ink-dim);
  white-space: nowrap;
}
.pf-mode svg, .pf-sub svg { flex: none; width: 15px; height: 15px; color: var(--mp-gold-2); }
.pf-opp { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pf-game .pf-opp-av { flex: none; width: 26px; height: 26px; font-size: 10px; font-weight: 700; }
.pf-game .pf-opp-av.is-bot svg { width: 13px; height: 13px; }
.pf-opp-name {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  font-family: var(--mp-sans);
  font-size: 15px;
  color: var(--mp-bone);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
}
button.pf-opp-name { cursor: var(--mp-cur-pointer); transition: color .16s ease; }
button.pf-opp-name:hover, button.pf-opp-name:focus-visible { color: var(--mp-gold-1); }
.pf-opp-elo { flex: none; font-family: var(--mp-mono); font-size: 11px; color: var(--mp-ink-dim); }
.pf-reason { font-family: var(--mp-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--mp-ink-dim); white-space: nowrap; }
.pf-delta { font-family: var(--mp-mono); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.pf-delta.is-up { color: #84e8b0; }
.pf-delta.is-down { color: #ef958a; }
.pf-moves { font-family: var(--mp-mono); font-size: 12px; text-align: right; color: var(--mp-ink-dim); white-space: nowrap; }
.pf-moves small { margin-left: 5px; font-size: 10px; color: var(--mp-ink-faint); }
.pf-sub { display: none; }
.pf-more { margin: 16px 0 0 48px; }
.pf-more small { font-family: var(--mp-mono); font-size: 10.5px; letter-spacing: 0; color: var(--mp-ink-dim); }

/* Leer: drei offene Koenigsplaetze und der Weg zur ersten Partie. Fehler: Neu laden. */
.pf-games-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  min-height: 200px;
  border: 1px dashed rgba(216, 177, 90, .16);
}
.pf-games-empty.is-error { min-height: 160px; }
.pf-ghosts { display: flex; gap: 20px; }
.pf-games-empty .pf-cta svg { width: 14px; height: 14px; }

/* ── Handy: drei Spalten, Modus und Ende als zweite Zeile ── */
@container (max-width: 640px) {
  .pf-game {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: "king opp delta" "king sub delta";
    column-gap: 12px;
    row-gap: 3px;
    min-height: 58px;
    padding: 8px 4px 8px 0;
  }
  .pf-king { grid-area: king; width: 30px; height: 30px; }
  .pf-king img { width: 19px; height: 19px; }
  .pf-opp { grid-area: opp; }
  .pf-delta { grid-area: delta; }
  .pf-sub {
    grid-area: sub;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    font-family: var(--mp-mono);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mp-ink-dim);
    white-space: nowrap;
  }
  .pf-sub svg { width: 12px; height: 12px; }
  .pf-mode, .pf-reason, .pf-moves, .pf-game .pf-opp-av { display: none; }
  .pf-opp-name { font-size: 14.5px; }
  .pf-days::before { left: 15px; }
  .pf-day-h { padding-left: 11px; }
  .pf-more { margin-left: 42px; }
  .pf-king.is-ghost { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-days.is-swap { animation: none; }
  .pf-game { transition: none; }
}
