﻿.online-chess-panel {
  display: none;
  width: min(100%, 34rem);
  margin: .8rem auto 0;
  padding: .85rem;
  border: 1px solid rgba(255, 214, 95, .52);
  border-radius: 14px;
  background: rgba(17, 22, 31, .9);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.online-chess-panel.is-visible { display: grid; gap: .65rem; }
.online-chess-help {
  padding: .7rem .75rem;
  border: 1px solid rgba(255, 220, 116, .35);
  border-radius: 10px;
  background: rgba(255, 223, 124, .09);
  color: #f8f2dc;
  font-size: .8rem;
  line-height: 1.38;
}
.online-chess-help strong { display: block; margin-bottom: .35rem; color: #ffe28a; font-size: .92rem; }
.online-chess-help p { margin: .55rem 0; color: #f8f2dc; }
.online-chess-help > button, .online-join-help > button {
  display: block;
  margin: .2rem auto 0;
  border: 1px solid #efc85c;
  border-radius: 999px;
  padding: .62rem 1rem;
  background: linear-gradient(#ffe79a, #c88a16);
  color: #241502;
  font: 700 .82rem/1 inherit;
  cursor: pointer;
}
.online-join-help {
  margin-top: .8rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(255, 220, 116, .3);
}
.online-join-help label { max-width: 15rem; margin: 0 auto; }
.online-chess-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.online-chess-panel label { display: grid; gap: .3rem; font-size: .82rem; }
.online-chess-panel label small { color: #ffe9a8; font-size: .68rem; font-weight: 600; }
.online-chess-panel input {
  min-width: 0;
  padding: .65rem .7rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 9px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font: inherit;
  text-transform: none;
}
.online-chess-panel input[data-room-code] { text-transform: uppercase; letter-spacing: .12em; }
.online-chess-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.online-chess-actions button, .online-match-bar button {
  border: 1px solid #efc85c;
  border-radius: 999px;
  padding: .58rem .9rem;
  background: linear-gradient(#ffe79a, #c88a16);
  color: #241502;
  font: 700 .82rem/1 inherit;
  cursor: pointer;
}
.online-chess-status { margin: 0; min-height: 1.2em; color: #ffe28a; text-align: center; font-size: .86rem; }
.online-match-bar {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem;
  width: min(100%, 520px);
  margin: 0 auto .55rem;
  padding: .55rem .7rem;
  border: 1px solid rgba(255, 215, 96, .5);
  border-radius: 12px;
  background: rgba(18, 20, 27, .9);
  color: #fff0b0;
  font-size: .8rem;
}
.online-match-bar.is-visible { display: flex; }
.online-room-code { color: #ffe071; font-weight: 900; letter-spacing: .12em; }
.online-chess-busy { opacity: .7; pointer-events: none; }

.online-games-page-mode > label,
.online-games-page-mode > .select-control,
.online-games-page-mode > .color-picker,
.online-games-page-mode > .online-games-in-progress-button,
.online-games-page-mode .online-chess-help {
  display: none !important;
}
.online-games-page-mode .online-chess-panel {
  width: min(100%, 42rem);
  margin-top: 0;
}
.panel:has(.online-games-page-mode) { width: min(100%, 680px); }


.online-game-shelf {
  display: grid;
  gap: .6rem;
  padding: .7rem;
  border: 1px solid rgba(255, 220, 116, .3);
  border-radius: 10px;
  background: rgba(0, 0, 0, .2);
}
.online-shelf-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  color: #ffe28a;
}
.online-shelf-heading > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.online-shelf-heading button, .online-game-card button {
  border: 1px solid #efc85c;
  border-radius: 999px;
  padding: .45rem .7rem;
  background: linear-gradient(#ffe79a, #c88a16);
  color: #241502;
  font: 700 .72rem/1 inherit;
  cursor: pointer;
}
.online-game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  margin-top: .45rem;
  padding: .65rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
}
.online-game-card.is-your-turn {
  border: 2px solid #3f9cff;
  background: rgba(39, 117, 210, .13);
  box-shadow: 0 0 0 1px rgba(93, 174, 255, .18), 0 7px 18px rgba(0, 0, 0, .18);
}
.online-game-card.is-current { border-color: #ffe071; box-shadow: 0 0 0 1px rgba(255, 224, 113, .2); }
.online-game-card > div { display: grid; gap: .22rem; }
.online-game-card > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.online-opponent-row { display: flex !important; align-items: center; justify-content: space-between; gap: .7rem; }
.online-opponent-name { min-width: 0; text-align: left; }
.online-opponent-name small { white-space: nowrap; color: #b7d9ff; }
.online-card-actions { align-items: center; justify-content: flex-end !important; }
.online-game-card strong { color: #fff2b7; font-size: .8rem; }
.online-game-card span { color: #fff; font-size: .76rem; }
.online-game-card small { color: #d8d3c2; font-size: .65rem; }
.online-danger-button {
  border-color: #de8377 !important;
  background: linear-gradient(#ffb3a8, #a83a2c) !important;
  color: #280603 !important;
}
.online-friends-heading { margin-top: .35rem; color: #ffe28a; font-size: .8rem; }
.online-friends-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.online-friend-name {
  padding: .28rem .5rem;
  border: 1px solid rgba(255, 226, 138, .35);
  border-radius: 999px;
  background: rgba(255, 226, 138, .1);
  color: #fff3c7;
  font-size: .7rem;
}
.online-player-summary {
  display: grid;
  gap: .4rem;
  margin-top: .35rem;
  padding: .58rem;
  border: 1px solid rgba(255, 226, 138, .24);
  border-radius: 9px;
  background: rgba(0, 0, 0, .2);
  color: #ffe28a;
  font-size: .78rem;
}
.online-player-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .8rem;
  color: #f6f0dc;
  font-size: .72rem;
}
.online-empty-state { margin: .25rem 0; color: #d8d3c2; font-size: .72rem; text-align: center; }

.online-games-in-progress-button {
  display: block;
  width: min(100%, 18rem);
  margin: 0 auto .7rem;
  border: 1px solid #efc85c;
  border-radius: 999px;
  padding: .68rem 1rem;
  background: linear-gradient(#fff0b5, #d99a22);
  color: #241502;
  font: 800 .9rem/1 inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
}
.online-turn-status {
  justify-self: start;
  border-radius: 999px;
  padding: .22rem .48rem;
  background: rgba(190, 190, 190, .16);
  color: #e7e2d5 !important;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.online-turn-status.is-your-move {
  background: rgba(89, 194, 99, .18);
  color: #baffb8 !important;
  box-shadow: inset 0 0 0 1px rgba(142, 255, 147, .35);
}
.online-resume-banner {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transform: scale(.92);
  transition: opacity .28s ease, transform .28s ease;
}
.online-resume-banner img {
  position: relative;
  width: min(96%, 780px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .5));
}
.online-resume-banner strong {
  position: absolute;
  z-index: 1;
  color: #2b1605;
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: .035em;
  white-space: nowrap;
  text-shadow: 0 1px #ffd979, 0 3px 3px rgba(77, 35, 0, .28);
}
.online-resume-banner.is-visible { opacity: 1; transform: scale(1); }
.online-resume-banner.is-leaving { opacity: 0; transform: scale(1.04); }


@media (max-width: 520px) {
  .online-chess-fields { grid-template-columns: 1fr; }
  .online-chess-panel { padding: .7rem; }
  .online-game-card { grid-template-columns: 1fr; }
  .online-game-card > div:last-child { justify-content: flex-start; }
}
