/* ===== Главная — светлый японский / Minecraft стиль ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;600;700&display=swap');

.page-home {
  --home-bg: #eceae6;
  --home-bg-grid: rgba(180, 175, 170, 0.35);
  --home-text: #3a3530;
  --home-text-muted: #6b6560;
  --home-orange: #e8872a;
  --home-orange-dark: #c96a15;
  --home-accent: #ffc870;
  --home-accent-dark: #f0a030;
  --home-accent-light: #ffe59a;
  --home-purple: #9b6bb8;
  --home-purple-light: #c49de0;
  --home-border: rgba(60, 55, 50, 0.35);
  --home-title-stripe: rgba(232, 135, 42, 0.25);
  --home-dash-accent: rgba(232, 135, 42, 0.45);
  --home-panel-bg: rgba(255, 255, 255, 0.82);
  --home-glow: rgba(255, 220, 140, 0.45);
  --font-home: 'Nunito', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;

  font-family: var(--font-home);
  color: var(--home-text);
  background: var(--home-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-home .bg-scene {
  display: none;
}

/* Фон: картинка клана + лёгкая сетка для читаемости */
.home-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--home-bg);
  background-image:
    linear-gradient(var(--home-bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--home-bg-grid) 1px, transparent 1px),
    url('/images/hero-banner.png');
  background-size: 24px 24px, 24px 24px, cover;
  background-position: center top, center top, center -130px;
  background-repeat: repeat, repeat, no-repeat;
  background-attachment: fixed;
}

.home-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(236, 234, 230, 0.55);
  pointer-events: none;
}

/* Летающие лепестки (другие страницы) */
.home-petals {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.home-petals::before,
.home-petals::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--home-purple-light);
  border-radius: 50% 0 50% 50%;
  opacity: 0.35;
  animation: petal-float 18s linear infinite;
}

.home-petals::before {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.home-petals::after {
  top: 30%;
  right: 20%;
  animation-delay: -6s;
  width: 6px;
  height: 6px;
}

@keyframes petal-float {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.2; }
  100% { transform: translate(80px, 400px) rotate(360deg); opacity: 0; }
}

