/* ===== Golden Empire theme (variant 9) ===== */

.coe-theme-golden {
  --coe-wood-1: #4a3018;
  --coe-wood-2: #6b4528;
  --coe-wood-3: #8a5a30;
  --coe-bronze: #c9944a;
  --coe-gold: #e8c060;
  --coe-gold-hi: #ffe8a0;
  --coe-parch: #f5e6c8;
  --coe-parch-deep: #e8d4a8;
  --coe-ruby: #c62828;
  --hud-h: 82px;
  --chat-h: 320px; /* ~10–12 строк лога */
  --rail-w: 248px;
}

.coe-theme-golden.coe-app {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 200, 100, 0.18) 0%, transparent 52%),
    linear-gradient(180deg, #3d2814 0%, #2a180c 45%, #1a0e08 100%);
}

/* HUD */
.coe-theme-golden .coe-hud {
  background:
    linear-gradient(180deg, #7a5028 0%, #4a3018 50%, #2a180c 100%);
  border-color: #c9944a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 160, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.coe-theme-golden .coe-hud::before,
.coe-theme-golden .coe-hud::after {
  border-color: rgba(255, 200, 100, 0.55);
}

.coe-theme-golden .coe-hbar {
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  background: rgba(10, 6, 4, 0.75);
  height: 14px;
  position: relative;
  overflow: hidden;
}

.coe-theme-golden .coe-hbar i {
  display: block;
  height: 100%;
  width: 50%;
  transition: width 0.15s ease;
}

.coe-theme-golden .coe-hbar.hp i {
  background: linear-gradient(180deg, #ff6050, #b82020 70%);
}

.coe-theme-golden .coe-hbar.res i {
  background: linear-gradient(180deg, #ffe070 0%, #e8b028 45%, #a87010 100%);
}

.coe-theme-golden .coe-hbar.res.mana i {
  background: linear-gradient(180deg, #7ecfff 0%, #3a98e8 48%, #1860b0 100%);
}

.coe-theme-golden .coe-hbar.xp i {
  background: linear-gradient(180deg, #8dff7a 0%, #3ecf3a 48%, #1a8a28 100%);
}

.coe-theme-golden .coe-hbar b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.coe-theme-golden .coe-ico .hud-icon-wrap {
  border: none;
  background: transparent;
  box-shadow: none;
}
.coe-theme-golden .coe-ico .hud-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

/* HUD меню — без рамок, только лёгкая тень; hover = свечение иконки */
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico .hud-icon-wrap {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico .hud-icon-wrap img {
  transition: filter 0.18s ease, opacity 0.18s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45)) !important;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico .hud-icon-wrap {
  position: relative;
  isolation: isolate;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico .hud-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.18s ease;
  box-shadow: 0 0 10px rgba(255, 210, 110, 0.85), 0 0 18px rgba(201, 148, 74, 0.45);
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico .hud-icon-wrap img {
  position: relative;
  z-index: 1;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico:hover .hud-icon-wrap::before,
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico:focus-visible .hud-icon-wrap::before {
  opacity: 1;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico:hover .hud-icon-wrap img,
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico:focus-visible .hud-icon-wrap img {
  filter:
    drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5))
    brightness(1.12)
    saturate(1.06) !important;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico:active .hud-icon-wrap img {
  filter:
    drop-shadow(0 0 4px rgba(255, 200, 90, 0.7))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55))
    brightness(1.06) !important;
}
.coe-theme-golden .coe-hud-minimal .coe-iconbar .coe-ico.locked .hud-icon-wrap img {
  filter: grayscale(0.45) brightness(0.72) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4)) !important;
}

/* Чат и списки — золотой скролл (не системный серый) */
.coe-theme-golden .coe-chat .chat-log,
.coe-theme-golden .coe-chat .chat-emotes,
.coe-theme-golden .coe-chat .chat-emote-popover,
.coe-theme-golden .coe-chat .chat-emote-grid,
.coe-theme-golden .residents-list,
.coe-theme-golden .kv-rail .quest-tracker {
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #c9944a #3a2818;
}
.coe-theme-golden .coe-chat .chat-log::-webkit-scrollbar,
.coe-theme-golden .coe-chat .chat-emotes::-webkit-scrollbar,
.coe-theme-golden .coe-chat .chat-emote-popover::-webkit-scrollbar,
.coe-theme-golden .coe-chat .chat-emote-grid::-webkit-scrollbar,
.coe-theme-golden .residents-list::-webkit-scrollbar,
.coe-theme-golden .kv-rail .quest-tracker::-webkit-scrollbar {
  width: 11px;
}
.coe-theme-golden .coe-chat .chat-log::-webkit-scrollbar-track,
.coe-theme-golden .coe-chat .chat-emotes::-webkit-scrollbar-track,
.coe-theme-golden .coe-chat .chat-emote-popover::-webkit-scrollbar-track,
.coe-theme-golden .coe-chat .chat-emote-grid::-webkit-scrollbar-track,
.coe-theme-golden .residents-list::-webkit-scrollbar-track,
.coe-theme-golden .kv-rail .quest-tracker::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(58, 38, 22, 0.75), rgba(22, 14, 10, 0.92));
  border-radius: 8px;
  border: 1px solid rgba(120, 78, 36, 0.4);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45);
}
.coe-theme-golden .coe-chat .chat-log::-webkit-scrollbar-thumb,
.coe-theme-golden .coe-chat .chat-emotes::-webkit-scrollbar-thumb,
.coe-theme-golden .coe-chat .chat-emote-popover::-webkit-scrollbar-thumb,
.coe-theme-golden .coe-chat .chat-emote-grid::-webkit-scrollbar-thumb,
.coe-theme-golden .residents-list::-webkit-scrollbar-thumb,
.coe-theme-golden .kv-rail .quest-tracker::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e0b058 0%, #a86828 45%, #5a3410 100%);
  border-radius: 8px;
  border: 2px solid #241608;
  min-height: 40px;
  box-shadow: inset 0 1px 0 rgba(255, 228, 170, 0.35);
}
.coe-theme-golden .coe-chat .chat-log::-webkit-scrollbar-thumb:hover,
.coe-theme-golden .residents-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f0c870, #b87030);
}

.coe-theme-golden .hud-face-wrap {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Stage — golden ornate frame around location (moon glade stays inside) */
.coe-theme-golden #stage {
  border: 4px solid #c9944a;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px #ffe8a0,
    inset 0 0 0 4px #4a3018,
    inset 0 0 24px rgba(255, 200, 100, 0.08),
    0 0 0 2px #2a180c,
    0 8px 24px rgba(0, 0, 0, 0.45);
  background: #1a1208;
}

.coe-theme-golden .coe-frame::before,
.coe-theme-golden .coe-frame::after {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 200, 100, 0.55);
}

.coe-theme-golden .coe-frame::before {
  box-shadow: -2px -2px 0 rgba(198, 40, 40, 0.45);
}

.coe-theme-golden .coe-frame::after {
  box-shadow: 2px -2px 0 rgba(198, 40, 40, 0.45);
}

