@charset "UTF-8";

:root {
  --ink: #17202d;
  --muted: #647386;
  --line: #d8e0e8;
  --panel-strong: #ffffff;
  --accent: #2775d1;
  --accent-dark: #1558a4;
  --warm: #f1b748;
  --mint: #2dbb85;
  --rose: #e45771;
  --shadow: 0 18px 54px rgba(29, 42, 58, 0.2);
  --game-base-width: 1020px;
  --game-stage-ratio: 1.5;
  --game-chrome-height: 130px;
  --game-viewport-gutter-y: 48px;
  --game-shell-scale: 1;
  --game-shell-width: min(
    var(--game-base-width),
    calc(100vw - 20px),
    calc((100vh - var(--game-viewport-gutter-y) - var(--game-chrome-height)) * var(--game-stage-ratio))
  );
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

html {
  background: #e7dcff;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px 0;
  color: var(--ink);
  font-family:
    "Trebuchet MS", "Segoe UI", "Noto Sans", Arial, ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #48236f 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.game-shell {
  position: relative;
  width: var(--game-base-width);
  margin: 0 auto;
  overflow: visible;
  border-radius: 42px 42px 8px 8px;
  box-shadow: var(--shadow);
  transform-origin: top center;
  zoom: var(--game-shell-scale);
}

.game-shell.box-game-room .avatar-hud {
  display: none;
}

.box-game-hud {
  position: absolute;
  inset: 50px 0 0 0;
  z-index: 44;
  pointer-events: none;
  font-family: "Trebuchet MS", "Segoe UI", "Noto Sans", Arial, sans-serif;
}

.box-scoreboard,
.box-results {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 214px;
  padding: 10px;
  border: 3px solid #ffcc28;
  border-radius: 12px;
  background: rgba(22, 31, 43, 0.86);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.box-results {
  top: 250px;
}

.box-scoreboard h3,
.box-results h3 {
  margin: 0 0 8px;
  color: #ffec66;
  font-size: 15px;
  text-align: center;
}

.box-scoreboard-list {
  display: grid;
  gap: 5px;
}

.box-board-row,
.box-result-row {
  display: grid;
  grid-template-columns: 20px 28px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.box-board-row.ready {
  background: rgba(75, 190, 115, 0.24);
}

.box-board-row.turn {
  outline: 2px solid #ffcc28;
}

.box-board-row img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.box-board-row strong,
.box-result-row span {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box-board-row em,
.box-result-row em {
  grid-column: 3;
  color: #dfe9ff;
  font-size: 10px;
  font-style: normal;
}

.box-last-event {
  margin-top: 8px;
  color: #ffec66;
  font-size: 11px;
  line-height: 1.25;
}

.box-actions {
  position: absolute;
  right: 18px;
  bottom: 78px;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: auto;
}

.box-actions button {
  min-width: 108px;
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #36a6ff, #116bd8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 7px 14px rgba(0, 0, 0, 0.22);
}

.box-actions button:disabled {
  filter: grayscale(0.8);
  opacity: 0.62;
}

#boxLeaveButton {
  background: linear-gradient(180deg, #ff6b63, #d91e2f);
}

#boxRollButton {
  display: inline-flex;
  min-width: 86px;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 7px solid #ffcc28;
  border-radius: 50%;
  background: #3b3b3d;
}

.box-die {
  display: grid;
  width: 30px;
  height: 30px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
  border-radius: 5px;
  background: #fff;
}

.box-die i {
  width: 5px;
  height: 5px;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: #1e1f24;
}

.box-progress {
  position: absolute;
  left: 300px;
  right: 250px;
  bottom: 20px;
  height: 18px;
  border: 2px solid #ffcc28;
  border-radius: 999px;
  background: rgba(30, 95, 55, 0.92);
  pointer-events: none;
}

.box-progress > div {
  position: absolute;
  inset: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.box-progress-avatar {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.box-progress-avatar img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.box-game-hud {
  inset: auto 0 auto 0;
  top: 50px;
  height: 680px;
  overflow: hidden;
}

.box-scoreboard {
  top: auto;
  bottom: 18px;
  width: 224px;
  max-height: 238px;
  border-color: #f2c236;
}

.box-scoreboard h3 {
  font-size: 18px;
}

.box-board-row {
  grid-template-columns: 24px 30px minmax(0, 1fr);
  min-height: 32px;
}

.box-board-row strong {
  font-size: 12px;
}

.box-board-row em {
  display: none;
}

.box-actions {
  right: 18px;
  bottom: 18px;
}

.box-info-bar {
  position: absolute;
  left: 254px;
  right: 134px;
  bottom: 62px;
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 16px;
  border: 2px solid rgba(255, 204, 40, 0.95);
  border-radius: 999px;
  background: rgba(27, 43, 62, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.box-info-bar span {
  color: #ffe26f;
}

.box-progress {
  left: 254px;
  right: 134px;
  bottom: 18px;
  height: 32px;
}

.box-progress-avatar img {
  width: 40px;
  height: 40px;
}

#boxRollButton {
  --box-turn-progress: 100%;
  position: relative;
  border: 0;
  background:
    conic-gradient(#e23238 var(--box-turn-progress), #ffcc28 0),
    #3b3b3d;
  isolation: isolate;
}

#boxRollButton::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  border-radius: 50%;
  background: #3b3b3d;
}

#boxRollButton > * {
  position: relative;
  z-index: 1;
}

#boxRollButton::after {
  content: attr(data-time);
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
}

.box-result-modal {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.box-result-modal-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d7dff1;
  border-radius: 12px;
  background: #fff;
  color: #17202d;
}

.box-result-modal-row em {
  color: #5d6b80;
  font-size: 12px;
  font-style: normal;
}

.box-editor-panel {
  display: grid;
  gap: 10px;
}

.box-editor-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.box-editor-modes button {
  border: 1px solid #cfd8eb;
  border-radius: 9px;
  padding: 8px 6px;
  background: #fff;
  color: #253454;
  font-weight: 800;
}

.box-editor-modes button.active {
  color: #fff;
  background: linear-gradient(180deg, #6aaeff, #2678da);
}

.box-editor-stats {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #d8e0ee;
  border-radius: 10px;
  background: #f8fbff;
  font-size: 12px;
}

.box-editor-note {
  padding: 9px;
  border-radius: 10px;
  color: #42506a;
  background: #fff9dc;
  font-size: 12px;
  line-height: 1.35;
}

.game-topbar {
  position: relative;
  z-index: 29;
  width: 100%;
  height: 50px;
  border-radius: 42px 42px 0 0;
  background: linear-gradient(180deg, #1e1d41 0 50%, #554087 50% 100%);
}

.game-logo {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: -78px;
  width: clamp(230px, 28vw, 300px);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 5px rgba(8, 9, 24, 0.28));
}

.game-loading-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 50px;
  bottom: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  border-radius: 0 0 8px 8px;
  background: #554087;
  color: #ffffff;
  pointer-events: all;
}

.game-loading-overlay.hidden {
  display: none;
}

.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 44px;
}

.loading-dots span {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 18%, rgba(255, 255, 255, 0) 19%),
    radial-gradient(circle at 50% 62%, #ffffff 0 46%, #d8c7ff 100%);
  box-shadow:
    inset 0 -4px 6px rgba(42, 24, 83, 0.34),
    inset 0 3px 5px rgba(255, 255, 255, 0.55),
    0 5px 9px rgba(24, 12, 52, 0.35);
  animation: loadingDotBounce 1.05s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.09s; }
.loading-dots span:nth-child(3) { animation-delay: 0.18s; }
.loading-dots span:nth-child(4) { animation-delay: 0.27s; }
.loading-dots span:nth-child(5) { animation-delay: 0.36s; }
.loading-dots span:nth-child(6) { animation-delay: 0.45s; }

.loading-text {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 3px 8px rgba(24, 12, 52, 0.32);
}

@keyframes loadingDotBounce {
  0%,
  78%,
  100% {
    transform: translateY(0) scale(0.9);
  }
  36% {
    transform: translateY(-18px) scale(1.08);
  }
}

.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #d8e8ef;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  outline: none;
}

.cinema-video-layer {
  position: absolute;
  left: calc(30% + 7px);
  top: calc(20.75% + 17px);
  z-index: 2;
  width: calc(39.7% - 13px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050506;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 222, 147, 0.18);
  pointer-events: none;
}

.cinema-video-layer.hidden {
  display: none;
}

.cinema-video-layer.audio-only {
  left: 0;
  top: 0;
  width: 220px;
  height: 124px;
  aspect-ratio: auto;
  opacity: 0.01;
  box-shadow: none;
}

#cinemaVideoMount,
#cinemaVideoMount iframe {
  width: 100%;
  height: 100%;
}

#cinemaVideoMount iframe {
  display: block;
  border: 0;
}

.stage-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.avatar-hud {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 55px;
  height: 55px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 30%, #ffffff 0 24%, #dff6ff 25% 62%, #9be1ff 63% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(61, 58, 118, 0.2),
    0 5px 12px rgba(8, 9, 24, 0.24);
}

.avatar-hud img {
  position: absolute;
  left: 50%;
  top: -4px;
  width: auto;
  height: 92px;
  transform: translateX(-50%);
}

.emerald-bar {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 190px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 23px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 241, 250, 0.96));
  box-shadow: 0 5px 12px rgba(8, 9, 24, 0.2);
  opacity: 0.8;
}

.community-hud-button {
  position: absolute;
  right: 22px;
  top: 70px;
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  transform-origin: 50% 50%;
  animation: communityHudGlow 2.35s ease-in-out infinite;
}

.community-hud-button img {
  display: block;
  width: 55px;
  height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(32, 10, 55, 0.28));
  pointer-events: none;
}

.community-hud-button:hover {
  transform: translateY(-2px) scale(1.04);
}

.quiz-hud-button {
  position: absolute;
  left: 83px;
  top: 15px;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 35% 25%, #ffffff 0 12%, rgba(255, 255, 255, 0) 13%),
    linear-gradient(180deg, #ffe27a 0%, #f08c2c 100%);
  color: #4a2366;
  box-shadow:
    inset 0 -4px 8px rgba(111, 51, 16, 0.28),
    0 6px 13px rgba(8, 9, 24, 0.28);
  pointer-events: auto;
  transform-origin: 50% 50%;
}

.quiz-hud-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #5d2387;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.quiz-hud-button.active {
  animation: communityHudGlow 1.7s ease-in-out infinite;
}

.quiz-hud-button:hover {
  transform: translateY(-2px) scale(1.04);
}

@keyframes communityHudGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.34));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.82));
  }
}

.emerald-icon {
  position: absolute;
  left: 6px;
  top: 50%;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: url("/assets/coin.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(91, 49, 132, 0.34));
  transform: translateY(-50%);
}

#emeraldAmount {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #201932;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.bottom-menu {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 360px 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 80px;
  padding: 0 28px;
  border-top: 1px solid rgba(24, 34, 47, 0.12);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.96);
}

.menu-left,
.menu-right {
  display: grid;
  align-items: center;
  gap: 0;
  width: 100%;
}

.menu-left {
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}

.menu-right {
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
}

.menu-icon {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: 50% 80%;
}

.menu-icon img {
  display: block;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(43, 19, 78, 0.24));
  pointer-events: none;
}

.menu-icon:hover {
  animation: menuIconBounce 0.46s ease-in-out both;
}

.menu-icon:focus-visible {
  outline: 2px solid rgba(85, 64, 135, 0.65);
  outline-offset: 3px;
}

@keyframes menuIconBounce {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  28% {
    transform: translateY(-7px) rotate(-5deg) scale(1.08);
  }
  48% {
    transform: translateY(0) rotate(4deg) scale(0.98);
  }
  68% {
    transform: translateY(-3px) rotate(-3deg) scale(1.04);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.menu-icon.phone::before {
  inset: 8px 13px;
  border-radius: 7px;
  background: #323943;
  transform: rotate(-26deg);
}

.menu-icon.phone::after {
  left: 19px;
  bottom: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #eef5fb;
}

.menu-icon.hands::before,
.menu-icon.hands::after {
  top: 13px;
  width: 16px;
  height: 18px;
  border-radius: 45% 45% 55% 55%;
  background: #f1c6a8;
  box-shadow: inset -2px -2px 0 rgba(138, 91, 64, 0.18);
}

.menu-icon.hands::before {
  left: 8px;
  transform: rotate(-24deg);
}

.menu-icon.hands::after {
  right: 8px;
  transform: rotate(24deg);
}

.menu-icon.shirt::before {
  left: 10px;
  top: 11px;
  width: 22px;
  height: 23px;
  border-radius: 7px 7px 4px 4px;
  background: #20a6dc;
  box-shadow:
    -9px 4px 0 -2px #20a6dc,
    9px 4px 0 -2px #20a6dc;
}

.menu-icon.bag::before {
  left: 9px;
  top: 15px;
  width: 24px;
  height: 20px;
  border-radius: 6px;
  background: #d66d2f;
  box-shadow: inset 0 -4px 0 rgba(105, 54, 24, 0.22);
}

.menu-icon.bag::after {
  left: 15px;
  top: 8px;
  width: 12px;
  height: 12px;
  border: 3px solid #8c4322;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.menu-icon.dance::before {
  left: 17px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b54ce2;
  box-shadow:
    -6px 14px 0 0 #b54ce2,
    6px 14px 0 0 #b54ce2;
}

.menu-icon.dance::after {
  left: 18px;
  top: 16px;
  width: 6px;
  height: 23px;
  border-radius: 5px;
  background: #b54ce2;
  transform: rotate(28deg);
}

.menu-icon.help::before {
  content: "?";
  inset: auto;
  left: 14px;
  top: 5px;
  color: #12a8cd;
  font-size: 27px;
  font-weight: 900;
}

.menu-icon.history::before {
  left: 9px;
  top: 10px;
  width: 24px;
  height: 22px;
  border-radius: 8px;
  background: #ffffff;
  border: 3px solid #49a7d8;
  box-shadow: inset 0 -6px 0 rgba(73, 167, 216, 0.14);
}

.menu-icon.history::after {
  left: 16px;
  top: 18px;
  width: 12px;
  height: 3px;
  border-radius: 3px;
  background: #49a7d8;
  box-shadow: 0 6px 0 #49a7d8;
}

.menu-icon.smile::before {
  left: 8px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #35c8d0;
}

.menu-icon.smile::after {
  left: 15px;
  top: 18px;
  width: 13px;
  height: 7px;
  border-bottom: 3px solid #1c6f77;
  border-radius: 0 0 12px 12px;
}

.menu-icon.trophy::before {
  left: 13px;
  top: 7px;
  width: 16px;
  height: 19px;
  border-radius: 3px 3px 9px 9px;
  background: #e68b18;
}

.menu-icon.trophy::after {
  left: 17px;
  top: 25px;
  width: 8px;
  height: 11px;
  background: #b96b11;
  box-shadow: -6px 10px 0 -2px #b96b11, 6px 10px 0 -2px #b96b11;
}

.menu-icon.island::before {
  left: 7px;
  bottom: 8px;
  width: 29px;
  height: 10px;
  border-radius: 50%;
  background: #8cc95f;
}

.menu-icon.island::after {
  left: 19px;
  top: 9px;
  width: 4px;
  height: 23px;
  border-radius: 3px;
  background: #8a5a44;
  transform: rotate(12deg);
  box-shadow: -6px -5px 0 2px #55aa48, 7px -6px 0 2px #55aa48;
}

.menu-icon.jewel::before {
  left: 8px;
  top: 7px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #f045a5, #c71877);
  clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%);
}

.chat-form {
  --chat-bubble-color: #fff3b0;
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  width: 360px;
}

.whisper-target-button {
  position: absolute;
  left: 11px;
  z-index: 2;
  height: 32px;
  max-width: 122px;
  padding: 0 28px 0 13px;
  border: 1px solid rgba(116, 55, 183, 0.32);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(230, 214, 255, 0.96));
  color: #6f22b7;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 8px rgba(68, 27, 122, 0.14);
  cursor: pointer;
}

.whisper-target-button::after {
  content: "x";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 0.74rem;
  font-weight: 1000;
  color: #8e4cc8;
}

.whisper-target-button.hidden {
  display: none;
}

.chat-form input {
  width: 360px;
  height: 52px;
  border: 1px solid #aeb4bd;
  border-radius: 28px;
  padding: 0 64px 0 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34)),
    var(--chat-bubble-color);
  color: #222a35;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 800;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chat-form.whisper-active input {
  padding-left: 142px;
}

.chat-form input::placeholder {
  color: #777f8c;
  opacity: 1;
}

.chat-form input:hover::placeholder,
.chat-form input:focus::placeholder {
  opacity: 0;
}

.chat-color-picker {
  position: absolute;
  right: 8px;
  top: 50%;
  z-index: 8;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
}

.chat-color-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(95, 111, 132, 0.34);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(35, 45, 60, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-color-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.chat-color-picker:hover .chat-color-button,
.chat-color-picker:focus-within .chat-color-button,
.chat-color-picker.open .chat-color-button {
  transform: translateY(-5px) scale(1.12);
  box-shadow: 0 10px 18px rgba(35, 45, 60, 0.18);
}

.chat-color-palette {
  position: absolute;
  right: -4px;
  bottom: 44px;
  display: flex;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(125, 137, 156, 0.22);
  border-radius: 18px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(35, 45, 60, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.92);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.2, 1.35, 0.42, 1);
}

.chat-color-picker:hover .chat-color-palette,
.chat-color-picker:focus-within .chat-color-palette,
.chat-color-picker.open .chat-color-palette {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-color-palette button {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 7px;
  padding: 0;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(87, 98, 116, 0.18), 0 4px 10px rgba(35, 45, 60, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.chat-color-palette button:hover,
.chat-color-palette button.selected {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 2px rgba(111, 78, 184, 0.34), 0 7px 14px rgba(35, 45, 60, 0.16);
}

.toast {
  position: absolute;
  right: 14px;
  bottom: 14px;
  max-width: min(360px, calc(100% - 28px));
  border: 1px solid rgba(24, 34, 47, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(29, 42, 58, 0.16);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  z-index: 12;
}

.toast.admin-warning {
  border-color: rgba(114, 73, 174, 0.26);
  background: #eadcff;
  color: #111;
}

.head-emoji-panel {
  position: fixed;
  z-index: 45;
  border: 1px solid rgba(75, 63, 128, 0.28);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 235, 249, 0.98));
  box-shadow: 0 20px 46px rgba(33, 27, 55, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transform-origin: bottom center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.head-emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  grid-auto-rows: 50px;
  gap: 8px;
}

.head-emoji-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.head-emoji-panel button {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(86, 72, 139, 0.28);
  border-radius: 12px;
  padding: 0;
  background: linear-gradient(180deg, #ffffff, #ece8f8);
  box-shadow: 0 5px 12px rgba(49, 40, 86, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.82);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.head-emoji-panel button:not(.empty):hover,
.head-emoji-panel button.hovered {
  border-color: rgba(104, 72, 181, 0.7);
  background: linear-gradient(180deg, #fff, #ded5ff);
  transform: translateY(-4px) scale(1.07);
  box-shadow: 0 13px 24px rgba(72, 52, 126, 0.25), 0 0 0 3px rgba(126, 91, 211, 0.14);
}

.head-emoji-panel button.empty {
  opacity: 1;
  background: repeating-linear-gradient(
    135deg,
    rgba(113, 103, 151, 0.1),
    rgba(113, 103, 151, 0.1) 6px,
    rgba(255, 255, 255, 0.7) 6px,
    rgba(255, 255, 255, 0.7) 12px
  );
  pointer-events: none;
}

.head-emoji-panel img {
  height: 28px;
  width: auto;
  max-width: 42px;
  object-fit: contain;
}

.head-emoji-panel span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #ede5ff;
  color: #4f35a5;
  font-size: 1.55rem;
  font-weight: 1000;
  line-height: 1;
}

.head-emoji-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  min-height: 22px;
  color: #4f35a5;
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.head-emoji-pager > span {
  display: block;
  width: auto;
  height: auto;
  min-width: 34px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #4f35a5;
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
}

.head-emoji-pager button {
  width: 26px;
  height: 22px;
  border-radius: 10px;
  color: #4f35a5;
  font-size: 1rem;
  line-height: 1;
}

.head-emoji-pager button:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.tool-panel[data-panel="community"] {
  width: min(1210px, calc(100vw - 56px));
  height: min(820px, calc(100vh - 56px));
  min-width: 760px;
  min-height: 560px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  max-height: none;
  background: #111214;
  border: 1px solid #26272b;
  border-radius: 6px;
  color: #edf0f7;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  resize: none;
}

.tool-panel[data-panel="community"] .tool-panel-head {
  display: none;
}

.tool-panel[data-panel="community"] .tool-panel-body {
  display: block;
  height: 100%;
  max-height: none;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.community-panel {
  position: relative;
  display: grid;
  grid-template-columns: 68px 304px minmax(0, 1fr) 230px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #18191e;
  font-family: "Inter", "Segoe UI", "Noto Sans", Arial, sans-serif;
}

.community-drag-handle {
  position: absolute;
  left: 68px;
  top: 0;
  right: 34px;
  height: 49px;
  z-index: 8;
  cursor: grab;
}

.community-drag-handle:active {
  cursor: grabbing;
}

.community-panel-close {
  position: absolute;
  right: 9px;
  top: 8px;
  z-index: 12;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b5bac1;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.community-panel-close:hover {
  background: #2d2f36;
  color: #fff;
}

.panel-resize-handle {
  position: absolute;
  z-index: 20;
  width: 16px;
  height: 16px;
}

.panel-resize-handle.nw {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.panel-resize-handle.ne {
  right: 0;
  top: 0;
  cursor: nesw-resize;
}

.panel-resize-handle.sw {
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
}

.panel-resize-handle.se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.panel-resize-handle::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.25);
  transition: opacity 0.12s ease;
}

.panel-resize-handle:hover::after {
  opacity: 1;
}

.community-rail {
  display: flex;
  justify-content: center;
  padding-top: 48px;
  background: #0f1012;
  border-right: 1px solid #25262b;
}

.community-server-badge {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f7f7f8;
  color: #1f2228;
  font-size: 0.7rem;
  font-weight: 1000;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.12);
}

.community-server-badge span {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7354f;
  border: 3px solid #0f1012;
  color: #fff;
  font-size: 0.66rem;
}

.community-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  background: #111214;
  border-right: 1px solid #24252a;
}

.community-server-title {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #24252a;
  color: #fff;
  font-weight: 900;
}

.community-channel-section {
  padding: 17px 16px 5px;
}

.community-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #a6abb8;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.community-add-channel {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9aa0ac;
  font-size: 1.15rem;
  line-height: 1;
}

.community-add-channel:hover:not(:disabled) {
  color: #f2f3f5;
  background: rgba(255, 255, 255, 0.06);
}

.community-add-channel:disabled {
  opacity: 0.45;
}

.community-channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  border-radius: 4px;
}

.community-channel-row.selected,
.community-channel-row:hover {
  background: rgba(78, 80, 88, 0.34);
}

.community-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 5px 8px;
  background: transparent;
  color: #949ba6;
  text-align: left;
  font-size: 0.96rem;
  font-weight: 700;
}

.community-delete-channel {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8f95a1;
  font-size: 0.92rem;
  cursor: pointer;
  opacity: 0;
}

.community-channel-row:hover .community-delete-channel {
  opacity: 1;
}

.community-delete-channel:hover {
  color: #f04747;
  background: rgba(240, 71, 71, 0.12);
}

.channel-hash,
.voice-channel-icon {
  width: 20px;
  color: #8f95a1;
  font-size: 1.35rem;
  line-height: 1;
}

.voice-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-channel-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.community-channel-row.selected .community-channel,
.community-channel:hover {
  color: #fff;
}

.community-channel-dialog {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
}

.community-channel-dialog.hidden {
  display: none;
}

.community-channel-dialog form {
  width: 310px;
  padding: 18px;
  border: 1px solid #31343c;
  border-radius: 10px;
  background: #1f2026;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.community-channel-dialog strong {
  display: block;
  margin-bottom: 12px;
  color: #fff;
  font-size: 1rem;
}

.community-channel-dialog input {
  width: 100%;
  height: 40px;
  border: 1px solid #343741;
  border-radius: 6px;
  padding: 0 12px;
  background: #121318;
  color: #f2f3f5;
  outline: none;
  font-weight: 800;
  box-sizing: border-box;
}

.community-channel-dialog input:focus {
  border-color: #5865f2;
}

.community-channel-dialog form > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.community-channel-dialog button {
  height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 0 13px;
  background: #31343c;
  color: #f2f3f5;
  font-weight: 900;
  cursor: pointer;
}

.community-channel-dialog button[type="submit"] {
  background: #5865f2;
  color: #fff;
}

.community-sidebar-spacer {
  flex: 1;
  min-height: 0;
}

.voice-channel-users {
  margin: 5px 0 0 14px;
}

.voice-channel-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  padding: 2px 6px;
  color: var(--community-name-color, #dfe1e7);
  font-size: 0.86rem;
  font-weight: 800;
}

.voice-user-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3fbf68;
}