/* Главная: масштаб 90% */
.page-home-index {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.page-home-index .home-ui-scale {
  transform: scale(0.9);
  transform-origin: top center;
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  margin-bottom: -2rem;
  overflow-x: hidden;
}

@supports (zoom: 0.9) {
  .page-home-index .home-ui-scale {
    zoom: 0.9;
    transform: none;
    margin-bottom: 0;
  }
}

.page-home-index .home-main {
  flex: 1;
}

.page-home-index .footer-home-wide {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}

/* Падающая сакура — главная */
.home-sakura-fall {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sakura-petal {
  position: absolute;
  top: -16px;
  background: linear-gradient(135deg, #f5c6e0 0%, #d4a0c8 50%, #e8b4d4 100%);
  border-radius: 50% 0 50% 50%;
  opacity: 0;
  animation: sakura-fall linear infinite;
  box-shadow: 0 0 2px rgba(200, 140, 180, 0.3);
}

@keyframes sakura-fall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    opacity: 0;
  }
  8% {
    opacity: 0.85;
  }
  50% {
    transform: translateY(50vh) translateX(var(--drift, 30px)) rotate(360deg) scale(0.95);
    opacity: 0.7;
  }
  100% {
    transform: translateY(105vh) translateX(calc(var(--drift, 30px) * -0.5)) rotate(720deg) scale(0.85);
    opacity: 0;
  }
}

/* Навигация на главной */
.page-home .navbar-home {
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid var(--home-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-home .nav-links {
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.2rem;
  min-width: 0;
}

.page-home .nav-links a {
  color: var(--home-text);
  font-family: var(--font-home);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.65rem;
  white-space: nowrap;
}

.page-home .nav-links li {
  display: flex;
  align-items: center;
}

.page-home .navbar-brand.navbar-brand-home {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  line-height: 1.05;
  flex-shrink: 0;
}

.brand-logo {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--home-dash-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.navbar-brand-home:hover .brand-logo {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(232, 135, 42, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.page-home .navbar-brand .brand-line {
  font-family: var(--font-home);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-text-muted);
}

.page-home .navbar-brand .brand-accent {
  font-family: var(--font-home);
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: none;
  color: var(--home-orange-dark);
  background: linear-gradient(105deg, #a85a10 0%, #c96a15 35%, #e8872a 70%, #b85810 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-home .navbar-brand:hover .brand-accent {
  background: linear-gradient(105deg, #963f08 0%, #b85810 40%, #d07820 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-home .nav-links a[data-page]:hover,
.page-home .nav-links a[data-page].active {
  background: rgba(255, 179, 71, 0.14);
  border-color: var(--home-accent);
  color: var(--home-accent-dark);
}

.page-home .nav-account-main,
.page-home .nav-account-main:hover {
  background: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.page-home .nav-avatar {
  border-color: rgba(155, 107, 184, 0.4);
  background: rgba(255, 255, 255, 0.5);
}

.page-home .nav-account-name {
  color: #d4a85c;
  font-weight: 600;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.page-home .nav-account-main:hover .nav-account-name {
  color: #f0d090;
}

.page-home .nav-logout {
  background: rgba(200, 55, 55, 0.18);
  border-color: rgba(200, 70, 70, 0.4);
  color: #c94a4a;
}

.page-home .nav-logout:hover {
  background: rgba(210, 60, 60, 0.5);
  color: #fff;
}

.page-home .nav-auth-btn {
  background: var(--home-accent) !important;
  color: #fff !important;
  border-radius: 6px !important;
}

.page-home .nav-auth-btn:hover {
  background: var(--home-accent-dark) !important;
}

/* Основной контент */
.home-main {
  flex: 1;
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 2rem 2rem;
  overflow-x: hidden;
}

/* Двухколоночный блок: слева тексты, справа галерея */
.home-content {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: stretch;
}

.home-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.home-gallery-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.home-gallery-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1.5rem;
  height: 100%;
}

/* Карусель: 1 фото, крутятся первые 3 опубликованных */
.home-carousel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 0;
}

.home-carousel-viewport {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.home-carousel-track {
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.home-carousel-track.slide-from-right {
  animation: carousel-in-right 0.45s ease;
}

.home-carousel-track.slide-from-left {
  animation: carousel-in-left 0.45s ease;
}

@keyframes carousel-in-right {
  from { opacity: 0.4; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes carousel-in-left {
  from { opacity: 0.4; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.home-carousel-slide {
  display: block;
  width: 100%;
}

.home-carousel-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid var(--home-border);
  border-radius: 50%;
  background: var(--home-carousel-btn-bg, rgba(255, 255, 255, 0.9));
  color: var(--home-accent-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 0;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.home-carousel-btn:hover {
  background: var(--home-accent);
  color: #fff;
  border-color: var(--home-accent);
}

.home-panel {
  background: var(--home-panel-bg);
  border: 1px solid var(--home-border);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(4px);
}

.home-panel-title {
  font-family: var(--font-home);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--home-orange-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--home-title-stripe);
}

.home-panel p {
  color: var(--home-text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.home-values {
  list-style: none;
  margin-top: 0.75rem;
}

.home-values li {
  font-size: 0.9rem;
  color: var(--home-text-muted);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.home-values li span {
  color: var(--home-purple);
  font-weight: 700;
}

.home-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.home-gallery-header .home-panel-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.home-gallery-link {
  font-size: 0.85rem;
  color: var(--home-orange);
  text-decoration: none;
  font-weight: 600;
}

.home-gallery-link:hover {
  color: var(--home-orange-dark);
  text-decoration: underline;
}

.home-gallery-item {
  flex-shrink: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.home-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(155, 107, 184, 0.2);
}

.home-gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

.home-gallery-item-info {
  display: none;
}

.home-gallery-empty {
  text-align: center;
  color: var(--home-text-muted);
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

/* Блок «Присоединяйся» — рамка снаружи clip-path, срезанные углы */
.home-join-frame {
  --join-notch: 8px;
  width: 100%;
  margin: 1.25rem auto 0;
  padding: 1px;
  box-sizing: border-box;
  background: var(--home-border);
  clip-path: polygon(
    0 var(--join-notch),
    var(--join-notch) var(--join-notch),
    var(--join-notch) 0,
    calc(100% - var(--join-notch)) 0,
    calc(100% - var(--join-notch)) var(--join-notch),
    100% var(--join-notch),
    100% calc(100% - var(--join-notch)),
    calc(100% - var(--join-notch)) calc(100% - var(--join-notch)),
    calc(100% - var(--join-notch)) 100%,
    var(--join-notch) 100%,
    var(--join-notch) calc(100% - var(--join-notch)),
    0 calc(100% - var(--join-notch))
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

#home-join.home-panel {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  backdrop-filter: none;
  overflow: visible;
  clip-path: polygon(
    0 var(--join-notch),
    var(--join-notch) var(--join-notch),
    var(--join-notch) 0,
    calc(100% - var(--join-notch)) 0,
    calc(100% - var(--join-notch)) var(--join-notch),
    100% var(--join-notch),
    100% calc(100% - var(--join-notch)),
    calc(100% - var(--join-notch)) calc(100% - var(--join-notch)),
    calc(100% - var(--join-notch)) 100%,
    var(--join-notch) 100%,
    var(--join-notch) calc(100% - var(--join-notch)),
    0 calc(100% - var(--join-notch))
  );
}

#home-join .home-join-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

#home-join .home-join-teaser {
  flex: 1;
  min-width: 0;
  margin: 0;
}

#home-join .join-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.45rem 0.55rem;
  margin: 0;
  overflow: visible;
}

#home-join .join-btn-center.lore-open-btn {
  padding: 0.4rem 0.65rem 0.4rem 0.55rem;
  font-size: 0.78rem;
  gap: 0.5rem;
  line-height: 1.25;
  transition: transform 0.2s ease;
}

#home-join .join-btn-led {
  position: relative;
  isolation: isolate;
  overflow: visible;
  border: 1.5px solid rgba(255, 190, 95, 0.9);
  animation: join-led-glow 2.6s ease-in-out infinite;
}

#home-join .join-btn-led::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 6px;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 210, 0.28) 0%,
    rgba(255, 210, 100, 0.1) 42%,
    rgba(255, 170, 50, 0.04) 100%
  );
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: join-led-inner 2.6s ease-in-out infinite;
}

#home-join .join-btn-led::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -2px 6px rgba(220, 140, 30, 0.12);
  pointer-events: none;
  z-index: 0;
}

#home-join .join-btn-led > * {
  position: relative;
  z-index: 1;
}

@keyframes join-led-glow {
  0%,
  100% {
    box-shadow:
      inset 0 0 6px rgba(255, 210, 120, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 3px rgba(255, 190, 70, 0.06);
    border-color: rgba(255, 195, 100, 0.88);
  }
  50% {
    box-shadow:
      inset 0 0 10px rgba(255, 225, 150, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      0 0 6px rgba(255, 200, 90, 0.1);
    border-color: #ffc870;
  }
}

@keyframes join-led-inner {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.55;
  }
}

#home-join .join-btn-led:hover,
#home-join .join-btn-led:focus-visible {
  transform: scale(1.06);
  background: rgba(255, 179, 71, 0.14);
}

#home-join .join-btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0.15rem;
  padding: 1px 2px 1px 0;
  color: #5865f2;
  line-height: 0;
}

#home-join .join-btn-discord svg {
  display: block;
  overflow: visible;
}

#home-join .join-btn-label {
  white-space: nowrap;
}

#home-join .join-btn-go {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.65;
  margin-left: 0.05rem;
  letter-spacing: -0.02em;
}

.join-btn-center {
  position: relative;
  z-index: 2;
}

@media (max-width: 560px) {
  #home-join .home-join-row {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home-join .join-btn-led,
  #home-join .join-btn-led::before {
    animation: none;
  }

  #home-join .join-btn-led {
    box-shadow:
      inset 0 0 8px rgba(255, 210, 120, 0.18),
      0 0 4px rgba(255, 190, 70, 0.08);
  }
}

.home-about-lead {
  font-weight: 700;
  color: var(--home-orange-dark);
  margin-bottom: 0.75rem;
}

.history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.history-teaser {
  flex: 1;
  margin: 0;
}

.lore-open-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 179, 71, 0.14);
  border: 1px solid var(--home-accent);
  border-radius: 8px;
  color: var(--home-accent-dark);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.lore-open-btn:hover {
  background: rgba(255, 179, 71, 0.24);
}

#home-join .join-btn-led.lore-open-btn:hover {
  background: rgba(255, 179, 71, 0.14);
}

.lore-open-btn:focus,
.lore-open-btn:active {
  outline: none;
  box-shadow: none;
}

.lore-open-btn:focus-visible {
  outline: 2px solid rgba(240, 160, 48, 0.55);
  outline-offset: 2px;
}

.lore-open-icon {
  font-size: 1.1rem;
}

.lore-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

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

.lore-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 20, 0.55);
  backdrop-filter: blur(4px);
}

.lore-modal-box {
  position: relative;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(255, 252, 245, 0.97);
  border: 1px solid var(--home-border);
  border-radius: 12px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.lore-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--home-text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.lore-modal-close:hover {
  color: var(--home-accent-dark);
}

.lore-modal-title {
  font-size: 1.25rem;
  color: var(--home-accent-dark);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.lore-modal-body p {
  color: var(--home-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.lore-modal-body p:last-child {
  margin-bottom: 0;
}

.page-home .nav-links a[data-page="join"] {
  color: var(--home-accent-dark);
  font-weight: 700;
}

.btn-home {
  background: linear-gradient(180deg, var(--home-accent-light) 0%, var(--home-accent) 45%, var(--home-accent-dark) 100%);
  color: #fff;
  white-space: nowrap;
  border-radius: 6px;
  font-family: var(--font-home);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 179, 71, 0.35);
}

.btn-home:hover {
  background: linear-gradient(180deg, var(--home-accent-light) 0%, var(--home-accent) 100%);
  color: #fff;
}

.footer-home {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem 2rem;
  color: var(--home-text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--home-border);
  background: var(--home-footer-bg, rgba(255, 255, 255, 0.75));
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.footer-home-wide {
  width: 100%;
  letter-spacing: 0.3px;
}

/* Адаптив */
@media (max-width: 860px) {
  .home-main {
    padding: 1.25rem 1rem 1.5rem;
  }

  .home-content {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .home-carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .page-home .navbar-brand .brand-line {
    font-size: 1.1rem;
  }

  .page-home .navbar-brand .brand-accent {
    font-size: 1.25rem;
  }
}

@media (min-width: 861px) {
  .home-content {
    min-height: 480px;
  }
}

/* ===== Новости ===== */
.page-section {
  max-width: none;
  width: 100%;
}

.page-desc {
  color: var(--home-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.news-form-wrap {
  margin-bottom: 2rem;
  padding: 1.25rem;
  border: 1px dashed var(--home-dash-accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.page-home .form-group label {
  color: var(--home-text);
  font-weight: 600;
}

.page-home .form-group input,
.page-home .form-group textarea {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--home-border);
  color: var(--home-text);
}

.news-admin-panel {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(155, 107, 184, 0.45);
  border-radius: 8px;
}

.news-admin-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--home-purple);
  margin-bottom: 0.25rem;
}

.news-admin-hint {
  font-size: 0.85rem;
  color: var(--home-text-muted);
  margin-bottom: 1rem;
}

.news-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.news-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.news-publish-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.news-modal-box {
  max-width: min(560px, 96vw);
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

.news-body-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.news-markdown-hint {
  font-size: 0.82rem;
  color: var(--home-text-muted);
  margin: -0.25rem 0 1rem;
}

.news-markdown-hint code {
  background: rgba(155, 107, 184, 0.12);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.news-card-body u {
  text-decoration: underline;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.news-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--home-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--home-orange);
}

.news-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.news-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--home-text);
}

.news-card-date {
  font-size: 0.8rem;
  color: var(--home-text-muted);
  white-space: nowrap;
}

.news-card-body {
  color: var(--home-text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.news-card-author {
  color: var(--home-purple);
  font-weight: 600;
}

.news-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--home-border);
  border-radius: 8px;
  overflow: hidden;
  border-left: 4px solid var(--home-orange);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-tile-delete {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  font-size: 1.1rem;
  opacity: 0.85;
}

.news-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.news-tile-open {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.news-tile-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.06);
}

.news-tile-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.45;
}

.news-tile-text {
  padding: 0.85rem 1rem 1rem;
}

.news-tile-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--home-text);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.news-tile-date {
  font-size: 0.78rem;
  color: var(--home-text-muted);
}

.news-detail-box {
  max-width: 720px;
}

.news-detail-content {
  padding: 0.5rem 1.25rem 1.25rem;
  max-height: min(85vh, 900px);
  overflow-y: auto;
}

.news-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.news-detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--home-text);
}

.upload-caption-textarea {
  margin-bottom: 0.75rem;
  width: 100%;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
  background: rgba(255, 252, 248, 0.95);
  color: var(--home-text);
}

.news-poll-readonly {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--home-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
}

.news-poll-question {
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.news-poll-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.news-poll-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.news-poll-option-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(201, 146, 58, 0.2);
  z-index: 0;
  max-width: 100%;
}

.news-poll-option-text,
.news-poll-option-votes {
  position: relative;
  z-index: 1;
}

.news-poll-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--home-text-muted);
}