/* Right rail panels — kv-rail остаётся светлым пергаментом */
.coe-theme-golden .rail-panel:not(.rail-quests):not(.rail-residents) {
  background: linear-gradient(180deg, #6b4528 0%, #3d2818 100%);
  border: 3px solid #c9944a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 160, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
.coe-theme-golden .right-rail.kv-rail .rail-panel,
.coe-theme-golden .kv-rail .rail-quests,
.coe-theme-golden .kv-rail .rail-residents {
  background: linear-gradient(180deg, #f3e6c4 0%, #e6d09a 55%, #d4b878 100%) !important;
  border: 2px solid #8a6838 !important;
  color: #1a1008 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 200, 0.45),
    0 3px 10px rgba(0, 0, 0, 0.3) !important;
}

.coe-theme-golden .rail-head {
  background: linear-gradient(180deg, #8a6030, #4a3018);
  color: #ffe8b0;
  letter-spacing: 0.08em;
}

.coe-theme-golden .rail-tabs {
  background: linear-gradient(180deg, #6b4528, #3d2818);
}

.coe-theme-golden .rail-tab.on {
  background: linear-gradient(180deg, #a87038, #6b4528);
  border-color: #e8c060;
  color: #fff8e0;
}

.coe-theme-golden .fantasy-frame {
  background: linear-gradient(165deg, #6b4528 0%, #3d2818 45%, #2a180c 100%) !important;
  border: 3px solid #c9944a !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 160, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

.coe-theme-golden .rail-quests.fantasy-frame .quest-tracker,
.coe-theme-golden .rail-residents.fantasy-frame .rail-body {
  background:
    linear-gradient(180deg, #f8ecd0 0%, #e8d4a8 55%, #d4b878 100%) !important;
  border: 2px solid #a87038;
  color: #2a1808;
}

/* Chat — thin golden frame (override fantasy-frame on #gameChat) */
.coe-theme-golden #gameChat.coe-chat,
.coe-theme-golden #gameChat.fantasy-frame {
  margin: 2px 6px 4px !important;
  padding: 0 !important;
  border: 2px solid #c9944a !important;
  border-radius: 4px !important;
  background: linear-gradient(180deg, #3d2818 0%, #24150c 100%) !important;
  box-shadow:
    inset 0 0 0 1px #ffe8a0,
    inset 0 0 0 2px #4a3018,
    0 3px 12px rgba(0, 0, 0, 0.4) !important;
}

.coe-theme-golden #gameChat .chat-head {
  background: linear-gradient(180deg, #6b4528, #3d2818) !important;
  border-bottom: 1px solid rgba(232, 192, 96, 0.35) !important;
  color: #ffe8c0 !important;
}

.coe-theme-golden #gameChat .chat-body {
  background: linear-gradient(180deg, #f5e6c8, #e8d4a8) !important;
  color: #2a1808 !important;
}

.coe-theme-golden #gameChat .chat-input-row {
  background: linear-gradient(180deg, #4a3018, #2a180c) !important;
  border-top: 1px solid rgba(201, 148, 74, 0.4) !important;
}

/* Play shell grid — chat spans full bottom */
.coe-theme-golden .play-shell {
  margin: 0 4px;
}

/* ===== Combat golden UI ===== */
.coe-golden-combat.combat-ui {
  pointer-events: none;
  z-index: 12;
  inset: 8px 10px 10px 10px;
}

.coe-golden-combat .skill-fan:not(.open) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

.coe-golden-combat .skill-fan.open {
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.15s ease, transform 0.18s ease;
  pointer-events: auto;
}

.coe-golden-combat .skill-fan.open .skill-ring-slot,
.coe-golden-combat .skill-fan.open .kv-wheel-x,
.coe-golden-combat .skill-fan.open .skill-ring-x {
  pointer-events: auto;
}

.coe-golden-combat .coe-combat-hud-top,
.coe-golden-combat .coe-combat-timer-wrap {
  pointer-events: none;
}

.coe-golden-combat .skill-ring-frame {
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.coe-golden-combat .skill-fan.mode-hero .skill-ring-frame {
  filter: none;
}

.coe-golden-combat .kv-skill-caption,
.coe-golden-combat .skill-fan.mode-enemy .kv-skill-caption,
.coe-golden-combat .skill-fan.mode-hero .kv-skill-caption {
  display: none !important;
}

.coe-golden-combat .skill-ring-slot {
  border: 2px solid #c9944a !important;
  background: radial-gradient(circle at 35% 30%, rgba(74, 48, 24, 0.96), rgba(26, 14, 8, 0.98)) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45) !important;
}

.coe-golden-combat .skill-fan.mode-hero .skill-ring-slot--buff {
  background: transparent !important;
  box-shadow: none !important;
}

.coe-golden-combat .skill-fan.mode-hero .skill-ring-slot--buff .skill-lock {
  background: transparent;
}

.coe-golden-combat .coe-combat-hud-top {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: min(100%, 360px);
  z-index: 14;
  pointer-events: none;
  width: auto;
  max-width: calc(100% - 16px);
}

.coe-golden-combat .coe-combat-meta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  gap: 2px;
  pointer-events: none;
}

.coe-golden-combat .combat-hud-status {
  display: block;
  max-width: min(320px, 92vw);
  text-align: center;
  font: 700 11px/1.25 Georgia, "Times New Roman", serif;
  color: #ffe8c0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: normal;
}
.coe-golden-combat .combat-hud-status--prep {
  color: #9cff9c;
}
.coe-golden-combat .combat-hud-status--sos {
  color: #ffb4b4;
  font-size: 10px;
}

.coe-golden-combat .coe-combat-timer-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  pointer-events: none;
}

.coe-golden-combat .combat-action-row {
  margin-top: 0;
  width: 100%;
  justify-content: center;
}

.coe-golden-combat .coe-golden-timer.turn-timer--ring {
  width: 62px !important;
  height: 62px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.coe-golden-combat .coe-golden-timer.turn-timer--ring .turn-timer-ring-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.coe-golden-combat .combat-sos-btn {
  border: 1px solid rgba(210, 78, 78, 0.88) !important;
  background: rgba(12, 6, 6, 0.82) !important;
  color: #ff6b6b !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.coe-golden-combat .combat-sos-btn:hover:not(:disabled) {
  background: rgba(38, 10, 10, 0.92) !important;
  border-color: rgba(255, 105, 105, 0.95) !important;
  color: #ff9595 !important;
  filter: none !important;
}
.coe-golden-combat .combat-sos-btn.on-cooldown,
.coe-golden-combat .combat-sos-btn:disabled {
  opacity: 0.38 !important;
  color: rgba(255, 120, 120, 0.55) !important;
  border-color: rgba(160, 70, 70, 0.45) !important;
}

.coe-golden-combat .coe-golden-timer .turn-timer-digit,
.coe-golden-combat .coe-golden-timer #turnTimerText {
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coe-golden-combat .party-ready-box {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  order: 20;
  flex: 0 0 auto;
  margin: 5px auto 0;
  width: min(158px, 72vw);
  min-height: 0;
  padding: 4px 6px 5px;
  font-size: 8px;
  line-height: 1.12;
  border: 1px solid rgba(201, 148, 74, 0.38);
  background: linear-gradient(168deg, rgba(28, 20, 14, 0.9), rgba(12, 9, 6, 0.86));
  z-index: 12;
  pointer-events: none;
  text-align: left;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
}

.coe-golden-combat .party-queue-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px;
  min-height: 14px;
  margin-bottom: 4px;
}

.coe-golden-combat .party-queue-round {
  font: 800 10px/1.15 Georgia, "Times New Roman", serif;
  color: #f3e2c4;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.coe-golden-combat .party-queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 14px;
  padding: 0 6px;
  border-radius: 999px;
  font: 700 8px/1 "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffe8c8;
  background: rgba(201, 148, 74, 0.22);
  border: 1px solid rgba(201, 148, 74, 0.45);
  white-space: nowrap;
}
.coe-golden-combat .party-queue-badge[data-kind="strike"] {
  color: #d8ffd8;
  border-color: rgba(100, 220, 120, 0.55);
  background: rgba(20, 48, 28, 0.65);
}
.coe-golden-combat .party-queue-badge[data-kind="mobs"] {
  color: #ffd4cc;
  border-color: rgba(255, 120, 100, 0.5);
  background: rgba(48, 16, 14, 0.65);
}
.coe-golden-combat .party-queue-badge[data-kind="prep"] {
  color: #fff0c0;
  border-color: rgba(255, 210, 120, 0.5);
  background: rgba(48, 36, 12, 0.55);
}

.coe-golden-combat .party-track.combat-turn-order {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  min-height: 24px;
  margin: 0;
}
.coe-golden-combat .combat-turn-order[hidden] { display: none !important; }

.coe-golden-combat .party-track-seg {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-rows: 11px 11px;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 2px 1px;
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.28);
  background: rgba(12, 9, 6, 0.75);
  opacity: 0.72;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.coe-golden-combat .party-track-seg.me {
  border-color: rgba(120, 190, 255, 0.45);
}
.coe-golden-combat .party-track-seg.on {
  opacity: 1;
  border-color: rgba(120, 255, 140, 0.75);
  background: rgba(16, 40, 22, 0.88);
  box-shadow: 0 0 0 1px rgba(80, 200, 100, 0.25);
}
.coe-golden-combat .party-track-seg.done {
  opacity: 0.5;
}
.coe-golden-combat .party-track-seg.ready {
  opacity: 0.92;
  border-color: rgba(255, 210, 110, 0.55);
}
.coe-golden-combat .party-track-seg.mob {
  flex: 0 0 38px;
  max-width: 38px;
}
.coe-golden-combat .party-track-seg.mob.on {
  opacity: 1;
  border-color: rgba(255, 120, 100, 0.65);
  background: rgba(48, 14, 12, 0.88);
}

.coe-golden-combat .party-track-ix {
  font: 800 8px/1 "Segoe UI", sans-serif;
  color: #e8c890;
  font-variant-numeric: tabular-nums;
}
.coe-golden-combat .party-track-nm {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font: 700 8px/1.05 "Segoe UI", sans-serif;
  color: #efe0c8;
  padding: 0 1px;
  box-sizing: border-box;
}
.coe-golden-combat .party-track-seg.on .party-track-nm { color: #eaffea; }
.coe-golden-combat .party-track-seg.mob.on .party-track-nm { color: #ffd8d0; }

.coe-golden-combat .party-ready-box--strike .party-ready-list {
  display: none !important;
}
.coe-golden-combat .party-ready-box--prep .party-track {
  margin-bottom: 4px;
}

.coe-golden-combat .party-ready-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: calc(var(--party-slot-rows, 2) * 17px);
}

.coe-golden-combat .party-slot-row {
  display: grid;
  grid-template-columns: 14px 1fr 44px;
  align-items: center;
  gap: 4px;
  height: 17px;
  padding: 0 2px;
  border-radius: 6px;
}
.coe-golden-combat .party-slot-row.me {
  background: rgba(80, 120, 180, 0.12);
}
.coe-golden-combat .party-slot-row.ready-ok {
  background: rgba(60, 140, 80, 0.1);
}

.coe-golden-combat .party-slot-ix {
  font: 800 8px/1 "Segoe UI", sans-serif;
  color: #c9944a;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.coe-golden-combat .party-slot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 9px/1.15 "Segoe UI", sans-serif;
  color: #efe4d0;
}
.coe-golden-combat .party-slot-st {
  justify-self: end;
  min-width: 44px;
  text-align: right;
  font: 700 8px/1 "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(232, 212, 168, 0.75);
}
.coe-golden-combat .party-slot-st.ok { color: #9cff9c; }
.coe-golden-combat .party-slot-st.pick { color: #ffe08a; }
.coe-golden-combat .party-slot-st.wait { color: rgba(232, 212, 168, 0.55); }
.coe-golden-combat .party-slot-st.off { color: #ff9a9a; }

html.is-mobile .coe-golden-combat .party-ready-box {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  margin: 4px auto 0 !important;
  width: min(152px, 76vw) !important;
}

.coe-golden-combat .combat-fight-ref {
  position: static;
  transform: none;
  z-index: 12;
  margin: 0 0 2px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.45);
  background: rgba(8, 6, 4, 0.72);
  color: #e8d4a8;
  font: 600 9px/1.2 Consolas, "Segoe UI", monospace;
  cursor: pointer;
  letter-spacing: 0.02em;
  pointer-events: auto;
  max-width: min(280px, 90vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coe-golden-combat .combat-fight-ref:hover {
  border-color: rgba(126, 200, 255, 0.65);
  color: #fff4dc;
}
.coe-golden-combat .coe-turn-hint.coe-turn-hint--sos-hidden {
  display: none !important;
}
.coe-golden-combat .coe-turn-hint.coe-turn-hint--meta-only {
  display: none !important;
}

.coe-golden-combat .combat-hint.coe-turn-hint {
  text-align: center;
  pointer-events: none;
  line-height: 1.2;
  white-space: normal;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  width: auto;
  max-width: min(268px, 88vw);
  opacity: 1 !important;
  visibility: visible !important;
  min-width: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 8px rgba(0, 0, 0, 0.55));
}

.coe-golden-combat .coe-turn-hint strong {
  display: inline;
  font-size: 11px;
  font-weight: 900;
  color: #7cff7c;
}

.coe-golden-combat .coe-turn-hint span {
  display: inline;
  font-size: 10px;
  font-weight: 700;
  color: #ffe8c0;
}

.coe-golden-combat.coe-combat-assist .party-ready-box,
.coe-golden-combat.coe-combat-assist .combat-turn-order,
.coe-golden-combat.coe-combat-assist .combat-hint.coe-turn-hint {
  max-width: min(168px, 80vw);
}
.coe-golden-combat.coe-combat-assist .cto-pill {
  padding: 2px 6px 2px 4px;
  font-size: 10px;
}
.coe-golden-combat.coe-combat-assist .ready-row {
  font-size: 10px;
  line-height: 1.15;
}

.coe-golden-combat .hidden {
  display: none !important;
}

.coe-golden-combat .combat-bottom {
  display: none;
}

/* Загрузка боя — низ экрана, не перекрывает всю сцену */
.combat-boot-shield {
  position: absolute;
  inset: 0;
  z-index: 88;
  pointer-events: auto;
  background: linear-gradient(to top, rgba(12, 8, 5, 0.72) 0%, rgba(12, 8, 5, 0.08) 42%, transparent 58%);
  transition: opacity 0.35s ease;
}
.combat-boot-shield.combat-boot-shield--out {
  opacity: 0;
  pointer-events: none;
}
.combat-boot-panel {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 89;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(42, 28, 18, 0.94), rgba(22, 14, 9, 0.96));
  border: 1px solid rgba(201, 148, 74, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 160, 0.12);
  pointer-events: none;
  min-width: min(92vw, 320px);
}
.combat-boot-ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.combat-boot-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.combat-boot-ring-bg {
  fill: none;
  stroke: rgba(255, 220, 160, 0.12);
  stroke-width: 5;
}
.combat-boot-ring-fill {
  fill: none;
  stroke: #c9944a;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s ease-out;
  filter: drop-shadow(0 0 4px rgba(255, 180, 80, 0.45));
}
.combat-boot-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px/1 system-ui, Segoe UI, sans-serif;
  color: #ffe8c8;
  text-shadow: 0 1px 4px #000;
}
.combat-boot-copy strong {
  display: block;
  font: 650 15px/1.25 Georgia, "Times New Roman", serif;
  color: #f3e6c8;
  letter-spacing: 0.02em;
}
.combat-boot-copy span {
  display: block;
  margin-top: 3px;
  font: 600 11px/1.35 system-ui, Segoe UI, sans-serif;
  color: rgba(255, 220, 180, 0.78);
}

/* Battle frame — pure CSS, canvas stays visible underneath */
.coe-battle-chrome {
  display: none;
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  border: 2px solid #c9944a;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px #ffe8a0,
    inset 0 0 0 2px #4a3018;
  box-sizing: border-box;
}

.coe-battle-chrome::before,
.coe-battle-chrome::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 200, 100, 0.65);
  pointer-events: none;
}

.coe-battle-chrome::before {
  top: 3px;
  left: 3px;
  border-right: 0;
  border-bottom: 0;
}

.coe-battle-chrome::after {
  top: 3px;
  right: 3px;
  border-left: 0;
  border-bottom: 0;
}

#app.combat-active #btnInv,
#app.combat-active #btnCharacter,
#app.combat-active #btnCharPanel,
#app.combat-active #btnShop,
#app.combat-active #btnMap,
#app.combat-active #btnWarehouse,
#app.combat-active #btnMail,
#app.combat-active #btnAlchemy,
#app.combat-active #btnFair,
#app.combat-active #btnClan,
#app.combat-active #btnSmith,
#app.combat-active #btnSkills {
  pointer-events: none;
  opacity: 0.35;
  filter: grayscale(0.4);
}

#app.combat-active .coe-battle-chrome {
  display: block;
}

#app.combat-active.coe-theme-golden #gameChat {
  display: flex !important;
}

#app.combat-active.coe-theme-golden .play-shell {
  grid-template-columns: 1fr;
  background: transparent;
  margin: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
}

/* Боевой рюкзак-овал на чёрном поле слева от сцены */
.combat-belt-oval {
  position: absolute;
  z-index: 24;
  width: 96px;
  pointer-events: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}
.combat-belt-oval.hidden { display: none !important; }
.combat-belt-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.combat-belt-links path {
  fill: none;
  stroke: rgba(201, 148, 74, 0.75);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.combat-belt-spine {
  display: none !important;
}
.combat-belt-slots {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.combat-belt-slot {
  position: absolute;
  left: calc(var(--bx) * 100%);
  top: calc(var(--by) * 100%);
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border: 2px solid #c9944a;
  background: rgba(36, 24, 14, 0.92);
  box-shadow: inset 0 0 0 1px rgba(20, 12, 6, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.combat-belt-slot.shape-circle { border-radius: 50%; }
.combat-belt-slot.shape-square {
  width: 46px;
  height: 46px;
  border-radius: 7px;
}
.combat-belt-slot.is-backpack {
  width: 48px;
  height: 48px;
  background: rgba(48, 32, 18, 0.95);
  border-color: #e0b45a;
}
.combat-belt-slot img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
}
.combat-belt-slot.is-backpack img {
  width: 82%;
  height: 82%;
}
.combat-belt-slot img.hidden { display: none; }
.combat-belt-count {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 14px;
  padding: 0 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 14px;
  color: #fff8e8;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.combat-belt-count.hidden { display: none; }
.combat-belt-slot:hover {
  filter: brightness(1.12);
  border-color: #ffe08a;
}
.combat-belt-slot.is-locked {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: #6a5340;
  background: rgba(18, 12, 8, 0.88);
  filter: grayscale(0.35);
}
.combat-belt-slot.is-locked:hover {
  filter: grayscale(0.35);
  border-color: #6a5340;
}
.coe-quick-slot.locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

#app.combat-active.coe-theme-golden .right-rail {
  display: none !important;
}

#app.combat-active.coe-theme-golden #stage {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 990 / 454;
  border: none !important;
  border-radius: 3px !important;
  background: #0a0604 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
  overflow: hidden;
}

#app.combat-active.coe-theme-golden #gameCanvas {
  z-index: 3;
}

#app.combat-active.coe-theme-golden .coe-frame {
  display: none !important;
}

.coe-golden-combat .combat-assist-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 14;
  pointer-events: auto;
  font-size: 11px;
  padding: 4px 10px;
}

#app.combat-active.coe-theme-golden.coe-app {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 200, 100, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #2a180c 0%, #1a0e08 100%);
}

/* ===== Shop — стиль CoE-иконок (золото / тёмный металл) ===== */
.overlay .panel.coe-shop {
  max-width: min(720px, 94vw);
  padding: 18px 18px 14px;
  position: relative;
  border: 2px solid #c9944a;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(232, 192, 96, 0.14) 0%, transparent 45%),
    linear-gradient(165deg, #2a2218 0%, #141018 48%, #0c1018 100%);
  box-shadow:
    0 0 0 1px #3a2a14,
    inset 0 0 0 1px rgba(255, 232, 160, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.55);
}
.coe-shop-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.coe-shop-badge {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}
.coe-shop-head h2 {
  margin: 0 0 2px;
  color: #ffe8a0;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 1px 2px #000;
}
.coe-shop-card .name {
  color: #f0e0c8;
  font-weight: 600;
}
.coe-shop-desc {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.35;
}
.coe-shop-tab {
  font-weight: 600;
}
.coe-shop-card .meta, .coe-shop-have { font-weight: 400; }
.btn.tiny { font-weight: 600; }

/* ===== Leaderboard panel ===== */
.overlay .panel.coe-lb-panel {
  position: relative;
  max-width: min(620px, 96vw);
  padding: 20px 18px 16px;
  border: 2px solid #c9944a;
  border-radius: 14px;
  background: linear-gradient(165deg, #2a2218 0%, #141018 48%, #0c1018 100%);
}
.coe-lb-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  min-width: 84px;
  padding: 6px 12px !important;
  font-weight: 800 !important;
}
.coe-lb-head { display: flex; align-items: center; gap: 12px; margin: 0 96px 12px 0; }
.coe-lb-badge { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); flex-shrink: 0; }
.coe-lb-head h2 { margin: 0; color: #ffe8a0; font-size: 20px; font-weight: 700; }
.coe-lb-head .meta { margin: 2px 0 0; color: #b8a888; font-weight: 400; font-size: 11px; }
.coe-lb-head .coe-lb-sub { color: #c9a878; font-size: 11px; line-height: 1.35; max-width: 420px; }
.lb-overall-hint {
  margin: 0 0 8px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #b8a888;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.2);
}
.coe-lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 10px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(201, 148, 74, 0.28);
  border-radius: 10px;
}
.coe-lb-tab {
  flex: 1 1 auto;
  min-width: 76px;
  padding: 9px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #c9b48a;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coe-lb-tab.on {
  background: linear-gradient(180deg, #6a5030, #3a2818);
  color: #ffe8c0;
  border-color: #c9944a;
  box-shadow: inset 0 1px 0 rgba(255, 232, 160, 0.18);
}
.coe-lb-scroll {
  max-height: min(58vh, 460px);
  overflow: auto;
  overflow-x: hidden;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(201, 148, 74, 0.22);
  padding-right: 2px;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #c9944a #1a120c;
}
.coe-lb-scroll::-webkit-scrollbar {
  width: 13px;
}
.coe-lb-scroll::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(48, 32, 18, 0.65), rgba(14, 10, 8, 0.92));
  border-radius: 10px;
  margin: 4px 2px;
  border: 1px solid rgba(120, 78, 36, 0.45);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}
.coe-lb-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, #e0b058 0%, #a86828 42%, #5a3410 100%);
  border-radius: 10px;
  border: 2px solid #241608;
  min-height: 48px;
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 170, 0.4),
    0 0 0 1px rgba(160, 100, 40, 0.35);
}
.coe-lb-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f0c870, #b87030);
}
.coe-lb-scroll::-webkit-scrollbar-corner {
  background: transparent;
}
.lb-table { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 500; table-layout: fixed; }
.lb-table th, .lb-table td { padding: 7px 8px; border-bottom: 1px solid rgba(201,148,74,0.18); text-align: left; vertical-align: middle; }
.lb-table th { color: #c9a878; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0; background: #1a140e; z-index: 1; }
.lb-table td { color: #e8dcc8; }
.lb-table th:nth-child(1), .lb-table td.lb-place { width: 36px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; color: #d4bc88; }
.lb-table:not(.lb-players) th:nth-child(2), .lb-rank-col { width: 28px; text-align: center; padding-left: 2px; padding-right: 2px; }
.lb-table.lb-players {
  table-layout: auto;
}
.lb-table.lb-players th:nth-child(2),
.lb-table.lb-players td.lb-nick {
  width: auto;
  min-width: 140px;
  max-width: 220px;
}
.lb-table.lb-players th:nth-child(3),
.lb-table.lb-players td:nth-child(3) { width: 44px; text-align: right; }
.lb-table.lb-players th:nth-child(4),
.lb-table.lb-players td:nth-child(4) { width: 68px; text-align: right; }
.lb-table.lb-players th:nth-child(5),
.lb-table.lb-players td:nth-child(5) { width: 76px; text-align: right; }
.lb-table.lb-players th:nth-child(6),
.lb-table.lb-players td:nth-child(6) {
  width: auto;
  min-width: 52px;
  text-align: left;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
.lb-table th:nth-child(4), .lb-table th:nth-child(5),
.lb-table td.lb-num { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.lb-table.lb-overall th:nth-child(4), .lb-table.lb-overall td.lb-side { width: 56px; text-align: center; }
.lb-table.lb-overall th:nth-child(5),
.lb-table.lb-overall th:nth-child(6),
.lb-table.lb-overall th:nth-child(7),
.lb-table.lb-overall td.lb-num { width: 64px; }
.lb-side { font-size: 11px; font-weight: 700; }
.lb-side.north { color: #9ad4ff; }
.lb-side.south { color: #ffb080; }
.lb-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-table tr.lb-me td { color: #ffe8a0; background: rgba(201, 148, 74, 0.12); font-weight: 700; }
.lb-table tr.lb-top1 td.lb-place { color: #ffd54f; }
.lb-table tr.lb-top2 td.lb-place { color: #e0e0e0; }
.lb-table tr.lb-top3 td.lb-place { color: #d4a574; }
.lb-rank-col { white-space: nowrap; overflow: hidden; }
.lb-rank { display: inline-flex; align-items: center; justify-content: center; }
.lb-rank img { width: 16px; height: 16px; object-fit: contain; }
.coe-profile-rank { display: inline-flex; align-items: center; gap: 4px; color: #e8c878; }
.coe-profile-rank img { width: 16px; height: 16px; object-fit: contain; }
.coe-glory-box {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px solid rgba(201, 148, 74, 0.35);
  border-radius: 6px;
  background: rgba(40, 28, 12, 0.45);
  font-size: 12px;
  line-height: 1.35;
  color: #e8dcc8;
}
.coe-glory-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #e8c878;
  margin-bottom: 4px;
}
.coe-glory-title .hud-rank-ico { width: 20px; height: 20px; }
.coe-glory-next { margin: 2px 0; }
.coe-glory-day { color: #b8a888; margin: 2px 0; }
.coe-glory-hint { margin-top: 6px; color: #a89878; font-size: 11px; font-weight: 400; }
.lb-empty { padding: 18px 8px; color: #b8a888; font-weight: 400; text-align: center; }
.lb-ban-nick, .lb-ban-flag { color: #d06050; font-weight: 700; }
.lb-table tr.lb-ban-row td { background: rgba(120, 30, 20, 0.12); }
.lb-ban-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 2px 8px; }
.lb-ban-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px;
  padding: 5px 8px; font-size: 12px; line-height: 1.35; color: #d8cbb8;
  border-radius: 6px; background: rgba(0,0,0,0.18);
}
.lb-ban-line.on { background: rgba(120, 30, 20, 0.18); }
.lb-ban-sep { color: #8a7a60; }
.lb-ban-reason { color: #e0c8b0; }
.lb-ban-when, .lb-ban-by { color: #b8a888; font-size: 11px; }
.lb-ban-on { color: #d06050; font-weight: 700; font-size: 10px; text-transform: uppercase; }
.lb-ban-off { color: #7a7060; font-size: 10px; }
.lb-clans-sum {
  padding: 8px 10px 6px;
  color: #b8a888;
  font-size: 11px;
  border-bottom: 1px solid rgba(201,148,74,0.18);
}
.lb-clans-sum b { color: #ffe8a0; }
.lb-table.lb-clans td.lb-clan-name { line-height: 1.25; }
.lb-clan-leader {
  display: block;
  font-size: 10px;
  color: #a89878;
  font-weight: 500;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-clan-ico {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}
.lb-clan-count {
  width: 88px !important;
  text-align: right;
}
.lb-clan-n {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #e8dcc8;
}
.lb-clan-bar {
  display: block;
  height: 3px;
  margin-top: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
}
.lb-clan-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a6030, #e8c070);
}
.lb-table.lb-clans tr[data-clan-view] { cursor: pointer; }
.lb-table.lb-clans tr[data-clan-view]:hover td { background: rgba(201, 148, 74, 0.08); }

/* —— Кубик группового лута —— */
.party-dice-layer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 4, 2, 0.62);
  animation: partyDiceFadeIn 0.25s ease-out;
}
.party-dice-layer.out { opacity: 0; transition: opacity 0.25s ease; pointer-events: none; }
@keyframes partyDiceFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.party-dice-panel {
  width: min(360px, 94vw);
  padding: 18px 16px 14px;
  text-align: center;
  max-height: min(90vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(165deg, rgba(42, 28, 14, 0.96), rgba(18, 12, 8, 0.98));
  border: 1px solid rgba(201, 148, 74, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 140, 0.12);
}
.party-dice-panel h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #ffe8a0;
  letter-spacing: 0.04em;
}
.party-dice-sub { margin: 0 0 10px; color: #a89878; font-size: 11px; }
.party-dice-loot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.party-dice-loot-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  border: 1px solid rgba(201, 148, 74, 0.3);
  opacity: 0;
  animation: partyDiceRowIn 0.22s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.04s);
}
.party-dice-loot-line img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}
.party-dice-loot-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  color: #e8dcc8;
  line-height: 1.2;
  word-break: break-word;
}
.party-dice-loot-qty {
  flex-shrink: 0;
  font-weight: 800;
  color: #ffe8a0;
  font-variant-numeric: tabular-nums;
}
.party-dice-loot-ico {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.3);
}
.party-dice-loot-ico img { width: 28px; height: 28px; object-fit: contain; }
.party-dice-stage {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  perspective: 420px;
}
.party-dice-cube {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #c9944a 0%, #8a6030 45%, #5a3a18 100%);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 2px 0 rgba(255, 230, 160, 0.35),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}
.party-dice-cube.spinning {
  animation: partyDiceSpin 0.45s linear infinite;
}
.party-dice-cube.landed {
  animation: partyDiceLand 0.45s ease-out;
}
@keyframes partyDiceSpin {
  0% { transform: rotateX(0deg) rotateY(0deg) scale(1); }
  50% { transform: rotateX(180deg) rotateY(90deg) scale(1.08); }
  100% { transform: rotateX(360deg) rotateY(180deg) scale(1); }
}
@keyframes partyDiceLand {
  0% { transform: scale(1.2) rotateZ(-8deg); }
  60% { transform: scale(0.94) rotateZ(3deg); }
  100% { transform: scale(1) rotateZ(0); }
}
.party-dice-face {
  font-size: 28px;
  font-weight: 800;
  color: #1a1008;
  text-shadow: 0 1px 0 rgba(255, 230, 160, 0.45);
  font-variant-numeric: tabular-nums;
}
.party-dice-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.party-dice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 148, 74, 0.15);
  opacity: 0;
  animation: partyDiceRowIn 0.3s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.08s);
}
@keyframes partyDiceRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.party-dice-row.mine { border-color: rgba(201, 148, 74, 0.4); }
.party-dice-row.win.reveal {
  background: rgba(201, 148, 74, 0.18);
  border-color: rgba(232, 192, 112, 0.65);
  box-shadow: 0 0 12px rgba(201, 148, 74, 0.25);
}
.party-dice-nick {
  font-weight: 700;
  color: #e8dcc8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.party-dice-pip {
  min-width: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #b8a888;
  text-align: right;
}
.party-dice-pip.locked { color: #ffe8a0; }
.party-dice-row.win.reveal .party-dice-pip { color: #fff0c0; font-size: 16px; }
.party-dice-result {
  min-height: 1.3em;
  margin: 0 0 12px;
  color: #a89878;
  opacity: 0;
  transition: opacity 0.25s;
}
.party-dice-result.on { opacity: 1; color: #ffe8a0; }
.party-dice-result b { color: #fff4d0; }
.party-dice-ok { width: 100%; }
.party-dice-ok:disabled { opacity: 0.45; cursor: default; }

.coe-lb-panel { position: relative; }
.lb-player-card-wrap { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lb-player-backdrop { position: absolute; inset: 0; background: rgba(8, 6, 4, 0.55); }
.lb-player-card { position: relative; z-index: 1; width: min(320px, 100%); margin: 0; padding: 16px 14px 12px; }
.lb-player-card .coe-lb-close { top: 6px; right: 6px; min-width: 36px; padding: 4px 8px !important; }
.lb-player-nick { margin: 0 32px 12px 0; font-size: 17px; display: flex; align-items: center; gap: 4px; }
.lb-player-stats { margin: 0; display: grid; gap: 8px; font-size: 13px; }
.lb-player-stats div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(201,148,74,0.15); padding-bottom: 4px; }
.lb-player-stats dt { margin: 0; color: #b8a888; font-weight: 600; }
.lb-player-stats dd { margin: 0; color: #e8dcc8; font-weight: 700; text-align: right; }
.lb-nick-btn { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-nick-btn:hover { text-decoration: underline; }
.lb-player-mod { margin-top: 12px; justify-content: flex-start; gap: 8px; }
html.is-mobile .overlay .panel.coe-lb-panel {
  width: calc(100vw - 12px);
  max-width: 100%;
  padding: 14px 10px 12px;
  border-radius: 12px;
}
html.is-mobile .coe-lb-close { top: 8px; right: 8px; min-width: 76px; padding: 6px 10px !important; }
html.is-mobile .coe-lb-head { margin-right: 88px; gap: 8px; }
html.is-mobile .coe-lb-badge { width: 36px; height: 36px; }
html.is-mobile .coe-lb-head h2 { font-size: 17px; }
html.is-mobile .coe-lb-tabs { margin-bottom: 8px; }
html.is-mobile .coe-lb-tab { font-size: 12px; padding: 10px 4px; }
html.is-mobile .coe-lb-scroll {
  max-height: min(62vh, 480px);
  -webkit-overflow-scrolling: touch;
}
html.is-mobile .lb-table { font-size: 13px; }
html.is-mobile .lb-table th, html.is-mobile .lb-table td { padding: 8px 6px; }
html.is-mobile .lb-table th:nth-child(4), html.is-mobile .lb-table th:nth-child(5),
html.is-mobile .lb-table td.lb-num { width: 64px; }
.coe-shop-head .meta {
  margin: 0;
  color: #c9b48a;
}

/* ===== Support / donate panel ===== */
.overlay .panel.coe-support {
  max-width: min(440px, 94vw);
  position: relative;
}
.coe-panel-x {
  position: sticky;
  top: 0;
  float: right;
  z-index: 5;
  margin: -6px -4px 0 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(201, 148, 74, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, #6b4528, #3a2414);
  color: #ffe8a0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}
.coe-panel-x:hover { filter: brightness(1.1); }
.coe-support-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding-top: 10px;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, rgba(14, 8, 9, 0.96) 28%);
}
.coe-support-body {
  margin: 4px 0 14px;
}
.coe-support-lead {
  margin: 0 0 14px;
  color: #e8dcc8;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
}
.coe-support-lead b {
  color: #ffe8a0;
  font-weight: 600;
}
.coe-support-card-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(201, 148, 74, 0.55);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 192, 96, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, rgba(42, 32, 20, 0.9), rgba(12, 14, 20, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 232, 160, 0.08);
  text-align: center;
}
.coe-support-bank {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9a878;
  font-weight: 600;
  margin-bottom: 8px;
}
.coe-support-number {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(15px, 4.2vw, 20px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffe8a0;
  text-shadow: 0 1px 2px #000;
  user-select: all;
  word-break: break-all;
}
.coe-support-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #b8a888;
  font-weight: 400;
}
.coe-support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.coe-support-actions .btn {
  min-width: 140px;
}
.coe-support-actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.overlay .panel.coe-vip {
  max-width: min(520px, 94vw);
}
.coe-vip-status {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(0, 0, 0, 0.28);
  color: #ffe8a0;
  font-size: 13px;
  text-align: center;
}
.coe-vip-status b {
  color: #fff2c0;
}
.coe-vip-ol {
  margin: 8px 0 0;
  padding-left: 1.25em;
  text-align: left;
  color: #e8dcc8;
  font-size: 13px;
  line-height: 1.45;
}
.coe-vip-ol li {
  margin: 0 0 6px;
}
.coe-vip-ol b {
  color: #ffe8a0;
}

/* ===== Feedback (bugs / ideas) ===== */
.overlay .panel.coe-feedback {
  max-width: min(520px, 94vw);
}
.coe-feedback-tabs { margin-bottom: 8px; }
.coe-feedback-scroll { max-height: min(50vh, 420px); }
.coe-feedback-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #d8c8a8;
}
.coe-feedback-label {
  display: block;
  font-size: 11px;
  color: #b8a888;
  margin: 10px 0 4px;
}
.coe-feedback-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #6b4424;
  background: rgba(20, 12, 8, 0.65);
  color: #f0e0c0;
  font: inherit;
  resize: vertical;
}
.coe-feedback-shot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.coe-feedback-shot-row input[type="file"] {
  max-width: 100%;
  font-size: 12px;
  color: #c9a878;
}
.coe-feedback-preview {
  margin-top: 10px;
  text-align: center;
}
.coe-feedback-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid #6b4424;
}
.coe-fb-divider {
  height: 1px;
  margin: 16px 0 12px;
  background: linear-gradient(90deg, transparent, #6b4424, transparent);
}
.coe-fb-section { margin-top: 4px; }
.coe-fb-section--admin {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(107, 68, 36, 0.65);
}
.coe-fb-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe08a;
  letter-spacing: 0.02em;
}
.coe-fb-empty {
  margin: 0;
  font-size: 13px;
  color: #a89070;
  font-style: italic;
}
.coe-fb-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coe-fb-card {
  border: 1px solid #5a3820;
  border-radius: 10px;
  background: rgba(12, 8, 5, 0.55);
  overflow: hidden;
}
.coe-fb-card--bug { border-color: #7a4028; }
.coe-fb-card-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "nick date"
    "preview preview"
    "badge chev";
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #f0e0c0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.coe-fb-card-head:hover { background: rgba(255, 183, 77, 0.06); }
.coe-fb-card-nick {
  grid-area: nick;
  font-weight: 700;
  color: #ffd89a;
  font-size: 13px;
}
.coe-fb-card-date {
  grid-area: date;
  font-size: 11px;
  color: #a89070;
  justify-self: end;
}
.coe-fb-card-preview {
  grid-area: preview;
  font-size: 12px;
  color: #c9b898;
  line-height: 1.35;
  margin-top: 2px;
}
.coe-fb-card-badge {
  grid-area: badge;
  font-size: 11px;
  color: #b8a888;
}
.coe-fb-card-chevron {
  grid-area: chev;
  justify-self: end;
  color: #ffb74d;
  font-size: 14px;
}
.coe-fb-card-body {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(107, 68, 36, 0.45);
}
.coe-fb-card.open .coe-fb-card-body { display: block; }
.coe-fb-card.open .coe-fb-card-preview { display: none; }
.coe-fb-card-text {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #efe2cc;
}
.coe-fb-card-meta { margin: 8px 0 0; font-size: 11px; }
/* Не display:none — мобилки; не clip:0 — иначе на ПК нет диалога файла */
.coe-fb-shot-add-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}
.coe-fb-shot-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
  font-size: 0;
}
.coe-fb-shot-input::file-selector-button {
  cursor: pointer;
}
.coe-fb-shots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.coe-fb-shot-tile {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #6b4424;
  background: #1a1008;
}
.coe-fb-shot-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.coe-fb-shot-rm {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #ffb4a2;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.coe-fb-shot-add-face {
  position: absolute;
  inset: 0;
  border: 1px dashed #8b6040;
  border-radius: 8px;
  background: rgba(20, 12, 8, 0.45);
  color: #d8c8a8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}
.coe-fb-shot-add-wrap:hover .coe-fb-shot-add-face {
  border-color: #ffb74d;
  background: rgba(255, 183, 77, 0.08);
}
.coe-feedback-paste-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #9a8868;
  color: #ffb74d;
}
.coe-fb-shots-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.coe-fb-shot-link {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #6b4424;
}
.coe-fb-shot-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.coe-feedback-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  padding-left: 2px;
}
.coe-feedback-ico-pick {
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.coe-feedback-ico-pick.on {
  border-color: #ffb74d;
  box-shadow: 0 0 10px rgba(255, 183, 77, 0.35);
}
.coe-feedback-ico-pick img {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 50%;
}

/* ===== Mail panel v2: friends sidebar + compose ===== */
.overlay .panel.coe-mail.coe-mail-v2 {
  max-width: min(720px, 96vw);
  width: min(720px, 96vw);
  position: relative;
  max-height: min(90vh, 680px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px;
}
.coe-mail-v2-head {
  padding-right: 36px;
  margin-bottom: 8px;
}
.coe-mail-v2-head h2 {
  margin: 0;
  font-size: 18px;
  color: #ffe8a0;
}
.coe-mail-v2-head .meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: #c9b48a;
}
.coe-mail-v2-body {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 10px;
  min-height: 0;
  flex: 1;
}
.coe-mail-aside {
  border: 1px solid rgba(201, 148, 74, 0.4);
  border-radius: 10px;
  background: rgba(8, 10, 16, 0.45);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.coe-mail-aside-title {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #c9b48a;
  border-bottom: 1px solid rgba(201, 148, 74, 0.3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.coe-mail-flist {
  overflow-y: auto;
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.coe-mail-frow {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #e8dcc8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.coe-mail-frow .coe-mail-fdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #666;
}
.coe-mail-frow.online .coe-mail-fdot { background: #6dce7a; box-shadow: 0 0 6px rgba(109, 206, 122, 0.55); }
.coe-mail-frow.offline { opacity: 0.45; cursor: not-allowed; }
.coe-mail-frow.on {
  border-color: rgba(201, 148, 74, 0.65);
  background: linear-gradient(180deg, rgba(106, 80, 48, 0.55), rgba(58, 40, 24, 0.55));
}
.coe-mail-frow:not(:disabled):hover {
  border-color: rgba(201, 148, 74, 0.45);
  background: rgba(42, 32, 20, 0.45);
}
.coe-mail-fnick { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coe-mail-fstat { font-size: 9px; color: #a89878; white-space: nowrap; }
.coe-mail-fempty { padding: 10px; margin: 0; }
.coe-mail-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.coe-mail-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coe-mail-to {
  font-size: 13px;
  color: #e8dcc8;
}
.coe-mail-to b { color: #ffe8a0; }
.coe-mail-hint { margin: 0; font-size: 11px; }
.coe-mail-admin-comp {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
}
@media (max-width: 640px) {
  .coe-mail-v2-body {
    grid-template-columns: 1fr;
  }
  .coe-mail-aside {
    max-height: 140px;
  }
  .coe-mail-flist {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .coe-mail-frow {
    grid-template-columns: 8px auto;
  }
  .coe-mail-fstat { display: none; }
}

/* ===== Mail panel (legacy compact) ===== */
.overlay .panel.coe-mail {
  max-width: min(480px, 94vw);
  position: relative;
  max-height: min(88vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px;
}
.overlay .panel.coe-mail.coe-mail-v2 {
  max-width: min(720px, 96vw);
}
.coe-mail-head {
  margin-bottom: 6px;
  padding-right: 28px;
}
.coe-mail-head .coe-shop-badge {
  width: 42px;
  height: 42px;
}
.coe-mail-head h2 {
  font-size: 17px;
}
.coe-mail-head .meta {
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.coe-panel-x {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201, 148, 74, 0.55);
  border-radius: 8px;
  background: rgba(8, 10, 16, 0.65);
  color: #ffe8a0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-weight: 600;
}
.coe-panel-x:hover {
  background: linear-gradient(180deg, #6a5030, #3a2818);
  border-color: #c9944a;
}
.coe-mail-tabs {
  margin: 2px 0 8px;
  gap: 4px;
}
.coe-mail-tabs .coe-shop-tab {
  padding: 6px 4px;
  font-size: 11px;
  border-radius: 8px;
}
.coe-mail-scroll {
  flex: 1;
  min-height: 0;
  max-height: min(52vh, 380px);
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coe-mail-write {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coe-mail-friends {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 52px;
  overflow: auto;
}
.coe-mail-friend {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.45);
  background: rgba(8, 10, 16, 0.45);
  color: #e8dcc8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.coe-mail-friend.on,
.coe-mail-friend:hover {
  background: linear-gradient(180deg, #6a5030, #3a2818);
  color: #ffe8c0;
  border-color: #c9944a;
}
.coe-mail-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.coe-mail-row2 .grow { grid-column: span 1; }
.coe-mail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #c9b48a;
  font-size: 10px;
  font-weight: 600;
}
.coe-mail-field input,
.coe-mail-field select,
.coe-mail-coin input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid rgba(201, 148, 74, 0.45);
  background: rgba(8, 10, 16, 0.55);
  color: #f0e0c8;
  font: inherit;
  font-size: 12px;
}
.coe-mail-coins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.coe-mail-coin {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #c9b48a;
  font-size: 10px;
  font-weight: 600;
}
.coe-mail-fee {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(201, 148, 74, 0.35);
  background: rgba(42, 32, 20, 0.45);
  color: #e8dcc8;
  font-size: 11px;
  line-height: 1.3;
}
.coe-mail-fee b { color: #ffe8a0; }
.coe-mail-card {
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid rgba(201, 148, 74, 0.4);
  background: rgba(8, 10, 16, 0.4);
}
.coe-mail-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.coe-mail-card .name {
  color: #f0e0c8;
  font-weight: 600;
  font-size: 12px;
}
.coe-mail-st {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(201, 148, 74, 0.4);
  color: #c9b48a;
  white-space: nowrap;
}
.coe-mail-st.pending { color: #ffe8a0; border-color: #c9944a; }
.coe-mail-st.accepted { color: #9ed49a; border-color: rgba(120, 180, 110, 0.55); }
.coe-mail-st.declined,
.coe-mail-st.returned { color: #e0a090; border-color: rgba(180, 100, 80, 0.5); }
.coe-mail-msg {
  color: #d4c4a0;
  font-size: 11px;
  font-style: italic;
  margin: 2px 0 4px;
  line-height: 1.3;
}
.coe-mail-card-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.coe-mail-atts { display: flex; gap: 4px; }
.coe-mail-att {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.4);
  background: rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.coe-mail-att img { width: 22px; height: 22px; object-fit: contain; }
.coe-mail-att .coe-gear-ico--md {
  width: 44px;
  height: 44px;
}
.coe-mail-att-qty {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 10px;
  font-weight: 800;
  color: #fff8e8;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.coe-mail-coins-got { font-size: 11px; }
.coe-mail-card-actions { display: flex; gap: 6px; margin-top: 6px; }
.coe-mail-sys-list { display: flex; flex-direction: column; gap: 4px; }
.coe-mail-sys-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.coe-mail-sys-x {
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #c9b48a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.coe-mail-sys-x:hover { color: #ffe8a0; }
.chat-sos-ref {
  color: #ffe08a;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.coe-mail-sys {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(8, 10, 16, 0.35);
  border: 1px solid rgba(201, 148, 74, 0.25);
  color: #d8ccb0;
  font-size: 11px;
  line-height: 1.35;
}
.coe-mail-sys-t {
  color: #a89068;
  font-size: 10px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.coe-mail-sys.sent { border-color: rgba(201, 148, 74, 0.45); }
.coe-mail-sys.recv { border-color: rgba(120, 180, 110, 0.4); }
.coe-mail-sys.ok { color: #b8e0b0; }
.coe-mail-sys.warn { color: #e8c0a8; border-color: rgba(180, 100, 80, 0.4); }
.coe-mail .panel-actions { margin-top: 8px; }
@media (max-width: 520px) {
  .coe-mail-row2,
  .coe-mail-coins { grid-template-columns: 1fr; }
  .coe-mail-tabs .coe-shop-tab { font-size: 10px; padding: 6px 2px; }
}
.coe-shop-wallet {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  margin: 8px 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 148, 74, 0.45);
  background: rgba(8, 10, 16, 0.55);
}
.coe-shop-grid,
.coe-shop-grid-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  max-height: none;
}
@media (min-width: 560px) {
  .coe-shop-grid,
  .coe-shop-grid-section {
    grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  }
}
@media (min-width: 820px) {
  .coe-shop-boutique .coe-shop-grid,
  .coe-shop-boutique .coe-shop-grid-section {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  }
}
.coe-shop-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 12px !important;
  border: 1px solid rgba(201, 148, 74, 0.4) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(145deg, rgba(48, 36, 22, 0.92), rgba(14, 16, 22, 0.95)) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 160, 0.08);
  min-width: 0;
  overflow: hidden;
}
.coe-shop-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.coe-shop-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.coe-shop-ico {
  width: 64px !important;
  height: 64px !important;
  flex: 0 0 64px !important;
  border-radius: 12px !important;
  border: 2px solid #e8c060 !important;
  background: rgba(8, 10, 14, 0.65) !important;
  background-image: none !important;
  box-shadow: none;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.coe-shop-ico img {
  width: 88% !important;
  height: 88% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.coe-shop-desc {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(201, 148, 74, 0.22);
  color: #d8c7a4;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.coe-shop-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.coe-shop-price-row .coe-wallet,
.coe-shop-price-row .coe-price {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.coe-shop-have { color: #b8a888 !important; }
.coe-shop-sell-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.coe-shop-sell-actions input[type="number"] {
  width: 56px;
  min-height: 28px;
}
.coe-shop-buy-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.coe-shop-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 8px;
  background: rgba(20, 12, 8, 0.45);
  border: 1px solid rgba(180, 130, 70, 0.35);
}
.coe-shop-qty input[type="number"] {
  width: 44px;
  min-height: 28px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid rgba(201, 148, 74, 0.45);
  background: #1a1410;
  color: #ffe8a0;
  font-weight: 700;
}
.coe-shop-qty-btn {
  min-width: 28px;
  padding: 4px 8px;
  font-weight: 800;
}
.coe-shop-qty-chip {
  min-width: 34px;
  padding: 4px 8px;
  color: #ffe8a0;
  border-color: rgba(232, 192, 96, 0.55);
}
.coe-shop-per {
  margin-left: 4px;
  font-size: 11px;
  color: #a89070;
  font-weight: 600;
}
.coe-shop-card--jewel {
  border-color: rgba(120, 180, 190, 0.45);
  box-shadow: inset 0 0 0 1px rgba(80, 140, 150, 0.18);
}
html.is-mobile .coe-shop-buy-actions {
  gap: 6px;
}
html.is-mobile .coe-shop-qty input[type="number"] {
  width: 40px;
  min-height: 32px;
}
.coe-shop-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 12px;
}
.coe-shop-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 148, 74, 0.55);
  background: linear-gradient(180deg, #3a2a1a, #1a1410);
  color: #c9b48a;
  font-weight: 700;
  cursor: pointer;
}
.coe-shop-tab.active {
  border-color: #e8c060;
  color: #ffe8a0;
  background: linear-gradient(180deg, #6b4528, #3a2414);
  box-shadow: inset 0 0 0 1px rgba(255, 232, 160, 0.2);
}
.coe-shop-scroll {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #a87838 #1a1410;
}
.coe-shop-scroll::-webkit-scrollbar {
  width: 11px;
}
.coe-shop-scroll::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(60, 40, 20, 0.55), rgba(20, 14, 10, 0.8));
  border-radius: 10px;
  border: 1px solid rgba(140, 90, 40, 0.35);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45);
}
.coe-shop-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, #c9944a 0%, #7a4818 45%, #4a2c10 100%);
  border-radius: 10px;
  border: 2px solid #2a1a0c;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 150, 0.35),
    0 0 0 1px rgba(180, 120, 50, 0.4);
}
.coe-shop-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e8c060, #9a5a20);
}
.overlay .panel.coe-shop {
  max-height: min(86vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.overlay .panel.coe-shop .panel-actions {
  margin-top: 10px;
  flex: 0 0 auto;
}
.hud-buff-icons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: flex-end;
  margin: 0;
}
.hud-buff-icons.empty { display: none; }
.hud-buff-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 24px;
}
.hud-buff-ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  cursor: help;
  flex: 0 0 20px;
  background: transparent !important;
  image-rendering: auto;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.55));
  box-shadow: none;
}
.hud-buff-timer {
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  color: #e8d6a8;
  text-shadow: 0 1px 2px #000;
}
.coe-pack-cell .pack-qty {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 10px;
  font-weight: 800;
  color: #ffe8a0;
  text-shadow: 0 1px 2px #000;
}
.coe-pack-cell .pack-sock,
.coe-inv-slot .pack-sock,
.coe-inspect-slot .pack-sock,
.coe-eq-art .pack-sock {
  position: absolute;
  width: 38%;
  height: 38%;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.9));
  background: rgba(10, 6, 2, 0.55);
  border-radius: 3px;
  padding: 1px;
}
.coe-pack-cell .pack-sock--bog,
.coe-inv-slot .pack-sock--bog,
.coe-inspect-slot .pack-sock--bog,
.coe-eq-art .pack-sock--bog {
  left: 1px;
  bottom: 1px;
  right: auto;
  top: auto;
}
.coe-inv-slot .pack-sock--sharpen,
.coe-inspect-slot .pack-sock--sharpen,
.coe-eq-art .pack-sock--sharpen {
  right: 1px;
  top: 1px;
  left: auto;
  bottom: auto;
}
/* Рюкзак: заточка слева от крестика × (не поверх) */
.coe-pack-cell .pack-sock--sharpen {
  top: 1px;
  right: 18px;
  left: auto;
  bottom: auto;
}
html.is-mobile .coe-pack-cell .pack-sock--sharpen {
  right: 34px;
}
.coe-inspect-slot { position: relative; }
.coe-eq-art .coe-drop-star {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 0 2px #000, 0 1px 2px #000;
  pointer-events: none;
  z-index: 2;
}
.coe-drop-star--fine { color: #ffd966; }
.coe-drop-star--rare { color: #3ddc84; }
.coe-pack-cell .pack-dura {
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 9px;
  font-weight: 700;
  color: #b8e0ff;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  z-index: 2;
}
.coe-shop-card .name {
  color: #ffe8a0;
  font-weight: 600;
}
.coe-shop-card .meta {
  color: #b8a882;
}
.coe-shop-close {
  border-color: #c9944a !important;
  background: linear-gradient(180deg, #6b4528, #3a2414) !important;
  color: #ffe8a0 !important;
}

/* ===== Boutique shop — сетка прилавков ===== */
.overlay .panel.coe-shop.coe-shop-boutique {
  max-width: min(980px, 96vw);
  padding: 20px 20px 16px;
  background:
    radial-gradient(ellipse at 85% 10%, rgba(255, 180, 80, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse at 15% 90%, rgba(120, 180, 255, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 0%, rgba(232, 192, 96, 0.14) 0%, transparent 45%),
    linear-gradient(165deg, #2a2218 0%, #141018 48%, #0c1018 100%);
}
.coe-shop-ambient {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 12px;
  opacity: 0.55;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(201, 148, 74, 0.04) 48px,
      rgba(201, 148, 74, 0.04) 49px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 55%);
}
.coe-shop-scroll--boutique {
  max-height: min(58vh, 540px);
  padding: 4px 2px 8px;
}
.coe-shop-showcase {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.coe-shop-aisle {
  margin-bottom: 14px;
}
.coe-shop-aisle:last-child {
  margin-bottom: 0;
}
.coe-shop-aisle-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(201, 148, 74, 0.28) 0%, rgba(201, 148, 74, 0.06) 72%, transparent 100%);
  border: 1px solid rgba(201, 148, 74, 0.22);
  border-left: 3px solid #e8c060;
  box-shadow: inset 0 1px 0 rgba(255, 232, 160, 0.1);
}
.coe-shop-aisle-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffe8a0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.coe-shop-tile {
  flex-direction: column !important;
  padding: 10px 8px 12px !important;
  position: relative;
  z-index: 1;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}
.coe-shop-tile:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(232, 192, 96, 0.72) !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 232, 160, 0.22),
    0 0 20px rgba(201, 148, 74, 0.15);
}
.coe-shop-tile-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  height: 100%;
  min-width: 0;
}
.coe-shop-tile-ico {
  width: 72px !important;
  height: 72px !important;
  flex: 0 0 72px !important;
  margin-bottom: 2px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(240, 255, 225, 0.35);
}
.coe-shop-tile-ico img {
  width: 88% !important;
  height: 88% !important;
  object-fit: contain !important;
  background: transparent !important;
}
.coe-shop-tile-name {
  font-size: 12px;
  line-height: 1.28;
  width: 100%;
  min-height: 2.55em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #ffe8b8;
}
.coe-shop-tile-price {
  justify-content: center;
  font-size: 12px;
}
.coe-shop-tile-price .coe-shop-per {
  font-size: 10px;
  opacity: 0.75;
}
.coe-shop-tile-stock {
  font-size: 10px !important;
  line-height: 1.3;
  color: #a89878 !important;
}
.coe-shop-tile-sellback {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  color: #889878;
}
.coe-shop-tile-buy {
  width: 100%;
  margin-top: auto;
  padding-top: 4px;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
}
.coe-shop-qty--compact {
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 4px;
}
.coe-shop-qty--compact .coe-shop-qty-label {
  display: none;
}
.coe-shop-tile-cta {
  width: 100%;
  min-height: 32px;
  font-weight: 700 !important;
}
.coe-shop-sell-grid .coe-shop-sell-actions {
  flex-direction: column;
  align-items: stretch;
}
.coe-shop-sell-grid .coe-shop-sell-actions input[type="number"] {
  width: 100%;
  text-align: center;
}
.coe-shop-sell-grid .coe-shop-tile-cta {
  width: 100%;
}
.coe-shop-boutique .coe-shop-wallet {
  margin-bottom: 10px;
  background:
    linear-gradient(90deg, rgba(8, 10, 16, 0.75), rgba(32, 24, 14, 0.55));
  box-shadow: inset 0 0 0 1px rgba(255, 232, 160, 0.08);
}
html.is-mobile .coe-shop-grid,
html.is-mobile .coe-shop-grid-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
html.is-mobile .coe-shop-tile-ico {
  width: 64px !important;
  height: 64px !important;
  flex: 0 0 64px !important;
}
/* Мобилка: лавка на весь экран, скролл товаров — не узкая полоска */
html.is-mobile .overlay .panel.coe-shop,
html.is-mobile .overlay .panel.coe-shop.coe-shop-boutique {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(94dvh, calc(100dvh - 4px)) !important;
  height: min(94dvh, calc(100dvh - 4px)) !important;
  margin: 0 !important;
  border-radius: 14px 14px 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 12px 10px 10px !important;
}
html.is-mobile .coe-shop-head {
  flex: 0 0 auto;
  margin-bottom: 6px;
}
html.is-mobile .coe-shop-head .meta {
  display: none;
}
html.is-mobile .coe-shop-wallet,
html.is-mobile .coe-shop-tabs {
  flex: 0 0 auto;
}
html.is-mobile .coe-shop-scroll,
html.is-mobile .coe-shop-scroll--boutique {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 2px 12px !important;
}
html.is-mobile .coe-shop-boutique .panel-actions {
  flex: 0 0 auto;
  margin-top: 8px;
}
html.is-mobile .coe-shop-tile-cta,
html.is-mobile .coe-shop-qty-btn,
html.is-mobile .coe-shop-qty-chip,
html.is-mobile-desk .coe-shop-tile-cta,
html.is-mobile-desk .coe-shop-qty-btn,
html.is-mobile-desk .coe-shop-qty-chip {
  min-height: 40px;
  touch-action: manipulation;
}
.coe-shop-cant-afford {
  opacity: 0.72;
  filter: saturate(0.85);
}
.coe-shop-tile-cta.coe-shop-cant-afford {
  pointer-events: auto !important;
  cursor: pointer;
}
html.is-mobile-desk .overlay .panel.coe-shop .btn,
html.is-mobile-desk .overlay .panel.coe-shop button.btn {
  pointer-events: auto !important;
  touch-action: manipulation;
  cursor: pointer;
}
