/* normalize.css v8.0.1*/

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

a:focus,
textatrea,
#magpie-dialog-trigger,
.magpie-dialog,
#Go_Top,
#posts_queue_button,
#Go_Bottom {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  outline: none !important;
}

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

body {
  margin: 0;
}

main {
  display: block;
}

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

a {
  background-color: transparent;
  text-decoration: none;
}

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  border-style: none;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

button,
input {
  /* 1 */
  overflow: visible;
}

button,
select {
  /* 1 */
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}
progress {
  vertical-align: baseline;
}

textarea {
  overflow: auto;
  outline: none;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

details {
  display: block;
}

summary {
  display: list-item;
  cursor: pointer;
}

template {
  display: none;
}

[hidden] {
  display: none;
}

table {
  width: 100%;
}

thead:not(.thead-font-size-override) {
  font-size: 10px;
}

th {
  padding-bottom: 10px;
}

ul {
  list-style-type: none;
}

:root {
  --text-dark-bg: #76736f;
  --text-light-bg: #1c1918;
  --text-beige: #8c867f;
  --text-light-grey: #a8a8a8;

  --red-a: #a45151;
  --red-a-lightback: #5c0e0e;

  --bg-green: #2f3127;
  --bg-light-green: #404330;
  --bg-beige: #7a6e60;
  --bg-light: #c3bab0;
  --bg-dark-brown: #1c1816;
  --bg-brown: #2c2422;
  --bg-light-brown: #3f3431;
  --bg-dark-red: #391e1e;
  --bg-red: #522828;

  --grayish-orange-bg-color: #b0a293; /*цвет для текста выделения*/
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background-color: rgba(20, 18, 15, 0.01);
}
::-webkit-scrollbar-thumb {
  background-color: rgb(91, 74, 59);
  width: 6px;
}

html,
body,
.code-box .scrollbox,
textarea,
div,
li,
p,
span,
form {
  scrollbar-width: thin;
  scrollbar-color: #532828 rgba(20, 18, 15, 0.01);
}

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

hr {
  width: 100%;
  margin: 8px 0;
  border-style: dashed;
  border-width: 1px 0 0 0;
}

textarea {
  padding: 5px;
  border: 1px solid rgb(186, 165, 140);
  background: rgb(206, 197, 187);
  box-shadow:
    0px 0px 2px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.51);
  border-radius: 10px;
}

details {
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
  padding: 4px 5px;
  outline: none;
  border: 1px solid rgb(186, 165, 140);
  background: rgba(195, 186, 176, 0.88);
  box-shadow:
    0px 0px 2px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.51);
  border-radius: 10px;
}

select {
  background: #615955;
  border-radius: 6px;
  box-shadow: 0px 0px 2px 0px black;
  border: none;
  padding: 3px 5px;
  color: var(--text-light-grey);
}

.button,
button,
input[type="submit"] {
  background: var(--bg-beige);
  border-radius: 10px;
  padding: 4px 11px;
  color: var(--bg-light);
  cursor: pointer;
  margin: 5px;
  border: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--bg-light-green);
}

a {
  color: var(--red-a);
}

/* a:hover {
  color: var(--text-dark-bg);
} */

html {
  font-size: 62.5%;
}

body {
  font-family: Verdana, Tahoma, Arial, Sans-Serif;
  background:
    url("../images/background.webp") repeat,
    var(--bg-brown);
  color: var(--text-dark-bg);
  min-height: 100vh;
  padding: 2rem;
}

.hint {
  font-size: 1.2rem;
  font-style: italic;
  margin: 5px 0px 5px;
}

.success {
  background: var(--bg-light-green);
  width: 100%;
  border-radius: 10px;
  padding: 5px 10px;
  color: var(--bg-light);
}

.waiting {
  background: var(--bg-red);
  width: 100%;
  border-radius: 10px;
  padding: 5px 10px;
  color: var(--bg-light);
}

.pagination {
  text-align: left;
  margin: 0px 0 15px;
}

.main-nav ul {
  list-style: none;
}

.main-nav li {
  display: inline-block;
}

.main-nav a,
.main-nav button {
  background: var(--bg-beige);
  border-radius: 10px;
  padding: 4px 11px;
  color: var(--bg-light);
  cursor: pointer;
  margin: 5px;
  border: none;
  text-decoration: none;
  font-size: 1.5rem;
}