.news-discord-author {
  font-size: 0.82rem;
  color: var(--home-text-muted);
}

.page-home .alert-success {
  background: rgba(45, 120, 80, 0.15);
  border-color: #3d8a60;
  color: #2d6a4a;
}

/* ===== Игроки онлайн ===== */
.online-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.online-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--home-text);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--home-border);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.online-dot {
  width: 10px;
  height: 10px;
  background: #43b581;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(67, 181, 129, 0.6);
  animation: pulse-online 2s infinite;
}

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

.online-hint {
  font-size: 0.88rem;
  color: var(--home-text-muted);
  background: rgba(155, 107, 184, 0.1);
  border: 1px solid rgba(155, 107, 184, 0.25);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--home-orange-dark);
  margin: 1.5rem 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-label-offline {
  color: var(--home-text-muted);
}

.section-label-pending {
  color: var(--home-purple);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--home-border);
  border-radius: 8px;
  position: relative;
}

a.player-card {
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

a.player-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  border-color: var(--home-accent-dark);
}

.player-online {
  border-left: 3px solid #43b581;
}

.player-offline {
  opacity: 0.85;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.player-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--home-orange), var(--home-purple));
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-weight: 700;
  color: var(--home-text);
  font-size: 0.95rem;
}

.player-discord {
  font-size: 0.78rem;
  color: var(--home-text-muted);
}