.voice-user-dot.muted {
  background: #e2475c;
}

.voice-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 16%;
  background: #2b2d33;
}

.voice-connection-card {
  display: grid;
  grid-template-columns: 1fr 124px;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 11px 14px;
  border-top: 1px solid #24252a;
  background: #202126;
}

.voice-connection-card strong {
  display: block;
  color: #43c56e;
  font-size: 0.86rem;
}

.voice-connection-card span {
  display: block;
  margin-top: 3px;
  color: #b0b5c1;
  font-size: 0.72rem;
}

.voice-connection-card button {
  height: 25px;
  border: 0;
  border-radius: 5px;
  background: #bf1244;
  color: #fff;
  font-weight: 1000;
}

.community-user-card {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 25px 31px 31px 31px;
  gap: 8px;
  align-items: center;
  min-height: 59px;
  margin: 0 8px 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #202126;
}

.community-user-avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #30323a;
}

.community-user-meta {
  min-width: 0;
}

.community-user-meta strong {
  display: block;
  overflow: hidden;
  color: var(--community-name-color, #fff);
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-user-meta span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #8fd29c;
  font-size: 0.7rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-name-color-picker {
  position: relative;
}

.community-name-color-button {
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background:
    conic-gradient(#fff3b0 0 25%, #a8d8ff 0 50%, #c0dec0 0 75%, #f58484 0);
}

.community-name-palette {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: grid;
  grid-template-columns: repeat(4, 18px);
  gap: 6px;
  padding: 8px;
  border-radius: 9px;
  background: #2b2d33;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.community-name-color-picker:hover .community-name-palette,
.community-name-color-picker:focus-within .community-name-palette {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.community-name-palette button {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: var(--swatch);
}

.community-name-palette button.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.8);
}

.community-control-button {
  position: relative;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b9bec8;
  font-size: 1rem;
}

.community-control-button:hover:not(:disabled) {
  background: #303137;
  color: #fff;
}

.community-control-button.muted {
  color: #f04747;
}

.community-control-button img {
  display: block;
  width: 23px;
  height: 23px;
  margin: auto;
  object-fit: contain;
  pointer-events: none;
}

.community-control-button .control-slash {
  position: absolute;
  left: 8px;
  top: 3px;
  color: #f04747;
  font-size: 1.6rem;
  font-weight: 1000;
  line-height: 1;
  transform: rotate(-20deg);
  pointer-events: none;
}

.community-control-button:disabled {
  opacity: 0.45;
}

.community-main {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 58px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #191a1f;
}

.community-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid #2a2b31;
  color: #f2f3f5;
}

.community-chat-head span {
  color: #8f95a1;
  font-size: 1.55rem;
  font-weight: 800;
}

.community-chat-head strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.community-messages {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 18px 16px 14px;
  scrollbar-width: none;
}

.community-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.community-message:first-child {
  margin-top: auto;
}

.community-message {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  margin-bottom: 14px;
  color: #eef1f8;
}

.community-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 12%;
  background: #424758;
}

.community-message-content {
  min-width: 0;
  max-width: 100%;
}

.community-message-head {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin-bottom: 4px;
}

.community-message-head strong {
  color: var(--community-name-color, #fff);
  font-size: 0.94rem;
}

.community-message-head span {
  color: #8e95aa;
  font-size: 0.72rem;
  font-weight: 800;
}

.community-message p {
  display: block;
  max-width: 100%;
  margin: 0;
  color: #d8dcea;
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.community-form {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #191a1f;
}

.community-form input {
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px 0 64px;
  background: #24262b;
  color: #fff;
  outline: none;
  font-weight: 800;
}

.community-form input::placeholder {
  color: #949bad;
}

.community-emoji-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-emoji-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  width: 31px;
  height: 31px;
  background: transparent;
  color: #b9bec8;
  font-size: 1.22rem;
}

.community-emoji-button:hover {
  color: #fff;
  background: #303137;
}

.community-emoji-button img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

.community-emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 35;
  width: min(360px, 72vw);
  max-height: 310px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #333640;
  border-radius: 10px;
  background: #202126;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: none;
}

.community-emoji-picker::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.community-emoji-picker.hidden {
  display: none;
}

.community-emoji-loading {
  color: #b9bec8;
  font-size: 0.85rem;
  font-weight: 800;
}

.community-emoji-group {
  margin-bottom: 10px;
}

.community-emoji-group:last-child {
  margin-bottom: 0;
}

.community-emoji-group > strong {
  display: block;
  margin: 0 0 7px;
  color: #9ca3b5;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.community-emoji-group > div {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.community-emoji-group button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.community-emoji-group button:hover {
  background: #303137;
  transform: translateY(-1px);
}

.community-emoji-group img {
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  pointer-events: none;
}

.community-inline-emoji {
  width: 22px;
  height: 22px;
  margin: 0 2px;
  object-fit: contain;
  vertical-align: -5px;
}

.community-members {
  min-height: 0;
  overflow: auto;
  padding: 18px 14px;
  background: #191a1f;
  border-left: 1px solid #2a2b31;
  scrollbar-width: none;
}

.community-members::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.member-section-title {
  margin: 2px 0 8px;
  color: #9aa0ac;
  font-size: 0.78rem;
  font-weight: 900;
}

.community-member,
.voice-empty {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 5px;
  padding: 6px 8px;
  color: #d6d9e0;
  font-size: 0.86rem;
  font-weight: 900;
}

.community-member.offline {
  opacity: 0.45;
}

.member-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.community-member-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #30323a;
}

.member-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 3px solid #191a1f;
  border-radius: 50%;
  background: #3fbf68;
}

.member-status-dot.offline {
  background: #5c626d;
}

.member-status-dot.muted {
  background: #e2475c;
}

.community-member-name {
  overflow: hidden;
  color: var(--community-name-color, #d6d9e0);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-empty {
  color: #9299ad;
}

.profile-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 31;
  display: grid;
  grid-template-rows: 340px minmax(0, 1fr) auto;
  gap: 24px;
  width: 760px;
  height: 760px;
  max-width: calc(100% - 46px);
  max-height: calc(100% - 30px);
  padding: 52px 58px 38px;
  border: 0;
  border-radius: 56px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.96) 0 18%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 56%, var(--profile-accent-soft, rgba(255, 255, 255, 0.86)) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.94),
    inset 0 -22px 42px rgba(214, 218, 224, 0.22),
    0 28px 54px rgba(19, 17, 28, 0.22),
    0 10px 24px rgba(19, 17, 28, 0.12);
  color: #111111;
  transform: translate(-50%, -50%);
  user-select: none;
  overflow: visible;
}

.profile-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #ffffff;
  box-shadow:
    inset 0 0 0 2px rgba(236, 237, 241, 0.86),
    inset 0 12px 26px rgba(255, 255, 255, 0.95);
}

.profile-panel::after {
  content: "";
  position: absolute;
  inset: 16px;
  z-index: 0;
  border-radius: 44px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(231, 234, 240, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(214, 218, 225, 0.28);
  pointer-events: none;
}

.profile-panel.hidden {
  display: none;
}

.profile-drag-area {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 1;
  height: 112px;
  cursor: move;
}

.profile-close {
  position: absolute;
  right: 28px;
  top: 26px;
  z-index: 3;
  width: 64px;
  height: 64px;
  border: 6px solid #ffffff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 24%, #ff8b8f 0 15%, #ff3339 48%, #d90e18 100%);
  box-shadow:
    0 6px 12px rgba(28, 30, 36, 0.24),
    inset 0 3px 5px rgba(255, 255, 255, 0.48),
    inset 0 -7px 9px rgba(160, 4, 14, 0.34);
  color: #fff;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 2px rgba(43, 8, 75, 0.36);
  cursor: pointer;
}

.profile-close::before,
.profile-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 31px;
  height: 6px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 2px rgba(92, 10, 16, 0.26);
  transform-origin: center;
}

.profile-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.profile-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.profile-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  min-height: 0;
}

.profile-avatar-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 228px;
  height: 300px;
  border: 0;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 245, 248, 0.96));
  box-shadow:
    0 16px 22px rgba(32, 34, 40, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.92),
    inset 0 -24px 34px rgba(218, 222, 229, 0.34);
  overflow: hidden;
}

.profile-avatar-box::before {
  content: "";
  position: absolute;
  inset: 24px 22px 58px;
  border-radius: 25px;
  background:
    radial-gradient(circle at 42% 36%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.66) 58%, rgba(246, 247, 249, 0.82) 100%);
  box-shadow:
    inset 0 2px 6px rgba(128, 132, 140, 0.24),
    inset 0 -2px 7px rgba(255, 255, 255, 0.96),
    0 1px 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.profile-avatar-box img {
  position: relative;
  z-index: 1;
  max-width: 72%;
  height: 214px;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 8px 6px rgba(33, 35, 40, 0.18));
}

.profile-head {
  position: relative;
  padding-top: 76px;
}

.profile-head h3 {
  margin: 0 0 30px;
  max-width: 330px;
  overflow: hidden;
  color: #151515;
  font-size: 4.05rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95),
    0 4px 10px rgba(15, 16, 20, 0.12);
}

.profile-actions {
  display: flex;
  gap: 16px;
  max-width: 360px;
}

.profile-actions button {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  filter:
    drop-shadow(0 8px 8px rgba(31, 34, 40, 0.22))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.7));
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition: transform 150ms cubic-bezier(0.2, 1.45, 0.32, 1), filter 150ms ease, opacity 150ms ease;
}

.profile-actions button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.profile-actions button:not(:disabled):hover {
  transform: translateY(-4px) scale(1.08);
  filter:
    drop-shadow(0 12px 10px rgba(31, 34, 40, 0.25))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.8));
}

.profile-actions button:not(:disabled):active {
  transform: translateY(-1px) scale(1.04);
}

.profile-actions button:disabled {
  cursor: default;
  opacity: 1;
}

.profile-actions button.active {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.65)) drop-shadow(0 5px 5px rgba(41, 12, 71, 0.28));
}

.profile-bio-title {
  display: none;
}

.profile-bio-title span {
  display: none;
}

.profile-bio-edit {
  position: absolute;
  right: 26px;
  top: 24px;
  z-index: 2;
  width: 54px;
  height: 54px;
  border: 5px solid #ffffff;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 24%, #ff8b8f 0 15%, #ff3037 48%, #dc101a 100%);
  color: transparent;
  font-weight: 1000;
  font-size: 0;
  box-shadow:
    0 5px 10px rgba(28, 30, 36, 0.22),
    inset 0 3px 5px rgba(255, 255, 255, 0.45),
    inset 0 -6px 8px rgba(160, 4, 14, 0.32);
  cursor: pointer;
}

.profile-bio-edit::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 14px;
  width: 9px;
  height: 26px;
  border-radius: 3px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 0 2px 2px rgba(92, 10, 16, 0.18);
}

.profile-bio-edit::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 29px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 9px solid #ffffff;
  transform: rotate(45deg);
}

.profile-bio-box {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 34px;
  padding: 38px 42px;
  background: #ffffff;
  box-shadow:
    0 12px 22px rgba(34, 36, 42, 0.16),
    inset 0 0 0 1px rgba(220, 223, 230, 0.95),
    inset 0 7px 13px rgba(124, 130, 142, 0.18),
    inset 0 -8px 13px rgba(255, 255, 255, 0.96);
  color: #222833;
  user-select: text;
}

.profile-bio-box p,
.profile-bio-box textarea {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 800 1rem/1.44 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
  resize: none;
  white-space: pre-wrap;
}

.profile-bio-controls {
  position: absolute;
  right: 86px;
  bottom: 52px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.profile-bio-controls button {
  border: 0;
  border-radius: 14px;
  padding: 8px 14px;
  background: var(--profile-accent, #2f8cff);
  color: var(--profile-accent-text, #fff);
  font-weight: 900;
  box-shadow:
    0 5px 10px rgba(28, 30, 36, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.profile-panel {
  grid-template-rows: 158px minmax(0, 1fr) auto;
  gap: 11px;
  width: 330px;
  height: 480px;
  max-width: none;
  max-height: none;
  padding: 28px 25px 20px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.96),
    inset 0 0 0 4px rgba(226, 230, 238, 0.72),
    inset 0 24px 32px rgba(255, 255, 255, 0.58),
    inset 0 -20px 30px rgba(255, 255, 255, 0.35),
    0 16px 30px rgba(19, 17, 28, 0.2),
    0 5px 13px rgba(19, 17, 28, 0.12);
  animation: profile-pop-in 180ms cubic-bezier(0.18, 1.28, 0.28, 1) both;
}

@keyframes profile-pop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.profile-panel::before {
  box-shadow:
    inset 0 0 0 1px rgba(232, 234, 240, 0.92),
    inset 0 8px 16px rgba(255, 255, 255, 0.95);
}

.profile-panel::after {
  display: none;
}

.profile-drag-area {
  z-index: 2;
  height: 36px;
}

.profile-close {
  right: 15px;
  top: 13px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-width: 4px;
}

.profile-close::before,
.profile-close::after {
  width: 18px;
  height: 4px;
}

.profile-top {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 17px;
  z-index: 3;
}

.profile-avatar-box {
  width: 104px;
  height: 136px;
  border: 8px solid #ffffff;
  border-radius: 19px;
  background: #ffffff;
  box-shadow:
    0 8px 14px rgba(32, 34, 40, 0.17),
    inset 0 0 0 1px rgba(214, 219, 228, 0.94),
    inset 0 -13px 19px rgba(218, 222, 229, 0.28);
}

.profile-avatar-box::before {
  display: none;
}

.profile-avatar-box img {
  max-width: 76%;
  height: 75px;
  object-position: center center;
}

.profile-head {
  z-index: 3;
  padding-top: 53px;
}

.profile-head h3 {
  margin: 0 0 10px;
  max-width: 148px;
  font-size: 1.26rem;
  line-height: 1.08;
}

.profile-actions {
  width: 148px;
  max-width: 148px;
}

.profile-actions {
  gap: 6px;
}

.profile-actions button {
  width: 31px;
  height: 31px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(173, 180, 194, 0.22),
    0 4px 8px rgba(32, 34, 40, 0.14);
  pointer-events: auto;
}

.profile-actions button:not(:disabled):hover {
  transform: translateY(-2px) scale(1.06);
}

.profile-actions button:disabled {
  opacity: 0.62;
}

.profile-actions button.remove-friend {
  background: transparent;
}

.profile-bio-box {
  z-index: 3;
  border-radius: 18px;
  padding: 28px 22px 18px;
  box-shadow:
    0 8px 15px rgba(34, 36, 42, 0.14),
    inset 0 0 0 1px rgba(220, 223, 230, 0.95),
    inset 0 5px 9px rgba(124, 130, 142, 0.16),
    inset 0 -6px 9px rgba(255, 255, 255, 0.96);
}

.profile-bio-edit {
  right: 14px;
  top: 14px;
  width: 29px;
  height: 29px;
  border-width: 3px;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 36% 24%, #fff9a7 0 15%, #ffd11f 48%, #e9a900 100%);
  box-shadow:
    0 5px 10px rgba(38, 31, 10, 0.22),
    inset 0 3px 5px rgba(255, 255, 255, 0.5),
    inset 0 -6px 8px rgba(140, 92, 0, 0.28);
}

.profile-bio-edit::before {
  display: none;
}

.profile-bio-edit::after {
  display: none;
}

.profile-bio-edit img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.profile-bio-box p,
.profile-bio-box textarea {
  font: 800 0.88rem/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.profile-bio-controls {
  right: 42px;
  bottom: 24px;
}

.profile-bio-controls button {
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 0.72rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 24, 38, 0.46);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-card {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.landing-auth {
  display: block;
  overflow: hidden;
  width: 100vw;
  min-height: 100vh;
  padding: 44px clamp(24px, 12.5vw, 200px) 54px;
  background:
    linear-gradient(180deg, rgba(84, 42, 171, 0.22), rgba(255, 255, 255, 0.34) 78%, rgba(244, 236, 255, 0.9)),
    url("/assets/landing/background.jpg") center / cover no-repeat;
  background-color: #e7dcff;
  backdrop-filter: none;
}

.landing-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(60, 28, 126, 0.24), rgba(255, 255, 255, 0.02) 46%, rgba(93, 42, 151, 0.2)),
    linear-gradient(180deg, rgba(95, 49, 184, 0.24), rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.62));
}

.landing-auth::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -58px;
  height: 190px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(252, 248, 255, 0.9) 0 20%, rgba(232, 211, 255, 0.72) 43%, rgba(232, 211, 255, 0) 74%),
    linear-gradient(180deg, rgba(232, 211, 255, 0), rgba(232, 211, 255, 0.72));
  filter: blur(7px);
}

.landing-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(390px, 430px);
  gap: clamp(34px, 6vw, 82px);
  align-items: center;
  width: 100%;
  max-width: 1200px;
  min-height: min(780px, calc(100vh - 130px));
  margin: 0 auto;
}

.landing-showcase {
  position: relative;
  min-height: 720px;
}

.landing-logo {
  position: absolute;
  left: 150px;
  top: -4px;
  z-index: 3;
  width: 300px;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(43, 13, 94, 0.34));
  user-select: none;
  pointer-events: none;
}

.landing-characters {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 2;
  width: 440px;
  height: 445px;
  pointer-events: none;
  transform: translateX(-50%);
}

.landing-character {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 445px;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 20px 14px rgba(35, 13, 58, 0.26));
  transform: translateX(-50%);
  user-select: none;
}

.landing-promo {
  position: absolute;
  left: 8px;
  right: 0;
  bottom: 26px;
  z-index: 4;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  width: min(690px, 100%);
  min-height: 66px;
  border-radius: 10px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(124, 70, 213, 0.86), rgba(99, 43, 180, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 16px 34px rgba(75, 31, 130, 0.32);
  color: #fff;
}

.landing-promo img {
  display: block;
  width: 58px;
  height: 50px;
  object-fit: contain;
}

.landing-promo strong,
.landing-promo span {
  display: block;
  text-shadow: 0 2px 5px rgba(43, 17, 83, 0.35);
}

.landing-promo strong {
  font-size: 1.01rem;
  font-weight: 900;
}

.landing-promo span {
  margin-top: 5px;
  font-size: 0.94rem;
  font-weight: 800;
}

.landing-card {
  align-self: center;
  width: 100%;
  max-height: calc(100vh - 88px);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  padding: 47px 50px 40px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0.94) 44%, rgba(250, 248, 255, 0.96) 100%);
  box-shadow:
    0 28px 72px rgba(48, 19, 91, 0.3),
    0 0 0 1px rgba(117, 79, 195, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.landing-card::after {
  content: "";
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: -34px;
  height: 46px;
  border-radius: 50%;
  background: rgba(149, 90, 230, 0.42);
  filter: blur(18px);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  color: transparent;
  font-size: 0;
}

.login-card h2 {
  margin: 0;
  color: #171630;
  font-size: 2.14rem;
  font-weight: 900;
  line-height: 1.19;
  letter-spacing: 0;
  text-align: center;
}

.login-card h2::first-line {
  color: #7a23dc;
}

.landing-subtitle {
  max-width: 335px;
  margin: 22px auto 28px;
  color: #4e5265;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.landing-register-button,
.landing-submit {
  width: 100%;
  min-height: 78px;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  background: linear-gradient(180deg, #a634eb 0%, #7618d9 52%, #5515ca 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 18px rgba(85, 31, 171, 0.3);
  color: #fff;
  font-size: 1.43rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.landing-register-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.landing-register-button:hover,
.landing-submit:hover {
  background: linear-gradient(180deg, #b33cff 0%, #8320e7 52%, #5b18d3 100%);
}

.gamepad-icon {
  display: block;
  width: 48px;
  height: 33px;
  object-fit: contain;
}

.landing-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 15px;
  align-items: center;
  margin: 33px 0 31px;
  color: #a4a3b0;
  font-size: 1rem;
  font-weight: 850;
}

.landing-divider::before,
.landing-divider::after {
  content: "";
  height: 1px;
  background: #e4e2ec;
}

.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.landing-auth-mode {
  display: none;
}

.auth-panel-title {
  margin: 0 0 18px;
  color: #202039;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.landing-input {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  margin-bottom: 16px;
  border: 1px solid #d9dce6;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 2px 4px rgba(40, 33, 67, 0.04),
    0 4px 8px rgba(54, 44, 83, 0.04);
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.landing-input input {
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  padding: 0 46px 0 52px;
  background: transparent;
  color: #202039;
  font-size: 0.96rem;
  font-weight: 800;
}

.landing-input input::placeholder {
  color: #8f93a3;
  opacity: 1;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 117, 209, 0.14);
}

.landing-input:focus-within {
  border-color: rgba(126, 51, 218, 0.54);
  box-shadow:
    0 0 0 3px rgba(126, 51, 218, 0.1),
    inset 0 2px 4px rgba(40, 33, 67, 0.04);
}

.landing-input input:focus {
  box-shadow: none;
}

.auth-error {
  margin: 0 0 12px;
  color: #d94b69;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.input-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 22px;
  height: 25px;
  object-fit: contain;
  transform: translateY(-50%);
}

.password-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 28px;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  transform: translateY(-50%);
}

.password-eye::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  width: 21px;
  height: 12px;
  border: 2px solid #858997;
  border-radius: 50%;
}

.password-eye::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #858997;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 3px 0 25px;
  color: #6d7180;
  font-size: 0.88rem;
  font-weight: 850;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.remember-check input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid #b7bbc7;
  border-radius: 5px;
  accent-color: #8b24e5;
}

.forgot-link,
.landing-join button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #8f2be5;
  font-weight: 900;
}

.landing-submit {
  min-height: 58px;
  margin-top: 0;
  font-size: 1.14rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 18px rgba(74, 25, 151, 0.32);
}

.landing-join {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 26px 0 0;
  color: #5d6070;
  font-size: 0.96rem;
  font-weight: 800;
}

.join-register-copy,
#landingSwitchLogin {
  display: none;
}

.register-mode .join-login-copy,
.register-mode #landingSwitchRegister {
  display: none;
}

.register-mode .join-register-copy,
.register-mode #landingSwitchLogin {
  display: inline;
}

.register-mode .landing-register-button,
.register-mode .landing-divider {
  display: none;
}

.register-mode .login-options {
  display: none;
}

.profile-mode .landing-register-button,
.profile-mode .landing-divider,
.profile-mode .login-options,
.profile-mode .landing-join {
  display: none;
}

.profile-mode .landing-card {
  max-height: min(760px, calc(100vh - 96px));
  overflow: visible;
}

.customize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
}

.color-choices {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.color-choices.compact {
  grid-template-columns: repeat(4, minmax(34px, 1fr));
}

.color-choice {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--avatar-color);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.64);
}

.color-choice.selected {
  border-color: var(--ink);
}

.segmented-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.segment-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.segment-button.selected {
  border-color: rgba(39, 117, 209, 0.55);
  background: rgba(39, 117, 209, 0.11);
  color: var(--accent-dark);
}

.primary-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button.landing-submit {
  min-height: 58px;
  margin-top: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #a634eb 0%, #7618d9 52%, #5515ca 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 18px rgba(74, 25, 151, 0.32);
  font-size: 1.14rem;
}

