html, body {
  margin: 0;
  padding: 0;
  background: #121213;
  color: #fff;
  font-family: arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
body {
  display: flex;
  justify-content: center;
}
.app {
  width: 100%;
  max-width: 700px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.top {
  border-bottom: 1px solid #2f2f31;
  position: relative;
  padding: 10px 0 8px;
  text-align: center;
}
.title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.hdstats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 6px;
}
.hstat {
  text-align: center;
  font-size: 11px;
  color: #818384;
  text-transform: uppercase;
}
.hstat span {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.newbtn {
  position: absolute;
  right: 12px;
  top: 10px;
  cursor: pointer;
  font-size: 22px;
  color: #818384;
  user-select: none;
  padding: 4px 6px;
  line-height: 1;
}
.newbtn:hover { color: #fff; }

.toggle {
  position: absolute;
  left: 12px;
  top: 12px;
  cursor: pointer;
  font-size: 18px;
  color: #818384;
  user-select: none;
  padding: 4px 6px;
  line-height: 1;
}
.toggle:hover { color: #fff; }

#timer {
  font-family: monospace;
  font-size: 12px;
  color: #818384;
  margin-top: 4px;
  letter-spacing: 1px;
}
#source {
  font-size: 10px;
  color: #818384;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toast-wrap {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.toast {
  background: #fff;
  color: #121213;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.toast.show { opacity: 1; transform: translateY(0); }

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(5px, 1.1dvh, 8px);
  width: min(420px, 54dvh, 90vw);
  margin: clamp(8px, 1.7dvh, 16px) auto;
}
.tile {
  aspect-ratio: 1;
  border: 2px solid #3a3a3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(24px, 4.7dvh, 52px);
  font-weight: 700;
  text-transform: uppercase;
}
.tile.filled   { border-color: #565758; }
.tile.pop      { animation: tpop 0.1s ease; }
.tile.hint     { border-color: #5b9bd5; color: #5b9bd5; }
.tile.correct  { background: #6aaa64; border-color: #6aaa64; color: #fff; }
.tile.present  { background: #c9b458; border-color: #c9b458; color: #fff; }
.tile.absent   { background: #3a3a3c; border-color: #3a3a3c; color: #fff; }
.tile.flip     { animation: flip 0.45s ease; }
.tile.shake    { animation: shake 0.45s ease; }
.tile.bounce   { animation: bounce 0.55s ease; }

@keyframes tpop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes flip {
  0%   { transform: rotateX(0); }
  50%  { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
@keyframes shake {
  0%,100%              { transform: translateX(0); }
  10%,30%,50%,70%,90% { transform: translateX(-5px); }
  20%,40%,60%,80%     { transform: translateX(5px); }
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  35%     { transform: translateY(-18px); }
  60%     { transform: translateY(-8px); }
}

.controls {
  display: flex;
  justify-content: center;
  margin: 0 0 6px;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 8px;
}
.ctrl-btn {
  background: #2f2f31;
  border: 1px solid #3a3a3c;
  color: #818384;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ctrl-btn:hover { color: #fff; border-color: #565758; }
.ctrl-btn:disabled { opacity: 0.35; cursor: default; }

.main-controls .ctrl-btn { min-width: 110px; }
.side-open-btn {
  position: absolute;
  right: 48px;
  top: 10px;
  cursor: pointer;
  font-size: 18px;
  color: #818384;
  background: transparent;
  border: 0;
  user-select: none;
  padding: 4px 7px;
  line-height: 1;
}
.side-open-btn:hover { color: #fff; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,0.55);
  z-index: 18;
}
.sidebar-overlay.show { display: block; }
.sidebar-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(310px, 88vw);
  background: #1a1a1b;
  border-left: 1px solid #333;
  padding: 18px;
  box-sizing: border-box;
  box-shadow: -18px 0 40px rgba(0,0,0,0.35);
  overflow: auto;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.sidebar-actions {
  display: grid;
  gap: 9px;
}
.sidebar-actions .ctrl-btn {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
}
.settings-panel {
  display: none;
  width: min(520px, 92vw);
  margin: 8px auto 4px;
  padding: 10px;
  border: 1px solid #2f2f31;
  border-radius: 6px;
  background: #181819;
  box-sizing: border-box;
}
.settings-panel.show { display: block; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.modal-actions .ctrl-btn { flex: 1; min-width: 130px; }
.definition {
  min-height: 18px;
  color: #818384;
  font-size: 12px;
  line-height: 1.35;
  margin: -4px 0 14px;
}

.keys {
  padding: clamp(4px, 1dvh, 10px) 6px clamp(8px, 2.2dvh, 24px);
  margin-top: auto;
}
.krow {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(4px, 1dvh, 8px);
}
.key {
  margin: 0 clamp(1px, 0.55vw, 4px);
  height: clamp(38px, 6.2dvh, 62px);
  flex: 1;
  min-width: 0;
  max-width: clamp(30px, 7.2vw, 56px);
  background: #818384;
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: clamp(11px, 1.65dvh, 18px);
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  transition: background 0.2s;
}
.key.big     { max-width: clamp(48px, 12vw, 84px); font-size: clamp(10px, 1.4dvh, 15px); }

.key svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.key:active  { filter: brightness(0.8); }
.key.correct { background: #6aaa64; color: #fff; }
.key.present { background: #c9b458; color: #fff; }
.key.absent  { background: #3a3a3c; color: #fff; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.panel {
  background: #1a1a1b;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 24px 28px 22px;
  text-align: center;
  width: min(320px, 88vw);
  animation: fadein 0.2s ease;
}
@keyframes fadein {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.panel-word {
  color: #818384;
  font-size: 13px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dist-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #818384;
  margin-bottom: 8px;
}
.dist { margin: 0 0 16px; }
.dist-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.dist-label {
  width: 18px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 6px;
}
.dist-wrap { flex: 1; }
.dist-bar {
  height: 22px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 2px;
  background: #3a3a3c;
  color: #fff;
  box-sizing: border-box;
  transition: width 0.5s ease;
}
.dist-bar.curr { background: #6aaa64; }

.srow {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.trow {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 18px;
}
.sbox { text-align: center; }
.snum { font-size: 26px; font-weight: 700; line-height: 1; }
.slabel { font-size: 10px; color: #818384; text-transform: uppercase; margin-top: 2px; }

.playbtn {
  background: #6aaa64;
  color: #fff;
  border: 0;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  width: 100%;
}
.playbtn:hover { background: #5a9a54; }

.spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #444;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* light mode */
body.light { background: #fff; color: #121213; }
body.light .top { border-color: #d3d6da; }
body.light .hstat { color: #787c7e; }
body.light .hstat span { color: #121213; }
body.light .newbtn { color: #787c7e; }
body.light .newbtn:hover { color: #121213; }
body.light .toggle { color: #787c7e; }
body.light .toggle:hover { color: #121213; }
body.light #timer { color: #787c7e; }
body.light #source { color: #787c7e; }
body.light .toast { background: #121213; color: #fff; }
body.light .tile { border-color: #d3d6da; color: #121213; }
body.light .tile.filled { border-color: #878a8c; }
body.light .tile.hint { border-color: #3a78c9; color: #3a78c9; }
body.light .ctrl-btn { background: #f0f0f0; border-color: #d3d6da; color: #787c7e; }
body.light .ctrl-btn:hover { color: #121213; border-color: #878a8c; }
body.light .settings-panel { background: #f7f7f7; border-color: #d3d6da; }
body.light .definition { color: #787c7e; }
body.light .key { background: #d3d6da; color: #121213; }
body.light .key.absent { background: #787c7e; }
body.light .modal { background: rgba(0,0,0,0.45); }
body.light .panel { background: #fff; border-color: #d3d6da; color: #121213; }
body.light .panel-word { color: #787c7e; }
body.light .slabel { color: #787c7e; }
body.light .dist-head { color: #787c7e; }
body.light .dist-bar { background: #d3d6da; color: #121213; }
body.light .dist-bar.curr { background: #6aaa64; color: #fff; }

@media (max-height: 760px) {
  .top { padding: 6px 0 5px; }
  .title { font-size: 21px; letter-spacing: 3px; }
  .hdstats { gap: 10px; margin-top: 3px; }
  .hstat { font-size: 9px; }
  .hstat span { font-size: 14px; }
  #timer { font-size: 11px; margin-top: 2px; }
  .newbtn { top: 6px; right: 8px; }
  .toggle { top: 7px; left: 8px; }
  .toast-wrap { height: 30px; }
  .toast { font-size: 11px; padding: 6px 12px; }
  .board { width: min(360px, 45dvh, 90vw); gap: 5px; margin: 7px auto; }
  .tile { font-size: clamp(22px, 4.2dvh, 42px); }
  .controls { margin-bottom: 4px; gap: 6px; }
  .ctrl-btn { font-size: 10px; padding: 5px 10px; letter-spacing: 0.5px; }
  .settings-panel { margin: 4px 8px 8px; padding: 8px; }
  .settings-grid { gap: 6px; }
  .keys { padding: 4px 5px 10px; }
  .krow { margin-bottom: 5px; }
  .key { height: clamp(34px, 5.7dvh, 48px); max-width: clamp(28px, 7vw, 48px); font-size: clamp(10px, 1.45dvh, 15px); }
  .key.big { max-width: clamp(46px, 11vw, 74px); font-size: clamp(9px, 1.25dvh, 13px); }
}

@media (max-height: 620px) {
  .title { font-size: 18px; letter-spacing: 2px; }
  .hdstats { display: none; }
  .toast-wrap { height: 26px; }
  .board { width: min(310px, 40dvh, 88vw); gap: 4px; margin: 5px auto; }
  .tile { border-width: 1.5px; font-size: clamp(18px, 3.8dvh, 34px); }
  .controls { margin-bottom: 2px; }
  .ctrl-btn { padding: 4px 8px; }
  .settings-panel { max-height: 35dvh; overflow: auto; }
  .keys { padding-bottom: 6px; }
  .krow { margin-bottom: 4px; }
  .key { height: clamp(30px, 5.1dvh, 40px); max-width: clamp(25px, 6.7vw, 42px); border-radius: 3px; }
  .key.big { max-width: clamp(42px, 10.5vw, 66px); }
}

@media (max-width: 430px) {
  .side-open-btn { right: 42px; top: 7px; }
  .key { margin: 0 2px; }
  .key.big { font-size: 10px; }
}

body.colorblind .tile.correct,
body.colorblind .key.correct,
body.colorblind .dist-bar.curr {
  background: #85c0f9;
  border-color: #85c0f9;
  color: #121213;
}
body.colorblind .tile.present,
body.colorblind .key.present {
  background: #f5793a;
  border-color: #f5793a;
  color: #121213;
}
body.colorblind .tile.hint {
  border-color: #b983ff;
  color: #b983ff;
}


/* server account / leaderboard ui */
.server-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 18px;
  padding: 2px 8px;
  margin-top: 4px;
  border-radius: 999px;
  border: 1px solid #2f2f31;
  color: #818384;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.server-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #787c7e;
  display: inline-block;
}
.server-dot.on { background: #6aaa64; }
.server-dot.off { background: #b23b3b; }
.account-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 14px;
}
.account-panel {
  width: min(520px, 94vw);
  max-height: 92vh;
  overflow: auto;
  background: #1a1a1b;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 18px;
  box-sizing: border-box;
}
.account-panel.wide { width: min(720px, 94vw); }
.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.account-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.xbtn {
  background: #2f2f31;
  color: #fff;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 5px 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.form-grid input,
.form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  background: #101011;
  color: #fff;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}
.form-grid textarea {
  min-height: 70px;
  resize: vertical;
}
.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
#logout-btn { display: none; }
.account-msg {
  min-height: 18px;
  color: #818384;
  font-size: 12px;
  margin: 8px 0 0;
  text-align: center;
}
.profile-card {
  display: none;
  margin-top: 12px;
  border-top: 1px solid #333;
  padding-top: 12px;
}
.profile-card.show { display: block; }
.profile-line {
  color: #d7dadc;
  font-size: 13px;
  margin: 0 0 10px;
}
.leader-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.leader-table th,
.leader-table td {
  border-bottom: 1px solid #333;
  padding: 8px 6px;
  text-align: left;
}
.leader-table th {
  color: #818384;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
}
.leader-table td.num,
.leader-table th.num { text-align: right; }
.leader-empty {
  color: #818384;
  font-size: 13px;
  padding: 10px 0;
}
.sync-note {
  color: #818384;
  font-size: 11px;
  margin-top: 8px;
  text-align: center;
}

.privacy-section {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.toggle-row input[type="checkbox"] { display: none; }
.toggle-switch {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #444;
  position: relative;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle-row input:checked + .toggle-switch { background: #538d4e; }
.toggle-row input:checked + .toggle-switch::after { transform: translateX(16px); }

.profile-preview-card,
.profile-result-card {
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  background: #101011;
  margin: 10px 0;
  position: relative;
}
.profile-banner {
  height: 58px;
  background: linear-gradient(135deg, #538d4e, #3a3a3c);
}
.profile-body {
  padding: 0 12px 12px;
}
.profile-topline {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: -22px;
}
.profile-avatar-big {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 4px solid #101011;
  background: #1a1a1b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex: 0 0 auto;
}

.profile-avatar-big.has-image {
  font-size: 0;
  overflow: hidden;
}
.profile-banner.has-image {
  overflow: hidden;
}
.profile-avatar-big img,
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lazy-img {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lazy-img-loaded {
  opacity: 1;
}
.profile-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.profile-file-row input[type=file] {
  padding: 8px;
}
.player-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}
.profile-nameblock {
  min-width: 0;
  padding-bottom: 5px;
}
.profile-display {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-username {
  color: #818384;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-status {
  margin-top: 8px;
  font-size: 12px;
  color: #d7dadc;
  border-left: 3px solid #6aaa64;
  padding-left: 8px;
}
.profile-bio-text {
  margin-top: 8px;
  color: #d7dadc;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.35;
}
.profile-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.profile-chip {
  border: 1px solid #333;
  border-radius: 999px;
  padding: 4px 8px;
  color: #818384;
  font-size: 11px;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #538d4e;
  border-radius: 999px;
  padding: 4px 10px;
  color: #b5e6a3;
  font-size: 11px;
  background: rgba(83,141,78,0.12);
  cursor: default;
}
.profile-hist-btn {
  margin-top: 10px;
  font-size: 11px;
}
.versus-history-box {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}
.vh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #1a1a1b;
  font-size: 12px;
}
.vh-result {
  font-weight: 700;
  font-size: 13px;
  min-width: 14px;
}
.vh-win .vh-result { color: #538d4e; }
.vh-loss .vh-result { color: #818384; }
.vh-opponent { flex: 1; color: #fff; }
.vh-meta { color: #818384; font-size: 11px; }

.social-section-title {
  color: #818384;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 12px 0 6px;
}
.social-box {
  display: grid;
  gap: 8px;
}
.social-row {
  border: 1px solid #333;
  border-radius: 10px;
  background: #101011;
  padding: 10px;
}
.social-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.social-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}
.social-actions .ctrl-btn {
  padding: 6px 9px;
  font-size: 10px;
}
.social-muted {
  color: #818384;
  font-size: 12px;
  line-height: 1.35;
}
.social-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.social-tabs .ctrl-btn {
  flex: 1;
  min-width: 110px;
}


.versus-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 18px;
  padding: 2px 8px;
  margin-top: 3px;
  border-radius: 999px;
  border: 1px solid #3a3a3c;
  color: #c9b458;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.versus-code {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  background: #101011;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 18px;
  margin: 8px 0;
}
.versus-status {
  color: #d7dadc;
  font-size: 13px;
  margin: 8px 0;
  line-height: 1.4;
}
.versus-players {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.versus-player {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  background: #111;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.versus-player span:last-child {
  color: #818384;
  font-size: 12px;
  text-align: right;
}
body.light .versus-badge { border-color: #d3d6da; color: #8a6d22; }
body.light .versus-code { background: #fff; border-color: #d3d6da; color: #121213; }
body.light .versus-status { color: #121213; }
body.light .versus-player { background: #f7f7f7; border-color: #d3d6da; }
body.light .versus-player span:last-child { color: #787c7e; }

body.light .server-pill { border-color: #d3d6da; color: #787c7e; }
body.light .account-panel { background: #fff; border-color: #d3d6da; color: #121213; }
body.light .side-open-btn { color: #787c7e; }
body.light .side-open-btn:hover { color: #121213; }
body.light .sidebar-drawer { background: #fff; border-color: #d3d6da; color: #121213; }
body.light .xbtn { background: #f0f0f0; color: #121213; border-color: #d3d6da; }
body.light .form-grid input,
body.light .form-grid textarea { background: #fff; color: #121213; border-color: #d3d6da; }
body.light .profile-card { border-top-color: #d3d6da; }
body.light .profile-line { color: #121213; }
body.light .leader-table th,
body.light .leader-table td { border-bottom-color: #d3d6da; }
body.light .account-msg,
body.light .leader-empty,
body.light .sync-note { color: #787c7e; }

body.light .profile-preview-card,
body.light .profile-result-card,
body.light .social-row { background: #fff; border-color: #d3d6da; }
body.light .profile-avatar-big { background: #fff; border-color: #fff; }
body.light .profile-status,
body.light .profile-bio-text { color: #121213; }
body.light .profile-chip { border-color: #d3d6da; color: #787c7e; }
body.light .social-section-title,
body.light .social-muted { color: #787c7e; }

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
  .account-actions .ctrl-btn { flex: 1; min-width: 120px; }
  .leader-table { font-size: 11px; }
  .leader-table th,
  .leader-table td { padding: 7px 4px; }
}


/* v9 desktop polish */
.toggle svg,
.newbtn svg,
.side-open-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toggle,
.newbtn,
.side-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-open-btn {
  width: 30px;
  height: 30px;
}
.newbtn,
.toggle {
  width: 30px;
  height: 30px;
}
.dev-note {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  padding: 18px;
}
.dev-note.show { display: flex; }
.dev-note-panel {
  width: min(540px, 92vw);
  background: #1a1a1b;
  color: #fff;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}
.dev-note-panel h2 {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 18px;
}
.dev-note-panel p {
  margin: 0 0 14px;
  color: #d7dadc;
  line-height: 1.45;
  font-size: 14px;
}
.dev-note-panel button {
  width: 100%;
}
@media (min-width: 900px) and (min-height: 720px) {
  .app {
    max-width: 560px;
  }
  .top {
    padding-top: 7px;
    padding-bottom: 6px;
  }
  .title {
    font-size: 22px;
    letter-spacing: 3px;
  }
  .hdstats {
    gap: 12px;
    margin-top: 4px;
  }
  .hstat span {
    font-size: 15px;
  }
  .toast-wrap {
    height: 32px;
  }
  .board {
    width: min(340px, 43dvh, 72vw);
    gap: 5px;
    margin: 8px auto;
  }
  .tile {
    font-size: clamp(22px, 3.7dvh, 38px);
  }
  .keys {
    max-width: 520px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 12px;
  }
  .key {
    height: clamp(34px, 4.7dvh, 46px);
    max-width: 43px;
    font-size: clamp(10px, 1.35dvh, 14px);
    margin-left: 2px;
    margin-right: 2px;
  }
  .key.big {
    max-width: 66px;
    font-size: clamp(9px, 1.2dvh, 12px);
  }
  .ctrl-btn {
    font-size: 11px;
    padding: 6px 14px;
  }
  .main-controls .ctrl-btn {
    min-width: 94px;
  }
}
@media (min-width: 1200px) and (min-height: 820px) {
  .app {
    transform: scale(0.92);
    transform-origin: top center;
  }
}
@media (max-width: 520px) {
  .side-open-btn {
    right: 42px;
  }
}

/* split build close icon fix */
.xbtn svg,
.xbtn .xicon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}


/* v14 chat */
.chat-panel { width: min(920px, 94vw); }
.chat-topline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 10px;
}
.chat-tabs, .chat-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chat-layout {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.chat-friends-panel {
  width: 190px;
  flex-shrink: 0;
  border-left: 1px solid #2a2a2c;
  background: #111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-friends-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #818384;
  padding: 12px 12px 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#chat-modal #chat-friends-close-mobile { display: none; }
.chat-friends-box {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-content: flex-start;
}
.chat-friend-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid #1e1e20;
  color: #d7dadc;
  border-radius: 0;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-friend-btn:hover { background: #1e1e20; }
.chat-friend-btn.active { background: #1e1e20; color: #6aaa64; }
.chat-friend-btn:last-child { border-bottom: none; }
.chat-friend-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.chat-friend-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-friend-info { flex: 1; min-width: 0; }
.chat-friend-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.chat-friend-receipt { font-size: 10px; color: #818384; white-space: nowrap; flex-shrink: 0; }
.chat-friend-receipt.new-chat { color: #6aaa64; font-weight: 700; }
.chat-friend-preview { font-size: 11px; color: #818384; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-channel-title {
  font-size: 12px;
  color: #818384;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.chat-msg {
  min-height: 18px;
  color: #818384;
  font-size: 12px;
  margin-bottom: 6px;
}
.chat-messages {
  flex: 1;
  min-height: 330px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0b0b0c;
  padding: 10px;
}
.chat-row {
  border-bottom: 1px solid #202020;
  padding: 8px 0;
}
.chat-row:last-child { border-bottom: 0; }
.chat-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  border: 1px solid #444;
  flex: 0 0 auto;
}
.chat-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #333;
  border: 1px solid #444;
  font-size: 12px;
  font-weight: 700;
}
.chat-name {
  font-weight: 700;
  color: #fff;
}
.chat-time {
  color: #818384;
  font-size: 11px;
}
.chat-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.chat-mini {
  background: #222;
  border: 1px solid #333;
  color: #aaa;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
}
.chat-mini:hover { color: #fff; border-color: #565758; }
.chat-text {
  color: #d7dadc;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-typing-indicator {
  font-size: 11px;
  color: #818384;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}
.chat-typing-dots { display: flex; gap: 3px; align-items: center; }
.chat-typing-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: #818384;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
#chat-input {
  flex: 1;
  background: #0d0d0e;
  color: #fff;
  border: 1px solid #444;
  outline: none;
  cursor: text;
  overflow-y: auto;
  max-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  box-sizing: border-box;
}
#chat-input:empty::before {
  content: attr(data-placeholder);
  color: #818384;
  pointer-events: none;
}
#chat-btn.has-chat {
  color: #fff;
  border-color: #6aaa64;
}
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-side { max-height: 170px; }
  .chat-messages { min-height: 300px; max-height: 45vh; }
}


/* v15 bottom-left compact chat */
.chat-float-btn {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 44;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1a1a1b;
  color: #fff;
  border: 1px solid #3a3a3c;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.35);
  cursor: pointer;
}
.chat-float-btn:hover,
.chat-float-btn.has-chat {
  border-color: #6aaa64;
  color: #fff;
}
.chat-float-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #565758;
}
.chat-float-btn.has-chat .chat-float-dot {
  background: #6aaa64;
  box-shadow: 0 0 0 4px rgba(106,170,100,0.18);
}
#chat-modal.account-modal {
  inset: auto auto 68px 14px;
  width: auto;
  height: auto;
  background: transparent;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: row;
  gap: 8px;
  pointer-events: none;
  z-index: 45;
}
#chat-modal .account-panel.chat-panel {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 84px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  border: 1px solid #2a2a2c;
}
#chat-modal .chat-friends-panel {
  width: 180px;
  pointer-events: auto;
  border-radius: 16px;
  border: 1px solid #2a2a2c;
  background: #111;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#chat-modal .account-head {
  margin-bottom: 10px;
  flex: 0 0 auto;
}
#chat-modal .account-head h2 {
  font-size: 15px;
  letter-spacing: 0.5px;
}
#chat-modal .xbtn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a2a2c;
  border: 1px solid #3a3a3c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#chat-modal .xbtn:hover { background: #3a3a3c; }
#chat-modal .chat-topline {
  gap: 6px;
  margin-bottom: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
}
#chat-modal .chat-tabs,
#chat-modal .chat-tools {
  gap: 5px;
  flex-wrap: nowrap;
}
#chat-modal .chat-tabs .ctrl-btn,
#chat-modal .chat-tools .ctrl-btn {
  padding: 6px 9px;
  font-size: 10px;
  white-space: nowrap;
}
#chat-modal .chat-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#chat-modal .chat-side {
  max-height: 84px;
  min-height: 0;
  padding: 7px 8px;
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
}
#chat-modal .chat-friends-box {
  flex-direction: column;
  flex-wrap: nowrap;
  overflow-x: hidden;
  overflow-y: auto;
}
#chat-modal .chat-friend-btn {
  width: 100%;
  flex: 0 0 auto;
}
#chat-modal .chat-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#chat-modal .chat-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 8px;
  border-radius: 10px;
  overflow-anchor: none;
}
#chat-modal .chat-row {
  padding: 6px 0;
}
#chat-modal .chat-row-head {
  gap: 6px;
  margin-bottom: 2px;
}
#chat-modal .chat-text {
  font-size: 13px;
  padding-left: 2px;
}
#chat-modal .chat-channel-title {
  font-size: 10px;
  margin-bottom: 4px;
}
#chat-modal .chat-msg {
  font-size: 11px;
  margin-bottom: 4px;
  min-height: 14px;
}
#chat-modal .chat-input-row {
  gap: 6px;
  margin-top: 8px;
  flex: 0 0 auto;
}
#chat-modal #chat-input {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
}
#chat-modal #chat-send-btn {
  padding: 8px 12px;
  font-size: 11px;
  border-radius: 8px;
}
#chat-modal .sync-note {
  display: none;
}
@media (max-width: 620px) {
  .chat-float-btn {
    left: 10px;
    top: 50px;
    bottom: auto;
    padding: 9px 12px;
    font-size: 11px;
  }
  #chat-modal.account-modal {
    left: 8px;
    right: 8px;
    top: 88px;
    bottom: auto;
    width: auto;
  }
  #chat-modal .account-panel.chat-panel {
    max-height: min(420px, 52dvh);
    padding: 11px 12px;
    border-radius: 14px;
  }
  #chat-modal .chat-side {
    max-height: 62px;
  }
  #chat-modal .chat-messages {
    max-height: min(180px, 24dvh);
  }
  #chat-modal .chat-topline {
    gap: 5px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  #chat-modal .chat-tabs .ctrl-btn,
  #chat-modal .chat-tools .ctrl-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
  #chat-modal .chat-friends-panel {
    position: absolute;
    inset: 0;
    width: auto;
    border-radius: 14px;
    z-index: 2;
  }
  #chat-modal #chat-friends-close-mobile {
    display: inline-flex;
  }
}

.chat-row-moderated { border-left: 3px solid #ef4444; padding-left: 8px; background: rgba(239,68,68,0.06); border-radius: 6px; margin: 4px 0; }
.chat-moderated-notice { color: #ef4444; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.chat-text-moderated { color: #9ca3af; text-decoration: line-through; }

.chat-mini-report { color: #6b6b6b; }
.chat-mini-report:hover { color: #ef4444; border-color: #ef4444; }
.chat-mini-delete { color: #6b6b6b; }
.chat-mini-delete:hover { color: #ef4444; border-color: #ef4444; }

.ctrl-btn-report { color: #6b6b6b; }
.ctrl-btn-report:hover { color: #ef4444; border-color: #6b3333; }

.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 18px;
}
.report-modal-panel {
  width: min(360px, 92vw);
  background: #1a1a1b;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 18px;
}
.report-modal-panel h3 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.report-modal-sub {
  color: #818384;
  font-size: 12px;
  margin-bottom: 12px;
}
.report-select, .report-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #101011;
  color: #fff;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  margin-bottom: 8px;
}
.report-textarea { min-height: 64px; resize: vertical; }
.report-modal-msg { min-height: 16px; font-size: 12px; margin-bottom: 8px; }
.report-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* mentions */
.chat-mention { color: #5b9bd5; font-weight: 600; }
.chat-mention-me { color: #c9b458; background: rgba(201,180,88,0.12); border-radius: 3px; padding: 0 2px; }

/* mention autocomplete dropdown */
.mention-dropdown {
  background: #1a1a1b;
  border: 1px solid #3a3a3c;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
.mention-item {
  padding: 7px 12px;
  font-size: 13px;
  color: #d7dadc;
  cursor: pointer;
}
.mention-item:hover { background: #2a2a2c; color: #fff; }

/* reply bar above input */
.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #1a1a1b;
  border: 1px solid #3a3a3c;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
  font-size: 12px;
}
.chat-reply-bar-label {
  color: #818384;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.chat-reply-bar-x {
  background: none;
  border: none;
  color: #818384;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex: 0 0 auto;
}
.chat-reply-bar-x:hover { color: #fff; }

/* reply preview inside a message */
.chat-reply-preview {
  border-left: 2px solid #3a3a3c;
  padding: 3px 8px;
  margin-bottom: 4px;
  border-radius: 0 4px 4px 0;
  background: rgba(255,255,255,0.03);
}
.chat-reply-ref {
  color: #818384;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* reactions */
.chat-react-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-height: 0;
}
.chat-react-chip {
  background: #1e1e1f;
  border: 1px solid #3a3a3c;
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 13px;
  cursor: pointer;
  color: #d7dadc;
  line-height: 1.6;
}
.chat-react-chip:hover { border-color: #565758; background: #2a2a2c; }
.chat-react-chip.mine { border-color: #538d4e; background: rgba(83,141,78,0.15); color: #6aaa64; }
.chat-react-add {
  background: none;
  border: 1px solid #3a3a3c;
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 13px;
  cursor: pointer;
  color: #818384;
  line-height: 1.6;
}
.chat-react-add:hover { border-color: #565758; color: #d7dadc; }
.reaction-picker {
  background: #1e1e1f;
  border: 1px solid #3a3a3c;
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  gap: 4px;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.reaction-picker-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 4px;
  line-height: 1;
}
.reaction-picker-btn:hover { background: #2a2a2c; }

/* edit */
.chat-edit-input {
  width: 100%;
  background: #1e1e1f;
  border: 1px solid #538d4e;
  border-radius: 6px;
  color: #d7dadc;
  font-size: 13px;
  padding: 5px 8px;
  resize: vertical;
  min-height: 40px;
  box-sizing: border-box;
  font-family: inherit;
}
.chat-edit-actions { display: flex; gap: 6px; margin-top: 5px; }
.chat-edited-label { color: #818384; font-size: 11px; }

/* images */
.chat-img-wrap { margin-top: 5px; }
.chat-msg-image {
  max-width: 260px;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  border: 1px solid #3a3a3c;
}
.chat-image-btn { padding: 0 8px; font-size: 12px; }
.chat-image-status { font-size: 11px; color: #818384; white-space: nowrap; }
.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 5px 6px;
  background: #1e1e1f;
  border: 1px solid #3a3a3c;
  border-radius: 8px;
}
.chat-img-pending {
  height: 48px;
  width: auto;
  max-width: 80px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}
.chat-img-pending-x {
  background: none;
  border: none;
  color: #818384;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
}
.chat-img-pending-x:hover { color: #ef4444; }

/* minimize */
#chat-modal.chat-minimized .chat-topline,
#chat-modal.chat-minimized .chat-layout {
  display: none !important;
}
#chat-modal.chat-minimized .account-panel {
  min-height: 0;
  height: auto;
}
.chat-head-btn {
  background: none;
  border: none;
  color: #818384;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.chat-head-btn:hover { color: #d7dadc; }

/* mute active state */
.ctrl-btn.active { border-color: #ef4444; color: #ef4444; }

/* SW update banner */
.sw-update-banner {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #538d4e;
  color: #fff;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  white-space: nowrap;
  text-align: center;
}
.sw-fallback-link {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
  cursor: pointer;
  text-decoration: underline;
}
.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
  transition: background 0.3s, opacity 0.3s;
  flex-shrink: 0;
}
.presence-dot.online {
  background: #4caf50;
  opacity: 1;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.activity-item:nth-child(even) {
  background: rgba(255,255,255,0.04);
}
.activity-icon { font-size: 15px; flex-shrink: 0; }
.activity-text { flex: 1; min-width: 0; word-break: break-word; }
.activity-time { font-size: 11px; color: #888; flex-shrink: 0; white-space: nowrap; }
.presence-dot.idle { background: #f59e0b; opacity: 1; }
.presence-dot.dnd { background: #ef4444; opacity: 1; }
.presence-dot.offline-seen { opacity: 0.4; background: #888; }
.status-picker { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 8px; justify-content: center; }
.status-opt { font-size: 11px; padding: 3px 9px; opacity: 0.4; }
.status-opt.active { opacity: 1; }
.status-opt[data-status="online"] { color: #6aaa64; }
.status-opt[data-status="idle"] { color: #f59e0b; }
.status-opt[data-status="dnd"] { color: #ef4444; }
.status-opt[data-status="offline"] { color: #aaa; }
.notif-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.notif-row + .notif-row { border-top: 1px solid rgba(255,255,255,0.05); }
.notif-unread { background: rgba(106,170,100,0.08); }
.notif-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.notif-text { flex: 1; min-width: 0; word-break: break-word; }
.notif-time { font-size: 11px; color: #888; flex-shrink: 0; white-space: nowrap; margin-left: 4px; }
.ctrl-btn.has-notif { background: #538d4e; }
.stats-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.leader-table tr.vh-win td { color: #6aaa64; }
.leader-table tr.vh-loss td { color: #ef4444; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.theme-card { border-radius: 8px; padding: 12px; cursor: pointer; border: 2px solid var(--theme-accent, #444); background: linear-gradient(135deg, var(--theme-banner, #2a2a2b) 0%, rgba(0,0,0,0.5) 100%); transition: transform 0.15s, box-shadow 0.15s; }
.theme-card:hover:not(.theme-locked) { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.theme-card.theme-locked { opacity: 0.45; cursor: default; }
.theme-card.theme-selected { box-shadow: 0 0 0 2px var(--theme-accent, #6aaa64); }
.theme-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: #fff; }
.theme-req { font-size: 11px; color: rgba(255,255,255,0.6); }
.profile-result-card[data-theme="ocean"] { border-color: #5b9bd5; }
.profile-result-card[data-theme="sunset"] { border-color: #e06830; }
.profile-result-card[data-theme="midnight"] { border-color: #8b5cf6; background: rgba(45,27,78,0.1); }
.profile-result-card[data-theme="rose"] { border-color: #e05080; }
.profile-result-card[data-theme="gold"] { border-color: #d4a017; }
img.emoji { height: 1.2em; width: 1.2em; vertical-align: -0.2em; display: inline-block; margin: 0 0.05em; }
.emoji-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 13px; color: #d7dadc; cursor: pointer; }
.emoji-item:hover, .emoji-item.emoji-selected { background: #3a3a3c; color: #fff; }
.emoji-char { font-size: 1.2em; min-width: 22px; text-align: center; display: flex; align-items: center; justify-content: center; }
.emoji-shortcode { color: #818384; font-size: 11px; }
.chat-guest-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(106,170,100,0.08); border-top: 1px solid #2a2a2c; font-size: 13px; color: #818384; }
.chat-guest-bar span { flex: 1; }
#chat-toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.chat-notif-card { display: flex; align-items: flex-start; gap: 10px; background: #1a1a1b; border: 1px solid #2a2a2c; border-left-width: 3px; border-radius: 14px; padding: 11px 14px; width: 280px; box-sizing: border-box; pointer-events: auto; cursor: pointer; transform: translateX(calc(100% + 32px)); transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1); box-shadow: 0 8px 28px rgba(0,0,0,0.6); }
.chat-notif-card.show { transform: translateX(0); }
.chat-notif-card:hover { background: #222; }
.chat-notif-av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; }
.chat-notif-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-notif-body { flex: 1; min-width: 0; }
.chat-notif-name { font-weight: 700; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-notif-channel { font-size: 10px; color: #818384; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.chat-notif-text { font-size: 12px; color: #ccc; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; word-break: break-word; }
.dev-deco { position: absolute; inset: -16%; width: 132%; height: 132%; pointer-events: none; z-index: 5; object-fit: contain; }
.dev-deco-wrap { position: relative; display: inline-flex; flex-shrink: 0; overflow: visible; }
.profile-avatar-big ~ .dev-deco { inset: -10%; width: 120%; height: 120%; }
