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;
}
.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;
}

.profile-preview-card,
.profile-result-card {
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  background: #101011;
  margin: 10px 0;
}
.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;
}
.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;
}
.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;
}