.main-nav a:hover,
.main-nav button:hover {
  background: var(--bg-light-green);
}

.container {
  /*position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);*/
  width: 1120px;
  margin: 50px auto 50px;
  font-size: 1.5rem;
  padding: 2rem;
  text-align: center;
  background:
    url("../images/leaves-top.jpg") center top no-repeat,
    url("../images/main-container-background.jpg") repeat;
  box-shadow:
    0px 0px 0px 1px #000000,
    0px 0px 0px 2px #474038,
    0px 0px 0px 4px #241d1c,
    0px 0px 0px 5px #252121,
    0px 0px 0px 6px #1e1817,
    0px 0px 0px 7px #221b19,
    0px 0px 0px 8px #251f1d;
}

header {
  margin-bottom: 3rem;
}

footer {
  margin-top: 3rem;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  width: 100%;
}

h2 {
  font-size: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  border-radius: 10px;
  background: url(https://forumstatic.ru/files/001c/38/50/89893.jpg)
    var(--bg-brown);
  color: var(--bg-light);
  padding: 1rem 1rem;
  text-transform: uppercase;
}

h3 {
  font-size: inherit;
  font-weight: bold;
  margin: 1.5rem 0 1rem;
  width: 100%;
}

.main_title {
  text-align: center;
  font-family: Balkara, Verdana, Tahoma, Arial, Sans-Serif;
  font-size: 20px;
  font-weight: normal;
  padding: 8px;
  color: var(--text-beige);
  text-shadow: 0px 0px 8px black;
  display: block;
  position: relative;
  background: url(../images/leaves-top.jpg) var(--bg-brown);
  border-radius: 10px 10px 0 0;
  border: 1px solid #453e37;
}

.main_content {
  color: var(--text-light-bg);
  padding: 25px;
  position: relative;
  background-color: rgb(185, 172, 156);
  box-shadow: inset 0px 0px 19.17px 7.83px rgba(38, 23, 10, 0.66);
  border: 1px solid #796b5a;
  border-radius: 0 0 10px 10px;
}

.auth-section {
  background: var(--bg-light-brown);
  padding: 2rem;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  margin: 2rem 0;
  border: 1px solid #453e37;
}

.user-info {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.role-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #ff9800;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-left: 10px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 400px;
  max-width: 600px;
  padding: 1.5rem;
  font-size: 1.5rem;
  background: #b9ac9c;
  box-shadow: inset 0 0 19.17px 7.83px #26170aa8;
  border: 1px solid #796b5a;
  border-radius: 10px;
  color: var(--text-light-bg);
}

.modal-window button.modal-close {
  position: absolute;
  right: 18px;
  top: 27px;
  padding: 2px 5px;
}

.modal-window form {
  max-height: 500px;
  overflow: auto;
}

.form-group {
  margin-bottom: 15px;
}

.form-group input {
  width: 100%;
}

.form-group input.error {
  border-color: red;
}

.error-text {
  color: var(--red-a-lightback);
  font-size: 1.2rem;
  display: block;
  margin-top: 5px;
}

.password-checks {
  margin-top: 10px;
  font-size: 12px;
}

.password-checks .check {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
}

.password-checks .check span:first-child {
  width: 20px;
  text-align: center;
  margin-right: 5px;
}

.password-checks .check.valid {
  color: green;
}

.password-checks .check:not(.valid) {
  color: #666;
}

.choose-item-form__item {
  border: 1px solid rgba(0, 0, 0, 0.3);
  margin: 10px;
  border-radius: 10px;
  cursor: pointer;
  padding: 5px;
}

.choose-item-form__item:hover {
  background: white;
}

.choose-item-form__turnItem.to-delete {
  background: rgb(255, 184, 184);
}

.choose-item-form__item.choose-item-form__skillRequestItem {
  display: block;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 6px 20px 6px 40px;
  background: rgb(98, 166, 255);
  border-radius: 6px;
  color: white;
  z-index: 10000;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  min-height: 44px; /* Для удобства клика */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.toast__close {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.2s ease;
  user-select: none;
}

.toast__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.toast__close:active {
  transform: translateY(-50%) scale(0.95);
}

.toast__message {
  flex: 1;
}

/* Типы уведомлений */
.toast-success {
  background: #036b2b;
}

.toast-error {
  background: #850b0b;
}

.toast-warning {
  background: #9e6400;
}

.toast-info {
  background: rgb(5, 69, 151);
}

/* Анимации */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

nav.menu ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
}

nav.menu li a {
  color: var(--red-a);
}

/*Профиль*/
#profileCharactersList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/*Список боёв*/

#battle-container,
.battles-list {
  display: flex;
  gap: 20px 10px;
  flex-wrap: wrap;
}

#createNewBattle {
  float: right;
}

