:root {
  --ink: #1e1b2e;
  --muted: #716a85;
  --line: rgba(30, 27, 46, 0.12);
  --rose: #ff6f91;
  --coral: #ff9671;
  --mint: #60d7bd;
  --sky: #77a7ff;
  --cream: #fff8ee;
  --paper: rgba(255, 255, 255, 0.86);
  --shadow: 0 22px 70px rgba(46, 35, 78, 0.17);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.16), rgba(96, 215, 189, 0.16) 42%, rgba(119, 167, 255, 0.18)),
    var(--cream);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(30, 27, 46, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 27, 46, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 12px 0 28px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 34px rgba(46, 35, 78, 0.1);
  backdrop-filter: blur(18px);
}

.brand,
.profile-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--sky));
  box-shadow: 0 10px 24px rgba(255, 111, 145, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a:hover {
  color: var(--ink);
  background: white;
}

.profile-mini {
  justify-self: end;
  color: var(--muted);
  font-size: 14px;
}

.profile-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(96, 215, 189, 0.18);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  min-height: 650px;
  gap: 54px;
  padding: 34px 0 72px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(68px, 11vw, 132px);
  line-height: 0.88;
  letter-spacing: 0;
}

.lead {
  max-width: 610px;
  margin: 24px 0 0;
  color: #514960;
  font-size: 21px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 12px;
  color: #9d4d69;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  box-shadow: 0 16px 34px rgba(255, 111, 145, 0.28);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.secondary-btn,
.ghost-btn {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.danger-btn {
  color: #a1273f;
  border: 1px solid rgba(161, 39, 63, 0.22);
  background: rgba(255, 111, 145, 0.1);
}

.full {
  width: 100%;
}

.hero-visual {
  display: grid;
  min-height: 560px;
  place-items: center;
}

.phone-card {
  width: min(100%, 360px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(255, 111, 145, 0.23), rgba(96, 215, 189, 0.22));
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.phone-top {
  width: 96px;
  height: 8px;
  margin: 2px auto 20px;
  border-radius: 99px;
  background: rgba(30, 27, 46, 0.2);
}

.story-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.story-strip span {
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--mint), var(--sky));
}

.story-strip span:nth-child(2) {
  background: linear-gradient(135deg, var(--rose), #ffd166);
}

.story-strip span:nth-child(3) {
  background: linear-gradient(135deg, #b088ff, var(--sky));
}

.story-strip span:nth-child(4) {
  background: linear-gradient(135deg, var(--coral), var(--mint));
}

.mini-post {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
}

.mini-post img {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: cover;
}

.mini-post p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mini-post.small {
  grid-template-columns: auto 1fr;
}

.mini-badge {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: var(--ink);
  font-weight: 900;
}

.welcome-panel,
.layout,
.news-section,
.rules-section {
  margin-bottom: 30px;
}

.welcome-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(96, 215, 189, 0.4);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 44px rgba(96, 215, 189, 0.16);
}

.welcome-panel h2,
.admin-login h1,
.admin-card h1,
.panel-heading h2,
.section-title h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

.welcome-panel p,
.panel-heading p,
.news-card p,
.post-card p,
.rules-list p {
  color: var(--muted);
  line-height: 1.58;
}

.layout {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.auth-panel {
  position: sticky;
  top: 102px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel-heading p {
  margin-bottom: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 22px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(30, 27, 46, 0.04);
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 8px 20px rgba(46, 35, 78, 0.08);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--rose);
}

.check-row a,
.footer a {
  color: #a7385c;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

input:focus {
  border-color: rgba(255, 111, 145, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 111, 145, 0.12);
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #9d4d69;
  font-weight: 800;
}

.section-title {
  margin-bottom: 18px;
}

.posts {
  display: grid;
  gap: 16px;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-card,
.news-card {
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 36px rgba(46, 35, 78, 0.09);
}

.post-card.featured {
  min-height: 250px;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.14), rgba(96, 215, 189, 0.14)),
    rgba(255, 255, 255, 0.76);
}

.post-image {
  display: block;
  width: calc(100% + 48px);
  max-height: 360px;
  margin: -24px -24px 20px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(30, 27, 46, 0.06);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.post-card h3,
.news-card h3 {
  margin: 14px 0 8px;
  font-size: clamp(23px, 3vw, 32px);
  letter-spacing: 0;
  line-height: 1.08;
}

.text-btn {
  margin-top: 16px;
  padding: 0;
  border: 0;
  color: #bf3f67;
  background: transparent;
  font-weight: 900;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.post-actions .secondary-btn,
.post-actions .danger-btn {
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 14px;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reaction-btn {
  display: inline-flex;
  min-width: 62px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(30, 27, 46, 0.1);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(46, 35, 78, 0.06);
}

.reaction-btn span {
  font-size: 22px;
  line-height: 1;
}

.reaction-btn strong {
  color: var(--ink);
  min-width: 12px;
  font-size: 14px;
  line-height: 1;
}

.reaction-btn.active {
  color: #8c2f50;
  border-color: rgba(255, 111, 145, 0.38);
  background: rgba(255, 111, 145, 0.13);
  box-shadow: 0 8px 22px rgba(255, 111, 145, 0.12);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 900;
}

.pagination .secondary-btn {
  min-height: 42px;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.news-section,
.rules-section {
  padding: 48px 0 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  gap: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #7e3351;
  background: rgba(255, 111, 145, 0.14);
  font-size: 13px;
  font-weight: 900;
}

.winner-box {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(96, 215, 189, 0.36);
  border-radius: 20px;
  background: rgba(96, 215, 189, 0.12);
}

.winner-box.locked {
  border-color: rgba(30, 27, 46, 0.12);
  background: rgba(30, 27, 46, 0.045);
}

.winner-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.winner-box strong {
  font-size: 22px;
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.rules-list p {
  min-height: 112px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.doc-page {
  padding-bottom: 50px;
}

.doc {
  max-width: 900px;
  margin: 70px auto;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.doc h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.98;
}

.doc h2 {
  margin: 30px 0 8px;
  font-size: 24px;
}

.doc p,
.doc li {
  color: var(--muted);
  line-height: 1.65;
}

.admin-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 48px 0;
}

.admin-login {
  display: grid;
  min-height: 620px;
  place-items: center;
}

.admin-login .admin-card {
  width: min(100%, 460px);
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.admin-reactions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(30, 27, 46, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.admin-reactions > strong {
  font-size: 14px;
}

.admin-reactions > span,
.reaction-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reaction-details {
  display: grid;
  gap: 8px;
}

.reaction-details div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.reaction-details em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.reaction-details span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-form {
  display: grid;
  gap: 14px;
}

textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .layout,
  .admin-layout,
  .news-grid,
  .rules-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    justify-items: center;
  }

  .brand,
  .profile-mini {
    justify-self: center;
  }

  .nav {
    width: 100%;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    gap: 24px;
    padding-top: 28px;
  }

  .hero-visual {
    min-height: 420px;
  }

  .auth-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .nav a {
    padding-inline: 9px;
    font-size: 13px;
  }

  .hero-copy h1 {
    font-size: 64px;
  }

  .lead {
    font-size: 18px;
  }

  .hero-actions,
  .welcome-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .phone-card {
    border-radius: 30px;
    transform: none;
  }
}