.primary-button.landing-submit:hover {
  background: linear-gradient(180deg, #b33cff 0%, #8320e7 52%, #5b18d3 100%);
}

.avatar-picker {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.gender-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.avatar-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.avatar-preview img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  object-fit: contain;
}

.register-mode .landing-card {
  padding-top: 28px;
  padding-bottom: 24px;
}

.register-mode .login-card h2 {
  font-size: 1.72rem;
}

.register-mode .landing-subtitle {
  display: none;
  margin: 10px auto 14px;
  font-size: 0.88rem;
  line-height: 1.42;
}

.profile-mode .landing-subtitle {
  display: none;
}

.register-mode .auth-panel-title {
  margin-bottom: 10px;
}

.register-mode .landing-input {
  min-height: 44px;
  margin-bottom: 10px;
}

.register-mode .landing-input input {
  min-height: 42px;
}

.register-mode .field-label {
  margin: 8px 0 6px;
}

.register-mode .avatar-picker {
  gap: 6px;
  margin: 8px 0 10px;
}

.register-mode .avatar-preview {
  min-height: 126px;
}

.register-mode .avatar-preview img {
  max-height: 120px;
}

.register-mode .turn-button {
  height: 31px;
}

.register-mode .landing-submit {
  min-height: 52px;
}

.register-mode .landing-join {
  margin-top: 14px;
}

.avatar-turn-controls {
  display: grid;
  grid-template-columns: 44px 44px;
  justify-content: center;
  gap: 12px;
}

.turn-button {
  width: 44px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.turn-button:hover {
  border-color: rgba(39, 117, 209, 0.48);
  background: rgba(39, 117, 209, 0.08);
}

.landing-footer {
  position: absolute;
  left: clamp(24px, 12.5vw, 200px);
  right: clamp(24px, 12.5vw, 200px);
  bottom: 17px;
  z-index: 2;
  display: grid;
  gap: 13px;
  justify-items: center;
  color: rgba(73, 67, 91, 0.58);
  font-size: 0.8rem;
  font-weight: 850;
}

.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}

.landing-footer a {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 981px) {
  .landing-auth {
    padding: 0;
  }

  .landing-shell {
    position: absolute;
    left: 50%;
    top: calc(50% - 8px);
    display: block;
    width: 1200px;
    height: 780px;
    min-height: 0;
    max-width: none;
    margin: 0;
    transform: translate(-50%, -50%) scale(var(--landing-scale, 1));
    transform-origin: center center;
  }

  .landing-showcase {
    position: absolute;
    left: 0;
    top: 0;
    width: 690px;
    height: 100%;
    min-height: 0;
  }

  .landing-logo {
    left: 345px;
    top: 34px;
    width: 300px;
    transform: translateX(-50%);
  }

  .landing-characters {
    left: 345px;
    bottom: 124px;
    width: 440px;
    height: 445px;
  }

  .landing-character {
    height: 445px;
  }

  .landing-promo {
    left: 0;
    right: auto;
    bottom: 58px;
    width: 690px;
    min-height: 66px;
  }

  .landing-card {
    position: absolute;
    right: 0;
    top: 34px;
    bottom: 58px;
    width: 430px;
    max-height: none;
    overflow: visible;
    padding: 47px 50px 34px;
  }
}

.tool-panel {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: 320px;
  max-height: 560px;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 18px 38px rgba(31, 34, 46, 0.18),
    0 7px 16px rgba(31, 34, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  z-index: 30;
  transform: scale(var(--game-shell-scale));
  transform-origin: top left;
  animation: panel-pop-in 180ms cubic-bezier(0.18, 1.28, 0.28, 1) both;
}

.tool-panel.hidden {
  display: none;
}

@keyframes panel-pop-in {
  from {
    opacity: 0;
    transform: scale(calc(var(--game-shell-scale) * 0.94)) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(var(--game-shell-scale)) translateY(0);
  }
}

.tool-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid rgba(222, 226, 234, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.96));
  color: #151822;
  cursor: grab;
  user-select: none;
}

.tool-panel-title {
  font-size: 1rem;
  font-weight: 1000;
  letter-spacing: 0;
}

.tool-panel.dragging .tool-panel-head {
  cursor: grabbing;
}

.panel-close {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 24%, #ff8f94 0 14%, #ff3339 50%, #d9111d 100%);
  color: #fff;
  font-weight: 900;
  box-shadow:
    0 5px 10px rgba(36, 39, 50, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.48);
}

.tool-panel-body {
  display: grid;
  gap: 10px;
  max-height: 500px;
  overflow: auto;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.tool-panel[data-panel="admin-furniture"],
.tool-panel[data-panel="npc"],
.tool-panel[data-panel="announcement-admin"],
.tool-panel[data-panel="area-editor"],
.tool-panel[data-panel="fishing-tiles"],
.tool-panel[data-panel="home-tiles"] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 360px;
  max-height: min(620px, calc((100vh - 42px) / var(--game-shell-scale)));
}

.tool-panel.hidden[data-panel="admin-furniture"],
.tool-panel.hidden[data-panel="npc"],
.tool-panel.hidden[data-panel="announcement-admin"],
.tool-panel.hidden[data-panel="area-editor"],
.tool-panel.hidden[data-panel="fishing-tiles"],
.tool-panel.hidden[data-panel="home-tiles"] {
  display: none;
}

.tool-panel[data-panel="admin-furniture"] .tool-panel-body,
.tool-panel[data-panel="npc"] .tool-panel-body,
.tool-panel[data-panel="announcement-admin"] .tool-panel-body,
.tool-panel[data-panel="area-editor"] .tool-panel-body,
.tool-panel[data-panel="fishing-tiles"] .tool-panel-body,
.tool-panel[data-panel="home-tiles"] .tool-panel-body {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-bottom: 42px;
  overscroll-behavior: contain;
}

.tool-panel[data-panel="inventory"] {
  width: 330px;
  height: 345px;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 18px 38px rgba(31, 34, 46, 0.18),
    0 7px 16px rgba(31, 34, 46, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.tool-panel[data-panel="inventory"] .tool-panel-head {
  position: relative;
  min-height: 62px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid rgba(222, 226, 234, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.96));
  cursor: grab;
}

.tool-panel[data-panel="inventory"] .tool-panel-title {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #151822;
  font-size: 1.55rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86);
}

.tool-panel[data-panel="inventory"] .panel-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: radial-gradient(circle at 36% 24%, #ff8f94 0 14%, #ff3339 50%, #d9111d 100%);
  color: #fff;
  font-size: 1.25rem;
  box-shadow:
    0 5px 10px rgba(36, 39, 50, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.48);
}

.tool-panel[data-panel="inventory"] .tool-panel-body {
  display: block;
  height: calc(100% - 62px);
  max-height: none;
  overflow: hidden;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.inventory-bag {
  display: grid;
  grid-template-rows: auto 30px;
  height: 100%;
  gap: 7px;
}

.inventory-slots {
  display: grid;
  grid-template-columns: repeat(4, 65px);
  grid-template-rows: repeat(3, 65px);
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(218, 223, 234, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 5px 12px rgba(31, 34, 46, 0.06);
}

.inventory-slot {
  position: relative;
  width: 65px;
  height: 65px;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(213, 219, 231, 0.95);
  border-radius: 13px;
  background:
    radial-gradient(circle at 45% 34%, #fff, #fbfcfe 70%, #f1f4f9);
  box-shadow:
    0 5px 12px rgba(31, 34, 46, 0.07),
    inset 0 1px 3px rgba(255, 255, 255, 0.94);
}

.inventory-slot.filled {
  cursor: pointer;
}

.inventory-slot.filled:hover,
.wardrobe-detail-slot:not(.empty):hover {
  border-color: rgba(117, 103, 177, 0.92);
  background: #7567b1;
  box-shadow:
    0 7px 14px rgba(55, 45, 104, 0.22),
    inset 0 1px 2px rgba(255, 255, 255, 0.18);
}

.inventory-slot.equipped {
  border-color: rgba(47, 140, 255, 0.8);
  box-shadow:
    0 0 0 2px rgba(47, 140, 255, 0.18),
    0 6px 14px rgba(47, 140, 255, 0.16),
    inset 0 1px 3px rgba(255, 255, 255, 0.94);
}

.tool-panel[data-panel="home"] .tool-panel-body {
  display: block;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.home-panel {
  width: 100%;
}

.home-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 10px;
  border: 1px solid rgba(205, 199, 229, 0.78);
  border-radius: 14px;
  background: rgba(243, 246, 255, 0.82);
}

.home-tabs button {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6d7894;
  font-weight: 800;
  cursor: pointer;
}

.home-tabs button.active {
  background: #fff;
  color: #2c7be5;
  box-shadow: 0 3px 10px rgba(45, 75, 120, 0.12);
}

.home-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  scrollbar-width: none;
}

.home-list::-webkit-scrollbar {
  display: none;
}

.home-room-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  border: 1px solid rgba(217, 225, 242, 0.95);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(31, 34, 46, 0.06);
}

.home-room-card:hover {
  background: #eef4ff;
}

.home-room-title {
  color: #1e2a44;
  font-size: 0.9rem;
  font-weight: 900;
}

.home-room-subtitle {
  color: #71809b;
  font-size: 0.78rem;
  font-weight: 700;
}

.home-empty {
  border: 1px dashed rgba(181, 171, 225, 0.78);
  border-radius: 14px;
  padding: 24px 14px;
  color: #7c86a0;
  text-align: center;
  font-weight: 800;
}

.inventory-slot img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  image-rendering: auto;
}

.inventory-slot img.rod-icon {
  inset: 4px 10px 8px;
  width: calc(100% - 20px);
  height: calc(100% - 12px);
}

.inventory-count {
  position: absolute;
  right: 7px;
  bottom: 4px;
  color: #151822;
  font-size: 1.08rem;
  font-weight: 1000;
  text-shadow: 0 1px 0 #fff;
}

.inventory-expire-bar {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(116, 40, 58, 0.18);
}

.inventory-expire-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff3333, #b60021);
}

.inventory-pager {
  display: grid;
  grid-template-columns: 36px auto 36px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #151822;
  font-size: 1.1rem;
  font-weight: 1000;
  text-align: center;
}

.inventory-pager button {
  width: 30px;
  height: 26px;
  justify-self: center;
  border: 1px solid rgba(205, 212, 225, 0.95);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f1f4f9);
  color: #1f2937;
  font-size: 1.55rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    0 4px 9px rgba(31, 34, 46, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.inventory-pager button:disabled {
  opacity: 0.35;
}

.tool-panel[data-panel="admin-furniture"] .tool-panel-body {
  display: block;
  padding: 10px 10px 42px;
}

.tool-panel[data-panel="admin-furniture"] .panel-row {
  margin-bottom: 8px;
}

.furniture-catalog-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 7px;
  background: #fff;
}

.furniture-placed-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 56px;
  align-items: start;
  gap: 7px;
  min-height: 0;
  margin-bottom: 8px;
  padding: 7px;
}

.furniture-row-main {
  min-width: 0;
  padding-top: 2px;
}

.furniture-row-main strong,
.furniture-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.furniture-row-actions {
  display: grid;
  gap: 5px;
  align-self: start;
}

.furniture-row-actions button {
  min-height: 25px;
  padding: 0 6px;
  font-size: 0.74rem;
  line-height: 1.05;
}

.furniture-row-text {
  min-width: 0;
}

.furniture-row-text strong,
.furniture-row-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.furniture-place-button {
  justify-self: end;
  width: 70px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.furniture-depth-details {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid rgba(210, 217, 232, 0.86);
  border-radius: 9px;
  background: rgba(247, 249, 253, 0.94);
  overflow: hidden;
}

.furniture-depth-details summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: #2f6fcf;
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.furniture-depth-details summary::-webkit-details-marker {
  display: none;
}

.furniture-depth-details summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
}

.furniture-depth-details[open] summary::after {
  content: "-";
}

.furniture-depth-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 0 6px 7px;
}

.furniture-depth-tools button {
  min-width: 0;
  min-height: 23px;
  border-radius: 7px;
  padding: 3px 4px;
  font-size: 0.62rem;
  line-height: 1.05;
  white-space: normal;
  overflow-wrap: anywhere;
}

.furniture-depth-tools button.active {
  background: linear-gradient(135deg, #2f8cff, #6a42e8);
  color: #fff;
  border-color: rgba(47, 140, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(47, 140, 255, 0.16);
}

.furniture-row-thumb,
.furniture-placed-row > img {
  width: 48px;
  height: 44px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(91, 65, 143, 0.12);
  pointer-events: none;
}

.tool-panel[data-panel="chat-history"] {
  width: 350px;
  height: 420px;
  max-height: none;
  background: #ffffff;
}

.tool-panel[data-panel="chat-history"] .tool-panel-head {
  min-height: 52px;
  border-bottom: 1px solid rgba(222, 226, 234, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 253, 0.96));
  color: #151822;
}

.tool-panel[data-panel="chat-history"] .tool-panel-body {
  display: flex;
  height: calc(100% - 52px);
  max-height: none;
  overflow: hidden;
  padding: 12px;
}

.tool-panel[data-panel="friends"] {
  width: 350px;
  height: 420px;
  max-height: none;
}

.tool-panel[data-panel="friends"] .tool-panel-body {
  height: calc(100% - 52px);
  max-height: none;
  overflow: hidden;
  padding: 12px;
}

.tool-panel[data-panel="settings"] {
  width: 350px;
  min-height: 220px;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.panel-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.friends-panel {
  display: grid;
  grid-template-rows: 88px 28px minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.friends-self {
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  grid-template-rows: 54px 24px;
  align-items: center;
  justify-items: center;
  column-gap: 16px;
  padding-top: 3px;
}

.friends-self-line {
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 151, 172, 0.62), transparent);
}

.friends-self-avatar {
  display: grid;
  place-items: center;
  position: relative;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 3px solid rgba(194, 202, 216, 0.98);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #fff, #edf3fb);
  box-shadow:
    0 4px 10px rgba(30, 34, 48, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.friends-self-avatar img {
  position: absolute;
  left: 50%;
  top: -4px;
  width: auto;
  height: 92px;
  max-width: none;
  transform: translateX(-50%);
}

.friends-self strong {
  grid-column: 1 / -1;
  align-self: start;
  color: #1a1720;
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 950;
  text-align: center;
}

.friend-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 8px;
}

.friend-add-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(205, 212, 225, 0.95);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #171b24;
  font-weight: 850;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(45, 51, 66, 0.06);
}

.friend-add-form input:focus {
  border-color: rgba(47, 140, 255, 0.65);
  box-shadow:
    0 0 0 3px rgba(47, 140, 255, 0.13),
    inset 0 2px 5px rgba(45, 51, 66, 0.05);
}

.friend-add-form button,
.friend-actions button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #389cff, #177ee8);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow:
    0 7px 13px rgba(23, 126, 232, 0.23),
    inset 0 2px 3px rgba(255, 255, 255, 0.34);
}

.friend-tabs {
  display: flex;
  align-items: center;
  justify-content: stretch;
  justify-self: stretch;
  gap: 2px;
  height: 28px;
  padding: 2px;
  border: 1px solid rgba(199, 211, 228, 0.96);
  border-radius: 999px;
  background: rgba(237, 242, 249, 0.9);
  box-shadow:
    inset 0 1px 2px rgba(106, 120, 146, 0.12),
    0 2px 5px rgba(30, 34, 48, 0.04);
}

.friend-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: transparent;
  color: #687285;
  font-size: 0.7rem;
  font-weight: 1000;
}

.friend-tabs button.active {
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  color: #247ee8;
  box-shadow:
    0 5px 12px rgba(31, 34, 46, 0.08),
    inset 0 0 0 1px rgba(47, 140, 255, 0.22);
}

.friend-section {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  border: 1px solid rgba(218, 223, 234, 0.9);
  border-radius: 16px;
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.friend-section h4 {
  margin: 0;
  color: #1b2030;
  font-size: 0.9rem;
  font-weight: 1000;
}

.friend-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.friend-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.friend-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(213, 219, 231, 0.95);
  border-radius: 13px;
  padding: 7px 10px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(31, 34, 46, 0.07);
}

.friend-card.request {
  grid-template-columns: minmax(0, 1fr) auto;
}

.friend-card-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.friend-card.expanded {
  border-color: rgba(47, 140, 255, 0.36);
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.friend-card-menu {
  display: grid;
  position: static;
  margin-top: 1px;
  padding: 7px 0 0 18px;
  border-top: 1px solid rgba(220, 226, 238, 0.8);
}

.friend-card-menu button {
  justify-self: start;
  min-height: 27px;
  border: 1px solid rgba(224, 41, 53, 0.24);
  border-radius: 9px;
  padding: 0 10px;
  background: linear-gradient(180deg, #fff8f8, #ffe7e9);
  color: #e02935;
  font-size: 0.72rem;
  font-weight: 1000;
}

.friend-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #171b24;
  font-size: 0.84rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card small {
  display: block;
  color: #7a8496;
  font-size: 0.68rem;
  font-weight: 900;
}

.friend-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b7bfcd;
  box-shadow: 0 0 0 3px rgba(183, 191, 205, 0.18);
}

.friend-status.online {
  background: #28c76f;
  box-shadow: 0 0 0 3px rgba(40, 199, 111, 0.16);
}

.friend-actions {
  display: flex;
  gap: 5px;
}

.friend-actions button {
  min-width: 46px;
  min-height: 28px;
  border-radius: 10px;
  padding: 0 8px;
}

.friend-actions button.ghost {
  background: linear-gradient(180deg, #fff, #f1f4f9);
  color: #596477;
  box-shadow:
    inset 0 0 0 1px rgba(201, 208, 221, 0.95),
    0 4px 9px rgba(31, 34, 46, 0.08);
}

.friend-remove-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(173, 180, 194, 0.18),
    0 4px 8px rgba(32, 34, 40, 0.12);
  cursor: pointer;
}

.friend-remove-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.friend-empty {
  border: 1px dashed rgba(198, 207, 222, 0.92);
  border-radius: 12px;
  padding: 12px 10px;
  background: rgba(248, 250, 253, 0.84);
  color: #7d8797;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.tool-panel[data-panel="chat-history"],
.tool-panel[data-panel="inventory"],
.tool-panel[data-panel="friends"],
.tool-panel[data-panel="wardrobe"],
.tool-panel[data-panel="wardrobe-detail"],
.tool-panel[data-panel="settings"] {
  border: 3px solid rgba(209, 207, 234, 0.94);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    radial-gradient(circle at 8% 70%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 248, 255, 0.98));
  box-shadow:
    0 20px 34px rgba(41, 36, 76, 0.22),
    0 7px 15px rgba(58, 49, 92, 0.13),
    inset 0 2px 0 rgba(255, 255, 255, 0.98),
    inset 0 -2px 0 rgba(188, 179, 221, 0.2);
}

.tool-panel[data-panel="chat-history"],
.tool-panel[data-panel="friends"] {
  width: 350px;
  height: 420px;
  max-height: none;
}

.tool-panel[data-panel="chat-history"] {
  width: 350px;
}

.tool-panel[data-panel="inventory"] {
  width: 330px;
  height: 345px;
  max-height: none;
}

.tool-panel[data-panel="settings"] {
  width: 350px;
  height: 220px;
  min-height: 0;
  max-height: none;
}

.tool-panel[data-panel="wardrobe"] {
  width: 280px;
  height: 310px;
  max-height: none;
}

.tool-panel[data-panel="wardrobe-detail"] {
  width: 190px;
  height: 260px;
  max-height: none;
  animation: wardrobe-side-in 180ms cubic-bezier(0.18, 1.12, 0.28, 1) both;
}

.tool-panel[data-panel="chat-history"] .tool-panel-head,
.tool-panel[data-panel="inventory"] .tool-panel-head,
.tool-panel[data-panel="friends"] .tool-panel-head,
.tool-panel[data-panel="wardrobe"] .tool-panel-head,
.tool-panel[data-panel="wardrobe-detail"] .tool-panel-head,
.tool-panel[data-panel="settings"] .tool-panel-head {
  position: relative;
  min-height: 52px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid rgba(207, 211, 225, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 248, 255, 0.91));
}

.tool-panel-title-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.tool-panel-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(185, 177, 226, 0.62);
  border-radius: 10px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.96), rgba(244, 242, 255, 0.74));
  box-shadow:
    0 5px 12px rgba(84, 70, 144, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
}

.tool-panel-icon.hidden {
  display: none;
}

.tool-panel-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.tool-panel[data-panel="chat-history"] .tool-panel-title,
.tool-panel[data-panel="inventory"] .tool-panel-title,
.tool-panel[data-panel="friends"] .tool-panel-title,
.tool-panel[data-panel="wardrobe"] .tool-panel-title,
.tool-panel[data-panel="wardrobe-detail"] .tool-panel-title,
.tool-panel[data-panel="settings"] .tool-panel-title {
  position: static;
  width: auto;
  transform: none;
  color: #13162a;
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1;
  text-align: left;
  text-shadow: 0 1px 0 #fff;
}

.tool-panel[data-panel="chat-history"] .panel-close,
.tool-panel[data-panel="inventory"] .panel-close,
.tool-panel[data-panel="friends"] .panel-close,
.tool-panel[data-panel="wardrobe"] .panel-close,
.tool-panel[data-panel="wardrobe-detail"] .panel-close,
.tool-panel[data-panel="settings"] .panel-close {
  position: static;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 25%, #ff9a9d 0 12%, #ff4148 48%, #d91623 100%);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow:
    0 7px 13px rgba(38, 39, 51, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.tool-panel[data-panel="chat-history"] .tool-panel-body,
.tool-panel[data-panel="inventory"] .tool-panel-body,
.tool-panel[data-panel="friends"] .tool-panel-body,
.tool-panel[data-panel="wardrobe"] .tool-panel-body,
.tool-panel[data-panel="wardrobe-detail"] .tool-panel-body,
.tool-panel[data-panel="settings"] .tool-panel-body {
  height: calc(100% - 52px);
  max-height: none;
  overflow: hidden;
  padding: 12px;
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 246, 255, 0.7));
}

.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  padding: 9px 12px 12px;
}

.tool-panel[data-panel="wardrobe-detail"] .tool-panel-body {
  padding: 10px;
  overflow: hidden;
}

@keyframes wardrobe-side-in {
  from {
    opacity: 0;
    transform: scale(var(--game-shell-scale)) translateX(18px);
  }
  to {
    opacity: 1;
    transform: scale(var(--game-shell-scale)) translateX(0);
  }
}

.wardrobe-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 7px;
  height: 100%;
  min-height: 0;
}

.wardrobe-column {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-height: 0;
}

.wardrobe-category {
  position: relative;
  display: grid;
  grid-template-rows: 17px 46px;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #171828;
  font-size: 0.58rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
}

.wardrobe-category span {
  display: none;
}

.wardrobe-category-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 10px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.96), rgba(244, 246, 253, 0.88));
  box-shadow:
    0 6px 12px rgba(39, 42, 60, 0.11),
    inset 0 1px 2px rgba(255, 255, 255, 0.98);
}

.wardrobe-category-icon::before,
.wardrobe-category-icon::after {
  content: none;
  position: absolute;
  background: #a9afb9;
}

.wardrobe-category-icon img {
  display: block;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 2px 2px rgba(35, 39, 55, 0.18));
}

.wardrobe-hat .wardrobe-category-icon::before {
  width: 28px;
  height: 9px;
  left: 7px;
  top: 25px;
  border-radius: 50%;
}

.wardrobe-hat .wardrobe-category-icon::after {
  width: 18px;
  height: 12px;
  left: 12px;
  top: 15px;
  border-radius: 12px 12px 6px 6px;
}

.wardrobe-mask .wardrobe-category-icon::before {
  width: 30px;
  height: 12px;
  left: 6px;
  top: 17px;
  border: 3px solid #a9afb9;
  border-left-width: 4px;
  border-right-width: 4px;
  border-radius: 999px;
  background: transparent;
}

.wardrobe-mask .wardrobe-category-icon::after {
  width: 10px;
  height: 3px;
  left: 16px;
  top: 22px;
  border-radius: 999px;
}

.wardrobe-costume .wardrobe-category-icon::before {
  width: 28px;
  height: 29px;
  left: 7px;
  top: 8px;
  clip-path: polygon(20% 0, 38% 8%, 50% 26%, 62% 8%, 80% 0, 100% 22%, 84% 36%, 78% 100%, 22% 100%, 16% 36%, 0 22%);
}

.wardrobe-top .wardrobe-category-icon::before {
  width: 30px;
  height: 28px;
  left: 6px;
  top: 9px;
  clip-path: polygon(18% 0, 38% 8%, 50% 22%, 62% 8%, 82% 0, 100% 26%, 78% 42%, 72% 100%, 28% 100%, 22% 42%, 0 26%);
}

.wardrobe-bottom .wardrobe-category-icon::before {
  width: 25px;
  height: 30px;
  left: 9px;
  top: 8px;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 58% 100%, 50% 36%, 42% 100%, 12% 100%);
}

.wardrobe-shoes .wardrobe-category-icon::before {
  width: 28px;
  height: 12px;
  left: 7px;
  top: 22px;
  border-radius: 5px 13px 7px 5px;
  transform: skewX(-12deg);
}

.wardrobe-category b {
  position: absolute;
  right: 5px;
  bottom: 5px;
  color: #7b8190;
  font-size: 0.7rem;
  font-weight: 1000;
  text-shadow: 0 1px 0 #fff;
}

.wardrobe-preview {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, #fff, #f9fafc 74%, #f0f3f9);
  box-shadow:
    0 8px 15px rgba(39, 42, 60, 0.12),
    inset 0 1px 4px rgba(255, 255, 255, 0.98);
}

.wardrobe-preview img {
  max-width: 88%;
  max-height: 188px;
  object-fit: contain;
  image-rendering: auto;
}

.wardrobe-detail-panel {
  display: grid;
  align-content: start;
  gap: 7px;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
}

.wardrobe-detail-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.wardrobe-detail-item,
.wardrobe-empty {
  min-height: 42px;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  color: #171828;
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 5px 11px rgba(39, 42, 60, 0.08);
}

.wardrobe-detail-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  text-align: left;
}