.battles-section {
  margin-bottom: 2rem;
}
.battles-section h2 {
  margin-bottom: 0.75rem;
}

.battles-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 15px;
}

.battle-card__badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75em;
  background: #3a3a3a;
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
}
.battle-card--hidden {
  outline: 2px dashed #7a7a7a;
  outline-offset: -2px;
}

.battle-card {
  width: calc(50% - 5px);
  border: 1px solid rgb(186, 165, 140);
  background: rgba(195, 186, 176, 0.88);
  box-shadow:
    0px 0px 14px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.66);
  border-radius: 10px;
}

.battles-list--grid .battle-card {
  padding-bottom: 15px;
}

.battles-list--list .battle-card {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battles-list--grid .battle-card__title {
  border-bottom: 1px solid rgb(186, 165, 140);
  background: url(https://forumstatic.ru/files/001c/38/50/33536.jpg)
    var(--bg-green);
  border-radius: 10px 10px 0 0;
  text-align: center;
  box-shadow:
    0px 1px 3px 0px rgba(31, 26, 21, 0.66),
    0px 1px 3px 0px rgba(0, 0, 0, 0.57) inset;
  padding: 10px 5px;
  color: var(--text-beige);
}

.battles-list--list .battle-card__title {
  flex-grow: 1;
}

.battle-card__img {
  height: 50px;
  border-bottom: 1px solid rgb(186, 165, 140);
  box-shadow:
    0px 1px 3px 0px rgba(31, 26, 21, 0.66),
    0px 1px 3px 0px rgba(0, 0, 0, 0.57) inset;
}

.battles-list--list .battle-card__status {
  width: 10%;
}

.battles-list--grid .battle-card__status {
  margin: 10px 0;
}

.battles-list--list .battle-card__members {
  width: 40%;
}

.battles-list--grid .battle-card__members {
  margin: 10px 0;
}

/*Генерация боевой сетки*/
.arena-container {
  width: 100%;
  max-height: 610px;
  overflow: auto;
  position: relative;
  margin: 10px 0 5px;
}

.arena-polygon {
  fill: transparent;
  stroke-width: 1;
}

.arena-color-white .arena-polygon {
  stroke: rgba(255, 255, 255, 0.3);
}

.arena-color-black .arena-polygon {
  stroke: rgba(0, 0, 0, 0.3);
}

.arena-polygon.fog-zone {
  fill: rgba(60, 60, 80, 0.8);
}

.arena-polygon.poison-cloud-zone {
  fill: rgba(43, 66, 30, 0.8);
}

.character-marker__group.fog-form {
  opacity: 0.45;
  filter: blur(1px);
}

.arena-polygon.active {
  fill: rgb(193, 241, 147);
}

.arena-polygon.obstacle {
  fill: rgba(24, 24, 24, 0.78);
  stroke: #910000;
}

.arena-polygon.movement {
  fill: rgba(117, 219, 133, 0.78);
  stroke: #009117;
}

.arena-polygon.movement-jump {
  fill: rgba(117, 219, 133, 0.18);
  stroke: #009117;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.arena-polygon.attack {
  fill: rgba(139, 1, 1, 0.78);
  stroke: #910000;
}

.arena-polygon.perception-1 {
  fill: rgba(80, 160, 255, 0.75);
}
.arena-polygon.perception-2 {
  fill: rgba(80, 160, 255, 0.58);
}
.arena-polygon.perception-3 {
  fill: rgba(80, 160, 255, 0.44);
}

.arena-polygon.hex-pick-allowed {
  fill: rgba(80, 160, 255, 0.35);
  stroke: #2a7fff;
  stroke-width: 2;
  cursor: pointer;
}

.arena-polygon.hex-pick-selected {
  fill: rgba(255, 215, 90, 0.55);
  stroke: #ffd75a;
  stroke-width: 3;
}

polygon[data-pick-label="1"].hex-pick-chosen {
  fill: rgba(185, 162, 255, 0.5);
}
polygon[data-pick-label="2"].hex-pick-chosen {
  fill: rgba(120, 200, 255, 0.5);
}

#hex-pick-panel {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  background: #e3e3e3;
  padding: 0px 10px;
  border-radius: 10px;
  z-index: 9998;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

#hex-pick-confirm {
  position: fixed;
  transform: translateX(-50%);
  z-index: 9999;
}

.character-marker__group.attack {
  opacity: 0.5;
}

/* призрак: полупрозрачный, пунктирный контур, серый — не путать с выбывшими и с призраками истории */
.stealth-ghost__group {
  opacity: 0.5;
  pointer-events: none;
}

.stealth-ghost__border {
  fill: rgba(0, 0, 0, 0.25);
  stroke: #ffffff;
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.stealth-ghost__group--mini .stealth-ghost__border {
  stroke-width: 1.5;
  stroke-dasharray: 2 2;
}

.stealth-ghost__image {
  filter: grayscale(1) contrast(0.8);
}

/* иллюзии */
.illusion__group {
  opacity: 0.6;
  pointer-events: none;
}

.illusion__border {
  fill: rgba(120, 90, 200, 0.25);
  stroke: #b9a2ff;
  stroke-width: 2;
  stroke-dasharray: 2 3;
}

/**/
.character-marker__group.astral-form {
  opacity: 0.35;
  filter: grayscale(0.6) blur(0.5px);
}

/* свой скрытый персонаж: пунктирное кольцо поверх обводки, чуть приглушённый аватар */
.character-marker__group.stealthed .character-marker__border {
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-dasharray: 5 3;
}

.character-marker__group.stealthed .character-marker {
  opacity: 0.7;
}

/* полутень: аватар без прозрачности, рамка своего цвета — пунктиром (цвет и радиус кольца ставит renderStealthMarkers) */
.character-marker__group.penumbra .character-marker__border {
  fill: none;
  stroke-width: 3;
  stroke-dasharray: 5 3;
}

/* значок в карточке */
.stealth-badge {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border-radius: 8px;
  border: 1px dashed currentColor;
  font-size: 0.85em;
  opacity: 0.85;
}

#arena-backgroundSetting {
  display: none;
  flex-wrap: wrap;
}

#arena-backgroundSetting h3 {
  width: 100%;
}

