/* ==================== ОВЕРЛЕИ ==================== */
.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.9);
  border: 2px solid #f1c40f;
  border-radius: 16px;
  padding: 20px 24px;
  z-index: 60;
  text-align: center;
  min-width: 300px;
  max-width: 92vw;
  box-shadow: 0 10px 40px rgba(0,0,0,.7);
}
[data-theme="paper"] .overlay { background: rgba(255,255,255,.97); color: #333; }
.ov-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #f1c40f; }
[data-theme="paper"] .ov-title { color: #b8860b; }
.ov-cards { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.ov-wait { color: #ccc; font-size: 12px; margin-top: 8px; }
[data-theme="paper"] .ov-wait { color: #666; }
.ov-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.ov-buttons button { padding: 10px 16px; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 14px; }

/* ==================== БАННЕР СВЕРХУ ==================== */
.pass-notice {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(231,76,60,.9);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 20;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  animation: pulseNotice 1.5s ease-in-out infinite;
}
.pass-notice.info { background: rgba(241,196,15,.9); color: #000; }
.pass-notice.wait { background: rgba(255,184,77,.95); color: #000; }
@keyframes pulseNotice {
  0%, 100% { opacity: 1; }
  50%      { opacity: .75; }
}

/* ==================== РЕАКЦИИ (Lottie) ==================== */
.reaction-fly {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  width: 0;
  height: 0;
  animation: reactionFly 3s cubic-bezier(.22,.85,.35,1) forwards;
  will-change: transform, opacity;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.45));
}
@keyframes reactionFly {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3) rotate(-10deg); }
  12%  { opacity: 1; transform: translate(0, 0) scale(1.25) rotate(6deg); }
  25%  { transform: translate(0, 0) scale(1) rotate(0); }
  70%  { opacity: 1; transform: translate(0, -80px) scale(1.05); }
  100% { opacity: 0; transform: translate(0, -160px) scale(.85); }
}

/* ==================== БАННЕР ФАЛЬШ ==================== */
.falsh-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.5);
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  font-weight: 900;
  padding: 24px 40px;
  border-radius: 20px;
  font-size: 26px;
  text-align: center;
  z-index: 500;
  pointer-events: none;
  animation: falshPop 2s ease-out forwards;
}
@keyframes falshPop {
  0%   { transform: translate(-50%,-50%) scale(.3);  opacity: 0; }
  15%  { transform: translate(-50%,-50%) scale(1.15); opacity: 1; }
  80%  { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(.9);  opacity: 0; }
}

/* ==================== ЧЕМПИОН ==================== */
.champ-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  overflow-y: auto;
}
.champ-title { font-size: 32px; font-weight: 900; color: #f1c40f; margin-bottom: 16px; text-shadow: 0 0 20px rgba(241,196,15,.7); }
.champ-names { font-size: 20px; margin-bottom: 20px; }
.champ-stats { font-size: 15px; line-height: 1.8; margin-bottom: 20px; opacity: .9; }
.champ-best { font-size: 16px; color: #2ecc71; font-weight: 700; margin-bottom: 20px; }
.champ-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.champ-buttons button { padding: 14px 28px; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; }

.history-list { max-height: 50vh; overflow-y: auto; text-align: left; margin-bottom: 14px; }
.history-row { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.15); font-size: 14px; }
[data-theme="paper"] .history-row { border-color: rgba(0,0,0,.15); }

/* ==================== МЕНЮ ⚙️ (боковая панель) ==================== */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 88vw;
  background: rgba(0,0,0,.95);
  color: #fff;
  z-index: 800;
  transform: translateX(100%);
  transition: transform .25s ease-out;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
[data-theme="paper"] .settings-panel { background: rgba(255,255,255,.98); color: #333; }
.settings-panel.open { transform: translateX(0); }
.settings-panel h3 { margin: 0 0 12px; font-size: 20px; }
.settings-panel .close-btn { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 22px; color: inherit; cursor: pointer; }
.settings-section { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
[data-theme="paper"] .settings-section { border-color: rgba(0,0,0,.1); }
.settings-section h4 { margin: 0 0 8px; font-size: 13px; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }

/* Тумблер */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  background: rgba(255,255,255,.2);
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s;
}
.toggle.on { background: #2ecc71; }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.toggle.on::after { left: 23px; }

.scale-row { display: flex; gap: 6px; }
.scale-row button {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.scale-row button.sel { border-color: var(--acc); background: rgba(241,196,15,.2); }

.menu-btn {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,.1);
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.menu-btn:active { background: rgba(255,255,255,.2); }
.menu-btn.danger { background: rgba(231,76,60,.85); color: #fff; }

/* ==================== ЧАТ ==================== */
.chat-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 92vw;
  height: 400px;
  max-height: 70vh;
  background: rgba(0,0,0,.95);
  color: #fff;
  z-index: 700;
  transform: translateY(100%);
  transition: transform .25s ease-out;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
[data-theme="paper"] .chat-panel { background: rgba(255,255,255,.98); color: #333; }
.chat-panel.open { transform: translateY(0); }
.chat-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.chat-head button { background: none; border: none; color: inherit; font-size: 20px; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { font-size: 13px; line-height: 1.4; }
.chat-msg .author { font-weight: 700; color: var(--acc); }
.chat-msg .time { font-size: 10px; opacity: .5; margin-left: 6px; }
.chat-input {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.1);
  color: inherit;
  font-size: 14px;
}
.chat-input button {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--acc);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== БЕЙДЖ НЕПРОЧИТАННЫХ ==================== */
.icon-btn { position: relative; }
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  animation: badgePop .3s ease-out;
}
@keyframes badgePop {
  0%   { transform: scale(.3); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* ==================== ПРАВИЛА / ПОЧТА / ПРОФИЛЬ (простые) ==================== */
.simple-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.simple-modal-inner {
  background: rgba(0,0,0,.95);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
[data-theme="paper"] .simple-modal-inner { background: #fff; color: #333; }
.simple-modal-inner h3 { margin: 0 0 12px; }
.simple-modal-inner .body { font-size: 14px; line-height: 1.6; }
.simple-modal-inner .close-btn {
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: var(--acc);
  color: #000;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 20000; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 90vw; align-items: center;
}
.toast {
  padding: 10px 18px; border-radius: 12px; background: rgba(0,0,0,.92);
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  transform: translateY(-20px); opacity: 0;
  transition: transform .25s ease-out, opacity .25s;
  pointer-events: none; text-align: center; max-width: 90vw;
  white-space: pre-wrap;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-error   { background: rgba(231,76,60,.95); }
.toast-success { background: rgba(46,204,113,.95); }
.toast-info    { background: rgba(52,152,219,.95); }
.toast-warn    { background: rgba(241,196,15,.95); color: #000; }

/* ==================== СЧЁТ В УГЛУ ==================== */
.score-corner {
  position: absolute; top: 14px; right: 56px;
  background: rgba(0,0,0,.55); color: #f1c40f;
  padding: 4px 12px; border-radius: 12px;
  font-weight: 700; font-size: 15px; z-index: 25;
  pointer-events: none; letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
[data-theme="paper"] .score-corner {
  background: rgba(255,255,255,.85); color: #b8860b;
}

/* ==================== ПУЛЬС «ТВОЙ ХОД» ==================== */
.table.my-turn .bottom-bar .hand {
  animation: myTurnPulse 2s ease-in-out infinite;
  border-radius: 16px;
}
@keyframes myTurnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241,196,15,0); }
  50%      { box-shadow: 0 0 24px 4px rgba(241,196,15,.45); }
}

/* ==================== ПОДСВЕТКА КАРТ, КОТОРЫЕ БЬЮТ ==================== */
.card.can-beat { position: relative; }
.card.can-beat::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 10px; border: 2px solid #2ecc71;
  box-shadow: 0 0 12px rgba(46,204,113,.7);
  pointer-events: none;
  animation: canBeatPulse 1.5s ease-in-out infinite;
}
@keyframes canBeatPulse {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}

/* ==================== МАГНИТ И ЦЕЛЬ ==================== */
.slot.drag-over { filter: drop-shadow(0 0 12px rgba(46,204,113,.9)); transition: filter .12s; }
.slot.selected-target { filter: drop-shadow(0 0 12px rgba(241,196,15,.9)); }
.center.drag-over-field { box-shadow: inset 0 0 40px rgba(241,196,15,.25); border-radius: 16px; transition: box-shadow .15s; }