.player-role {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid;
}

.player-role-pending {
  background: rgba(155, 107, 184, 0.12);
  border-color: var(--home-purple-light);
  color: var(--home-purple);
}

.player-status {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #43b581;
  text-transform: uppercase;
}

/* ===== Галерея — лента ===== */
.gallery-page {
  max-width: 1520px;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  box-sizing: border-box;
}

.gallery-shell {
  width: 100%;
  padding: 1.35rem 1.5rem 1.5rem;
  box-sizing: border-box;
}

.gallery-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.gallery-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--home-accent-dark);
  margin: 0;
}

#publish-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

/* Модалка публикации */
.upload-modal-box {
  max-width: 520px;
  width: 100%;
  padding: 1.5rem 1.5rem 1.35rem;
}

.upload-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--home-accent-dark);
  margin: 0 2rem 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--home-title-stripe);
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 2px dashed var(--home-dash-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.95) 0%, rgba(255, 235, 200, 0.2) 100%);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
}

.upload-dropzone:hover,
.upload-dropzone--drag {
  border-color: var(--home-accent);
  background: linear-gradient(180deg, rgba(255, 248, 230, 1) 0%, rgba(255, 220, 150, 0.28) 100%);
  transform: translateY(-1px);
}

.upload-dropzone--drag {
  box-shadow: inset 0 0 0 2px rgba(255, 200, 112, 0.35);
}