#arena-backgroundSetting > div {
  width: 50%;
}

#arena-nameSetting {
  display: none;
}

#arena .character-marker {
  /* Для лучшего качества изображения */
  image-rendering: optimizeQuality;

  /* Чтобы clip-path работал во всех браузерах */
  -webkit-clip-path: circle(50% at 50% 50%);
  clip-path: circle(50% at 50% 50%);
}

/* foreignObject внутри SVG */
.hex-popover {
  position: absolute;
  display: none;
  width: 200px;
  min-height: 120px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  pointer-events: all;
}

.popover-content {
  background: white;
  border-radius: 10px;
  padding: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.popover-info p {
  margin-bottom: 10px;
}

.coords {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.popover-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.action-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #45a049;
}

/* Для интерактивности гексов */
.arena-polygon {
  cursor: pointer;
  transition: fill 0.2s;
}

.arena-polygon:hover {
  fill: rgb(255, 255, 255) !important;
}

.spawn-marker {
  animation: pulse 1.5s infinite;
  pointer-events: none;
}

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

/*Выбор участников боя*/
#arena-membersSetting {
  width: 100%;
}

#membersChooser {
  display: flex;
}

#membersChooser > div {
  width: calc(50% - 10px);
}

#all-list,
#selected-list {
  display: flex;
  flex-wrap: wrap;
  max-height: 400px;
  overflow: auto;
}

.chooser-member {
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.32);
  margin: 5px;
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 233px;
}

#selected-list .chooser-member {
  flex-wrap: wrap;
}

.chooser-member:hover {
  background: white;
}