.wardrobe-detail-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8f9fd, #e9edf7);
  box-shadow: inset 0 0 0 1px rgba(177, 184, 201, 0.42);
}

.wardrobe-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border-style: dashed;
  color: #7d8797;
  text-align: center;
  padding: 10px;
}

.tool-panel[data-panel="wardrobe-detail"] {
  width: 208px;
}

.tool-panel[data-panel="wardrobe-detail"][data-side="left"] {
  transform-origin: right top;
  animation: wardrobe-side-in-left 0.18s ease both;
}

.tool-panel[data-panel="wardrobe-detail"][data-side="right"] {
  transform-origin: left top;
  animation: wardrobe-side-in-right 0.18s ease both;
}

.tool-panel[data-panel="wardrobe-detail"].closing-left {
  animation: wardrobe-side-out-left 0.16s ease both;
}

.tool-panel[data-panel="wardrobe-detail"].closing-right {
  animation: wardrobe-side-out-right 0.16s ease both;
}

.tool-panel[data-panel="wardrobe-detail"] .panel-close {
  display: none;
}

.tool-panel[data-panel="wardrobe-detail"] .tool-panel-title {
  font-size: 0.92rem;
}

@keyframes wardrobe-side-in-left {
  from {
    opacity: 0;
    transform: scale(var(--game-shell-scale)) translateX(18px);
  }
  to {
    opacity: 1;
    transform: scale(var(--game-shell-scale)) translateX(0);
  }
}

@keyframes wardrobe-side-in-right {
  from {
    opacity: 0;
    transform: scale(var(--game-shell-scale)) translateX(-18px);
  }
  to {
    opacity: 1;
    transform: scale(var(--game-shell-scale)) translateX(0);
  }
}

@keyframes wardrobe-side-out-left {
  to {
    opacity: 0;
    transform: scale(var(--game-shell-scale)) translateX(18px);
  }
}

@keyframes wardrobe-side-out-right {
  to {
    opacity: 0;
    transform: scale(var(--game-shell-scale)) translateX(-18px);
  }
}

.wardrobe-panel {
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 7px;
}

.wardrobe-category {
  grid-template-rows: 17px 60px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-category {
  grid-template-rows: 60px;
  align-content: center;
}

.wardrobe-category-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.wardrobe-category.active .wardrobe-category-icon {
  border-color: rgba(132, 92, 255, 0.8);
  box-shadow:
    0 0 0 3px rgba(132, 92, 255, 0.14),
    0 8px 15px rgba(39, 42, 60, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.98);
}

.wardrobe-preview {
  position: relative;
  grid-template-rows: 1fr auto;
  padding: 8px 6px 7px;
  overflow: hidden;
}

.wardrobe-preview img {
  max-width: 70px;
  max-height: 70px;
}

.wardrobe-rotate {
  position: absolute;
  top: 52%;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #6b5be8;
  font-size: 1.2rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 4px 8px rgba(39, 42, 60, 0.12);
}

.wardrobe-rotate.left {
  left: 5px;
}

.wardrobe-rotate.right {
  right: 5px;
}

.wardrobe-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  width: 100%;
}

.wardrobe-actions button {
  min-width: 0;
  width: 70px;
  height: 28px;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f1f4ff);
  color: #352a6e;
  font-size: 0.72rem;
  font-weight: 1000;
  box-shadow: 0 4px 8px rgba(39, 42, 60, 0.1);
}

.wardrobe-actions button:first-child {
  border-color: rgba(58, 142, 255, 0.55);
  background: linear-gradient(180deg, #62b8ff, #2578ee);
  color: #fff;
}

.wardrobe-detail-panel {
  gap: 8px;
  overflow: hidden;
}

.wardrobe-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-auto-rows: 60px;
  gap: 4px;
  justify-content: center;
}

.wardrobe-detail-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(205, 211, 227, 0.94);
  border-radius: 10px;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.98), rgba(245, 247, 253, 0.9));
  box-shadow:
    0 6px 10px rgba(39, 42, 60, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.wardrobe-detail-slot img {
  max-width: 54px;
  max-height: 54px;
  object-fit: contain;
  image-rendering: auto;
}

.wardrobe-detail-slot i {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #a9afb9;
}

.wardrobe-detail-slot.empty {
  opacity: 0.55;
}

.wardrobe-remove-slot span {
  color: #f04b5b;
  font-size: 2.1rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 #fff;
}

.wardrobe-empty {
  min-height: 58px;
  font-size: 0.72rem;
}

.tool-panel[data-panel="wardrobe"] {
  overflow: visible;
  border-radius: 28px;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-head,
.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  position: relative;
  z-index: 2;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  overflow: visible;
}

.wardrobe-panel {
  position: relative;
  height: 100%;
  overflow: visible;
}

.wardrobe-main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 7px;
  height: 100%;
}

.wardrobe-attached-drawer {
  position: absolute;
  top: -1px;
  z-index: 1;
  width: 204px;
  min-height: 236px;
  padding: 13px 10px 12px;
  border: 3px solid rgba(209, 207, 234, 0.94);
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 248, 255, 0.98));
  box-shadow:
    0 18px 30px rgba(41, 36, 76, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.98);
}

.wardrobe-attached-drawer[data-side="left"] {
  right: calc(100% - 1px);
  border-radius: 24px 0 0 24px;
  animation: wardrobe-drawer-left-in 0.18s ease both;
}

.wardrobe-attached-drawer[data-side="right"] {
  left: calc(100% - 1px);
  border-radius: 0 24px 24px 0;
  animation: wardrobe-drawer-right-in 0.18s ease both;
}

@keyframes wardrobe-drawer-left-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(26px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes wardrobe-drawer-right-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-26px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes wardrobe-drawer-left-out {
  from {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(-50%) translateX(26px);
  }
}

@keyframes wardrobe-drawer-right-out {
  from {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(-50%) translateX(-26px);
  }
}

.wardrobe-drawer-title {
  margin: 0 0 10px;
  color: #171828;
  font-size: 0.82rem;
  font-weight: 1000;
}

.wardrobe-attached-drawer .wardrobe-detail-grid {
  grid-template-columns: repeat(3, 60px);
  grid-auto-rows: 60px;
  gap: 4px;
}

.wardrobe-preview img {
  max-width: 80px;
  max-height: 80px;
}

.wardrobe-rotate {
  top: 48%;
}

.tool-panel[data-panel="wardrobe"] {
  isolation: isolate;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    radial-gradient(circle at 8% 70%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 248, 255, 0.98));
}

.tool-panel[data-panel="wardrobe"] .tool-panel-head {
  z-index: 5;
  border-radius: 24px 24px 0 0;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  z-index: 4;
  border-radius: 0 0 24px 24px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 3;
  border-radius: 0 0 24px 24px;
  background: transparent;
  pointer-events: none;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.98);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 7px;
  width: 100%;
  height: 100%;
  border-radius: 0 0 24px 24px;
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    linear-gradient(180deg, #ffffff, #f7f8ff);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer {
  top: 50%;
  z-index: -1;
  width: 226px;
  height: auto;
  min-height: 244px;
  transform: translateY(-50%);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] {
  right: calc(100% - 1px);
  animation: wardrobe-drawer-left-in 0.18s ease both;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] {
  left: calc(100% - 1px);
  animation: wardrobe-drawer-right-in 0.18s ease both;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer .wardrobe-detail-grid {
  gap: 6px;
}

.wardrobe-drawer-pager {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #352a6e;
  font-size: 0.76rem;
  font-weight: 1000;
  text-align: center;
}

.wardrobe-drawer-pager button {
  width: 32px;
  height: 26px;
  border: 1px solid rgba(205, 211, 227, 0.92);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f2f4ff);
  color: #6b5be8;
  font-size: 1.2rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 4px 8px rgba(39, 42, 60, 0.1);
}

.wardrobe-drawer-pager button:disabled {
  opacity: 0.35;
}

