﻿/* ── Chinese Chess Web UI ───────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "SimHei", "Segoe UI", sans-serif;
  background: #3a2618;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  user-select: none;
  font-size: 18px;
}

/* ── Layout ────────────────────────────────────── */
#app {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: rgb(160,120,80);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

#board-container {
  width: 780px;
  height: 832px;
  flex-shrink: 0;
}

#board-canvas {
  display: block;
  cursor: pointer;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#panel {
  width: 340px;
  background: rgb(220,190,140);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 2px solid rgb(101,67,33);
}

/* ── Top bar ───────────────────────────────────── */
.panel-top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 4px;
}

.top-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.top-btn-share {
  width: auto;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  background: rgb(60,160,80);
  color: #fff;
  border-color: rgb(40,130,60);
}

.top-btn-share:hover { background: rgb(75,185,95); }

.top-btn-help {
  background: rgb(70,120,180);
  color: #fff;
  border-color: rgb(50,90,140);
}

.top-btn-help:hover { background: rgb(90,145,210); }

.top-btn-settings {
  background: rgb(160,150,140);
  color: #fff;
  border-color: rgb(120,110,100);
}

.top-btn-settings:hover { background: rgb(180,170,160); }

/* ── Login area ─────────────────────────────────── */
#login-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guest-label {
  color: #888;
  font-size: 17px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: bold;
  color: rgb(60,40,20);
}

.badge {
  background: rgb(163,110,60);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 14px;
}

.xp-bar-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.xp-bar {
  flex: 1;
  height: 8px;
  background: #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90d9, #7ab8ff);
  border-radius: 4px;
  transition: width 0.5s;
}

.xp-text {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

.coin-display {
  font-size: 20px;
  font-weight: bold;
  color: rgb(180,130,30);
  display: flex;
  align-items: center;
  gap: 4px;
}
.coin-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.inline-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.user-links {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.user-links a {
  font-size: 12px;
  color: rgb(120,80,40);
  text-decoration: none;
}

.user-links a:hover {
  text-decoration: underline;
}

/* ── Online players ───────────────────────────── */
.online-players {
  margin-bottom: 4px;
}

.online-player-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.online-player {
  font-size: 17px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.25);
  flex: 1;
  text-align: center;
}

.online-player.red  { color: rgb(180,30,30); }
.online-player.black { color: rgb(20,20,20); }

/* ── Turn indicator ────────────────────────────── */
.turn-info {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.3);
}

.turn-info.your-turn { color: rgb(40,100,40); }
.turn-info.thinking { color: rgb(120,100,40); animation: pulse 1s ease-in-out infinite; }
.turn-info.check { color: rgb(220,50,50); animation: pulse 0.5s ease-in-out infinite; }
.turn-info.win { color: rgb(200,120,20); font-size: 28px; }
.turn-info.lose { color: rgb(150,50,50); font-size: 28px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Captured pieces ───────────────────────────── */
#captured-area {
  min-height: 60px;
}

.captured-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.captured-label {
  font-size: 16px;
  color: rgb(80,50,30);
  white-space: nowrap;
}

.captured-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.captured-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgb(250,235,215);
  border: 1.5px solid rgb(60,40,20);
  font-size: 18px;
  flex-shrink: 0;
}

.captured-chip.red { color: rgb(180,30,30); }
.captured-chip.black { color: rgb(20,20,20); }

/* ── Action buttons ───────────────────────────── */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  gap: 8px;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  padding: 10px 20px;
  border: 1.5px solid rgb(140,90,50);
  border-radius: 6px;
  background: rgb(200,170,130);
  color: rgb(60,35,15);
  cursor: pointer;
  font-size: 18px;
  font-family: inherit;
  transition: all 0.15s;
}

.btn:hover { background: rgb(215,185,145); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; background: rgb(180,160,130); }

.btn-primary {
  background: rgb(163,110,60);
  color: #fff;
  border-color: rgb(120,75,35);
}

.btn-primary:hover { background: rgb(185,130,75); }

.btn-danger {
  background: rgb(190,60,50);
  color: #fff;
  border-color: rgb(150,40,30);
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-icon { font-weight: bold; font-size: 20px; }

.btn-sm { padding: 6px 12px; font-size: 15px; }
.btn-block { display: block; width: 100%; margin-bottom: 8px; }

.btn-new-game {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: rgb(180,130,70);
  color: #fff;
  border-color: rgb(130,90,40);
  font-weight: bold;
  font-size: 19px;
}

.badge-sm {
  background: rgb(60,40,20);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
}

/* ── Bottom bar ─────────────────────────────────── */
#bottom-bar {
  margin-top: auto;
  text-align: center;
}