.chooser-member__image {
  width: 50px;
  height: 50px;
  background-size: cover;
  background-position: center;
}

.chooser-member__info {
  padding: 5px;
  flex-grow: 1;
}

#memberList {
  width: 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: flex-start;
}

.member-card {
  padding: 10px;
  margin: 10px 0px;
  border-radius: 6px;
  border: 1px solid rgb(186, 165, 140);
  background: rgba(195, 186, 176, 0.88);
  box-shadow:
    0px 0px 14px 0px rgba(0, 0, 0, 0.21),
    inset 0px 0px 7px 0px rgba(62, 44, 26, 0.57);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 90%;
}

.member-card.short {
  /*max-width: 35%;*/
  align-items: center;
}

#choose-item-form .member-card.short {
  display: inline-block;
  width: calc(50% - 10px);
}

.member-card__image {
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
}

.member-card.full {
  width: calc(50% - 10px);
}

.member-card.full .member-card__image,
#turn-panel__current .member-card .member-card__image {
  width: 60px;
  height: 60px;
  border-radius: 0%;
}

.member-card.full tr[data-key="health"][data-value^="-"],
.member-card.full tr[data-key="health"][data-value="0"] {
  color: var(--red-a);
  font-weight: bold;
}

#membersToPlace {
  display: none;
  gap: 10px;
}

#membersToPlace .member-card,
#choose-item-form .member-card {
  padding: 5px 8px;
  cursor: pointer;
  box-shadow: none;
  align-items: center;
  max-width: 100%;
}

#membersToPlace .member-card:hover,
#choose-item-form .member-card:hover {
  background: #fff;
}

.character-marker {
  /* Для лучшего качества изображения */
  image-rendering: optimizeQuality;

  /* Чтобы clip-path работал во всех браузерах */
  -webkit-clip-path: circle(50% at 50% 50%);
  clip-path: circle(50% at 50% 50%);

  pointer-events: none; /* Клики проходят сквозь маркер к гексу */
}

.character-marker__border {
  pointer-events: none;
}

#arena-membersPreparation {
  width: 100%;
}

.member-card__info {
  /*flex-grow: 1;*/
  text-align: left;
  display: flex;
  gap: 10px;
}

.member-card.full .member-card__info {
  flex-grow: 1;
}

.member-card__build {
  width: 100%;
}

.member-card__build summary {
  background: var(--bg-beige);
  border-radius: 10px;
  padding: 4px 11px;
  color: var(--bg-light);
  cursor: pointer;
  margin: 5px;
}

.member-card__build table tr.odd {
  background: rgba(255, 255, 255, 0.22);
}

.member-card__build table td {
  padding: 5px;
}

.member-card__build tr.modified td:nth-child(2) {
  color: #3f8f4f;
  font-weight: bold;
}

.member-card .mod-form-container {
  margin: 10px 2px;
  background: var(--grayish-orange-bg-color);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--bg-beige);
}

.member-card .mod-container {
  margin: 10px;
}

.member-card .modificator-badge {
  margin: 10px 0px;
  align-items: center;
}

.mod-form-container .mod-value {
  width: 70px;
}

.member-card__build .readines-status {
  margin: 14px 0 5px;
  padding: 5px;
  border-radius: 10px;
  color: var(--grayish-orange-bg-color);
}

.readines-status[data-ready="ready"] {
  background: var(--bg-light-green);
}

.readines-status[data-ready="not_ready"] {
  background: var(--bg-dark-red);
}

#membersToPlace .member-card .diceInitiativeContainer {
  display: none;
}

.diceInitiativeResult {
  padding: 5px;
  border: 1px solid var(--bg-beige);
}

#current-member__block {
  width: 100%;
}

.roundMember {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: bold;
  margin-right: 2px;
}