.upload-dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 4px 10px rgba(232, 135, 42, 0.25));
}

.upload-dropzone-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--home-text);
}

.upload-dropzone-hint {
  font-size: 0.8rem;
  color: var(--home-text-muted);
  max-width: 280px;
  line-height: 1.4;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.25rem;
}

.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--home-border);
  background: rgba(0, 0, 0, 0.04);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(40, 35, 30, 0.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.upload-preview-remove:hover {
  background: rgba(180, 50, 40, 0.9);
}

.upload-caption-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--home-text-muted);
  margin-bottom: 0.35rem;
}

.upload-caption-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--home-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--home-text);
}

.upload-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.upload-modal-actions .btn-home:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.page-home .btn-outline {
  background: transparent;
  color: var(--home-accent-dark);
  border: 1px solid var(--home-accent);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.page-home .btn-outline:hover {
  background: rgba(255, 179, 71, 0.12);
}

.gallery-feed {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  width: 100%;
}

@media (max-width: 960px) {
  .gallery-feed {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .gallery-feed {
    grid-template-columns: 1fr;
  }
}

.gallery-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--home-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 179, 71, 0.22);
}

.gallery-tile-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-tile-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.gallery-tile-open:hover img {
  transform: scale(1.04);
}

.gallery-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 2.5rem;
}