#mode-label {
  display: block;
  font-size: 13px;
  color: rgb(100,70,40);
  margin-bottom: 6px;
}

/* ── Modal overlay ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-box {
  background: rgb(245,235,210);
  border: 2px solid rgb(101,67,33);
  border-radius: 10px;
  min-width: 510px;
  max-width: 510px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.modal-box.help-wide {
  max-width: 620px;
}

.modal-title-bar {
  background: rgb(130,90,50);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 22px;
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { color: #fcc; }

.modal-body {
  padding: 16px;
}

/* ── Dialog forms ──────────────────────────────── */
.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row label {
  min-width: 50px;
  font-size: 14px;
  color: rgb(80,50,30);
}

.input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid rgb(140,110,70);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: rgb(255,255,250);
}

.input:focus {
  outline: none;
  border-color: rgb(180,50,30);
}

.dialog-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* ── Mode grid ──────────────────────────────────── */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-btn {
  padding: 16px 12px;
  border: 2px solid rgb(140,110,70);
  border-radius: 8px;
  background: rgb(255,248,235);
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  transition: all 0.15s;
}

.mode-btn:hover {
  background: rgb(240,220,180);
  border-color: rgb(180,120,40);
}

.mode-btn small {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* ── Puzzle list ────────────────────────────────── */
.puzzle-list {
  max-height: 400px;
  overflow-y: auto;
}

.puzzle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgb(200,180,150);
  cursor: pointer;
  transition: background 0.15s;
}

.puzzle-item:hover { background: rgb(255,245,220); }

.puzzle-item.completed { opacity: 0.7; background: rgb(235,255,235); }

.puzzle-idx { font-weight: bold; color: rgb(120,80,40); min-width: 30px; }
.puzzle-title { font-weight: bold; flex: 1; }
.puzzle-desc { font-size: 12px; color: #888; }
.puzzle-star { font-size: 18px; }

/* ── Account list ────────────────────────────── */
.account-list {
  max-height: 240px;
  overflow-y: auto;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgb(200,180,150);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.account-row:hover { background: rgb(255,245,220); }

.account-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-phone {
  font-size: 16px;
  font-weight: bold;
  color: rgb(60,40,20);
}

.account-name {
  font-size: 14px;
  color: rgb(120,80,40);
}

.account-lock {
  font-size: 14px;
}

/* ── Shop ──────────────────────────────────────── */
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgb(200,180,150);
  border-radius: 8px;
  margin-bottom: 8px;
}

.shop-icon {
  font-size: 30px;
  width: 40px;
  text-align: center;
}

.shop-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shop-info small {
  color: #888;
  font-size: 12px;
}

.shop-qty-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgb(190, 160, 120);
  border-color: rgb(120, 85, 45);
  color: rgb(60, 35, 15);
}

.qty-btn:hover { background: rgb(210, 180, 140); }

.qty-input {
  width: 48px;
  height: 26px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  border: 1.5px solid rgb(140, 90, 50);
  border-radius: 4px;
  background: #fff;
  color: rgb(60, 35, 15);
  padding: 0 4px;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Recharge dialog ──────────────────────────── */
.recharge-amounts {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
}

.recharge-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
}

.qr-image-container {
  text-align: center;
  margin: 0 auto 8px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  max-width: 220px;
  max-height: 220px;
  border: 2px solid rgb(200,180,150);
  border-radius: 8px;
}

/* ── Sandbox panel (replaces right panel during setup) ── */
#sandbox-panel {
  width: 280px;
  background: rgb(220,190,140);
  border-radius: 8px;
  padding: 14px;
  border: 2px solid rgb(101,67,33);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-title {
  font-size: 16px;
  font-weight: bold;
  color: rgb(60,40,20);
  text-align: center;
}

.sb-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
}

.sb-warning {
  font-size: 12px;
  color: rgb(200,50,50);
  text-align: center;
}

.sb-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.sb-piece-btn {
  padding: 6px 8px;
  border: 1px solid rgb(160,130,90);
  border-radius: 4px;
  background: rgb(210,200,180);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}

.sb-piece-btn:hover { background: rgb(230,220,200); }

.sb-piece-btn.red { color: rgb(180,30,30); }
.sb-piece-btn.black { color: rgb(20,20,20); }