.runes-container,
.potions-container,
.curios-container {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.badge {
  width: 50%;
  display: flex;
  border: 1px solid black;
  align-items: center;
  justify-content: center;
}

.badge.free {
  font-size: 3rem;
  cursor: pointer;
}

.rune-badge .choosed-item,
.potion-badge .choosed-item,
.curio-badge .choosed-item {
  padding: 5px;
}

.skills-list {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.skill-badge {
  flex: 1;
  flex-direction: column;
  padding: 5px;
  border: 1px solid black;
  align-items: center;
}

.badge-test {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: #f6de95;
  border-radius: 6px;
  border: 1px dashed currentColor;
  font-size: 0.75em;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  vertical-align: middle;
}

.branch-levels:empty {
  display: none;
}
.branch-level {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  margin: 6px 0;
  padding: 6px 10px;
}
.branch-level legend {
  font-weight: bold;
  padding: 0 4px;
}
.branch-level__option {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  margin-right: 14px;
  cursor: pointer;
}
.branches-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge.branch-badge {
  width: 49%;
}

.branch-split {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.branch-split[hidden] {
  display: none;
}

/*панель ходов*/
#turn-panel {
  width: 100%;
  border: 1px solid var(--bg-beige);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

#turn-panel__actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #7a6e60;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

#actions__action-points {
  width: 6%;
  padding: 5px;
  border: 1px solid var(--bg-beige);
  display: flex;
  align-items: center;
  justify-content: center;
}

#action-points__left {
  margin-right: 5px;
  font-weight: bold;
}

#actions__button-container {
  flex-grow: 1;
  max-width: calc(90% - 10px);
}

#action-points__all {
  margin-right: 5px;
}

#move-radius-button,
#attack-radius-button,
#perception-radius-button {
  background: var(--bg-red);
}

#move-radius-button {
  margin-left: auto;
}

#move-radius-button:hover,
#attack-radius-button:hover,
#perception-radius-button:hover {
  background: var(--bg-light-green);
}

#turn-panel__current {
  width: 50%;
  display: none;
}

#turn-panel__current .member-card {
  width: 100%;
  max-width: 100%;
}

#turn-panel__effects {
  width: 100%;
}

.turn-panel__effect {
  width: calc(100% - 10px);
  padding: 5px;
  margin: 5px;
  border: 1px solid rgb(186, 165, 140);
  background: rgb(206, 197, 187);
  border-radius: 10px;
}

.effect-type-label {
  display: inline-block;
  padding: 1px 9px 3px;
  border-radius: 10px;
  font-weight: bold;
  background: #e3e3e3;
  margin: 2px 10px 2px 0;
}

.effect-type-label.inactive {
  opacity: 0.3;
  text-decoration: line-through;
}

.tooltip {
  display: inline-block;
  position: relative;
}

.tooltip-icon {
  display: inline-block;
  border-radius: 50%;
  padding: 1px 4px;
  border: 1px solid black;
  opacity: 0.5;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 2px;
}

.tooltip-description {
  display: none;
}

.tooltip-description--rich {
  min-width: 250px;
  max-width: 400px;
}

.tooltip-description__header {
  font-weight: bold;
  margin: 5px 0 0;
}

.tooltip-floating {
  display: none;
  position: fixed;
  z-index: 10000;
  min-width: 250px;
  max-width: 400px;
  border: 1px solid rgb(186, 165, 140);
  padding: 1px 9px 3px;
  border-radius: 10px;
  background: #e3e3e3;
  font-weight: normal;
  font-size: 1.2rem;
  pointer-events: none;
  white-space: pre-line;
}

.tooltip-floating .tooltip-description__header {
  font-weight: bold;
  margin: 5px 0 0;
}

#history {
  width: 100%;
}

#historyList {
  width: 100%;
  padding: 10px;
}

#historyList__area {
  box-sizing: border-box;
  height: 200px;
  min-height: 200px;
  max-height: 400px;
  resize: vertical;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgb(186, 165, 140);
  background: rgb(206, 197, 187);
  box-shadow:
    0px 0px 2px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.51);
  border-radius: 10px;
  font-size: 1.2rem;
  text-align: left;
}

.round-header {
  text-align: center;
  margin: 10px 5px 5px;
  background: var(--grayish-orange-bg-color);
  padding: 2px 3px;
  border-radius: 10px;
}

.member-turns {
  margin: 5px 5px 15px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #b0a293;
}

.member-turns > div {
  margin: 7px 0;
}

.member-turns > div:not(:first-child) {
  border-top: 1px solid #b0a293;
  padding-top: 5px;
}

#history__switchers {
  margin: 15px 0;
}

