/* ================================================================
   PvP Online Addon CSS — Obsidian Chess
   Matches the game's dark obsidian theme, amber accents
================================================================ */

/* ── UTILITY ──────────────────────────────────────────────────── */
.pvp__dn {
  display: none !important;
}
.pvp__full {
  width: 100%;
  box-sizing: border-box;
}
.pvp__mt {
  margin-top: 12px;
}
.pvp__mt-sm {
  margin-top: 8px;
}

/* ── ROOT WRAPPER ─────────────────────────────────────────────── */
#pvp-addon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "Georgia", serif;
  font-size: 14px;
}

/* ── FLOAT BUTTON ─────────────────────────────────────────────── */
.pvp__float {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--bg, #0e1118);
  border: 1px solid var(--accent, #c87840);
  border-radius: 100px;
  color: var(--accent, #c87840);
  font-family: "Georgia", serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(200, 120, 64, 0.22),
    0 4px 20px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
}
.pvp__float:hover {
  background: rgba(200, 120, 64, 0.1);
  box-shadow:
    0 0 26px rgba(200, 120, 64, 0.38),
    0 6px 28px rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}

/* ── PANEL ────────────────────────────────────────────────────── */
.pvp__panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 316px;
  background: var(--surface, #161c28);
  border: 1px solid rgba(200, 120, 64, 0.22);
  border-radius: 6px;
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.88),
    0 0 40px rgba(200, 120, 64, 0.05);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.pvp__panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.pvp__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(200, 120, 64, 0.14);
}
.pvp__hdr-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent, #c87840);
  text-transform: uppercase;
}
.pvp__x {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(200, 120, 64, 0.18);
  border-radius: 3px;
  color: rgba(200, 120, 64, 0.55);
  cursor: pointer;
  transition: all 0.2s;
}
.pvp__x:hover {
  border-color: var(--accent, #c87840);
  color: var(--accent, #c87840);
}

/* ── SCREENS ──────────────────────────────────────────────────── */
.pvp__s {
  padding: 18px 15px;
}
.pvp__s--on {
  display: block;
}

/* ── MENU SCREEN ──────────────────────────────────────────────── */
.pvp__tagline {
  text-align: center;
  font-size: 0.84rem;
  color: rgba(200, 120, 64, 0.45);
  margin-bottom: 16px;
  font-style: italic;
}
.pvp__mbns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.pvp__foot {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(200, 120, 64, 0.28);
  padding-top: 10px;
  border-top: 1px solid rgba(200, 120, 64, 0.09);
}

/* ── NAME ROW ─────────────────────────────────────────────────── */
.pvp__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(200, 120, 64, 0.06);
  border: 1px solid rgba(200, 120, 64, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 13px;
}
.pvp__name-lbl {
  color: rgba(200, 120, 64, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pvp__name-val {
  color: var(--accent, #c87840);
  font-size: 0.85rem;
  font-weight: 600;
  flex: 1;
}
.pvp__name-edit {
  background: none;
  border: 1px solid rgba(200, 120, 64, 0.22);
  border-radius: 3px;
  color: rgba(200, 120, 64, 0.55);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.pvp__name-edit:hover {
  border-color: var(--accent, #c87840);
  color: var(--accent, #c87840);
}
.pvp__name-in {
  width: 100%;
  box-sizing: border-box;
  background: rgba(200, 120, 64, 0.06);
  border: 1px solid rgba(200, 120, 64, 0.2);
  border-radius: 5px;
  color: var(--accent, #c87840);
  font-size: 0.92rem;
  padding: 10px 13px;
  outline: none;
  margin-top: 8px;
  font-family: inherit;
}
.pvp__name-in:focus {
  border-color: rgba(200, 120, 64, 0.5);
}
.pvp__name-hint {
  color: rgba(200, 120, 64, 0.35);
  font-size: 0.7rem;
  margin: 6px 0 0;
  text-align: center;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.pvp__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Georgia", serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.2s;
  border: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
}
.pvp__btn b {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}
.pvp__btn small {
  display: block;
  font-family: "Georgia", serif;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.6;
  margin-top: 2px;
}

.pvp__btn-p {
  background: rgba(200, 120, 64, 0.1);
  border-color: var(--accent, #c87840);
  color: var(--accent, #c87840);
}
.pvp__btn-p:hover {
  background: rgba(200, 120, 64, 0.18);
  box-shadow: 0 0 14px rgba(200, 120, 64, 0.22);
}

.pvp__btn-s {
  background: transparent;
  border-color: rgba(200, 120, 64, 0.28);
  color: rgba(245, 239, 224, 0.75);
}
.pvp__btn-s:hover {
  border-color: var(--accent, #c87840);
  color: var(--accent, #c87840);
}

.pvp__btn-g {
  background: transparent;
  border-color: rgba(200, 120, 64, 0.13);
  color: rgba(200, 120, 64, 0.38);
  justify-content: center;
}
.pvp__btn-g:hover {
  border-color: rgba(200, 120, 64, 0.38);
  color: rgba(200, 120, 64, 0.65);
}

.pvp__btn-d {
  background: rgba(180, 40, 40, 0.1);
  border-color: rgba(180, 40, 40, 0.38);
  color: #e06060;
  justify-content: center;
  gap: 6px;
}
.pvp__btn-d:hover {
  border-color: #e06060;
  box-shadow: 0 0 10px rgba(180, 40, 40, 0.25);
}

/* ── QUICK MATCH BUTTON ─────────────────────────────────────────*/
.pvp__btn-q {
  background: rgba(200, 120, 64, 0.07);
  border: 1px solid rgba(200, 120, 64, 0.52);
  color: var(--accent, #c87840);
  position: relative;
  overflow: hidden;
}
.pvp__btn-q::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(200, 120, 64, 0.09),
    transparent
  );
  transform: translateX(-100%);
  animation: pvp-shimmer 2.5s infinite;
}
@keyframes pvp-shimmer {
  to {
    transform: translateX(100%);
  }
}
.pvp__btn-q:hover {
  background: rgba(200, 120, 64, 0.16);
  box-shadow: 0 0 16px rgba(200, 120, 64, 0.22);
}

/* ── WAITING SCREEN ───────────────────────────────────────────── */
.pvp__spin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.pvp__spin-wrap p {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: rgba(200, 120, 64, 0.45);
  text-transform: uppercase;
}
.pvp__spin {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(200, 120, 64, 0.14);
  border-top-color: var(--accent, #c87840);
  border-radius: 50%;
  animation: pvp-spin 1s linear infinite;
}
@keyframes pvp-spin {
  to {
    transform: rotate(360deg);
  }
}

.pvp__code-card {
  background: rgba(200, 120, 64, 0.04);
  border: 1px solid rgba(200, 120, 64, 0.15);
  border-radius: 4px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.pvp__code-lbl {
  font-size: 0.48rem;
  letter-spacing: 0.25em;
  color: rgba(200, 120, 64, 0.38);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pvp__code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pvp__code {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: var(--accent, #c87840);
  text-shadow: 0 0 22px rgba(200, 120, 64, 0.4);
}
.pvp__copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(200, 120, 64, 0.2);
  border-radius: 3px;
  color: rgba(200, 120, 64, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}
.pvp__copy:hover {
  border-color: var(--accent, #c87840);
  color: var(--accent, #c87840);
}
.pvp__code-hint {
  font-size: 0.74rem;
  color: rgba(200, 120, 64, 0.33);
  font-style: italic;
}

/* ── JOIN SCREEN ──────────────────────────────────────────────── */
.pvp__jlbl {
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  color: rgba(200, 120, 64, 0.5);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 14px;
}
.pvp__chars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 12px;
}
.pvp__csep {
  color: rgba(200, 120, 64, 0.3);
  font-size: 1.2rem;
}
.pvp__c {
  width: 38px;
  height: 46px;
  background: rgba(200, 120, 64, 0.05);
  border: 1px solid rgba(200, 120, 64, 0.2);
  border-radius: 3px;
  color: var(--accent, #c87840);
  font-family: "Georgia", serif;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.pvp__c:focus {
  border-color: var(--accent, #c87840);
  box-shadow: 0 0 9px rgba(200, 120, 64, 0.2);
}
.pvp__jerr {
  text-align: center;
  font-size: 0.78rem;
  color: #e06060;
  font-style: italic;
  margin-bottom: 10px;
  min-height: 18px;
}

/* ── LOBBY SCREEN ─────────────────────────────────────────────── */
.pvp__conn-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  background: rgba(80, 180, 80, 0.07);
  border: 1px solid rgba(80, 180, 80, 0.22);
  border-radius: 3px;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: #80d080;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.pvp__gdot {
  width: 6px;
  height: 6px;
  background: #80d080;
  border-radius: 50%;
  box-shadow: 0 0 6px #80d080;
  animation: pvp-pulse 2s infinite;
}
@keyframes pvp-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.pvp__players {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}
.pvp__pl {
  flex: 1;
  background: rgba(200, 120, 64, 0.04);
  border: 1px solid rgba(200, 120, 64, 0.11);
  border-radius: 4px;
  padding: 11px 7px;
  text-align: center;
}
.pvp__pl-y {
  border-color: rgba(200, 120, 64, 0.3);
}
.pvp__av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  margin: 0 auto 7px;
}
.pvp__av-y {
  background: rgba(200, 120, 64, 0.12);
  border: 1px solid var(--accent, #c87840);
  color: var(--accent, #c87840);
}
.pvp__av-o {
  background: rgba(200, 120, 64, 0.05);
  border: 1px solid rgba(200, 120, 64, 0.22);
  color: rgba(200, 120, 64, 0.55);
}
.pvp__pn {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 239, 224, 0.75);
  margin-bottom: 3px;
}
.pvp__pr {
  font-size: 0.7rem;
  color: rgba(200, 120, 64, 0.5);
  font-style: italic;
}
.pvp__pr b {
  display: block;
  font-size: 0.84rem;
  color: var(--accent, #c87840);
  margin-bottom: 2px;
}
.pvp__vs {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: rgba(200, 120, 64, 0.28);
  flex-shrink: 0;
}

/* ── RESULT SCREEN ────────────────────────────────────────────── */
.pvp__rico {
  text-align: center;
  margin-bottom: 10px;
  color: var(--accent, #c87840);
}
.pvp__rtitle {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
  color: rgba(245, 239, 224, 0.9);
  margin-bottom: 4px;
}
.pvp__rsub {
  font-size: 0.82rem;
  color: rgba(200, 120, 64, 0.5);
  text-align: center;
  font-style: italic;
  margin-bottom: 4px;
}

/* ── DISCONNECTED SCREEN ──────────────────────────────────────── */
.pvp__dcico {
  text-align: center;
  color: rgba(200, 120, 64, 0.25);
  margin-bottom: 10px;
}
.pvp__dctitle {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(245, 239, 224, 0.85);
  text-align: center;
  margin-bottom: 5px;
}
.pvp__dcmsg {
  font-size: 0.8rem;
  color: rgba(200, 120, 64, 0.4);
  text-align: center;
  font-style: italic;
  margin-bottom: 4px;
}

/* ── NOTIFICATION ─────────────────────────────────────────────── */
.pvp__notif {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 9px 14px;
  font-size: 0.82rem;
  text-align: center;
  font-style: italic;
  border-top: 1px solid rgba(200, 120, 64, 0.1);
  animation: pvp-fadein 0.2s ease;
}
@keyframes pvp-fadein {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.pvp__notif--success {
  color: #80d080;
}
.pvp__notif--error {
  color: #e06060;
}
.pvp__notif--warn {
  color: #d0a040;
}
.pvp__notif--info {
  color: rgba(200, 120, 64, 0.72);
}
.pvp__notif--chat {
  color: rgba(200, 120, 64, 0.85);
}

/* ── QUICK MATCH SCREEN ──────────────────────────────────────── */
.pvp__qm-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvp__qm-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(200, 120, 64, 0.3);
  animation: pvp-qm-pulse 2s ease-out infinite;
}
.pvp__qm-ring--2 {
  animation-delay: 0.5s;
}
.pvp__qm-ring--3 {
  animation-delay: 1s;
}
@keyframes pvp-qm-pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
.pvp__qm-icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 120, 64, 0.1);
  border: 1px solid rgba(200, 120, 64, 0.42);
  color: var(--accent, #c87840);
  border-radius: 4px;
}
.pvp__qm-status {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent, #c87840);
  text-align: center;
  margin-bottom: 6px;
}
.pvp__qm-sub {
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(200, 120, 64, 0.35);
  text-align: center;
  margin-bottom: 4px;
}
[data-state="found"] .pvp__qm-ring {
  border-color: rgba(128, 208, 128, 0.4);
}
[data-state="found"] .pvp__qm-icon {
  border-color: rgba(128, 208, 128, 0.6);
  color: #80d080;
}
[data-state="found"] .pvp__qm-status {
  color: #80d080;
}

/* ── SET NAME SCREEN ─────────────────────────────────────────── */
.pvp__s #pvp-nameinput {
  width: 100%;
  box-sizing: border-box;
}

/* ================================================================
   IN-GAME HUD BAR — fixed bottom bar during online match
================================================================ */
/* ── PVP GAME PILL (replaces old bottom bar) ─────────────────── */
/* Floats at the bottom-center of the board, above the footer.   */
.pvp__hudbar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(200, 120, 64, 0.2);
  border-radius: 100px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 6px 6px 6px 18px;
  min-width: 340px;
  transition:
    opacity 0.3s,
    transform 0.3s;
  white-space: nowrap;
}
.pvp__hudbar.pvp__dn {
  display: none !important;
}

/* Status left */
.pvp__pill-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding-right: 16px;
}
.pvp__pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.pvp__pill-dot[data-turn="yours"] {
  background: #4ade80;
  box-shadow:
    0 0 0 3px rgba(74, 222, 128, 0.2),
    0 0 12px rgba(74, 222, 128, 0.5);
}
.pvp__pill-dot[data-turn="theirs"] {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}
.pvp__pill-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.pvp__pill-turn {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.pvp__pill-opp {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.03em;
}

/* Divider */
.pvp__pill-divider {
  width: 1px;
  height: 28px;
  background: rgba(200, 120, 64, 0.18);
  flex-shrink: 0;
  margin-right: 6px;
}

/* Action buttons */
.pvp__pill-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pvp__pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s;
  position: relative;
}
.pvp__pill-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.pvp__pill-btn svg {
  flex-shrink: 0;
}
.pvp__pill-resign {
  color: rgba(248, 113, 113, 0.7);
}
.pvp__pill-resign:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}
.pvp__pill-exit:hover {
  background: rgba(200, 120, 64, 0.12);
  color: var(--accent, #c87840);
}

/* Badge on chat icon */
.pvp__hudbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: var(--accent, #c87840);
  color: #0e1118;
  font-size: 10px;
  font-weight: 900;
  border-radius: 100px;
  padding: 0 3px;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* Legacy selectors kept for compat */
.pvp__hudbar-turn {
  display: none;
}
.pvp__opp-name {
  display: none;
}
.pvp__hudbar-btn {
  display: none;
} /* replaced by pill-btn */

/* ── CHAT PANEL ─────────────────────────────────────────────── */
.pvp__chatpanel {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 280px;
  background: rgba(10, 13, 20, 0.98);
  border: 1px solid rgba(200, 120, 64, 0.18);
  border-radius: 5px 5px 0 0;
  z-index: 9997;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.65);
}
.pvp__chatpanel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(200, 120, 64, 0.11);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200, 120, 64, 0.55);
}
.pvp__chatpanel-close {
  background: transparent;
  border: none;
  color: rgba(200, 120, 64, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.pvp__chatpanel-close:hover {
  color: var(--accent, #c87840);
}
.pvp__chatpanel-msgs {
  height: 160px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pvp__chatpanel-msgs::-webkit-scrollbar {
  width: 3px;
}
.pvp__chatpanel-msgs::-webkit-scrollbar-thumb {
  background: rgba(200, 120, 64, 0.2);
}
.pvp__chatmsg {
  padding: 5px 9px;
  border-radius: 3px;
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 90%;
  word-break: break-word;
}
.pvp__chatmsg--me {
  background: rgba(200, 120, 64, 0.1);
  border: 1px solid rgba(200, 120, 64, 0.2);
  color: rgba(245, 239, 224, 0.85);
  align-self: flex-end;
}
.pvp__chatmsg--op {
  background: rgba(200, 120, 64, 0.04);
  border: 1px solid rgba(200, 120, 64, 0.1);
  color: rgba(200, 120, 64, 0.55);
  align-self: flex-start;
}
.pvp__chatpanel-input {
  display: flex;
  border-top: 1px solid rgba(200, 120, 64, 0.1);
}
.pvp__chatpanel-cin {
  flex: 1;
  padding: 9px 10px;
  background: transparent;
  border: none;
  color: rgba(245, 239, 224, 0.85);
  font-family: "Georgia", serif;
  font-size: 0.85rem;
  outline: none;
}
.pvp__chatpanel-cin::placeholder {
  color: rgba(200, 120, 64, 0.24);
}
.pvp__chatpanel-send {
  width: 36px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(200, 120, 64, 0.1);
  color: rgba(200, 120, 64, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.pvp__chatpanel-send:hover {
  color: var(--accent, #c87840);
}

/* ── EXIT / RESIGN DIALOGS ──────────────────────────────────── */
.pvp__exitdlg {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvp__exitdlg-box {
  background: var(--surface, #161c28);
  border: 1px solid rgba(200, 120, 64, 0.28);
  border-radius: 6px;
  padding: 28px 28px 22px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.92);
}
.pvp__exitdlg-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(245, 239, 224, 0.88);
  margin-bottom: 8px;
}
.pvp__exitdlg-sub {
  font-size: 0.82rem;
  color: rgba(200, 120, 64, 0.44);
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}
.pvp__exitdlg-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pvp__exitdlg-btns .pvp__btn {
  width: auto;
  flex: 1;
}

/* ── Hide in-game topbar buttons during online PVP ─────────── */
body.pvp-online-active #btn-undo,
body.pvp-online-active #btn-restart,
body.pvp-online-active #btn-hint,
body.pvp-online-active #btn-pause,
body.pvp-online-active #btn-resume,
body.pvp-online-active #btn-resign,
body.pvp-online-active #btn-quit {
  display: none !important;
}

/* ── Online mode button in lobby ────────────────────────────── */
.pvp__lobby-online-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 13px 22px;
  background: transparent;
  border: 1px solid var(--accent, #c87840);
  border-radius: 4px;
  color: var(--accent, #c87840);
  font-family: "Georgia", serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pvp__lobby-online-btn:hover {
  background: rgba(200, 120, 64, 0.09);
  box-shadow: 0 0 16px rgba(200, 120, 64, 0.2);
}

/* Add bottom padding to game screen when hud bar is visible */
body.pvp-online-active #screen-game {
  padding-bottom: 54px;
}

/* ================================================================
   LIGHT MODE OVERRIDES — pvp-addon
   All dark hardcoded colors made responsive to light theme
================================================================ */

/* Float button */
body.light-mode .pvp__float {
  background: var(--surface, #e8e2d8);
  border-color: var(--copper, #9a5520);
  color: var(--copper, #9a5520);
  box-shadow:
    0 0 14px rgba(154, 85, 32, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.15);
}
body.light-mode .pvp__float:hover {
  background: rgba(154, 85, 32, 0.1);
}

/* Panel shell */
body.light-mode .pvp__panel {
  background: var(--surface, #e8e2d8);
  border-color: rgba(154, 85, 32, 0.28);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.22),
    0 0 24px rgba(154, 85, 32, 0.06);
}

/* Header */
body.light-mode .pvp__hdr {
  border-bottom-color: rgba(154, 85, 32, 0.16);
  background: var(--surface2, #ddd5c8);
}
body.light-mode .pvp__hdr-title {
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__x {
  border-color: rgba(154, 85, 32, 0.22);
  color: var(--copper-dim, #7a4018);
}
body.light-mode .pvp__x:hover {
  border-color: var(--copper, #9a5520);
  color: var(--copper, #9a5520);
}

/* Tagline & footer */
body.light-mode .pvp__tagline {
  color: var(--text-dim, #4a3e30);
}
body.light-mode .pvp__foot {
  color: var(--text-muted, #7a6e60);
  border-top-color: rgba(154, 85, 32, 0.12);
}

/* Name row */
body.light-mode .pvp__name-row {
  background: rgba(154, 85, 32, 0.06);
  border-color: rgba(154, 85, 32, 0.2);
}
body.light-mode .pvp__name-lbl {
  color: var(--copper-dim, #7a4018);
}
body.light-mode .pvp__name-val {
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__name-edit {
  border-color: rgba(154, 85, 32, 0.25);
  color: var(--copper-dim, #7a4018);
}
body.light-mode .pvp__name-in {
  background: rgba(154, 85, 32, 0.05);
  border-color: rgba(154, 85, 32, 0.22);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__name-hint {
  color: var(--text-muted, #7a6e60);
}

/* Primary button */
body.light-mode .pvp__btn-p {
  background: rgba(154, 85, 32, 0.1);
  border-color: var(--copper, #9a5520);
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__btn-p:hover {
  background: rgba(154, 85, 32, 0.18);
}

/* Secondary button */
body.light-mode .pvp__btn-s {
  border-color: rgba(154, 85, 32, 0.3);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__btn-s:hover {
  border-color: var(--copper, #9a5520);
  color: var(--copper, #9a5520);
}

/* Ghost button */
body.light-mode .pvp__btn-g {
  border-color: rgba(154, 85, 32, 0.18);
  color: var(--text-muted, #7a6e60);
}
body.light-mode .pvp__btn-g:hover {
  border-color: var(--copper, #9a5520);
  color: var(--copper, #9a5520);
}

/* Danger button */
body.light-mode .pvp__btn-d {
  background: rgba(176, 48, 48, 0.08);
  border-color: rgba(176, 48, 48, 0.35);
  color: var(--danger, #b03030);
}

/* Quick match button */
body.light-mode .pvp__btn-q {
  background: rgba(154, 85, 32, 0.07);
  border-color: rgba(154, 85, 32, 0.45);
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__btn-q:hover {
  background: rgba(154, 85, 32, 0.14);
}

/* Code card */
body.light-mode .pvp__code-card {
  background: rgba(154, 85, 32, 0.05);
  border-color: rgba(154, 85, 32, 0.18);
}
body.light-mode .pvp__code-lbl {
  color: var(--text-muted, #7a6e60);
}
body.light-mode .pvp__code {
  color: var(--copper, #9a5520);
  text-shadow: none;
}
body.light-mode .pvp__code-hint {
  color: var(--text-muted, #7a6e60);
}
body.light-mode .pvp__copy {
  border-color: rgba(154, 85, 32, 0.22);
  color: var(--copper-dim, #7a4018);
}

/* Join screen */
body.light-mode .pvp__jlbl {
  color: var(--text-dim, #4a3e30);
}
body.light-mode .pvp__csep {
  color: rgba(154, 85, 32, 0.35);
}
body.light-mode .pvp__char {
  background: rgba(154, 85, 32, 0.06);
  border-color: rgba(154, 85, 32, 0.22);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__char:focus {
  border-color: var(--copper, #9a5520);
}

/* Waiting spinner */
body.light-mode .pvp__spin-wrap p {
  color: var(--text-dim, #4a3e30);
}
body.light-mode .pvp__spin {
  border-color: rgba(154, 85, 32, 0.15);
  border-top-color: var(--copper, #9a5520);
}

/* Lobby roles */
body.light-mode .pvp__roles-wrap {
  border-color: rgba(154, 85, 32, 0.14);
}
body.light-mode .pvp__role-you,
body.light-mode .pvp__role-opp {
  background: rgba(154, 85, 32, 0.05);
  border-color: rgba(154, 85, 32, 0.15);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__role-you b,
body.light-mode .pvp__role-opp b {
  color: var(--copper, #9a5520);
}

/* Dividers and separators */
body.light-mode .pvp__sep {
  color: var(--text-muted, #7a6e60);
}
body.light-mode [class*="pvp__s"] {
  color: var(--text, #1a1612);
}

/* Result screen */
body.light-mode .pvp__result-ico {
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__result-title {
  color: var(--text, #1a1612);
}
body.light-mode .pvp__result-sub {
  color: var(--text-dim, #4a3e30);
}

/* Notification */
body.light-mode .pvp__notif {
  background: var(--surface2, #ddd5c8);
  border-color: rgba(154, 85, 32, 0.2);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__notif--success {
  color: var(--success, #3a8050);
}
body.light-mode .pvp__notif--error {
  color: var(--danger, #b03030);
}
body.light-mode .pvp__notif--warn {
  color: #9a6800;
}
body.light-mode .pvp__notif--info {
  color: var(--copper, #9a5520);
}

/* Chat panel */
body.light-mode .pvp__chatpanel {
  background: var(--surface, #e8e2d8);
  border-color: rgba(154, 85, 32, 0.22);
}
body.light-mode .pvp__chat-hdr {
  border-bottom-color: rgba(154, 85, 32, 0.14);
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__chat-msgs {
  background: var(--surface2, #ddd5c8);
}
body.light-mode .pvp__chat-msg {
  color: var(--text, #1a1612);
}
body.light-mode .pvp__chat-name {
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__chat-in {
  background: rgba(154, 85, 32, 0.06);
  border-color: rgba(154, 85, 32, 0.22);
  color: var(--text, #1a1612);
}
body.light-mode .pvp__chat-send {
  background: rgba(154, 85, 32, 0.1);
  border-color: rgba(154, 85, 32, 0.3);
  color: var(--copper, #9a5520);
}

/* HUD pill */
body.light-mode .pvp__hudbar {
  background: rgba(240, 237, 232, 0.92);
  border-color: rgba(154, 85, 32, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
body.light-mode .pvp__pill-turn {
  color: var(--text, #1a1612);
}
body.light-mode .pvp__pill-opp {
  color: var(--text-dim, #4a3e30);
}
body.light-mode .pvp__pill-divider {
  background: rgba(154, 85, 32, 0.18);
}
body.light-mode .pvp__pill-btn {
  color: var(--text-dim, #4a3e30);
}
body.light-mode .pvp__pill-btn:hover {
  background: rgba(154, 85, 32, 0.08);
  color: var(--copper, #9a5520);
}
body.light-mode .pvp__pill-resign {
  color: var(--danger, #b03030);
}
body.light-mode .pvp__pill-resign:hover {
  background: rgba(176, 48, 48, 0.08);
}

/* Font size boosts for readability */
body.light-mode .pvp__btn {
  font-size: 0.68rem;
}
body.light-mode .pvp__btn small {
  font-size: 0.8rem;
}
body.light-mode .pvp__code {
  font-size: 2rem;
}
body.light-mode .pvp__hdr-title {
  font-size: 0.64rem;
}

/* Panel embedded in online-pvp-host */
#online-pvp-host .pvp__panel {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  max-width: 460px !important;
  border: 1px solid rgba(200, 120, 64, 0.2);
}
#online-pvp-host .pvp__hdr {
  display: none !important;
}

/* Ensure the body-level pvp-addon widget never appears as a stray popup.
   The pvp-panel is opacity:0 when not open, but sections moved back to it
   could bleed through. Force the entire addon wrapper hidden when panel is closed. */
#pvp-addon .pvp__panel:not(.pvp__panel--open) {
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
#pvp-addon .pvp__panel:not(.pvp__panel--open) .pvp__s {
  display: none !important;
}