.gallery-tile-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--home-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-tile-like {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.gallery-modal-box {
  max-width: 720px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

#gallery-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.gallery-modal-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.gallery-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 107, 184, 0.5) transparent;
}

.gallery-modal-scroll::-webkit-scrollbar {
  width: 6px;
}

.gallery-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(155, 107, 184, 0.45);
  border-radius: 3px;
}

.gallery-modal-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(155, 107, 184, 0.65);
}

.gallery-modal-composer {
  flex-shrink: 0;
  padding: 0.65rem 1.15rem 1rem;
  background: rgba(255, 252, 245, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
}

.gallery-modal-box .lore-modal-close {
  z-index: 3;
}

.gallery-modal-media {
  padding: 2.75rem 2.75rem 0.65rem 1rem;
  display: flex;
  justify-content: center;
}

.gallery-modal-img-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-modal-img-btn:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.gallery-modal-img-btn:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
}

.gallery-modal-img {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
}

.gallery-modal-body {
  padding: 0.85rem 1.15rem 1.15rem;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gallery-lightbox.hidden {
  display: none;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.82);
  backdrop-filter: blur(8px);
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 2;
  background: rgba(255, 252, 245, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 252, 245, 0.28);
}

.gallery-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.feed-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.feed-meta-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.gallery-post-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(180, 60, 60, 0.35);
  border-radius: 6px;
  background: rgba(200, 70, 70, 0.08);
  color: #b83c3c;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.gallery-post-delete:hover {
  background: rgba(200, 70, 70, 0.18);
  border-color: rgba(180, 60, 60, 0.55);
  color: #962e2e;
}

.gallery-delete-icon {
  display: block;
}

.feed-author {
  font-weight: 700;
  color: var(--home-purple);
}

.feed-profile-link {
  color: inherit;
  text-decoration: none;
}

.feed-profile-link:hover {
  text-decoration: underline;
}

.feed-comment-author.feed-profile-link {
  font-weight: 700;
}

.feed-date {
  color: var(--home-text-muted);
}

.feed-caption {
  color: var(--home-text);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.feed-like {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(55, 48, 40, 0.1);
  border: 1px solid rgba(200, 150, 70, 0.45);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--home-accent-dark);
  transition: all 0.2s;
}

.feed-like:hover {
  background: rgba(55, 48, 40, 0.16);
  border-color: rgba(220, 165, 80, 0.65);
}

.feed-like .dragon-icon-clipped {
  flex-shrink: 0;
  opacity: 1;
  filter: contrast(1.15) brightness(0.92);
}