.sb-piece-btn.selected {
  background: rgb(100,180,100) !important;
  color: #fff !important;
  border-color: rgb(60,130,60);
}

.sb-btn-start {
  padding: 10px;
  font-size: 17px;
  font-weight: bold;
  border-radius: 6px;
  width: 100%;
}

.sb-btn-start:enabled {
  background: rgb(50,150,70);
  color: #fff;
  border-color: rgb(30,110,50);
}

.sb-btn-start:disabled {
  background: rgb(130,120,110);
  color: #ccc;
  cursor: not-allowed;
}

.sb-btn-exit {
  width: 100%;
  padding: 7px;
  background: rgb(160,70,60);
  color: #fff;
  border-color: rgb(120,40,30);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.sb-btn-clear {
  width: 100%;
  padding: 7px;
  background: rgb(160,120,40);
  color: #fff;
  border-color: rgb(120,90,30);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.sb-save-row {
  display: flex;
  gap: 6px;
}

.sb-btn-save {
  flex: 1;
  padding: 7px;
  background: rgb(60,130,180);
  color: #fff;
  border-color: rgb(40,100,150);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

/* ── Sandbox side picker ─────────────────────── */
.sb-side-btn {
  flex: 1;
  padding: 16px 10px;
  border-radius: 10px;
  border: 2px solid rgb(140,110,70);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.sb-side-red {
  background: rgb(255,235,235);
  color: rgb(180,30,30);
}

.sb-side-red:hover { background: rgb(255,210,210); border-color: rgb(200,50,50); }

.sb-side-black {
  background: rgb(235,235,240);
  color: rgb(20,20,20);
}

.sb-side-black:hover { background: rgb(210,210,220); border-color: rgb(50,50,50); }

/* ── Help dialog ──────────────────────────────── */
.modal-box.help-wide {
  max-width: 560px;
}

.help-content {
  font-size: 14px;
  line-height: 1.8;
  color: rgb(60,40,20);
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

.help-content h4 {
  margin: 14px 0 6px 0;
  font-size: 16px;
  color: rgb(120,80,40);
  border-bottom: 1px solid rgb(200,180,150);
  padding-bottom: 4px;
}

.help-content h4:first-child { margin-top: 0; }

.help-content p {
  margin: 0 0 4px 0;
}

/* ── Event / Check-in ─────────────────────────── */
.checkin-grid {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.checkin-slot {
  width: 50px;
  height: 60px;
  border: 1.5px solid rgb(200,180,150);
  border-radius: 8px;
  text-align: center;
  padding: 4px;
  font-size: 11px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.checkin-slot.claimed {
  background: rgb(220,255,220);
  border-color: rgb(100,180,100);
}

.checkin-slot.today {
  border-color: rgb(200,150,50);
  border-width: 2px;
  background: rgb(255,250,230);
}

.checkin-day {
  font-weight: bold;
  color: rgb(100,70,30);
  font-size: 12px;
}

.checkin-reward {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}

.checkin-mark {
  color: rgb(40,150,40);
  font-weight: bold;
  font-size: 14px;
}

.quest-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid rgb(200,180,150);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
}

/* ── Share dialog ────────────────────────────────── */
.share-preview-wrap {
  text-align: center;
  margin-bottom: 16px;
}
.share-preview-img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  border: 3px solid rgb(180,140,90);
}
.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.share-btn-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 2.5px solid;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
}
.share-btn-big:hover { transform: translateY(-2px); }
.share-btn-icon { font-size: 32px; }
.share-btn-sub { font-size: 11px; font-weight: normal; opacity: 0.7; }

.share-btn-qq {
  background: linear-gradient(135deg, #e6f7ff, #cceeff);
  color: #12B7F5;
  border-color: #12B7F5;
}
.share-btn-qq:hover { box-shadow: 0 4px 16px rgba(18,183,245,0.35); }

.share-btn-wechat {
  background: linear-gradient(135deg, #e8fce8, #d0f5d0);
  color: #07C160;
  border-color: #07C160;
}
.share-btn-wechat:hover { box-shadow: 0 4px 16px rgba(7,193,96,0.35); }

.share-btn-download {
  background: linear-gradient(135deg, #fff3e6, #ffe8cc);
  color: #e67e22;
  border-color: #e67e22;
}
.share-btn-download:hover { box-shadow: 0 4px 16px rgba(230,126,34,0.35); }

.share-btn-copy-link {
  background: linear-gradient(135deg, #f0e8ff, #e4d8f8);
  color: #7c3aed;
  border-color: #7c3aed;
}
.share-btn-copy-link:hover { box-shadow: 0 4px 16px rgba(124,58,237,0.35); }

.share-qr-row {
  display: none;
  text-align: center;
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 10px;
}
.share-qr-row.show { display: block; }
.share-qr-img {
  width: 180px;
  height: 180px;
  border: 2px solid #ddd;
  border-radius: 8px;
}
.share-qr-hint {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}
.share-qr-close {
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

/* ── Toast ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 2000;
  pointer-events: none;
}

.toast-success {
  background: rgba(40,140,70,0.9);
  color: #fff;
}

.toast-error {
  background: rgba(200,40,30,0.9);
  color: #fff;
}


.hidden { display:none !important; }
/* ── Online chat ── */
.chat-toggle { position:fixed; bottom:48px; right:16px; width:44px; height:44px; border-radius:50%; background:#2196F3; color:#fff; font-size:20px; border:none; cursor:pointer; z-index:200; box-shadow:0 2px 8px rgba(0,0,0,0.4); }
.chat-toggle:hover { background:#1976D2; }
.chat-dot { display:none; position:absolute; top:-4px; right:-4px; width:14px; height:14px; background:#e04040; border-radius:50%; border:2px solid #fff; pointer-events:none; }
.chat-dot.show { display:block; }
.chat-popup { position:fixed; bottom:48px; right:68px; width:280px; max-height:320px; background:#1e2a3a; border:1px solid #3a4a5a; border-radius:8px; z-index:200; display:flex; flex-direction:column; box-shadow:0 4px 16px rgba(0,0,0,0.5); }
.chat-popup .chat-msgs { flex:1; max-height:240px; overflow-y:auto; padding:8px 10px; font-size:13px; line-height:1.6; color:#ccc; }
.chat-popup .chat-msgs .msg { margin:2px 0; word-break:break-all; }
.chat-popup .chat-msgs .msg .who { color:#ffd700; font-weight:bold; }
.chat-popup .chat-msgs .msg .who.me { color:#4caf50; }
.chat-popup .chat-input-row { display:flex; gap:4px; padding:6px 8px; border-top:1px solid #2a3a4a; }
.chat-popup .chat-input-row input { flex:1; padding:5px 8px; border-radius:4px; border:1px solid #555; background:#121a24; color:#fff; font-size:13px; }
.chat-popup .chat-input-row button { padding:5px 10px; font-size:12px; }
.chat-side { position:fixed; top:0; right:0; bottom:0; width:300px; background:#1e2a3a; border-left:1px solid #3a4a5a; z-index:220; display:flex; flex-direction:column; padding:16px 12px; gap:10px; transform:translateX(105%); transition:transform .25s ease; box-shadow:-6px 0 24px rgba(0,0,0,.35); }
.chat-side.show { transform:translateX(0); }
.chat-side .side-title { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:#8aa0c0; font-weight:600; letter-spacing:2px; }
.side-close { background:transparent; border:none; color:#8aa0c0; font-size:18px; cursor:pointer; padding:0 4px; line-height:1; }
.side-close:hover { color:#eee; }
.chat-side .chat-msgs { flex:1; overflow-y:auto; padding:10px; font-size:13px; line-height:1.6; color:#ccc; border:1px solid #3a4a5a; border-radius:10px; }
.chat-side .chat-msgs .msg { margin:2px 0; word-break:break-all; }
.chat-side .chat-msgs .msg .who { color:#ffd700; font-weight:bold; }
.chat-side .chat-msgs .msg .who.me { color:#4caf50; }
.chat-side .chat-input-row { display:flex; gap:6px; }
.chat-side .chat-input-row input { flex:1; padding:9px 10px; border-radius:8px; border:1px solid #3a4a5a; background:#121a24; color:#fff; font-size:13px; margin:0; }
.chat-side .chat-input-row input:focus { outline:none; border-color:#ffd700; }
.chat-side .chat-input-row button { padding:8px 14px; font-size:13px; border-radius:8px; flex:0 0 auto; }
.chat-fab { position:fixed; right:22px; bottom:22px; width:58px; height:58px; border-radius:50%; background:#2a3747; border:1px solid #33414f; color:#fff; font-size:24px; cursor:pointer; z-index:220; box-shadow:0 4px 16px rgba(0,0,0,.5); transition:transform .1s; }
.chat-fab:hover { background:#33414f; transform:scale(1.06); }
@media (max-width:640px) { .chat-side { width:100vw; } }