/* Final wardrobe drawer layout: attached, centered, never covering the main panel. */
.tool-panel[data-panel="wardrobe"] {
  overflow: visible;
  isolation: auto;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-head {
  position: relative;
  z-index: 4;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before {
  display: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 7px;
  width: 100%;
  height: 100%;
  border-radius: 0 0 24px 24px;
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    linear-gradient(180deg, #ffffff, #f7f8ff);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-column,
.tool-panel[data-panel="wardrobe"] .wardrobe-preview {
  position: relative;
  z-index: 3;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 286px;
  min-height: 250px;
  height: auto;
  padding: 10px 14px 12px;
  transform: translateY(-50%);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] {
  right: calc(100% - 40px);
  left: auto;
  border-radius: 24px 0 0 24px;
  animation: wardrobe-drawer-left-in 0.18s ease both;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] {
  left: calc(100% - 40px);
  right: auto;
  border-left: 0;
  border-radius: 0 24px 24px 0;
  animation: wardrobe-drawer-right-in 0.18s ease both;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer .wardrobe-detail-grid {
  grid-template-columns: repeat(3, 60px);
  grid-auto-rows: 60px;
  gap: 7px;
  justify-content: center;
  margin-top: 0;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] .wardrobe-detail-grid {
  transform: translateX(-17px);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] .wardrobe-detail-grid {
  transform: translateX(17px);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-category b {
  display: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-drawer-title {
  display: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-drawer-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] .wardrobe-drawer-pager {
  transform: translateX(-17px);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] .wardrobe-drawer-pager {
  transform: translateX(17px);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-drawer-pager span {
  min-width: 42px;
  text-align: center;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-column {
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-preview {
  min-width: 0;
  width: 100%;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-preview img {
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 80px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-panel::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 42px;
  background: linear-gradient(180deg, #ffffff, #f7f8ff);
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before {
  left: 0;
  border-radius: 0 0 0 24px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::after {
  right: 0;
  border-radius: 0 0 24px 0;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main {
  isolation: isolate;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-main::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 62px;
  background: linear-gradient(180deg, #ffffff, #f7f8ff);
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main::before {
  left: 0;
  border-radius: 0 0 0 24px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main::after {
  right: 0;
  border-radius: 0 0 24px 0;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-panel::after {
  top: 0 !important;
  bottom: 0 !important;
  z-index: 2 !important;
  width: 62px !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before {
  left: 0 !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::after {
  right: 0 !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-column {
  align-content: center;
  justify-items: center;
  gap: 16px;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-category {
  justify-items: center;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-right {
  position: relative;
  z-index: 5;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-right::before {
  content: "";
  position: absolute;
  inset: -10px -12px -12px -42px;
  z-index: 0;
  border-radius: 0 0 24px 0;
  background: linear-gradient(180deg, #ffffff, #f7f8ff);
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-right::after {
  content: "";
  position: absolute;
  left: -42px;
  bottom: -14px;
  width: 56px;
  height: 38px;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff, #f7f8ff);
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-right .wardrobe-category {
  position: relative;
  z-index: 3;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer.closing[data-side="left"] {
  animation: wardrobe-drawer-left-out 0.18s ease both;
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer.closing[data-side="right"] {
  animation: wardrobe-drawer-right-out 0.18s ease both;
  pointer-events: none;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main {
  z-index: 10;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer {
  z-index: 1;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-panel::after,
.tool-panel[data-panel="wardrobe"] .wardrobe-main::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-main::after,
.tool-panel[data-panel="wardrobe"] .wardrobe-right::before,
.tool-panel[data-panel="wardrobe"] .wardrobe-right::after {
  content: none !important;
  display: none !important;
}

/* Wardrobe drawers must live under the main panel, not be faked with masks. */
.tool-panel[data-panel="wardrobe"] {
  overflow: visible !important;
  isolation: isolate !important;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-head,
.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  position: relative !important;
  overflow: visible !important;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-head {
  z-index: 5 !important;
}

.tool-panel[data-panel="wardrobe"] .tool-panel-body {
  z-index: 1 !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-panel {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-main {
  position: relative !important;
  z-index: 2 !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer {
  z-index: -1 !important;
  border: 3px solid rgba(209, 207, 234, 0.94) !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] {
  right: calc(100% - 40px) !important;
  left: auto !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] {
  left: calc(100% - 40px) !important;
  right: auto !important;
  border-left: 3px solid rgba(209, 207, 234, 0.94) !important;
}

/* No drawer overlap: drawers open outside the panel, so nothing leaks over the main wardrobe. */
.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] {
  right: 100% !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] {
  left: 100% !important;
}

/* The drawer slides underneath the wardrobe; its under-panel overlap is not painted. */
.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer {
  top: 50% !important;
  z-index: -1 !important;
  width: 286px !important;
  height: 250px !important;
  min-height: 250px !important;
  max-height: 250px !important;
  transform: translateY(-50%) !important;
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="left"] {
  right: calc(100% - 40px) !important;
  left: auto !important;
  clip-path: inset(0 40px 0 0 round 24px 0 0 24px);
}

.tool-panel[data-panel="wardrobe"] .wardrobe-attached-drawer[data-side="right"] {
  left: calc(100% - 40px) !important;
  right: auto !important;
  clip-path: inset(0 0 0 40px round 0 24px 24px 0);
}

/* Shared button polish */
button {
  position: relative;
}

button:not(:disabled):not(.whisper-target-button):not(.inventory-slot):not(.wardrobe-detail-slot)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

button:not(:disabled):not(.whisper-target-button):not(.inventory-slot):not(.wardrobe-detail-slot):hover::after {
  opacity: 1;
}

.panel-close,
.profile-close,
.community-panel-close,
.quiz-close-button,
.gartic-close {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: url("/assets/ui/red-close.png") center / contain no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-indent: -9999px !important;
  box-shadow: none !important;
  overflow: hidden;
}

.profile-close::before,
.profile-close::after,
.panel-close::before,
.community-panel-close::before,
.quiz-close-button::before,
.gartic-close::before {
  content: none !important;
  display: none !important;
}

.panel-close:hover,
.profile-close:hover,
.community-panel-close:hover,
.quiz-close-button:hover,
.gartic-close:hover {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.3) !important;
}

.tool-panel[data-panel="chat-history"] .chat-history-search {
  position: relative;
  margin-bottom: 10px;
}

.tool-panel[data-panel="chat-history"] .chat-history-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 4px solid rgba(138, 144, 163, 0.7);
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.tool-panel[data-panel="chat-history"] .chat-history-search::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 28px;
  width: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(138, 144, 163, 0.7);
  transform: rotate(45deg);
  pointer-events: none;
}

.tool-panel[data-panel="chat-history"] .chat-history-search input {
  height: 42px;
  border-color: rgba(198, 204, 222, 0.94);
  border-radius: 14px;
  padding: 0 14px 0 48px;
  background: rgba(255, 255, 255, 0.82);
  color: #15172a;
  font-size: 0.92rem;
  box-shadow:
    0 5px 14px rgba(58, 54, 91, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.88);
}

.tool-panel[data-panel="chat-history"] .chat-history-list {
  border: 1px dashed rgba(181, 171, 225, 0.78);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.tool-panel[data-panel="inventory"] .tool-panel-body {
  padding: 12px 14px 10px;
}

.tool-panel[data-panel="inventory"] .inventory-bag {
  grid-template-rows: minmax(0, 1fr) 30px;
  gap: 7px;
}

.tool-panel[data-panel="inventory"] .inventory-slots {
  align-content: center;
  grid-template-columns: repeat(4, 65px);
  grid-template-rows: repeat(3, 65px);
  gap: 5px;
  padding: 8px;
  border-color: rgba(205, 199, 229, 0.78);
  border-radius: 18px;
  background:
    radial-gradient(circle at 94% 20%, rgba(255, 255, 255, 0.98) 0 2px, transparent 3px),
    rgba(255, 255, 255, 0.52);
}

.tool-panel[data-panel="inventory"] .inventory-slot {
  border-color: rgba(199, 199, 222, 0.92);
  border-radius: 12px;
}

.tool-panel[data-panel="inventory"] .inventory-pager {
  grid-template-columns: 36px 64px 36px;
  gap: 8px;
}

.tool-panel[data-panel="inventory"] .inventory-pager button {
  width: 30px;
  height: 26px;
  border-color: rgba(191, 185, 220, 0.82);
  border-radius: 11px;
  color: #7969ac;
  font-size: 1.7rem;
  background: linear-gradient(180deg, #fff, #f0edff);
}

.tool-panel[data-panel="friends"] .friends-panel {
  grid-template-rows: 88px 28px minmax(0, 1fr);
  gap: 8px;
}

.tool-panel[data-panel="friends"] .friend-tabs {
  justify-self: stretch;
}

.tool-panel[data-panel="friends"] .friend-tabs button {
  min-width: 0;
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.7rem;
}

.tool-panel[data-panel="friends"] .friend-section {
  gap: 7px;
  border-color: rgba(205, 199, 229, 0.78);
  border-radius: 18px;
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.52);
}

.tool-panel[data-panel="friends"] .friend-section h4 {
  color: #6b59b7;
  font-size: 0.9rem;
}

.tool-panel[data-panel="friends"] .friend-card {
  min-height: 44px;
  border-color: rgba(205, 211, 227, 0.92);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.tool-panel[data-panel="friends"] .friend-card-menu {
  position: static;
  margin-top: 1px;
}

.tool-panel[data-panel="settings"] .settings-panel {
  height: 100%;
}

.tool-panel[data-panel="settings"] .settings-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 64px;
  border-color: rgba(205, 199, 229, 0.78);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 8px 17px rgba(58, 54, 91, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.settings-row-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(185, 177, 226, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.settings-row-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.tool-panel[data-panel="settings"] .settings-row strong {
  color: #15172a;
  font-size: 0.9rem;
  font-weight: 1000;
}

.tool-panel[data-panel="settings"] .settings-row small {
  color: #7b80a1;
  font-size: 0.7rem;
}

.tool-panel[data-panel="admin-accounts"] {
  width: 820px;
  height: 620px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  border: 1px solid rgba(78, 67, 121, 0.2);
  border-radius: 12px;
  background: #f6f7fb;
  box-shadow: 0 22px 55px rgba(33, 29, 55, 0.22);
}

.tool-panel[data-panel="admin-accounts"] .tool-panel-head {
  min-height: 50px;
  border-bottom: 0;
  background: linear-gradient(135deg, #2d3142, #60528e);
  color: #fff;
}

.tool-panel[data-panel="admin-accounts"] .panel-close {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.tool-panel[data-panel="admin-accounts"] .tool-panel-body {
  display: grid;
  align-content: start;
  gap: 12px;
  height: calc(100% - 50px);
  max-height: none;
  overflow: auto;
  padding: 12px;
  background: linear-gradient(180deg, #f7f8fc, #eef2f7);
}

.admin-accounts-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(96, 82, 142, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(33, 29, 55, 0.07);
}

.admin-accounts-toolbar input {
  width: min(320px, 42vw);
  height: 34px;
  border: 1px solid rgba(96, 82, 142, 0.2);
  border-radius: 999px;
  padding: 0 13px;
  background: #fff;
  color: #202433;
  font-weight: 850;
}

.admin-accounts-toolbar button,
.admin-account-actions button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: linear-gradient(180deg, #6753c8, #4f3dab);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow: 0 7px 14px rgba(79, 61, 171, 0.2);
}

.admin-account-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(96, 82, 142, 0.13);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(42, 38, 67, 0.08);
}

.admin-account-card.hidden-by-search {
  display: none;
}

.admin-account-card.banned {
  border-color: rgba(201, 47, 63, 0.24);
  background: #fffafa;
}

.admin-account-head,
.admin-account-fields {
  display: grid;
  gap: 8px;
}

.admin-account-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-account-head span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf0f6;
  color: #566071;
  font-size: 0.75rem;
  font-weight: 1000;
}

.admin-account-head span.online {
  background: #dff7e8;
  color: #23764b;
}

.admin-account-head span.banned {
  background: #ffe1e1;
  color: #a92332;
}

.admin-account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  border-radius: 8px;
  padding: 8px;
  background: #f6f8fb;
  color: #687386;
  font-size: 0.72rem;
  font-weight: 850;
}

.admin-account-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-account-fields label {
  display: grid;
  gap: 4px;
  color: #566071;
  font-size: 0.72rem;
  font-weight: 900;
}

.admin-account-fields input,
.admin-account-fields select {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(96, 82, 142, 0.18);
  border-radius: 9px;
  padding: 0 9px;
  background: #fff;
  color: #202433;
  font-weight: 850;
}

.admin-account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-account-actions .danger {
  background: linear-gradient(180deg, #f05252, #c92f3f);
  color: #fff;
  box-shadow: 0 7px 14px rgba(201, 47, 63, 0.18);
}

.admin-account-actions .warning {
  background: linear-gradient(180deg, #f0b451, #c78025);
  color: #fff;
  box-shadow: 0 7px 14px rgba(199, 128, 37, 0.18);
}

.admin-account-actions .success {
  background: linear-gradient(180deg, #39b980, #238c5c);
  color: #fff;
  box-shadow: 0 7px 14px rgba(35, 140, 92, 0.18);
}

@media (max-width: 780px) {
  .admin-account-meta,
  .admin-account-fields {
    grid-template-columns: 1fr;
  }
}

.area-editor-panel {
  display: grid;
  gap: 10px;
}

.area-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.area-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.area-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(24, 34, 47, 0.18);
}

.area-dot.walkable {
  background: #27d269;
}

.area-dot.blocked {
  background: #ff3648;
}

.area-dot.entry {
  background: #ff9b22;
}

.area-dot.fishing-water {
  background: #159dff;
}

.area-dot.fishing-cast {
  background: #ffdc37;
}

.area-dot.home-entrance {
  background: #7567b1;
}

.panel-wide-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.panel-wide-button.subtle {
  background: #edf2f7;
  color: var(--ink);
}

.tool-panel[data-panel="quiz"] {
  width: min(830px, calc(100vw - 28px));
  min-width: 720px;
}

.tool-panel[data-panel="quiz"] .tool-panel-body {
  padding: 0;
  overflow: hidden;
}

.quiz-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  min-height: 510px;
  background: #fff9f0;
}

.quiz-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 245, 222, 0.96)),
    radial-gradient(circle at 14% 8%, rgba(255, 226, 122, 0.42), rgba(255, 255, 255, 0) 34%);
}

.quiz-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid #f0d59b;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(92, 61, 20, 0.08);
}

.quiz-titlebar strong,
.quiz-titlebar span {
  display: block;
}

.quiz-titlebar strong {
  color: #39224f;
  font-size: 1.12rem;
  font-weight: 1000;
}

.quiz-titlebar span {
  margin-top: 2px;
  color: #7d6a53;
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-titlebar b {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #4f2b7d;
  color: #fff;
  font-size: 1.18rem;
  box-shadow: inset 0 -4px 7px rgba(22, 8, 40, 0.25);
}

.quiz-admin-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 112px 92px;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.quiz-admin-form label span {
  display: block;
  margin-bottom: 5px;
  color: #6b5b72;
  font-size: 0.78rem;
  font-weight: 900;
}

.quiz-admin-form input,
.quiz-admin-form button {
  height: 38px;
  border-radius: 7px;
  font-weight: 900;
}

.quiz-admin-form input {
  width: 100%;
  border: 1px solid #d8c6e4;
  padding: 0 10px;
  background: #fff;
  color: #30213f;
}

.quiz-admin-form button {
  border: 0;
  background: #4f2b7d;
  color: #fff;
}

.quiz-admin-form #quizResetButton {
  background: #e9e0f1;
  color: #4f2b7d;
}

.quiz-idle,
.quiz-countdown,
.quiz-final,
.quiz-question-card {
  margin-top: 15px;
}

.quiz-idle,
.quiz-countdown {
  display: grid;
  min-height: 310px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #e1c68e;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.quiz-idle strong {
  color: #39224f;
  font-size: 1.35rem;
}

.quiz-idle span,
.quiz-countdown span,
.quiz-countdown em {
  color: #78686f;
  font-style: normal;
  font-weight: 900;
}

.quiz-countdown strong {
  color: #4f2b7d;
  font-size: 6rem;
  line-height: 1;
  text-shadow: 0 7px 0 rgba(79, 43, 125, 0.12);
}

.quiz-question-card {
  display: grid;
  gap: 13px;
}

.quiz-question-head {
  display: flex;
  justify-content: space-between;
  color: #5d416f;
  font-weight: 1000;
}

.quiz-question-card h3 {
  margin: 0;
  min-height: 70px;
  border-radius: 8px;
  padding: 18px;
  background: #432264;
  color: #fff;
  font-size: 1.18rem;
  line-height: 1.32;
  box-shadow: inset 0 -5px 0 rgba(15, 6, 27, 0.18);
}

.quiz-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  border: 2px solid #d8c5e8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #2f253a;
  text-align: left;
  box-shadow: 0 6px 15px rgba(65, 43, 88, 0.08);
}

.quiz-choice span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #efe5f7;
  color: #4f2b7d;
  font-weight: 1000;
}

.quiz-choice strong {
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.2;
}

.quiz-choice:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: #8d55c3;
}

.quiz-choice.selected {
  border-color: #ffd65a;
  box-shadow: 0 0 0 3px rgba(255, 214, 90, 0.68);
}

.quiz-choice.correct {
  border-color: #28a868;
  background: #e6fbef;
}

.quiz-choice.wrong {
  border-color: #d9354f;
  background: #ffe8ed;
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-hint {
  margin: 0;
  color: #796a78;
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-scoreboard {
  min-width: 0;
  padding: 18px 14px;
  border-left: 1px solid #ead8b3;
  background: #2b1740;
  color: #fff;
}

.quiz-scoreboard > strong {
  display: block;
  margin-bottom: 12px;
  color: #ffe27a;
  font-size: 0.96rem;
}

.quiz-score-row,
.quiz-final-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 0.86rem;
  font-weight: 900;
}

.quiz-score-row {
  background: rgba(255, 255, 255, 0.07);
  margin-bottom: 7px;
}

.quiz-score-row.self {
  background: rgba(255, 226, 122, 0.2);
}

.quiz-rank {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffe27a;
}

.quiz-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-empty {
  color: #9f91ad;
  font-size: 0.84rem;
  font-weight: 800;
}

.quiz-final h3 {
  margin: 0 0 12px;
  color: #39224f;
  font-size: 1.4rem;
}

.quiz-final-list {
  display: grid;
  gap: 8px;
}

.quiz-final-row {
  background: #fff;
  color: #39224f;
  box-shadow: 0 6px 16px rgba(65, 43, 88, 0.08);
}

.quiz-final-row.winner {
  background: #fff2bb;
}

.quiz-final-row span {
  color: #8f5c19;
}

.quiz-final-row em {
  color: #4f2b7d;
  font-style: normal;
}

.tool-panel[data-panel="quiz"] {
  width: min(1120px, calc(100vw - 28px));
  min-width: 980px;
  border: 3px solid #d88b18;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #4e1285 0%, #210934 100%);
  box-shadow:
    0 20px 48px rgba(35, 9, 61, 0.42),
    inset 0 0 0 3px rgba(19, 6, 36, 0.75),
    inset 0 0 0 6px rgba(134, 45, 198, 0.36);
}

.tool-panel[data-panel="quiz"] .tool-panel-head {
  display: none;
}

.tool-panel[data-panel="quiz"] .tool-panel-body {
  max-height: none;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 20%, rgba(156, 64, 255, 0.38), rgba(156, 64, 255, 0) 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 190, 43, 0.2), rgba(255, 190, 43, 0) 24%),
    linear-gradient(180deg, #4b1380 0%, #230a3c 100%);
}

.quiz-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: 118px minmax(0, 1fr);
  gap: 14px 18px;
  min-height: 690px;
  padding: 18px 24px 22px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.025) 75%, transparent 75%) 0 0 / 34px 34px,
    radial-gradient(circle at 50% -6%, rgba(255, 221, 76, 0.34), rgba(255, 221, 76, 0) 20%),
    linear-gradient(180deg, #40106e 0%, #170524 100%);
  color: #fff;
}

.quiz-brandbar {
  position: relative;
  grid-column: 1 / -1;
  min-height: 118px;
  border-bottom: 2px solid rgba(170, 68, 230, 0.54);
}

.quiz-logo {
  position: absolute;
  left: 50%;
  top: -14px;
  min-width: 410px;
  padding: 18px 44px 20px;
  border: 3px solid rgba(146, 50, 216, 0.8);
  border-radius: 0 0 42px 42px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 227, 75, 0.42), rgba(255, 227, 75, 0) 42%),
    linear-gradient(180deg, #64209a 0%, #391063 100%);
  text-align: center;
  transform: translateX(-50%);
  box-shadow:
    inset 0 -8px 0 rgba(17, 5, 31, 0.22),
    0 12px 22px rgba(17, 5, 31, 0.38);
}

.quiz-logo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -50px;
  width: 92px;
  height: 74px;
  background:
    linear-gradient(138deg, transparent 0 36%, #ffbd22 37% 74%, transparent 75%) 0 18px / 31px 52px no-repeat,
    linear-gradient(180deg, #ffe96b 0%, #ffac17 88%) 31px 0 / 32px 76px no-repeat,
    linear-gradient(222deg, transparent 0 36%, #ffbd22 37% 74%, transparent 75%) 61px 18px / 31px 52px no-repeat;
  filter: drop-shadow(0 4px 0 #351064);
  transform: translateX(-50%);
}

.quiz-logo span {
  display: block;
  color: #fff;
  font-size: 56px;
  font-weight: 1000;
  line-height: 0.92;
  text-shadow:
    0 5px 0 #4d1684,
    0 8px 0 #21063c,
    0 0 12px rgba(255, 255, 255, 0.62);
}

.quiz-exit-button {
  position: absolute;
  left: 136px;
  top: 18px;
  min-width: 118px;
  height: 48px;
  border: 2px solid rgba(181, 86, 240, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, #7a32b1, #411065);
  color: #fff;
  font-weight: 1000;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.2),
    0 5px 0 rgba(13, 4, 26, 0.46);
}

.quiz-icon-row {
  position: absolute;
  right: 12px;
  top: 16px;
  display: flex;
  gap: 13px;
}

.quiz-icon-row b {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 2px solid rgba(201, 97, 255, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 24%, #b653ff 0%, #6415a0 54%, #2d0649 100%);
  color: #fff;
  font-size: 27px;
  box-shadow:
    inset 0 4px 4px rgba(255, 255, 255, 0.25),
    0 5px 0 rgba(12, 3, 23, 0.5);
}

.quiz-main {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  background: transparent;
}

.quiz-titlebar {
  min-height: 58px;
  border: 0;
  padding: 4px 36px;
  background: transparent;
  box-shadow: none;
}

.quiz-titlebar strong {
  display: inline;
  color: #ffdc25;
  font-size: 22px;
  text-shadow: 0 2px 0 #5a1b00;
}

.quiz-titlebar span {
  display: inline;
  margin-left: 6px;
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
}

.quiz-timer {
  display: grid;
  grid-template-columns: 72px 220px;
  align-items: center;
  gap: 8px;
}

.quiz-timer span,
.quiz-question-head strong {
  position: relative;
  display: grid;
  width: 72px;
  height: 36px;
  place-items: center;
  border: 2px solid #ffbd24;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffd834, #f49712);
  color: #3e1063;
  font-size: 20px;
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.54);
}

.quiz-timer i {
  display: block;
  height: 16px;
  border: 2px solid #210938;
  border-radius: 10px;
  background:
    linear-gradient(90deg, #ffd31e 0 34%, rgba(255, 211, 30, 0) 34%),
    #180526;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.14);
}

.quiz-question-card,
.quiz-idle,
.quiz-countdown,
.quiz-final {
  min-height: 498px;
  margin-top: 0;
  border: 3px solid #5f1995;
  border-radius: 20px;
  padding: 38px 34px 28px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.025) 75%, transparent 75%) 0 0 / 26px 26px,
    linear-gradient(180deg, #32105b 0%, #180526 100%);
  box-shadow:
    inset 0 0 0 2px rgba(176, 82, 241, 0.34),
    inset 0 18px 48px rgba(111, 28, 178, 0.24);
}

.quiz-question-card h3 {
  min-height: 130px;
  padding: 0 18px;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1.42;
  box-shadow: none;
}

.quiz-question-head {
  margin: -28px 0 18px;
}

.quiz-question-head span {
  color: #ffdc25;
  font-size: 22px;
  font-weight: 1000;
}

.quiz-question-head strong {
  width: 62px;
  height: 34px;
}

.quiz-choices {
  grid-template-columns: 1fr;
  gap: 13px;
}

.quiz-choice {
  grid-template-columns: 72px minmax(0, 1fr) 42px;
  min-height: 72px;
  border: 2px solid #7c2db7;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #7122a4 0%, #45116f 100%);
  color: #fff;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.16),
    0 5px 0 rgba(13, 4, 27, 0.45),
    0 8px 16px rgba(8, 2, 17, 0.26);
}

.quiz-choice span {
  width: 72px;
  height: 100%;
  border-radius: 0;
  background: rgba(150, 59, 207, 0.52);
  color: #ffd523;
  font-size: 38px;
  text-shadow:
    0 3px 0 #7e2b00,
    0 0 4px rgba(255, 255, 255, 0.45);
}

.quiz-choice strong {
  font-size: 18px;
}

.quiz-choice.correct::after {
  content: "✓";
  color: #8cff63;
  font-size: 44px;
  font-weight: 1000;
  text-shadow: 0 3px 0 #0e4c19;
}

.quiz-choice.wrong::after {
  content: "×";
  color: #ff6b7e;
  font-size: 44px;
  font-weight: 1000;
  text-shadow: 0 3px 0 #6a1020;
}

.quiz-choice.correct {
  border-color: #5ed95c;
  background: linear-gradient(180deg, #52b850 0%, #24812f 100%);
}

.quiz-choice.wrong {
  border-color: #ff6077;
  background: linear-gradient(180deg, #b52a4e 0%, #78142f 100%);
}

.quiz-choice.selected {
  border-color: #ffdc25;
  box-shadow:
    0 0 0 3px rgba(255, 220, 37, 0.82),
    0 5px 0 rgba(13, 4, 27, 0.45);
}

.quiz-hint {
  color: #d8c5ef;
  font-size: 13px;
}

.quiz-idle,
.quiz-countdown {
  gap: 12px;
  border-style: solid;
}

.quiz-idle strong,
.quiz-final h3 {
  color: #ffdc25;
  font-size: 34px;
  text-shadow: 0 3px 0 #55155f;
}

.quiz-idle span,
.quiz-countdown span,
.quiz-countdown em {
  color: #fff;
  font-size: 18px;
}

.quiz-countdown strong {
  color: #ffdc25;
  font-size: 112px;
  text-shadow:
    0 7px 0 #561465,
    0 12px 18px rgba(0, 0, 0, 0.42);
}

.quiz-scoreboard {
  grid-column: 2;
  grid-row: 2;
  padding: 22px 14px;
  border: 3px solid #5f1995;
  border-radius: 20px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.025) 75%, transparent 75%) 0 0 / 25px 25px,
    linear-gradient(180deg, #36105e 0%, #1a0629 100%);
  box-shadow: inset 0 0 0 2px rgba(176, 82, 241, 0.28);
}

.quiz-scoreboard > strong {
  text-align: center;
  color: #ffdc25;
  font-size: 20px;
}

.quiz-score-row {
  grid-template-columns: 26px 42px minmax(0, 1fr) 68px;
  min-height: 52px;
  border: 1px solid rgba(156, 71, 222, 0.46);
  border-radius: 12px;
  padding: 5px 9px;
  background: linear-gradient(180deg, rgba(88, 28, 130, 0.78), rgba(40, 11, 68, 0.9));
}

.quiz-score-row.self {
  border-color: #ffdc25;
  background: linear-gradient(180deg, rgba(103, 45, 150, 0.9), rgba(53, 14, 86, 0.94));
}

.quiz-score-avatar {
  width: 38px;
  height: 38px;
  border: 2px solid #ffdc25;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #dff6ff;
}

.quiz-rank {
  background: transparent;
  color: #ffdc25;
}

.quiz-score-row strong {
  display: grid;
  min-width: 62px;
  height: 31px;
  place-items: center;
  border: 2px solid #a247ea;
  border-radius: 16px;
  background: #421063;
  color: #fff;
}

.quiz-final-list {
  gap: 11px;
}

.quiz-final-row {
  grid-template-columns: 48px 48px minmax(0, 1fr) auto;
  min-height: 62px;
  border: 2px solid #7c2db7;
  border-radius: 14px;
  background: linear-gradient(180deg, #7122a4 0%, #45116f 100%);
  color: #fff;
}

.quiz-final-row.winner {
  border-color: #ffdc25;
  background: linear-gradient(180deg, #8a36bd 0%, #542184 100%);
}

.quiz-final-row span,
.quiz-final-row em {
  color: #ffdc25;
}

.tool-panel[data-panel="quiz-admin"] {
  width: 330px;
  min-width: 330px;
  border: 2px solid #d88b18;
  border-radius: 14px;
  background: linear-gradient(180deg, #40106e, #1b062a);
}

.tool-panel[data-panel="quiz-admin"] .tool-panel-head {
  background: linear-gradient(180deg, #6922a0, #3d0f62);
  color: #ffdc25;
}

.quiz-admin-panel {
  display: grid;
  gap: 12px;
  color: #fff;
}

.quiz-admin-status {
  border: 1px solid rgba(255, 220, 37, 0.32);
  border-radius: 10px;
  padding: 12px;
  background: rgba(31, 6, 49, 0.78);
}

.quiz-admin-status strong,
.quiz-admin-status span {
  display: block;
}

.quiz-admin-status strong {
  color: #ffdc25;
  font-weight: 1000;
}

.quiz-admin-status span {
  margin-top: 3px;
  color: #d8c5ef;
  font-size: 12px;
  font-weight: 800;
}

.quiz-admin-form {
  grid-template-columns: 1fr;
}

.quiz-admin-form input {
  border-color: #7c2db7;
  background: #210938;
  color: #fff;
}

.quiz-admin-form button,
.quiz-admin-reset {
  border: 0;
  border-radius: 9px;
  min-height: 38px;
  background: linear-gradient(180deg, #ffd736, #e58a16);
  color: #32104d;
  font-weight: 1000;
}

.quiz-admin-form #quizStopButton,
.quiz-admin-reset {
  background: linear-gradient(180deg, #7c2db7, #40106e);
  color: #fff;
}

.tool-panel[data-panel="quiz"] {
  width: min(980px, calc(100vw - 28px));
  min-width: 760px;
  height: min(620px, calc(100vh - 28px));
  min-height: 500px;
  overflow: visible;
}

.tool-panel[data-panel="quiz"] .tool-panel-body {
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.tool-panel[data-panel="quiz"] .panel-resize-handle {
  z-index: 8;
}

.quiz-panel {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  grid-template-rows: 100px minmax(0, 1fr);
  gap: 10px 14px;
  min-height: 0;
  height: 100%;
  padding: 14px 18px 16px;
  overflow: hidden;
}

.quiz-brandbar {
  min-height: 100px;
  cursor: move;
}

.quiz-logo {
  min-width: 320px;
  padding: 16px 34px 16px;
}

.quiz-logo span {
  font-size: clamp(36px, 4.8vw, 50px);
}

.quiz-exit-button {
  left: 98px;
  top: 15px;
  height: 42px;
}

.quiz-icon-row b {
  width: 48px;
  height: 48px;
}

.quiz-main {
  min-height: 0;
}

.quiz-titlebar {
  min-height: 44px;
  padding: 0 28px;
}

.quiz-titlebar strong,
.quiz-titlebar span {
  font-size: 18px;
}

.quiz-timer {
  grid-template-columns: 62px minmax(110px, 180px);
}

.quiz-question-card,
.quiz-idle,
.quiz-countdown,
.quiz-final {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 22px 24px 20px;
}

.quiz-question-card h3 {
  min-height: 92px;
  font-size: clamp(20px, 2.4vw, 27px);
}

.quiz-choices {
  gap: 10px;
}

.quiz-choice {
  min-height: 58px;
  grid-template-columns: 60px minmax(0, 1fr) 34px;
}

.quiz-choice span {
  width: 60px;
  font-size: 31px;
}

.quiz-scoreboard {
  min-height: 0;
  overflow: auto;
}

.quiz-score-row {
  grid-template-columns: 22px 34px minmax(0, 1fr) 54px;
  min-height: 44px;
}

.quiz-score-avatar {
  width: 32px;
  height: 32px;
}

.tool-panel[data-panel="quiz"] {
  height: min(760px, calc(100vh - 28px));
  min-height: 690px;
}

.quiz-panel {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  grid-template-rows: 100px minmax(0, 1fr);
}

.quiz-question-card,
.quiz-idle,
.quiz-countdown,
.quiz-final {
  overflow: hidden;
}

.quiz-question-card {
  grid-template-rows: auto auto minmax(0, auto) auto;
  align-content: start;
}

.quiz-question-card h3 {
  min-height: 105px;
}

.quiz-choice {
  min-height: 64px;
}

.quiz-side {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(210px, 0.9fr) minmax(230px, 1fr);
  gap: 12px;
  min-height: 0;
}

.quiz-side .quiz-scoreboard {
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  overflow: hidden;
}

.quiz-side .quiz-scoreboard > div {
  max-height: calc(100% - 34px);
  overflow: auto;
  scrollbar-width: none;
}

.quiz-side .quiz-scoreboard > div::-webkit-scrollbar,
.quiz-chat-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.quiz-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 46px;
  min-height: 0;
  padding: 13px 13px 12px;
  border: 3px solid #5f1995;
  border-radius: 20px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.025) 50%, rgba(255, 255, 255, 0.025) 75%, transparent 75%) 0 0 / 25px 25px,
    linear-gradient(180deg, #36105e 0%, #1a0629 100%);
  box-shadow: inset 0 0 0 2px rgba(176, 82, 241, 0.28);
}

.quiz-chat > strong {
  display: block;
  text-align: center;
  color: #ffdc25;
  font-size: 20px;
  font-weight: 1000;
}

.quiz-chat-messages {
  min-height: 0;
  margin: 10px 0;
  overflow: auto;
  border-radius: 11px;
  padding: 10px 11px;
  background: rgba(17, 4, 30, 0.72);
  color: #f2e8ff;
  scrollbar-width: none;
}

.quiz-chat-messages p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.32;
}

.quiz-chat-messages p:last-child {
  margin-bottom: 0;
}

.quiz-chat-messages strong {
  color: #ffffff;
}

.quiz-chat-empty {
  color: #a994c2;
  font-weight: 900;
}

.quiz-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.quiz-chat-form input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(124, 45, 183, 0.75);
  border-radius: 11px;
  padding: 0 13px;
  background: rgba(28, 7, 48, 0.78);
  color: #fff;
  outline: none;
  font-weight: 900;
}

.quiz-chat-form input::placeholder {
  color: #b69ccf;
}

.quiz-chat-form button {
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #c25cff, #7422aa);
  color: #fff;
  font-size: 20px;
  font-weight: 1000;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.22);
}

.area-placement-active {
  display: grid;
  gap: 7px;
  border: 2px solid #ffb32d;
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #fff7dc, #ffe7a3);
  color: #55320a;
  box-shadow: 0 8px 18px rgba(255, 155, 34, 0.22);
}

.area-placement-active strong {
  font-size: 13px;
}

.area-placement-active small {
  color: #7c4d0f;
  font-weight: 850;
  line-height: 1.35;
}

.area-door-builder {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.area-door-builder label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.area-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.area-door-builder input,
.area-door-builder select,
.area-portal-controls select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  background: #f9fbff;
}

.area-facing-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.area-facing-row.compact {
  gap: 5px;
}

.area-facing-row button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  padding: 4px 5px;
}

.area-facing-row button.selected {
  background: var(--accent);
  color: #fff;
}

.area-portal-list {
  display: grid;
  gap: 8px;
}

.area-portal-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.area-portal-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.area-portal-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.area-portal-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.area-portal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.area-portal-actions button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--ink);
  font-weight: 900;
}

.area-portal-actions button.selected {
  background: #2f7ed8;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.settings-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  height: 100%;
}

.settings-row {
  min-height: 58px;
  border-color: rgba(213, 219, 231, 0.95);
  border-radius: 15px;
  padding: 11px 12px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(31, 34, 46, 0.07);
}

.sound-toggle {
  position: relative;
  display: inline-grid;
  width: 54px;
  height: 30px;
  place-items: center;
  cursor: pointer;
}

.sound-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sound-toggle span {
  position: relative;
  display: block;
  width: 50px;
  height: 26px;
  border-radius: 999px;
  background: #d7ddea;
  box-shadow: inset 0 2px 5px rgba(24, 34, 47, 0.18);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.sound-toggle span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 34, 47, 0.22);
  transition: transform 0.18s ease;
}

.sound-toggle input:checked + span {
  background: linear-gradient(180deg, #389cff, #177ee8);
  box-shadow:
    inset 0 2px 5px rgba(30, 85, 140, 0.25),
    0 0 0 3px rgba(47, 140, 255, 0.12);
}

.sound-toggle input:checked + span::after {
  transform: translateX(24px);
}

.cinema-panel {
  display: grid;
  gap: 10px;
}

.cinema-panel .panel-form {
  grid-template-columns: 1fr auto;
}

.cinema-panel-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cinema-panel-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #554087;
  color: #fff;
  font-weight: 900;
}

.npc-panel {
  display: grid;
  gap: 10px;
}

.npc-card {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  cursor: grab;
}

.npc-card:active {
  cursor: grabbing;
}

.npc-card img {
  width: 44px;
  height: 58px;
  object-fit: contain;
}

.npc-card small,
.npc-row-head small,
.npc-message-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.npc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-weight: 850;
}

.npc-message-field,
.npc-placed-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.npc-message-field textarea,
.npc-placed-row textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: 800 12px system-ui;
}

.npc-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.npc-row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}

.announcement-admin-panel {
  display: grid;
  gap: 12px;
}

.announcement-admin-panel label {
  display: grid;
  gap: 6px;
  color: #151822;
  font-size: 0.82rem;
  font-weight: 950;
}

.announcement-admin-panel select,
.announcement-admin-panel textarea {
  width: 100%;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 10px;
  background: #fff;
  color: #151822;
  font: 850 0.86rem system-ui, sans-serif;
  box-shadow:
    inset 0 1px 2px rgba(31, 34, 46, 0.04),
    0 4px 10px rgba(31, 34, 46, 0.05);
}

.announcement-admin-panel select {
  min-height: 38px;
  padding: 0 10px;
}

.announcement-admin-panel textarea {
  min-height: 112px;
  resize: vertical;
  padding: 10px;
  line-height: 1.35;
}

.announcement-admin-status {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 11px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #f6f8fc);
}

.announcement-admin-status.active {
  border-color: rgba(47, 140, 255, 0.38);
  background: linear-gradient(180deg, #f1f8ff, #ffffff);
}

.announcement-admin-status strong {
  color: #151822;
  font-size: 0.88rem;
  font-weight: 1000;
}

.announcement-admin-status small {
  color: #667085;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.3;
}

.announcement-current-auto {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(168, 177, 198, 0.7);
  border-radius: 11px;
  padding: 10px 12px;
  background: rgba(248, 250, 255, 0.9);
}

.announcement-current-auto.active {
  border-style: solid;
  border-color: rgba(47, 140, 255, 0.32);
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.announcement-current-auto strong {
  color: #151822;
  font-size: 0.82rem;
  font-weight: 1000;
}

.announcement-current-auto span {
  color: #247ee8;
  font-size: 0.78rem;
  font-weight: 950;
}

.announcement-current-auto p {
  margin: 0;
  color: #303747;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.announcement-current-auto small {
  color: #667085;
  font-size: 0.7rem;
  font-weight: 800;
}

.announcement-auto-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
}

.announcement-auto-list::-webkit-scrollbar {
  display: none;
}

.announcement-auto-empty {
  color: #7b8293;
  font-size: 0.76rem;
  font-weight: 850;
}

.announcement-auto-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(180deg, #fff, #f7f9fd);
}

.announcement-auto-row.active {
  border-color: rgba(47, 140, 255, 0.34);
}

.announcement-auto-row strong,
.announcement-auto-row span {
  display: inline-flex;
  margin-right: 5px;
}

.announcement-auto-row p {
  margin-top: 3px;
  -webkit-line-clamp: 2;
}

.announcement-auto-row-actions {
  display: grid;
  gap: 5px;
}

.announcement-auto-row-actions button {
  min-height: 26px;
  border: 1px solid rgba(47, 140, 255, 0.32);
  border-radius: 8px;
  padding: 0 8px;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  color: #247ee8;
  font-size: 0.68rem;
  font-weight: 1000;
}

.announcement-auto-row-actions button.danger {
  border-color: rgba(224, 41, 53, 0.28);
  background: linear-gradient(180deg, #fff7f7, #ffe7e9);
  color: #e02935;
}

.announcement-admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.announcement-admin-actions button {
  min-height: 36px;
  border: 1px solid rgba(47, 140, 255, 0.45);
  border-radius: 10px;
  background: linear-gradient(180deg, #45a5ff, #247ee8);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow: 0 7px 14px rgba(47, 140, 255, 0.15);
}

.announcement-admin-actions button.subtle {
  grid-column: 1 / -1;
  border-color: rgba(211, 216, 227, 0.95);
  background: linear-gradient(180deg, #ffffff, #eef2f8);
  color: #151822;
  box-shadow: 0 5px 10px rgba(31, 34, 46, 0.08);
}

.announcement-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.announcement-color-row input {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.tool-panel[data-panel="membership"] {
  width: min(330px, calc(100vw - 28px));
}

.membership-panel {
  display: grid;
  gap: 12px;
}

.membership-status,
.membership-meta {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(211, 216, 227, 0.95);
  border-radius: 13px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff, #f6f8fc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.membership-status.active {
  border-color: rgba(46, 204, 113, 0.38);
  background: linear-gradient(180deg, #f2fff7, #ffffff);
}

.membership-status.closed {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(180deg, #fff4f4, #ffffff);
}

.membership-status strong,
.membership-meta strong {
  color: #151822;
  font-size: 0.94rem;
  font-weight: 1000;
}

.membership-status span,
.membership-meta span,
.membership-meta small {
  color: #667085;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.3;
}

.membership-panel button {
  min-height: 40px;
  border: 1px solid rgba(47, 140, 255, 0.45);
  border-radius: 12px;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 1000;
  box-shadow: 0 8px 16px rgba(31, 34, 46, 0.14);
}

.membership-panel button.success {
  background: linear-gradient(180deg, #4bd47f, #20a95b);
  border-color: rgba(32, 169, 91, 0.45);
}

.membership-panel button.danger {
  background: linear-gradient(180deg, #ff6565, #e02935);
  border-color: rgba(224, 41, 53, 0.45);
}

.npc-announcement {
  position: absolute;
  right: 10px;
  top: var(--announcement-top, 66px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  z-index: 15;
  pointer-events: none;
  max-width: 360px;
}

.npc-announcement-bubble {
  position: relative;
  width: max-content;
  max-width: 265px;
  max-height: 110px;
  min-height: 36px;
  padding: 10px 11px 10px 12px;
  border-radius: 5px;
  background: var(--announcement-bubble-color, #1f2228);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateX(24px) scaleX(0.78);
  transform-origin: right center;
  transition:
    opacity 0.24s ease 0.19s,
    transform 0.32s cubic-bezier(0.18, 1.06, 0.22, 1) 0.19s;
  pointer-events: auto;
  overflow: visible;
}

.npc-announcement-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 8px solid var(--announcement-bubble-color, #1f2228);
  transform: translateY(-50%);
}

.npc-announcement.show .npc-announcement-bubble {
  opacity: 1;
  transform: translateX(0) scaleX(1);
}

.npc-announcement.closing-bubble .npc-announcement-bubble {
  opacity: 0;
  transform: translateX(24px) scaleX(0.76);
  transition-delay: 0s;
}

.npc-announcement-bubble p {
  display: -webkit-box;
  margin: 0;
  max-height: 90px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
}

.npc-announcement-close {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: url("/assets/ui/red-close.png") center / contain no-repeat;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
}

.npc-announcement-avatar-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  width: 81px;
  transform: translateX(86px);
  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.33s cubic-bezier(0.18, 1.08, 0.2, 1);
  pointer-events: none;
}

.npc-announcement.show .npc-announcement-avatar-wrap {
  opacity: 1;
  transform: translateX(0);
}

.npc-announcement.closing-avatar .npc-announcement-avatar-wrap {
  opacity: 0;
  transform: translateX(86px);
}

.npc-announcement-avatar-shell {
  position: relative;
  display: grid;
  width: 75px;
  height: 75px;
  place-items: center;
}

@property --announcement-progress {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

.npc-announcement-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  --announcement-progress: 1;
  background:
    conic-gradient(var(--announcement-ring-color, #f2a328) calc(var(--announcement-progress) * 1turn), rgba(255, 255, 255, 0.22) 0turn);
  animation: announcement-ring-drain var(--announcement-duration, 30000ms) linear forwards;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28), 0 0 9px color-mix(in srgb, var(--announcement-ring-color, #f2a328) 55%, transparent);
}

.npc-announcement-avatar {
  position: relative;
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--announcement-bubble-color, #1f2228);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.24);
}

.npc-announcement-avatar img {
  width: 86%;
  height: 92%;
  object-fit: contain;
  object-position: center bottom;
  transform: scaleX(-1);
}

.npc-announcement-avatar.player-avatar img {
  height: 100%;
  transform: none;
}

.npc-announcement-name {
  min-width: 68px;
  max-width: 82px;
  height: 25px;
  margin-top: -4px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--announcement-bubble-color, #1f2228);
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  line-height: 19px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

@keyframes announcement-ring-drain {
  from {
    --announcement-progress: 1;
  }
  to {
    --announcement-progress: 0;
  }
}

.npc-card button,
.npc-row-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: #554087;
  color: #fff;
  font-weight: 850;
}

.npc-row-actions button[data-npc-remove] {
  background: #e45771;
}

.panel-row button,
.panel-form button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.panel-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.panel-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.chat-history-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.chat-history-search {
  display: block;
  width: 100%;
  margin: 0 0 10px;
}

.chat-history-search input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(205, 212, 225, 0.95);
  border-radius: 12px;
  padding: 0 13px;
  background: #fff;
  color: #15171b;
  font-weight: 850;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(45, 51, 66, 0.06);
}

.chat-history-search input:focus {
  border-color: rgba(47, 140, 255, 0.65);
  box-shadow:
    0 0 0 3px rgba(47, 140, 255, 0.13),
    inset 0 2px 5px rgba(45, 51, 66, 0.05);
}

.chat-history-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.chat-history-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chat-history-row {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 74%;
  border: 1px solid rgba(213, 219, 231, 0.95);
  border-radius: 14px;
  padding: 8px 10px;
  background: #fff;
  color: #15171b;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 5px 12px rgba(31, 34, 46, 0.07);
}

.chat-history-row.own {
  align-self: flex-end;
  text-align: right;
  border-color: rgba(173, 214, 255, 0.95);
  background: #eef7ff;
}

.chat-history-row strong {
  font-weight: 900;
}

.chat-history-row span {
  overflow-wrap: anywhere;
}

.chat-history-empty {
  border: 1px dashed rgba(198, 207, 222, 0.92);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 250, 253, 0.84);
  color: #7d8797;
  font-weight: 900;
  text-align: center;
}

.notice-card {
  max-width: 430px;
}

@media (max-width: 1220px) {
  .stage-wrap,
  #world,
  .game-topbar,
  .bottom-menu {
    width: 100%;
  }

  .stage-wrap,
  #world {
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .bottom-menu {
    grid-template-columns: 1fr minmax(260px, 360px) 1fr;
  }
}

@media (max-height: 820px) {
  :root {
    --game-viewport-gutter-y: 98px;
  }

  body {
    align-items: flex-start;
    padding-top: 82px;
    padding-bottom: 16px;
  }
}

@media (max-height: 930px) {
  :root {
    --game-shell-width: min(
      var(--game-base-width),
      calc(100vw - 20px),
      93vh
    );
  }
}

@media (max-width: 1700px) and (min-width: 761px) {
  :root {
    --game-shell-width: min(
      var(--game-base-width),
      calc(100vw - 20px),
      calc(100vw * 0.5235)
    );
  }
}

@media (max-width: 760px) {
  .bottom-menu {
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
    padding: 12px;
  }

  .menu-left,
  .menu-right {
    justify-content: center;
  }

  .chat-form,
  .chat-form input {
    width: min(360px, 100%);
  }

  .customize-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1220px) {
  .landing-auth {
    padding-inline: clamp(28px, 6vw, 86px);
  }

  .landing-shell {
    grid-template-columns: minmax(430px, 1fr) minmax(360px, 410px);
    gap: 32px;
  }

  .landing-logo {
    left: 50%;
    width: 260px;
  }

  .landing-characters {
    left: 50%;
    width: 440px;
    height: 445px;
  }

  .landing-character {
    height: 445px;
  }
}

@media (max-height: 860px) and (min-width: 981px) {
  .landing-auth {
    padding-top: 28px;
    padding-bottom: 42px;
  }

  .landing-shell {
    min-height: min(700px, calc(100vh - 86px));
  }

  .landing-showcase {
    min-height: 650px;
  }

  .landing-logo {
    top: -10px;
    width: 260px;
  }

  .landing-character {
    height: 445px;
  }

  .landing-promo {
    bottom: 12px;
  }

  .landing-card {
    padding: 34px 42px 31px;
  }

  .login-card h2 {
    font-size: 1.92rem;
  }

  .landing-subtitle {
    margin: 16px auto 22px;
  }

  .landing-register-button {
    min-height: 66px;
  }

  .landing-divider {
    margin: 24px 0 22px;
  }
}

@media (max-width: 980px) {
  .landing-auth {
    overflow: auto;
    padding: 26px 24px 36px;
  }

  .landing-shell {
    display: block;
    min-height: auto;
    max-width: 440px;
  }

  .landing-showcase {
    min-height: 128px;
  }

  .landing-logo {
    position: relative;
    left: 50%;
    top: 0;
    width: min(280px, 82vw);
    transform: translateX(-50%);
  }

  .landing-characters,
  .landing-promo,
  .landing-footer {
    display: none;
  }

  .landing-card {
    padding: 34px 26px 30px;
    border-radius: 24px;
  }

  .login-card h2 {
    font-size: 1.82rem;
  }

  .landing-subtitle {
    margin: 16px auto 22px;
  }

  .landing-register-button {
    min-height: 62px;
    font-size: 1.16rem;
  }

  .login-options,
  .landing-join {
    flex-wrap: wrap;
  }
}

.tool-panel[data-panel="quiz"] {
  height: min(790px, calc(100vh - 20px));
  min-height: 720px;
}

.quiz-panel {
  position: relative;
  grid-template-rows: 94px minmax(0, 1fr);
  padding: 12px 18px 14px;
}

.quiz-brandbar {
  min-height: 94px;
}

.quiz-exit-button {
  top: 14px;
  height: 40px;
  min-width: 104px;
}

.quiz-icon-row {
  gap: 10px;
}

.quiz-icon-row b,
.quiz-close-button {
  width: 46px;
  height: 46px;
  font-size: 22px;
}

.quiz-close-button {
  display: grid;
  place-items: center;
  border: 2px solid rgba(201, 97, 255, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 24%, #b653ff 0%, #6415a0 54%, #2d0649 100%);
  color: #fff;
  font-weight: 1000;
  box-shadow:
    inset 0 4px 4px rgba(255, 255, 255, 0.25),
    0 5px 0 rgba(12, 3, 23, 0.5);
  cursor: pointer;
}

.quiz-brandbar {
  cursor: default;
}

.quiz-titlebar {
  min-height: 38px;
  padding: 0 26px;
}

.quiz-question-card,
.quiz-idle,
.quiz-countdown,
.quiz-final {
  overflow: hidden;
}

.quiz-question-card {
  padding: 16px 24px 12px;
  gap: 8px;
  align-content: start;
}

.quiz-question-head {
  display: none;
}

.quiz-question-card h3 {
  min-height: 70px;
  padding: 0 10px;
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.25;
}

.quiz-choices {
  gap: 8px;
}

.quiz-choice {
  min-height: 56px;
  grid-template-columns: 56px minmax(0, 1fr) 30px;
}

.quiz-choice span {
  width: 56px;
  font-size: 28px;
}

.quiz-choice strong {
  font-size: 17px;
}

.quiz-hint {
  margin-top: 0;
}

.quiz-timer i {
  background:
    linear-gradient(90deg, #ffd31e 0 var(--quiz-time-progress, 100%), rgba(255, 211, 30, 0) var(--quiz-time-progress, 100%)),
    #180526;
}

.quiz-side {
  grid-template-rows: minmax(190px, 0.82fr) minmax(250px, 1fr);
}

.quiz-next-button {
  position: absolute;
  left: 50%;
  bottom: 20px;
  min-width: 240px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: linear-gradient(180deg, #f0f0f6, #85838f);
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(35, 22, 54, 0.45);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.35),
    0 5px 0 rgba(20, 6, 38, 0.46);
  transform: translateX(-50%);
  z-index: 3;
}

.quiz-score-row {
  transition:
    transform 280ms ease,
    background 280ms ease,
    border-color 280ms ease,
    box-shadow 280ms ease;
}

.quiz-choice-answers {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: none;
}

.quiz-choice.correct .quiz-choice-answers {
  color: rgba(237, 255, 229, 0.92);
}

.quiz-choice.wrong .quiz-choice-answers {
  color: rgba(255, 229, 234, 0.9);
}

.quiz-score-row:first-child {
  box-shadow:
    0 0 0 2px rgba(255, 220, 37, 0.52),
    0 0 18px rgba(255, 220, 37, 0.22);
}

.quiz-question-card.revealing {
  animation: quiz-card-reveal 420ms ease both;
}

.quiz-question-card.revealing .quiz-choice {
  animation: quiz-choice-reveal 420ms ease both;
  animation-delay: calc(var(--choice-index, 0) * 70ms);
}

.quiz-choice.correct {
  animation: quiz-correct-pulse 920ms ease-in-out infinite;
}

.quiz-choice.wrong.selected {
  animation: quiz-wrong-shake 420ms ease both;
}

@keyframes quiz-score-slide {
  from {
    opacity: 0.2;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes quiz-card-reveal {
  from {
    filter: brightness(0.86);
    transform: scale(0.992);
  }
  to {
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes quiz-choice-reveal {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes quiz-correct-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(105, 255, 90, 0.36),
      0 5px 0 rgba(13, 4, 27, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 220, 37, 0.72),
      0 0 24px rgba(105, 255, 90, 0.5),
      0 5px 0 rgba(13, 4, 27, 0.45);
  }
}

@keyframes quiz-wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.gartic-hud-button {
  position: absolute;
  left: 143px;
  top: 15px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: radial-gradient(circle at 30% 20%, #d36cff, #6a1ab5 58%, #2b084b);
  color: #fff;
  font-size: 23px;
  font-weight: 1000;
  box-shadow: 0 4px 0 rgba(35, 7, 63, 0.45), 0 0 0 2px rgba(255, 220, 37, 0.7);
  pointer-events: auto;
  cursor: pointer;
}

.gartic-hud-button.active {
  animation: communityHudGlow 1.7s ease-in-out infinite;
}

.gartic-hud-button:hover {
  transform: translateY(-2px) scale(1.04);
}

.gartic-hud-button.hidden {
  display: none;
}

.tool-panel[data-panel="gartic"] {
  width: min(1160px, calc(100vw - 24px));
  min-width: 900px;
  height: min(820px, calc(100vh - 22px));
  min-height: 700px;
  border: 3px solid #7d2dff;
  border-radius: 26px;
  background: linear-gradient(180deg, #2b0662, #12002f);
  overflow: visible;
}

.tool-panel[data-panel="gartic"] .tool-panel-head {
  display: none;
}

.tool-panel[data-panel="gartic"] .tool-panel-body {
  height: 100%;
  max-height: none;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, #3b0786, #150036);
}

.gartic-panel {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  padding: 14px;
  color: #fff;
}

.gartic-players,
.gartic-main,
.gartic-chat,
.gartic-turn {
  border: 2px solid rgba(132, 58, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(180deg, #4b10a0, #170043);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), 0 10px 26px rgba(10, 0, 31, 0.35);
}

.gartic-players {
  padding: 16px 10px;
  overflow: hidden;
}

.gartic-players h3 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 19px;
}

.gartic-player {
  display: grid;
  grid-template-columns: 24px 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 72px;
  border-bottom: 1px solid rgba(104, 67, 162, 0.24);
  padding: 8px 4px;
  color: #2e2540;
  background: rgba(255, 255, 255, 0.92);
}

.gartic-player:first-of-type {
  border-radius: 12px 12px 0 0;
}

.gartic-player.self {
  background: #efe4ff;
  color: #162dbf;
}

.gartic-player.drawing {
  box-shadow: inset 4px 0 0 #ffce19;
}

.gartic-player.guessed .gartic-player-mark {
  color: #1bc728;
}

.gartic-player-mark {
  min-width: 20px;
  color: #0b77ff;
  font-size: 22px;
  font-weight: 1000;
}

.gartic-player img {
  width: 54px;
  height: 54px;
  border: 2px solid #0829ff;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #dff6ff;
}

.gartic-player strong,
.gartic-player em {
  display: block;
}

.gartic-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.gartic-player em {
  color: #161146;
  font-size: 13px;
  font-style: normal;
}

.gartic-main {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 128px 240px;
  gap: 10px;
  padding: 0 10px 10px;
  min-width: 0;
}

.gartic-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px 0 16px;
  cursor: default;
}

.gartic-head strong {
  flex: 1;
  font-size: 20px;
  font-weight: 1000;
}

.gartic-head span {
  display: grid;
  min-width: 94px;
  height: 42px;
  place-items: center;
  border: 6px solid #ffbd13;
  border-radius: 24px;
  background: #17132a;
  font-size: 20px;
  font-weight: 1000;
}

.gartic-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #1d1440;
  color: #fff;
  font-size: 24px;
  font-weight: 1000;
}

.gartic-canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fffaf4;
}

#garticCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.gartic-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(24, 4, 62, 0.12);
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.gartic-overlay strong {
  font-size: 30px;
}

.gartic-overlay span {
  font-size: 17px;
  font-weight: 900;
}

.gartic-overlay.reveal {
  background: #ffffff;
  color: #070817;
  text-shadow: none;
}

.gartic-choice-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.gartic-choice-row button {
  min-width: 160px;
  min-height: 54px;
  border: 2px solid #087cff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f1f7ff);
  color: #087cff;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 6px 14px rgba(8, 124, 255, 0.14);
}

.gartic-tools {
  display: grid;
  grid-template-columns: repeat(3, 86px) 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 0;
  border-radius: 14px;
  padding: 10px;
  background: rgba(20, 0, 57, 0.78);
}

.gartic-tools.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.gartic-tools button {
  height: 48px;
  border: 2px solid #5c24c7;
  border-radius: 10px;
  background: #2d086d;
  color: #fff;
  font-weight: 1000;
}

.gartic-tools button.active {
  border-color: #ffdc25;
  box-shadow: 0 0 0 2px rgba(255, 220, 37, 0.28);
}

.gartic-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gartic-colors button {
  width: 34px;
  height: 34px;
  min-width: 0;
  border-radius: 7px;
  background: var(--color);
}

.gartic-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 12px;
  min-height: 0;
}

.gartic-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 56px;
  gap: 8px;
  padding: 12px;
  min-width: 0;
}

#garticMessages {
  overflow: auto;
  color: #fff;
  font-weight: 800;
}

#garticMessages p {
  margin: 0 0 7px;
}

#garticMessages .system {
  color: #25b7ff;
}

#garticMessages .system.correct {
  color: #24ff42;
}

#garticMessageForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 8px;
}

#garticMessageForm input {
  min-width: 0;
  border: 2px solid #7627dc;
  border-radius: 12px;
  padding: 0 16px;
  background: rgba(24, 4, 62, 0.75);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

#garticMessageForm button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #b354ff, #6b20c0);
  color: #fff;
  font-size: 28px;
  font-weight: 1000;
}

.gartic-turn {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
}

.gartic-turn strong {
  font-size: 18px;
}

.gartic-turn span {
  color: #ffdc25;
  font-size: 24px;
  font-weight: 1000;
}

.gartic-turn button {
  min-height: 42px;
  border: 2px solid rgba(255, 220, 37, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, #8a34df, #43107d);
  color: #fff;
  font-weight: 1000;
}

.gartic-empty {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.tool-panel[data-panel="gartic"] {
  width: min(1440px, calc(100vw - 8px));
  min-width: min(980px, calc(100vw - 8px));
  height: min(1080px, calc(100vh - 8px));
  min-height: min(760px, calc(100vh - 8px));
  border-radius: 30px;
  border-color: #8230ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(119, 51, 255, 0.42), rgba(119, 51, 255, 0) 30%),
    linear-gradient(180deg, #23045a 0%, #0a0126 100%);
  box-shadow:
    0 22px 52px rgba(10, 0, 38, 0.48),
    inset 0 0 0 3px rgba(17, 0, 47, 0.9);
}

.tool-panel[data-panel="gartic"] .tool-panel-body {
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% -5%, rgba(129, 52, 255, 0.56), rgba(129, 52, 255, 0) 28%),
    linear-gradient(180deg, #23045a 0%, #0c012a 100%);
}

.gartic-panel {
  grid-template-columns: minmax(245px, 310px) minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px 20px;
}

.gartic-players,
.gartic-main,
.gartic-chat,
.gartic-turn {
  border: 2px solid rgba(134, 59, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(120, 38, 255, 0.42), rgba(120, 38, 255, 0) 40%),
    linear-gradient(180deg, #41109b 0%, #13003a 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.05),
    inset 0 -12px 18px rgba(8, 0, 34, 0.38),
    0 14px 26px rgba(8, 0, 34, 0.35);
}

.gartic-players {
  padding: 22px 14px;
  background:
    linear-gradient(180deg, #5016bd 0 70px, #f7f3ff 70px 100%);
}

.gartic-players h3 {
  margin: 0 0 22px;
  color: #fff;
  font-size: 22px;
  letter-spacing: 0;
}

.gartic-player {
  grid-template-columns: 30px 72px minmax(0, 1fr) 28px;
  min-height: 108px;
  border-bottom: 2px solid #e2d5f5;
  padding: 10px 8px;
  background: #fbf7ff;
  color: #34303a;
}

.gartic-player.self,
.gartic-player.drawing {
  background: #eee4ff;
}

.gartic-player img {
  width: 68px;
  height: 68px;
  border-width: 3px;
}

.gartic-player strong {
  color: #39333d;
  font-size: 20px;
}

.gartic-player.self strong {
  color: #0b78ff;
}

.gartic-player em {
  color: #120d43;
  font-size: 15px;
  font-weight: 1000;
}

.gartic-player-mark {
  color: #0f74ff;
  font-size: 30px;
}

.gartic-player.guessed .gartic-player-mark {
  color: #20c723;
}

.gartic-main {
  grid-template-rows: 64px minmax(260px, 1fr) 154px minmax(190px, 285px);
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gartic-head {
  min-height: 64px;
  padding: 0 8px 0 24px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #5113bd, #2a0870);
}

.gartic-head strong {
  font-size: 25px;
  text-transform: uppercase;
}

.gartic-top-timer {
  min-width: 142px;
  height: 58px;
  border: 7px solid #ffbd13;
  border-left-width: 9px;
  border-radius: 32px;
  background: #19142c;
  font-size: 27px;
  box-shadow: -11px 0 0 rgba(255, 190, 19, 0.24);
}

.gartic-top-timer::before {
  content: "";
  width: 25px;
  height: 25px;
  margin-right: 7px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #19142c;
}

.gartic-close {
  width: 58px;
  height: 58px;
  background: #1d1640;
  font-size: 36px;
}

.gartic-canvas-wrap {
  border-radius: 0 0 12px 12px;
  background: #fffaf4;
}

.gartic-tools {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 72px 62px;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.gartic-tool-row,
.gartic-color-row {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 0;
  border-radius: 14px;
  padding: 8px 12px;
  background:
    linear-gradient(180deg, rgba(50, 10, 128, 0.98), rgba(24, 2, 76, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(116, 47, 226, 0.72),
    0 8px 15px rgba(7, 0, 34, 0.28);
}

.gartic-tools button {
  display: grid;
  width: 70px;
  height: 56px;
  place-items: center;
  border: 2px solid #6730c7;
  border-radius: 10px;
  background: linear-gradient(180deg, #381090, #1d065e);
  color: #fff;
  font-size: 20px;
  font-weight: 1000;
}

.gartic-tools button.active {
  border-color: #ffdc25;
  box-shadow:
    0 0 0 2px rgba(255, 220, 37, 0.45),
    inset 0 0 12px rgba(255, 220, 37, 0.18);
}

.gartic-size-dots {
  display: flex;
  gap: 8px;
  padding: 0 8px;
}

.gartic-size-dots button {
  width: 44px;
  height: 44px;
}

.gartic-size-dots i {
  display: block;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: #fff;
}

.gartic-color-row input[type="range"] {
  width: 130px;
  accent-color: #0a9bff;
}

.gartic-colors {
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 14px;
}

.gartic-colors button {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.gartic-chat,
.gartic-turn {
  border-radius: 18px;
  padding: 16px;
}

#garticMessages {
  font-size: 19px;
}

#garticMessages .system {
  color: #00a9ff;
  font-weight: 1000;
}

#garticMessageForm {
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 12px;
}

#garticMessageForm input {
  height: 56px;
  border-color: #8338ff;
  border-radius: 14px;
  font-size: 20px;
}

#garticMessageForm button {
  height: 56px;
  border-radius: 16px;
  font-size: 34px;
}

.gartic-turn {
  align-content: start;
  gap: 18px;
  padding: 22px 20px;
}

.gartic-turn > strong {
  text-align: left;
  font-size: 23px;
}

.gartic-turn-now {
  display: grid;
  grid-template-columns: 132px 82px;
  grid-template-areas:
    "timer avatar"
    "text text";
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
}

.gartic-turn-now b {
  grid-area: timer;
  display: grid;
  width: 122px;
  height: 122px;
  place-items: center;
  border: 10px solid #ffbf13;
  border-radius: 50%;
  background: #19142c;
  color: #fff;
  font-size: 27px;
  font-weight: 1000;
}

.gartic-turn-now img {
  grid-area: avatar;
  width: 82px;
  height: 82px;
  border: 3px solid #0b68ff;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #dff6ff;
}

.gartic-turn-now span {
  grid-area: text;
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
}

.gartic-turn-now em {
  color: #11a8ff;
  font-size: 26px;
  font-style: normal;
}

.gartic-turn button {
  min-height: 50px;
  border-color: #b957ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #c84fff, #6817bd);
  font-size: 18px;
}

@media (max-width: 980px), (max-height: 760px) {
  .gartic-panel {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .gartic-main {
    grid-template-rows: 52px minmax(210px, 1fr) 110px minmax(150px, 220px);
    gap: 8px;
  }

  .gartic-players {
    padding: 14px 10px;
  }

  .gartic-player {
    grid-template-columns: 22px 50px minmax(0, 1fr);
    min-height: 66px;
  }

  .gartic-player img {
    width: 48px;
    height: 48px;
  }

  .gartic-player strong {
    font-size: 14px;
  }

  .gartic-tool-row {
    gap: 8px;
  }

  .gartic-tools button {
    width: 48px;
    height: 42px;
    font-size: 15px;
  }

  .gartic-color-row {
    gap: 8px;
  }

  .gartic-size-dots button,
  .gartic-colors button {
    width: 30px;
    height: 30px;
  }

  .gartic-bottom {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .gartic-turn-now {
    grid-template-columns: 82px 58px;
  }

  .gartic-turn-now b {
    width: 78px;
    height: 78px;
    border-width: 7px;
    font-size: 18px;
  }

  .gartic-turn-now img {
    width: 56px;
    height: 56px;
  }
}

.tool-panel[data-panel="gartic"] {
  width: min(940px, calc(100vw - 16px));
  min-width: min(820px, calc(100vw - 16px));
  height: min(760px, calc(100vh - 16px));
  min-height: min(700px, calc(100vh - 16px));
  border-radius: 24px;
  overflow: hidden;
}

.tool-panel[data-panel="gartic"] .panel-resize-handle {
  display: none;
}

.tool-panel[data-panel="gartic"] .tool-panel-body {
  border-radius: 20px;
}

.gartic-panel {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px 16px;
  min-width: 0;
  overflow: hidden;
}

.gartic-players {
  padding: 14px 12px;
  min-width: 0;
}

.gartic-players h3 {
  margin-bottom: 16px;
  font-size: 20px;
}

.gartic-player {
  grid-template-columns: 24px 54px minmax(0, 1fr);
  min-height: 72px;
  padding: 8px 6px;
}

.gartic-player img {
  width: 52px;
  height: 52px;
}

.gartic-player strong {
  font-size: 16px;
}

.gartic-player em {
  font-size: 13px;
}

.gartic-main {
  grid-template-rows: 58px minmax(320px, 1fr) 104px 150px;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
}

.gartic-head {
  min-height: 58px;
  padding: 0 8px 0 18px;
  border-radius: 18px 18px 0 0;
  cursor: grab;
}

.gartic-head:active {
  cursor: grabbing;
}

.gartic-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
}

.gartic-top-timer {
  min-width: 104px;
  height: 46px;
  border-width: 5px;
  border-radius: 25px;
  font-size: 21px;
}

.gartic-top-timer::before {
  width: 20px;
  height: 20px;
}

.gartic-close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  font-size: 29px;
  cursor: pointer;
}

.gartic-tools {
  grid-template-rows: 48px 49px;
  gap: 7px;
}

.gartic-tool-row,
.gartic-color-row {
  gap: 8px;
  padding: 6px 8px;
  overflow: hidden;
}

.gartic-tools button {
  width: 48px;
  height: 38px;
  font-size: 15px;
}

.gartic-size-dots {
  gap: 5px;
  padding: 0;
}

.gartic-size-dots button {
  width: 34px;
  height: 34px;
}

.gartic-color-row input[type="range"] {
  width: 90px;
}

.gartic-colors {
  justify-content: flex-start;
  gap: 7px;
  overflow: hidden;
}

.gartic-colors button {
  width: 30px;
  height: 30px;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 10px;
}

.gartic-chat,
.gartic-turn {
  padding: 10px;
  border-radius: 15px;
}

#garticMessages {
  font-size: 14px;
}

#garticMessageForm {
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

#garticMessageForm input,
#garticMessageForm button {
  height: 40px;
}

#garticMessageForm input {
  font-size: 15px;
}

#garticMessageForm button {
  font-size: 27px;
}

.gartic-turn {
  gap: 8px;
}

.gartic-turn > strong {
  font-size: 17px;
}

.gartic-turn-now {
  grid-template-columns: 80px 58px;
  gap: 8px 12px;
}

.gartic-turn-now b {
  width: 68px;
  height: 68px;
  border-width: 7px;
  font-size: 17px;
}

.gartic-turn-now img {
  width: 52px;
  height: 52px;
}

.tool-panel[data-panel="gartic-admin"] {
  width: 300px;
  min-width: 300px;
  border: 2px solid #ffbd13;
  border-radius: 14px;
  background: linear-gradient(180deg, #40106e, #1b062a);
}

.tool-panel[data-panel="gartic-admin"] .tool-panel-head {
  background: linear-gradient(180deg, #6922a0, #3d0f62);
  color: #ffdc25;
}

.gartic-admin-panel {
  display: grid;
  gap: 12px;
  color: #fff;
}

.gartic-admin-status {
  border: 1px solid rgba(255, 220, 37, 0.34);
  border-radius: 10px;
  padding: 12px;
  background: rgba(31, 6, 49, 0.78);
}

.gartic-admin-status strong,
.gartic-admin-status span {
  display: block;
}

.gartic-admin-status strong {
  color: #ffdc25;
  font-weight: 1000;
}

.gartic-admin-status span {
  margin-top: 4px;
  color: #d8c5ef;
  font-size: 12px;
  font-weight: 800;
}

.gartic-admin-actions {
  display: grid;
  gap: 9px;
}

.gartic-admin-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffd736, #e58a16);
  color: #32104d;
  font-weight: 1000;
}

.gartic-admin-actions button:last-child {
  background: linear-gradient(180deg, #7c2db7, #40106e);
  color: #fff;
}

.gartic-admin-actions button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.gartic-turn-now span {
  font-size: 13px;
}

.gartic-turn-now em {
  font-size: 20px;
}

.gartic-turn button {
  min-height: 38px;
  font-size: 14px;
}

.gartic-overlay {
  padding: 0 16px;
}

.gartic-overlay strong {
  font-size: 24px;
}

.gartic-overlay span {
  max-width: 460px;
  font-size: 14px;
  white-space: normal;
}

.tool-panel[data-panel="gartic"] {
  width: min(846px, calc(100vw - 12px));
  min-width: min(780px, calc(100vw - 12px));
  height: min(540px, calc(100vh - 12px));
  min-height: min(520px, calc(100vh - 12px));
  border-radius: 22px;
}

.gartic-panel {
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px 12px;
}

.gartic-players {
  padding: 10px;
}

.gartic-players h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.gartic-player {
  grid-template-columns: 22px 50px minmax(0, 1fr);
  min-height: 64px;
  padding: 7px 5px;
}

.gartic-player img {
  width: 48px;
  height: 48px;
}

.gartic-player strong {
  font-size: 14px;
}

.gartic-player em {
  font-size: 12px;
}

.gartic-main {
  grid-template-rows: 46px minmax(172px, 1fr) 82px 132px;
  gap: 7px;
}

.gartic-head {
  min-height: 46px;
  padding: 0 7px 0 14px;
  border-radius: 16px 16px 0 0;
}

.gartic-head strong {
  font-size: 18px;
}

.gartic-top-timer {
  min-width: 92px;
  height: 38px;
  border-width: 4px;
  font-size: 17px;
}

.gartic-top-timer::before {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

.gartic-close {
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.gartic-tools {
  grid-template-rows: 40px 35px;
  gap: 6px;
}

.gartic-tool-row,
.gartic-color-row {
  gap: 6px;
  padding: 4px 6px;
  border-radius: 10px;
}

.gartic-tools button {
  width: 38px;
  height: 31px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.gartic-size-dots {
  gap: 4px;
  flex: 0 0 auto;
}

.gartic-size-dots button {
  width: 27px;
  height: 27px;
}

.gartic-color-row input[type="range"] {
  width: 74px;
}

.gartic-colors {
  gap: 5px;
  flex-wrap: nowrap;
}

.gartic-colors button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 206px;
  gap: 8px;
}

.gartic-chat,
.gartic-turn {
  padding: 8px;
  border-radius: 13px;
}

.gartic-chat {
  grid-template-rows: minmax(0, 1fr) 38px;
  gap: 6px;
}

#garticMessages {
  font-size: 12px;
}

#garticMessages p {
  margin-bottom: 4px;
}

#garticMessageForm {
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 7px;
}

#garticMessageForm input,
#garticMessageForm button {
  height: 36px;
}

#garticMessageForm input {
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
}

#garticMessageForm button {
  border-radius: 12px;
  font-size: 22px;
}

.gartic-turn {
  gap: 6px;
  overflow: hidden;
}

.gartic-turn > strong {
  font-size: 15px;
}

.gartic-turn-now {
  grid-template-columns: 66px 48px;
  gap: 6px 10px;
}

.gartic-turn-now b {
  width: 58px;
  height: 58px;
  border-width: 6px;
  font-size: 13px;
}

.gartic-turn-now img {
  width: 46px;
  height: 46px;
}

.gartic-turn-now span {
  font-size: 11px;
}

.gartic-turn-now em {
  font-size: 17px;
}

.gartic-turn button {
  min-height: 30px;
  border-radius: 9px;
  font-size: 12px;
}

.gartic-overlay strong {
  font-size: 21px;
}

.gartic-overlay span {
  max-width: 360px;
  font-size: 12px;
}

/* Gartic white visual theme */
.tool-panel[data-panel="gartic"] {
  width: min(1180px, calc(100vw - 18px));
  min-width: min(900px, calc(100vw - 18px));
  height: min(820px, calc(100vh - 18px));
  min-height: min(720px, calc(100vh - 18px));
  border: 0;
  border-radius: 17px;
  background: #f6f7f9;
  box-shadow: 0 12px 32px rgba(14, 20, 32, 0.18);
  overflow: hidden;
}

.tool-panel[data-panel="gartic"] .tool-panel-body {
  height: 100%;
  border-radius: 17px;
  background: #f4f5f7;
  color: #070817;
}

.gartic-panel {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  padding: 14px;
  color: #070817;
  overflow: hidden;
}

.gartic-players,
.gartic-main,
.gartic-chat,
.gartic-turn {
  border: 1px solid #d9dde4;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff, #f7f8fa);
  box-shadow:
    0 8px 20px rgba(13, 22, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.gartic-players {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.gartic-players h3 {
  display: grid;
  place-items: center;
  margin: 0;
  border-bottom: 1px solid #e2e5ea;
  background: #fbfcfe;
  color: #070817;
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0;
}

.gartic-players > div {
  padding: 10px 12px 14px;
  overflow: hidden;
}

.gartic-player {
  grid-template-columns: 24px 64px minmax(0, 1fr) 25px;
  gap: 8px;
  min-height: 90px;
  border: 0;
  border-bottom: 1px solid #e4e6eb;
  padding: 8px 5px;
  background: transparent;
  color: #070817;
}

.gartic-player:first-of-type {
  border-radius: 9px;
  background: linear-gradient(180deg, #f2f8ff, #e7f1fb);
  box-shadow: inset 0 0 0 1px #d4e5f6;
}

.gartic-player.self,
.gartic-player.drawing {
  background: linear-gradient(180deg, #f2f8ff, #e7f1fb);
}

.gartic-player img {
  width: 62px;
  height: 62px;
  border: 3px solid #087cff;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #dff6ff;
}

.gartic-player-mark {
  color: #0a7dff;
  font-size: 26px;
  font-weight: 1000;
}

.gartic-player.guessed .gartic-player-mark {
  color: #1ec71c;
}

.gartic-player strong {
  color: #070817;
  font-size: 17px;
  font-weight: 1000;
}

.gartic-player.self strong {
  color: #087cff;
}

.gartic-player em {
  color: #070817;
  font-size: 14px;
  font-weight: 1000;
}

.gartic-main {
  grid-template-rows: 52px minmax(350px, 1fr) 138px 245px;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gartic-head {
  min-height: 52px;
  padding: 0 8px 0 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #070817;
  cursor: grab;
}

.gartic-head:active {
  cursor: grabbing;
}

.gartic-head strong {
  color: #070817;
  font-size: 21px;
  font-weight: 1000;
  text-transform: uppercase;
}

.gartic-top-timer {
  min-width: 112px;
  height: 44px;
  border: 6px solid #ffb20d;
  border-radius: 27px;
  background: #ffffff;
  color: #070817;
  font-size: 22px;
  box-shadow: 0 3px 9px rgba(255, 178, 13, 0.28);
}

.gartic-top-timer::before {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: 3px solid #070817;
  box-shadow: inset 0 0 0 4px #fff;
}

.gartic-close {
  width: 38px;
  height: 38px;
  border: 1px solid #e1e4ea;
  border-radius: 50%;
  background: #ffffff;
  color: #070817;
  font-size: 31px;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(13, 22, 34, 0.12);
}

.gartic-canvas-wrap {
  border: 1px solid #dce0e6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow:
    inset 0 1px 2px rgba(13, 22, 34, 0.05),
    0 3px 12px rgba(13, 22, 34, 0.08);
}

#garticCanvas {
  background: #ffffff;
}

.gartic-tools {
  display: grid;
  grid-template-rows: 70px 58px;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.gartic-tools.disabled {
  opacity: 1;
  pointer-events: none;
}

.gartic-tool-row,
.gartic-color-row {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 0;
  border: 1px solid #e1e4ea;
  border-radius: 12px;
  padding: 8px 10px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 22, 34, 0.1);
  overflow: hidden;
}

.gartic-tools button {
  display: grid;
  width: 56px;
  height: 52px;
  place-items: center;
  border: 1px solid #dce0e6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f4f5f7);
  color: #10131c;
  font-size: 22px;
  font-weight: 1000;
  box-shadow: 0 3px 8px rgba(13, 22, 34, 0.1);
}

.gartic-tools button.active {
  border-color: #0a7dff;
  box-shadow:
    0 0 0 2px rgba(10, 125, 255, 0.18),
    0 4px 9px rgba(13, 22, 34, 0.12);
  color: #0a7dff;
}

.gartic-size-dots {
  display: flex;
  gap: 8px;
  padding: 0 4px;
}

.gartic-size-dots button {
  width: 38px;
  height: 38px;
}

.gartic-size-dots i {
  background: #1c1e24;
}

.gartic-color-row input[type="range"] {
  width: 120px;
  accent-color: #087cff;
}

.gartic-colors {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 12px;
}

.gartic-colors button {
  width: 36px;
  height: 36px;
  border: 1px solid #dce0e6;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(13, 22, 34, 0.14);
}

.gartic-colors button.active {
  border-color: #087cff;
  box-shadow: 0 0 0 3px rgba(8, 124, 255, 0.18);
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 10px;
  min-height: 0;
}

.gartic-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 54px;
  gap: 10px;
  padding: 14px 16px;
  min-width: 0;
}

#garticMessages {
  overflow: hidden;
  color: #080a18;
  font-size: 16px;
  font-weight: 800;
}

#garticMessages p {
  margin: 0 0 7px;
}

#garticMessages .system {
  color: #087cff;
  font-weight: 1000;
}

#garticMessages .system.correct {
  color: #12bc19;
}

#garticMessageForm {
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
}

#garticMessageForm input {
  height: 48px;
  min-width: 0;
  border: 1px solid #d9dde4;
  border-radius: 9px;
  padding: 0 14px;
  background: #ffffff;
  color: #070817;
  font-size: 15px;
  font-weight: 800;
}

#garticMessageForm input::placeholder {
  color: #8a8f9a;
}

#garticMessageForm button {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #087cff;
  font-size: 42px;
  line-height: 1;
  font-weight: 1000;
}

.gartic-turn {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 66px;
  align-content: stretch;
  gap: 10px;
  padding: 14px 18px;
  text-align: center;
}

.gartic-turn > strong {
  align-self: center;
  text-align: left;
  color: #070817;
  font-size: 18px;
  font-weight: 1000;
}

.gartic-turn-now {
  display: grid;
  grid-template-columns: 125px 72px;
  grid-template-areas:
    "timer avatar"
    "text text";
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
}

.gartic-turn-now b {
  grid-area: timer;
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border: 9px solid #f4a900;
  border-radius: 50%;
  background: #ffffff;
  color: #070817;
  font-size: 22px;
  font-weight: 1000;
}

.gartic-turn-now img {
  grid-area: avatar;
  width: 70px;
  height: 70px;
  border: 3px solid #087cff;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
  background: #dff6ff;
}

.gartic-turn-now span {
  grid-area: text;
  color: #070817;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.15;
}

.gartic-turn-now em {
  color: #087cff;
  font-size: 25px;
  font-style: normal;
  font-weight: 1000;
}

.gartic-next-drawer {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border: 1px solid #d9dde4;
  border-radius: 10px;
  background: #ffffff;
  color: #070817;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.gartic-next-drawer span {
  display: grid;
  place-items: center;
  color: #087cff;
  font-size: 30px;
  font-weight: 1000;
}

.gartic-next-drawer p {
  margin: 0;
  text-align: left;
  font-size: 15px;
  font-weight: 900;
}

.gartic-next-drawer strong {
  color: #087cff;
  font-size: 22px;
}

.gartic-overlay {
  background: rgba(255, 255, 255, 0.72);
  color: #070817;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.65);
}

.gartic-overlay strong {
  color: #070817;
  font-size: 28px;
}

.gartic-overlay span {
  color: #4d5563;
  font-size: 15px;
}

@media (max-width: 1050px), (max-height: 820px) {
  .gartic-panel {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .gartic-main {
    grid-template-rows: 46px minmax(280px, 1fr) 104px 190px;
    gap: 8px;
  }

  .gartic-player {
    grid-template-columns: 20px 50px minmax(0, 1fr);
    min-height: 70px;
  }

  .gartic-player img {
    width: 48px;
    height: 48px;
  }

  .gartic-tool-row,
  .gartic-color-row {
    gap: 7px;
  }

  .gartic-tools button {
    width: 42px;
    height: 38px;
    font-size: 18px;
  }

  .gartic-colors {
    gap: 6px;
  }

  .gartic-colors button {
    width: 27px;
    height: 27px;
  }

  .gartic-bottom {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .gartic-turn-now {
    grid-template-columns: 78px 52px;
    gap: 7px 10px;
  }

  .gartic-turn-now b {
    width: 66px;
    height: 66px;
    border-width: 7px;
    font-size: 14px;
  }

  .gartic-turn-now img {
    width: 50px;
    height: 50px;
  }

  .gartic-turn-now em {
    font-size: 18px;
  }

  .gartic-next-drawer strong {
    font-size: 17px;
  }
}

/* Gartic fit and swatch correction */
.tool-panel[data-panel="gartic"] {
  width: min(1180px, calc(100vw - 24px));
  min-width: min(900px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 28px));
  min-height: 0;
}

.gartic-panel {
  padding: 10px 12px 12px;
}

.gartic-main {
  grid-template-rows: 46px minmax(260px, 1fr) 100px 150px;
  gap: 8px;
}

.gartic-head {
  min-height: 46px;
}

.gartic-canvas-wrap {
  min-height: 0;
}

.gartic-tools {
  grid-template-rows: 48px 44px;
  gap: 8px;
}

.gartic-tool-row,
.gartic-color-row {
  gap: 8px;
  padding: 5px 8px;
}

.gartic-tools button {
  width: 42px;
  height: 38px;
  flex: 0 0 42px;
  font-size: 18px;
}

.gartic-size-dots {
  gap: 5px;
  flex: 0 0 auto;
}

.gartic-size-dots button {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.gartic-size-dots i {
  width: var(--dot);
  height: var(--dot);
}

.gartic-color-row input[type="range"] {
  width: 96px;
  flex: 0 0 96px;
}

.gartic-colors {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.gartic-tools .gartic-colors button {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  min-width: 25px;
  border-radius: 5px;
  background: var(--color) !important;
  color: transparent;
  font-size: 0;
}

.gartic-tools .gartic-colors button[data-gartic-color="#ffffff"] {
  box-shadow:
    inset 0 0 0 1px #cfd5df,
    0 3px 8px rgba(13, 22, 34, 0.14);
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 8px;
}

.gartic-chat {
  grid-template-rows: minmax(0, 1fr) 42px;
  gap: 7px;
  padding: 10px 12px;
}

#garticMessages {
  font-size: 14px;
}

#garticMessageForm {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

#garticMessageForm input,
#garticMessageForm button {
  height: 40px;
}

#garticMessageForm button {
  font-size: 34px;
}

.gartic-turn {
  grid-template-rows: 26px minmax(0, 1fr) 52px;
  gap: 6px;
  padding: 10px 12px;
}

.gartic-turn > strong {
  font-size: 16px;
}

.gartic-turn-now {
  grid-template-columns: 82px 54px;
  gap: 6px 10px;
}

.gartic-turn-now b {
  width: 70px;
  height: 70px;
  border-width: 7px;
  font-size: 15px;
}

.gartic-turn-now img {
  width: 52px;
  height: 52px;
}

.gartic-turn-now span {
  font-size: 12px;
}

.gartic-turn-now em {
  font-size: 18px;
}

.gartic-next-drawer {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  min-height: 48px;
}

.gartic-next-drawer span {
  font-size: 24px;
}

.gartic-next-drawer p {
  font-size: 12px;
}

.gartic-next-drawer strong {
  font-size: 16px;
}

/* Gartic hard viewport fit */
.tool-panel[data-panel="gartic"] {
  width: min(1040px, calc(100vw - 48px));
  min-width: min(900px, calc(100vw - 48px));
  height: min(680px, calc(100vh - 72px));
  max-height: calc(100vh - 72px);
  min-height: 0;
}

.tool-panel[data-panel="gartic"] .tool-panel-body,
.gartic-panel {
  min-height: 0;
}

.gartic-panel {
  grid-template-columns: 260px minmax(0, 1fr);
  padding: 8px 10px 10px;
}

.gartic-players {
  grid-template-rows: 58px minmax(0, 1fr);
}

.gartic-players > div {
  padding: 9px 11px;
}

.gartic-main {
  grid-template-rows: 40px minmax(230px, 1fr) 88px 122px;
  gap: 7px;
}

.gartic-head {
  min-height: 40px;
  padding-left: 20px;
}

.gartic-head strong {
  font-size: 18px;
}

.gartic-close {
  width: 34px;
  height: 34px;
  font-size: 27px;
}

.gartic-tools {
  grid-template-rows: 42px 39px;
  gap: 6px;
}

.gartic-tool-row,
.gartic-color-row {
  gap: 6px;
  padding: 4px 7px;
}

.gartic-tools button {
  width: 37px;
  height: 33px;
  flex-basis: 37px;
  font-size: 16px;
}

.gartic-size-dots button {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
}

.gartic-color-row input[type="range"] {
  width: 82px;
  flex-basis: 82px;
}

.gartic-tools .gartic-colors button {
  width: 23px;
  height: 23px;
  min-width: 23px;
  flex-basis: 23px;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 226px;
}

.gartic-chat {
  grid-template-rows: minmax(0, 1fr) 36px;
  padding: 8px 10px;
}

#garticMessages {
  font-size: 13px;
}

#garticMessageForm input,
#garticMessageForm button {
  height: 34px;
}

.gartic-turn {
  grid-template-rows: 22px minmax(0, 1fr) 44px;
  padding: 8px 10px;
}

.gartic-turn-now b {
  width: 58px;
  height: 58px;
  border-width: 6px;
  font-size: 13px;
}

.gartic-turn-now img {
  width: 44px;
  height: 44px;
}

.gartic-turn-now {
  grid-template-columns: 66px 46px;
}

.gartic-next-drawer {
  min-height: 42px;
}

/* Gartic drawer-only side tools */
.gartic-players {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
}

.gartic-players.has-draw-tools,
.gartic-players:has(.gartic-draw-tools) {
  grid-template-columns: minmax(0, 1fr) 92px;
  grid-template-rows: 58px minmax(0, 1fr);
}

.gartic-players h3 {
  grid-column: 1 / -1;
}

.gartic-player-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.gartic-player-list::-webkit-scrollbar,
#garticMessages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.gartic-draw-tools {
  display: grid;
  grid-template-rows: auto auto 44px minmax(88px, 1fr);
  gap: 8px;
  min-height: 0;
  padding: 8px 8px 10px;
  border-left: 2px solid #0a7dff;
  background: linear-gradient(180deg, #0b7dff, #053fba);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.24);
}

.gartic-draw-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.gartic-draw-tool-grid button,
.gartic-draw-colors button,
.gartic-palette-row input {
  border: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.gartic-draw-tool-grid button {
  display: grid;
  height: 33px;
  place-items: center;
  background: rgba(0, 45, 145, 0.5);
  color: #d8ecff;
  font-size: 20px;
  font-weight: 1000;
}

.gartic-draw-tool-grid button.active {
  background: #ffd21d;
  color: #072768;
  box-shadow: 0 0 0 2px #fff;
}

.gartic-draw-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gartic-draw-colors button {
  width: 100%;
  aspect-ratio: 1;
  background: var(--color);
}

.gartic-draw-colors button.active {
  outline: 3px solid #ffd21d;
  outline-offset: 1px;
}

.gartic-palette-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.gartic-palette-row input {
  width: 100%;
  height: 38px;
  padding: 0;
  overflow: hidden;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  cursor: pointer;
}

.gartic-size-control {
  display: grid;
  place-items: center;
}

.gartic-size-control input[type="range"] {
  width: 120px;
  transform: rotate(-90deg);
  accent-color: #ffffff;
}

.gartic-main {
  grid-template-rows: 40px minmax(320px, 1fr) 132px;
}

.gartic-tools {
  display: none;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 226px;
  min-height: 0;
}

#garticMessages {
  overflow-y: auto;
  scrollbar-width: none;
}

.gartic-turn-now b {
  background:
    radial-gradient(circle, #fff 58%, transparent 59%),
    conic-gradient(#f4a900 0 var(--gartic-time-progress, 0%), #e8ecf2 var(--gartic-time-progress, 0%) 100%);
  border: 0;
}

.gartic-turn-now b span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
}

/* Gartic fixed chat flow */
.gartic-main,
.gartic-bottom,
.gartic-chat {
  min-height: 0;
}

.gartic-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 38px;
  overflow: hidden;
}

#garticMessages {
  display: flex;
  min-height: 0;
  max-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

#garticMessages p {
  flex: 0 0 auto;
}

#garticMessageForm {
  align-self: end;
}

/* Gartic taller layout */
.tool-panel[data-panel="gartic"] {
  height: min(820px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
}

.gartic-main {
  grid-template-rows: minmax(470px, 1fr) 272px;
  gap: 8px;
}

.gartic-head {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  width: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.gartic-head strong {
  display: none;
}

.gartic-top-timer,
.gartic-close {
  pointer-events: auto;
}

.gartic-canvas-wrap {
  min-height: 0;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 226px;
  gap: 8px;
}

.gartic-chat {
  grid-template-rows: minmax(0, 1fr) 42px;
  padding: 10px 12px;
}

.gartic-turn {
  grid-template-rows: 32px minmax(0, 1fr) 58px;
  padding: 10px 12px;
}

.gartic-turn-now b {
  width: 78px;
  height: 78px;
}

.gartic-turn-now b span {
  width: 58px;
  height: 58px;
}

.gartic-turn-now img {
  width: 54px;
  height: 54px;
}

.gartic-turn-now {
  grid-template-columns: 88px 58px;
}

.gartic-next-drawer {
  min-height: 54px;
}

/* Gartic drag handle and white admin */
.gartic-panel {
  position: relative;
}

.gartic-drag-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 78px;
  height: 42px;
  z-index: 2;
  cursor: grab;
}

.gartic-drag-zone:active {
  cursor: grabbing;
}

.tool-panel[data-panel="gartic-admin"] {
  width: 300px;
  min-width: 300px;
  border: 1px solid #d9dde4;
  border-radius: 15px;
  background: #f6f7f9;
  box-shadow: 0 12px 32px rgba(14, 20, 32, 0.16);
}

.tool-panel[data-panel="gartic-admin"] .tool-panel-head {
  border-bottom: 1px solid #e2e5ea;
  background: #ffffff;
  color: #070817;
}

.tool-panel[data-panel="gartic-admin"] .tool-panel-body {
  background: #f6f7f9;
}

.gartic-admin-panel {
  color: #070817;
}

.gartic-admin-status {
  border: 1px solid #d9dde4;
  background: #ffffff;
}

.gartic-admin-status strong {
  color: #087cff;
}

.gartic-admin-status span {
  color: #4d5563;
}

.gartic-admin-actions button {
  background: linear-gradient(180deg, #138cff, #0872db);
  color: #ffffff;
}

.gartic-admin-actions button:last-child {
  background: linear-gradient(180deg, #ffffff, #f0f2f5);
  color: #070817;
  border: 1px solid #d9dde4;
}

.gartic-final-list {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.gartic-final-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9dde4;
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #070817;
  text-align: left;
  text-shadow: none;
}

.gartic-final-row strong,
.gartic-final-row em {
  color: #087cff;
  font-style: normal;
  font-weight: 1000;
}

/* Gartic final fit polish */
.tool-panel[data-panel="gartic"] {
  height: min(860px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
}

.gartic-panel {
  gap: 10px;
}

.gartic-main {
  grid-template-rows: minmax(340px, 1fr) clamp(224px, 33vh, 284px);
  gap: 8px;
}

.gartic-canvas-wrap,
#garticCanvas {
  background: #ffffff;
}

.gartic-head {
  top: 12px;
  right: 14px;
}

.gartic-top-timer {
  display: none !important;
}

.gartic-drag-zone {
  right: 64px;
  height: 56px;
}

.gartic-bottom {
  grid-template-columns: minmax(0, 1fr) 230px;
}

.gartic-turn {
  grid-template-rows: minmax(0, 1fr) 58px;
  padding: 10px 12px;
}

.gartic-turn > strong {
  display: none !important;
}

.gartic-turn-now {
  grid-template-columns: 82px 52px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 8px;
}

.gartic-turn-now b {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(#f4a900 0 var(--gartic-time-progress, 0%), #e8ecf2 var(--gartic-time-progress, 0%) 100%);
  padding: 6px;
}

.gartic-turn-now b span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
}

.gartic-turn-now img {
  width: 50px;
  height: 50px;
}

.gartic-turn-now span {
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.gartic-turn-now em {
  display: block;
  overflow: hidden;
  color: #087cff;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gartic-next-drawer {
  min-height: 56px;
}

.gartic-players.has-draw-tools,
.gartic-players:has(.gartic-draw-tools) {
  grid-template-columns: minmax(0, 1fr) 84px;
}

.gartic-draw-tools {
  grid-template-rows: auto auto 34px minmax(82px, 1fr);
  gap: 6px;
  padding: 6px;
  border-left: 1px solid #d9dde4;
  background: #ffffff;
  box-shadow: none;
}

.gartic-draw-tool-grid {
  gap: 5px;
}

.gartic-draw-tool-grid button {
  height: 28px;
  border: 1px solid #d9dde4;
  background: #ffffff;
  color: #087cff;
  font-size: 16px;
  box-shadow: none;
}

.gartic-draw-tool-grid button.active {
  background: #087cff;
  color: #ffffff;
  box-shadow: none;
}

.gartic-draw-colors {
  gap: 5px;
  align-content: start;
}

.gartic-draw-colors button,
.gartic-palette-row input {
  border: 1px solid #cfd5df;
  box-shadow: none;
}

.gartic-draw-colors button.active {
  outline: 2px solid #087cff;
  outline-offset: 1px;
}

.gartic-palette-row input {
  height: 30px;
}

.gartic-size-control input[type="range"] {
  width: 104px;
  accent-color: #087cff;
}

/* Gartic timer ring readability */
.gartic-turn-now {
  grid-template-columns: 116px 52px;
  grid-template-rows: 116px auto;
  justify-content: center;
  align-content: center;
  gap: 8px 10px;
}

.gartic-turn-now b {
  width: 108px;
  height: 108px;
  padding: 6px;
  background: conic-gradient(#f4a900 0 var(--gartic-time-progress, 0%), #e3e8ef var(--gartic-time-progress, 0%) 100%);
}

.gartic-turn-now b span {
  width: 100%;
  height: 100%;
  color: #070817;
  font-size: 21px;
  font-weight: 1000;
}

.gartic-turn-now img {
  align-self: center;
  width: 50px;
  height: 50px;
}

.gartic-turn-now > span {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
}

/* Gartic timer must look like a large clean clock badge */
.gartic-turn .gartic-turn-now {
  grid-template-columns: 132px !important;
  grid-template-rows: 132px 54px !important;
  justify-items: center !important;
  align-content: center !important;
  gap: 8px !important;
}

.gartic-turn .gartic-turn-now b[data-gartic-time-ring] {
  display: grid !important;
  width: 122px !important;
  height: 122px !important;
  box-sizing: border-box !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  padding: 8px !important;
  background: conic-gradient(#f2a900 0 var(--gartic-time-progress, 100%), #e4e9f0 var(--gartic-time-progress, 100%) 100%) !important;
  box-shadow:
    0 3px 8px rgba(21, 24, 32, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9) !important;
}

.gartic-turn .gartic-turn-now b[data-gartic-time-ring] span[data-gartic-time] {
  display: grid !important;
  width: 100% !important;
  height: 100% !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #05070c !important;
  font-size: 27px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: none !important;
}

.gartic-turn .gartic-turn-now img {
  display: none !important;
}

.gartic-turn .gartic-turn-now > span {
  grid-column: 1 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  text-align: center !important;
}

/* Gartic timer geometry lock: centered inner disc and centered text */
.gartic-turn .gartic-turn-now b[data-gartic-time-ring] {
  position: relative !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.gartic-turn .gartic-turn-now b[data-gartic-time-ring]::before {
  content: "" !important;
  position: absolute !important;
  inset: 8px !important;
  z-index: 0 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
}

.gartic-turn .gartic-turn-now b[data-gartic-time-ring] span[data-gartic-time] {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
}

/* Gartic drawer tools need more room inside the left column */
.gartic-panel {
  grid-template-columns: 323px minmax(0, 1fr) !important;
}

.gartic-players.has-draw-tools,
.gartic-players:has(.gartic-draw-tools) {
  grid-template-columns: minmax(0, 1fr) 104px !important;
}

.gartic-draw-tool-grid button {
  min-width: 0 !important;
}

/* Gartic drawer tools compact fit */
.gartic-draw-tools {
  grid-template-rows: auto auto 24px minmax(66px, 1fr) !important;
  gap: 6px !important;
  padding: 4px !important;
}

.gartic-draw-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 3px !important;
  row-gap: 6px !important;
}

.gartic-draw-tool-grid button {
  height: 22px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.gartic-draw-colors {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 3px !important;
  row-gap: 6px !important;
}

.gartic-draw-colors button {
  min-width: 0 !important;
  border-radius: 4px !important;
}

.gartic-palette-row input {
  height: 30px !important;
  width: 30px !important;
  justify-self: center !important;
  border-radius: 50% !important;
  border: 3px solid transparent !important;
  padding: 0 !important;
  overflow: hidden !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(red, #ffcf00, #00df3f, #00d7ff, #174cff, #b000ff, #ff1493, red) border-box !important;
  box-shadow: 0 2px 5px rgba(13, 23, 41, 0.18) !important;
}

.gartic-size-control input[type="range"] {
  width: 88px !important;
}

.gartic-palette-row input::-webkit-color-swatch-wrapper {
  padding: 0 !important;
}

.gartic-palette-row input::-webkit-color-swatch {
  border: 0 !important;
  border-radius: 50% !important;
}

/* Gartic drag/close controls stay on the frame, never over the drawing canvas */
.gartic-drag-zone {
  top: 0 !important;
  left: 0 !important;
  right: 48px !important;
  height: 25px !important;
  z-index: 4 !important;
}

.gartic-head {
  top: 5px !important;
  right: 8px !important;
  z-index: 5 !important;
}

.gartic-close {
  width: 30px !important;
  height: 30px !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

.gartic-word-badge {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 6;
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 74px;
  align-items: center;
  gap: 12px;
  max-width: min(440px, calc(100% - 96px));
  min-height: 44px;
  padding: 4px 5px 4px 18px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  background: #087cff;
  color: #ffffff;
  opacity: 0.4;
  transform: translateX(-50%);
  transition: opacity 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 18px rgba(9, 20, 54, 0.22);
}

.gartic-word-badge:hover,
.gartic-word-badge:focus-within {
  opacity: 1;
}

.gartic-word-badge strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: 6px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gartic-word-badge button {
  height: 36px;
  border: 2px solid #ffffff;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
}

.gartic-word-badge button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Gartic drawer toolbar: two-column vertical tool strip like the reference */
.gartic-players.has-draw-tools,
.gartic-players:has(.gartic-draw-tools) {
  grid-template-columns: minmax(0, 1fr) 104px !important;
}

.gartic-draw-tools {
  display: grid !important;
  grid-template-rows: auto auto auto minmax(154px, 1fr) !important;
  align-content: start !important;
  gap: 10px !important;
  padding: 20px 10px 14px !important;
  border-left: 1px solid #d9dde4 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.gartic-draw-tool-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 34px) !important;
  justify-content: center !important;
  column-gap: 12px !important;
  row-gap: 0 !important;
}

.gartic-draw-tool-grid button {
  position: relative !important;
  display: grid !important;
  width: 34px !important;
  height: 42px !important;
  min-width: 0 !important;
  place-items: center !important;
  border: 0 !important;
  border-bottom: 1px solid #9ba8b8 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #087cff !important;
  font-size: 26px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.gartic-draw-tool-grid button.active {
  border: 2px solid #ffd51e !important;
  border-radius: 4px !important;
  background: rgba(8, 124, 255, 0.08) !important;
  color: #087cff !important;
  box-shadow: none !important;
}

.gartic-draw-colors {
  display: grid !important;
  grid-template-columns: repeat(3, 25px) !important;
  justify-content: center !important;
  column-gap: 5px !important;
  row-gap: 5px !important;
}

.gartic-draw-colors button {
  width: 25px !important;
  height: 25px !important;
  min-width: 0 !important;
  border: 2px solid #102238 !important;
  border-radius: 3px !important;
  box-shadow: none !important;
}

.gartic-draw-colors button.active {
  outline: 2px solid #ffd51e !important;
  outline-offset: 1px !important;
}

.gartic-palette-row {
  display: grid !important;
  justify-items: center !important;
  padding: 6px 0 4px !important;
}

.gartic-palette-row input {
  width: 34px !important;
  height: 34px !important;
  justify-self: center !important;
  border-radius: 50% !important;
  border: 4px solid transparent !important;
  padding: 0 !important;
  overflow: hidden !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(red, #ffcf00, #00df3f, #00d7ff, #174cff, #b000ff, #ff1493, red) border-box !important;
  box-shadow: 0 2px 5px rgba(13, 23, 41, 0.18) !important;
}

.gartic-size-control {
  position: relative !important;
  display: grid !important;
  min-height: 158px !important;
  justify-items: center !important;
  align-items: center !important;
  padding-top: 20px !important;
  border-top: 1px solid #9ba8b8 !important;
}

.gartic-size-control::before,
.gartic-size-control::after {
  content: "" !important;
  display: block !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #173d86 !important;
}

.gartic-size-control::before {
  position: absolute !important;
  top: 22px !important;
}

.gartic-size-control::after {
  position: absolute !important;
  bottom: 10px !important;
}

.gartic-size-control input[type="range"] {
  width: 118px !important;
  height: 22px !important;
  margin: 48px 0 22px !important;
  accent-color: #087cff !important;
  transform: rotate(-90deg) !important;
}

/* Gartic drawer toolbar hard-fit inside the 104px column */
.gartic-players.has-draw-tools,
.gartic-players:has(.gartic-draw-tools) {
  grid-template-columns: minmax(0, 1fr) 104px !important;
}

.gartic-draw-tools {
  box-sizing: border-box !important;
  width: 104px !important;
  max-width: 104px !important;
  overflow: hidden !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.gartic-draw-tool-grid {
  grid-template-columns: repeat(2, 32px) !important;
  column-gap: 9px !important;
}

.gartic-draw-tool-grid button {
  width: 32px !important;
  height: 40px !important;
  font-size: 24px !important;
}

.gartic-draw-colors {
  grid-template-columns: repeat(3, 24px) !important;
  column-gap: 5px !important;
}

.gartic-draw-colors button {
  width: 24px !important;
  height: 24px !important;
}

.gartic-size-control input[type="range"] {
  width: 96px !important;
}

.gartic-eyedropper-loupe {
  position: absolute;
  z-index: 8;
  display: none;
  width: 96px;
  height: 96px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 0 3px #087cff,
    0 12px 28px rgba(8, 18, 42, 0.28);
  image-rendering: pixelated;
  pointer-events: none;
}

.gartic-eyedropper-loupe.show {
  display: block;
}

/* Gartic toolbar symmetry and brush-size markers */
.gartic-draw-tools {
  padding-left: 7px !important;
  padding-right: 9px !important;
}

.gartic-draw-tool-grid,
.gartic-draw-colors {
  transform: translateX(-1px) !important;
}

.gartic-palette-row,
.gartic-size-control {
  transform: translateX(-1px) !important;
}

.gartic-size-control {
  min-height: 156px !important;
  padding-top: 34px !important;
}

.gartic-size-control::before {
  top: 44px !important;
  width: 20px !important;
  height: 20px !important;
}

.gartic-size-control::after {
  bottom: 10px !important;
  width: 7px !important;
  height: 7px !important;
}

.gartic-size-control input[type="range"] {
  margin: 38px 0 18px !important;
}

/* Gartic player state labels and correct-answer highlight */
.gartic-player-role {
  color: #087cff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.gartic-player.guessed {
  border-color: #8ee6a4 !important;
  background: #dff8e6 !important;
}

.gartic-player.guessed strong,
.gartic-player.guessed em {
  color: #125b2c !important;
}

.gartic-player.guessed .gartic-player-role {
  color: #087cff !important;
}

.tool-panel[data-panel="walk-frame-offsets"] {
  width: 690px;
  max-width: calc(100vw - 24px);
}

.walk-offset-panel {
  display: grid;
  gap: 12px;
  color: #1b2340;
  font-weight: 800;
}

.walk-offset-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  align-items: start;
}

.walk-offset-controls {
  display: grid;
  gap: 12px;
}

.walk-offset-panel p {
  margin: 0;
  color: #66708a;
  font-size: 12px;
  line-height: 1.35;
}

.walk-offset-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.walk-offset-tabs button,
.walk-offset-row button {
  border: 1px solid #cfd8ec;
  border-radius: 9px;
  background: #ffffff;
  color: #2567c8;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(31, 48, 90, 0.08);
}

.walk-offset-tabs button {
  min-height: 34px;
}

.walk-offset-tabs button.active {
  background: #2f83e6;
  color: #ffffff;
  border-color: #2f83e6;
}

.walk-offset-grid {
  display: grid;
  gap: 8px;
}

.walk-offset-row {
  display: grid;
  grid-template-columns: 92px repeat(2, 55px) repeat(4, 1fr);
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid #dce3f1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.walk-offset-row strong {
  font-size: 12px;
  color: #202943;
}

.walk-offset-row .walk-offset-visibility {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: #202943;
}

.walk-offset-row .walk-offset-visibility input {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 2px solid #c7d2ea;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(31, 48, 90, 0.08);
  cursor: pointer;
}

.walk-offset-row .walk-offset-visibility input:checked {
  border-color: #2f83e6;
  background:
    linear-gradient(135deg, transparent 0 40%, #ffffff 40% 58%, transparent 58%),
    linear-gradient(45deg, transparent 0 42%, #ffffff 42% 58%, transparent 58%),
    #2f83e6;
}

.walk-offset-row label {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 3px;
  color: #59647c;
  font-size: 12px;
}

.walk-offset-row input {
  width: 34px;
  height: 28px;
  border: 1px solid #cfd8ec;
  border-radius: 7px;
  text-align: center;
  font-weight: 900;
}

.walk-offset-row button {
  min-height: 28px;
  padding: 0 5px;
  font-size: 11px;
}

.walk-offset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.walk-offset-preview-wrap {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px;
  border: 1px solid #dce3f1;
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(211, 219, 235, 0.45) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(211, 219, 235, 0.45) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(211, 219, 235, 0.45) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(211, 219, 235, 0.45) 75%),
    #ffffff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(31, 48, 90, 0.08);
}

.walk-offset-preview-wrap > strong {
  color: #202943;
  font-size: 13px;
}

.walk-offset-preview {
  position: relative;
  width: 132px;
  height: 258px;
  overflow: hidden;
  border: 1px solid #cfd8ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.walk-offset-preview::before,
.walk-offset-preview::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: rgba(37, 103, 200, 0.18);
}

.walk-offset-preview::before {
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
}

.walk-offset-preview::after {
  left: 8px;
  right: 8px;
  bottom: 22px;
  height: 1px;
}

.walk-offset-preview-frame {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 18px;
  height: 230px;
  width: auto;
  opacity: 0.42;
  transform: translateX(calc(-50% + var(--walk-preview-x, 0px))) translateY(var(--walk-preview-y, 0px));
  filter: drop-shadow(0 1px 1px rgba(20, 32, 55, 0.2));
  pointer-events: none;
}

.walk-offset-preview-frame.mirrored {
  transform: translateX(calc(-50% + var(--walk-preview-x, 0px))) translateY(var(--walk-preview-y, 0px)) scaleX(-1);
}

.walk-offset-preview-frame.frame-1 {
  opacity: 0.76;
}

.walk-offset-preview-frame.frame-2 {
  mix-blend-mode: multiply;
}

.walk-offset-preview-frame.frame-3 {
  opacity: 0.36;
}

.walk-offset-preview-frame.frame-4 {
  opacity: 0.5;
}

.walk-offset-preview-frame.hidden {
  display: none;
}

.walk-offset-preview-wrap small {
  color: #66708a;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.tool-panel[data-panel="trade"] {
  width: 950px;
  height: 330px;
  max-width: calc(100vw - 24px);
}

.tool-panel[data-panel="trade"] .tool-panel-body {
  padding: 0;
  overflow: hidden;
}

.tool-panel[data-panel="trade-request"] {
  width: 340px;
  min-height: 190px;
}

.trade-request-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  height: 100%;
  padding: 20px 22px 24px;
  text-align: center;
  color: #172033;
  font-weight: 800;
}

.trade-request-panel p {
  margin: 0;
  line-height: 1.35;
}

.trade-request-actions,
.trade-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.trade-request-actions button,
.trade-actions button {
  min-width: 128px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 5px 10px rgba(26, 36, 64, 0.18);
}

.trade-request-actions .accept,
.trade-actions .accept {
  background: linear-gradient(180deg, #5bbf58, #238f35);
}

.trade-request-actions .reject,
.trade-actions .reject {
  background: linear-gradient(180deg, #d75a4f, #a42c28);
}

.trade-window {
  display: grid;
  grid-template-columns: 318px 1fr 1fr;
  grid-template-rows: 1fr 46px;
  height: 100%;
  overflow: hidden;
  border-radius: 0 0 22px 22px;
  background: rgba(255, 255, 255, 0.92);
}

.trade-column {
  position: relative;
  min-width: 0;
  padding: 10px 16px 8px;
}

.trade-bag-column {
  background: rgba(255, 255, 255, 0.84);
  border-right: 1px solid rgba(134, 153, 190, 0.28);
}

.trade-offer.self {
  background: rgba(184, 238, 248, 0.82);
}

.trade-offer.other {
  background: rgba(255, 203, 162, 0.88);
}

.trade-column h3 {
  margin: 0 0 8px;
  color: #10182a;
  font-size: 18px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(4, 58px);
  grid-auto-rows: 58px;
  justify-content: center;
  gap: 8px;
}

.trade-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(116, 137, 177, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), 0 2px 5px rgba(33, 45, 75, 0.08);
}

.trade-slot.filled {
  cursor: pointer;
}

.trade-slot.filled:hover {
  background: #7567b1;
}

.trade-slot img {
  max-width: 45px;
  max-height: 45px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.trade-item-fallback {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #eef3ff;
  color: #53607d;
  font-weight: 900;
}

.trade-count {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #172033;
  font-size: 14px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.trade-remove-x {
  position: absolute;
  top: -7px;
  right: -7px;
  display: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef2e35;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(40, 20, 28, 0.28);
}

.trade-slot.removable:hover .trade-remove-x {
  display: grid;
}

.trade-accepted-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.3);
  color: #19233b;
  font-size: 24px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.trade-actions {
  grid-column: 1 / -1;
  padding: 6px 12px 8px;
  background: rgba(255, 255, 255, 0.76);
  border-top: 1px solid rgba(134, 153, 190, 0.25);
}

.trade-actions button:disabled {
  opacity: 0.7;
  cursor: default;
}