.feed-like.liked {
  background: linear-gradient(180deg, #6b4a1f 0%, #4d3518 100%);
  border-color: #c9923a;
  color: #ffe9b8;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.2);
}

.feed-like.liked:hover {
  background: linear-gradient(180deg, #7a5524 0%, #57401c 100%);
  border-color: #e0a84a;
}

.feed-like.liked .dragon-icon-clipped {
  opacity: 1;
  filter: brightness(1.35) contrast(1.2) drop-shadow(0 0 3px rgba(255, 230, 160, 0.5));
}

.home-gallery-item-info .likes {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Иконка лайка — дракон со срезанными углами */
.dragon-icon-clipped {
  --dragon-notch: 4px;
  display: inline-block;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  background: url('/images/dragon-like.png') center / contain no-repeat;
  clip-path: polygon(
    0 var(--dragon-notch),
    var(--dragon-notch) var(--dragon-notch),
    var(--dragon-notch) 0,
    calc(100% - var(--dragon-notch)) 0,
    calc(100% - var(--dragon-notch)) var(--dragon-notch),
    100% var(--dragon-notch),
    100% calc(100% - var(--dragon-notch)),
    calc(100% - var(--dragon-notch)) calc(100% - var(--dragon-notch)),
    calc(100% - var(--dragon-notch)) 100%,
    var(--dragon-notch) 100%,
    var(--dragon-notch) calc(100% - var(--dragon-notch)),
    0 calc(100% - var(--dragon-notch))
  );
}

.dragon-icon-clipped--sm {
  --dragon-notch: 3px;
  width: 17px;
  height: 17px;
}

.news-login-hint {
  font-size: 0.9rem;
  color: var(--home-text-muted);
  background: rgba(155, 107, 184, 0.1);
  border: 1px solid rgba(155, 107, 184, 0.25);
  padding: 0.65rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.news-login-hint a {
  color: var(--home-orange);
  font-weight: 600;
}

.feed-comments {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-comments-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.feed-comments-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--home-text-muted);
  font-style: italic;
}

.feed-comment {
  font-size: 0.85rem;
  color: var(--home-text-muted);
  padding: 0.3rem 0;
}

.feed-comment-author {
  font-weight: 700;
  color: var(--home-text);
  margin-right: 0.35rem;
}

.feed-comment-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.feed-comment-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--home-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  color: var(--home-text);
}

.feed-comment-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.feed-sticker-wrap {
  position: relative;
}

.feed-sticker-toggle {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--home-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--home-accent-dark);
  transition: background 0.2s, border-color 0.2s;
}

.feed-sticker-toggle:hover {
  background: rgba(155, 107, 184, 0.12);
  border-color: rgba(155, 107, 184, 0.45);
}

.feed-sticker-panel {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 2.1rem);
  gap: 0.25rem;
  padding: 0.45rem;
  background: rgba(255, 252, 245, 0.98);
  border: 1px solid var(--home-border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

.feed-sticker-panel.hidden {
  display: none;
}

.feed-sticker-btn {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.feed-sticker-btn:hover {
  background: rgba(155, 107, 184, 0.15);
  transform: scale(1.08);
}

.feed-comment-send {
  background: var(--home-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 0.85rem;
  height: 2.35rem;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.feed-comment-send:hover {
  filter: brightness(1.05);
}

/* Галерея — несколько фото в одной публикации */
.gallery-tile-open .gallery-tile-collage {
  height: 100%;
}

.gallery-tile-collage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  gap: 2px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
}

.gallery-tile-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-tile-collage.collage-2 {
  grid-template-columns: 1fr 1fr;
}

.gallery-tile-collage.collage-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery-tile-collage.collage-3 img:first-child {
  grid-row: span 2;
}

.gallery-tile-collage.collage-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery-tile-more,
.gallery-media-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  pointer-events: none;
}

.gallery-tile-collage .gallery-tile-more {
  right: 0;
  bottom: 0;
  left: auto;
  top: auto;
  width: 50%;
  height: 50%;
}

.gallery-media-grid {
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
}

.gallery-media-grid.count-1 {
  grid-template-columns: 1fr;
}

.gallery-media-grid.count-2 {
  grid-template-columns: 1fr 1fr;
}

.gallery-media-grid.count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery-media-grid.count-3 .gallery-media-cell:first-child {
  grid-row: span 2;
}

.gallery-media-grid.count-4,
.gallery-media-grid.count-many {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery-media-cell {
  position: relative;
  min-height: 100px;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery-media-cell img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 0;
}

.gallery-media-grid.count-1 .gallery-media-cell img {
  max-height: 46vh;
  object-fit: contain;
}

.gallery-media-more {
  font-size: 1.35rem;
}