#history__turnInfo {
  padding: 1rem;
  border: 1px solid rgb(186, 165, 140);
  background: rgb(206, 197, 187);
  box-shadow:
    0px 0px 2px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.51);
  border-radius: 10px;
  font-size: 1.2rem;
  width: 500px;
  margin: 0 auto;
}

/* Пульсация для атаки */
@keyframes pulse {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.attack-marker {
  animation: pulse 2s infinite;
}

.battle-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 10px 0;
}

.battle-settings {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 10px;
  border: 1px solid var(--bg-beige);
  border-radius: 10px;
}

/* без этого display:flex перебьёт атрибут hidden и блок не скроется */
.battle-settings[hidden] {
  display: none;
}

.battle-settings__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.battle-settings__stroke {
  display: flex;
  gap: 12px;
  align-items: center;
}

.battle-settings__danger {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(145, 0, 0, 0.4);
}

.battle-settings__delete {
  background: var(--bg-dark-red);
  color: var(--grayish-orange-bg-color);
}

#master-panel {
  text-align: left;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--bg-beige);
}

#master-panel summary {
  padding: 5px 10px;
}

#master-panel__container {
  padding: 1.5rem 0;
}

#turn-panel__master-actions summary {
  text-align: left;
  padding: 5px 10px;
}

/* админка и страница боев - переключатели */

.admin-nav,
.section-nav {
  margin-bottom: 10px;
  text-align: left;
}

.admin-nav li,
.section-nav li {
  display: inline-block;
}

.admin-nav li.active,
.section-nav li.active {
  background: var(--bg-light-green);
}

.admin-nav li a,
.section-nav li a {
  color: var(--bg-light);
}

/* админка */

.users-list {
  display: flex;
  gap: 20px 10px;
  flex-wrap: wrap;
}

.user-card {
  width: calc(25% - 8px);
  border: 1px solid rgb(186, 165, 140);
  background: rgba(195, 186, 176, 0.88);
  box-shadow:
    0px 0px 14px 0px rgba(0, 0, 0, 0.35),
    inset 0px 0px 7px 0px rgba(31, 26, 21, 0.66);
  border-radius: 10px;
  padding: 10px;
}

.user-card > * {
  margin: 10px 0px;
}

.npc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.npc-char-row:not([data-requires-key=""]) {
  background: var(--grayish-orange-bg-color);
}

.characteristics-table input {
  width: 100px;
}

.characteristics-table td.npc-char-row {
  width: 200px;
}

.characteristics-table .default-cell {
  width: 240px;
}

/* команды */

.team-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.8em;
  color: #fff;
  background: var(--team-color, #888);
}

.team-row,
.teams-manager__member {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.team-row__label {
  flex: 1;
  min-width: 0;
}
.team-row__color {
  width: 36px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
}
.team-row__remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.teams-manager__member .team-select {
  margin-left: auto;
}
.roundMember.is-inactive {
  opacity: 0.5;
  text-decoration: line-through;
}

.chooser-member .team-select {
  display: block;
  margin-top: 4px;
  width: 100%;
}

g.ally circle {
  stroke-dasharray: 4 3;
  opacity: 0.8;
}

/**/
.ignite-available {
  filter: drop-shadow(0 0 4px #ff7a1a);
}

/* Стили окна затемнения и анимации ожидания*/
.anim-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: anim-fade-in 0.2s ease-out;
}
.anim-overlay.closing {
  animation: anim-fade-out 0.2s ease-in forwards;
}
.anim-text {
  color: #fff;
  font-size: 22px;
  text-align: center;
  padding: 0 20px;
}
.anim-text.changed {
  animation: anim-fade-in 0.25s ease-out;
}
.anim-dots {
  display: inline-block;
  width: 1.2em;
  text-align: left;
}
.anim-dots.hidden {
  display: none;
}
.anim-dots span {
  animation: anim-blink 1.4s infinite both;
}
.anim-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.anim-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes anim-blink {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}
@keyframes anim-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes anim-fade-out {
  to {
    opacity: 0;
  }
}

/* Арена во фрейме форума: остаётся только блок .main_content */
body.embed {
  background: none;
  padding: 0;
  min-height: 0;
}

body.embed .container {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
}

body.embed .main_title {
  display: none;
}

body.embed .main_content {
  box-shadow: none;
  border: none;
  padding: 0;
}