.site-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.site-theme-card {
  overflow: hidden;
  border: 1px solid #adc7c6;
  border-radius: 10px;
  background: #f5fbfb;
  color: #153b3b;
}

.site-theme-sample {
  aspect-ratio: 2.5;
  border-bottom: 1px solid #adc7c6;
}

.site-theme-sample-mc-day {
  background:
    url('./assets/ui/mc/sky/cloud2.png') 18% 19% / 25% auto no-repeat,
    url('./assets/ui/mc/sky/cloud4.png') 86% 32% / 31% auto no-repeat,
    linear-gradient(#66c2eb 8%, #bce9f6 73%, #76b655 73% 85%, #8b5842 85%);
}

.site-theme-sample-winter-night {
  background: #0b2c33 url('./assets/ui/themes/winter-night.webp') 80% 64% / cover no-repeat;
}

.site-theme-info { padding: 1rem; }
.site-theme-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.site-theme-title h3 { margin: 0; }
.site-theme-info .actions { margin-top: .75rem; }
.site-theme-info .actions form { margin: 0; }
.site-theme-preview-bar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem 1rem;
  padding: .6rem 1rem;
  background: #c6efee;
  color: #12363a;
  font-size: .9rem;
}
.site-theme-preview-bar form { margin: 0; }
.site-theme-preview-bar button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #145b4d;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.home-heading-winter { display: none; }

body.theme-winter-night {
  --bg: #08282d;
  --bg2: #123846;
  --card: #edf9fa;
  --accent: #187b60;
  --winter-white: #f1fbfb;
  --winter-muted: #c2dfe1;
  --winter-edge: #79b7bd;
  --winter-ice: #e9f7f8;
  --winter-ink: #123d45;
  background: radial-gradient(ellipse at 75% 0, #154855, transparent 38rem), #08282d;
}

.theme-winter-night .mc-world { display: none; }
.theme-winter-night .top {
  background: #092d33;
  border-color: #327179;
  box-shadow: 0 6px 0 #061e24;
}
.theme-winter-night .top::after {
  content: "";
  position: absolute;
  inset: auto 9px -5px;
  height: 21px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 4px 5px at 12px 12px, #ffe6d4 18%, #ff6c62 48%, transparent 94%) 0 0 / 58px 21px repeat-x,
    radial-gradient(ellipse 4px 5px at 41px 14px, #fff3cb 18%, #ffc04f 48%, transparent 94%) 0 0 / 58px 21px repeat-x,
    radial-gradient(ellipse 11px 9px at 12px 12px, #ef665480, transparent 95%) 0 0 / 58px 21px repeat-x,
    radial-gradient(ellipse 11px 9px at 41px 14px, #f8b84980, transparent 95%) 0 0 / 58px 21px repeat-x,
    radial-gradient(ellipse 29px 8px at 29px 0, transparent 72%, #739687 80% 92%, transparent 100%) 0 0 / 58px 21px repeat-x;
}

@media (prefers-reduced-motion: no-preference) {
  .theme-winter-night .top::after { animation: winter-garland 3.8s ease-in-out infinite alternate; }
}

@keyframes winter-garland {
  from { filter: brightness(.9); }
  to { filter: brightness(1.2); }
}
.theme-winter-night .top :is(.brand-name, .brand:hover .brand-name) { color: var(--winter-white); }
.theme-winter-night .top .brand-by { color: var(--winter-muted); }
.theme-winter-night .brand-mark {
  position: relative;
  background: linear-gradient(#478da0 0 20%, #227267 20% 56%, #10493f 56%);
  box-shadow: inset 0 0 0 2px #65a8a5, 2px 2px 0 #061e24;
}
.theme-winter-night .brand-mark::before {
  content: "";
  position: absolute;
  inset: -4px 2px auto;
  height: 11px;
  background: linear-gradient(#f1fdff 60%, #a9dce6 60%);
  clip-path: polygon(14% 0, 80% 0, 80% 18%, 94% 18%, 94% 44%, 100% 44%, 100% 70%,
    68% 70%, 68% 100%, 56% 100%, 56% 70%, 36% 70%, 36% 86%, 22% 86%, 22% 66%, 0 66%, 0 32%, 14% 32%);
  pointer-events: none;
}
.theme-winter-night .brand-mark::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -5px;
  width: 11px;
  height: 11px;
  background: #d8f8ff;
  clip-path: polygon(41% 0, 59% 0, 59% 32%, 82% 9%, 94% 21%, 68% 41%, 100% 41%, 100% 59%,
    68% 59%, 94% 79%, 82% 91%, 59% 68%, 59% 100%, 41% 100%, 41% 68%, 18% 91%,
    6% 79%, 32% 59%, 0 59%, 0 41%, 32% 41%, 6% 21%, 18% 9%, 41% 32%);
  pointer-events: none;
}
.theme-winter-night .top .nav-burger { border-color: #66aeb0; background: #174149; }
.theme-winter-night .top .nav-burger span { background: var(--winter-white); }
.theme-winter-night .top .nav-pill { background: #18434b; border-color: #427e86; color: var(--winter-white); }
.theme-winter-night .top .nav-pill:hover { background: #24565c; }
.theme-winter-night .top ::selection { background: #86d8cf; color: #092d33; }
.theme-winter-night .top :is(.profile-bar, .balance-chip:not(.has-flash-offer)) {
  background: #154149;
  border-color: #477e85;
}
.theme-winter-night .top :is(.profile-menu-name, .profile-menu-gear, .social-btn) { color: #cbf8ed; }
.theme-winter-night .top .balance-chip:not(.has-flash-offer) :is(.balance-label, strong) { color: #cbf8ed; }
.theme-winter-night .top .balance-plus { background: #9be2cd; border-color: #69b99f; color: #0a3838; }
.theme-winter-night .top .social-btn { background: #17434b; border-color: #427e86; }

@media (min-width: 641px) {
  .theme-winter-night .profile-menu .avatar-frame-badge.badge-admin-pixel-guardian { font-size: .51rem; }
}

.theme-winter-night :is(.hero-card, .form-card, .stat, .server-card:not(.block-card):not(.game-slot), .news-card) {
  background: linear-gradient(165deg, #f7fdfd, #deeff1);
  border-color: #9abfc3;
}
.theme-winter-night .content > :is(.page-head, .news-feed) > :is(h1, p, .muted),
.theme-winter-night .content > :is(h1, h2, p),
.theme-winter-night .news-feed-title { color: var(--winter-white); }
.theme-winter-night .news-feed > .muted,
.theme-winter-night .content > .page-head > div > :is(h1, .muted) { color: var(--winter-muted); }
.theme-winter-night .site-legal p {
  color: var(--winter-muted);
  background: #0b3038;
  border-color: #327179;
  box-shadow: none;
}
.theme-winter-night .site-legal a { color: #c4f6ea; }
.theme-winter-night :is(.btn.primary, .btn-copy) { background: #15765d; color: #fff; border-color: #0c584c; }
.theme-winter-night .btn.game:is(.primary, :not(.ok, .danger, .square)) {
  border-width: 2px;
  border-image: none;
  border-radius: 4px;
  text-shadow: none;
}
.theme-winter-night .btn.game.primary { color: #fff; }
.theme-winter-night .btn.game:not(.primary, .ok, .danger, .square),
.theme-winter-night :is(.news-card-actions, .chat-dock-panel) .btn:not(.primary, .danger, .ok) {
  background: #e1f3f4;
  border-color: #83b7bf;
  color: var(--winter-ink);
}
.theme-winter-night .btn-copy.is-copied { background: #d1f1e6; color: #124b3f; border-color: #6cae9a; }

.theme-winter-night .news-card-title-panel {
  background: linear-gradient(135deg, #1a5a67, #103a47);
  border-color: #407985;
  box-shadow: inset 0 2px #59959f, inset 0 -2px #133440;
}
.theme-winter-night .news-card-title a { color: #f3fcff; text-shadow: 0 2px #102e39; }
.theme-winter-night :is(.news-card-summary-panel, .news-card-meta) {
  background: #f4fbfd;
  border-color: #afcfd6;
}
.theme-winter-night .news-article {
  background: linear-gradient(160deg, #f4fcfd, #ddedf3);
  border-color: #82adb8;
}
.theme-winter-night .news-article .news-article-head { border-bottom-color: #8fb6c1; }

.theme-winter-night :is(.server-card, .plan-card, .selected-tariff).block-card { --block-rim: #426f7b; }
.theme-winter-night :is(.server-card, .plan-card, .selected-tariff).block-card > .block-card-body {
  background: linear-gradient(165deg, #f2fafc, #e0eef3);
  border-color: #9abfc8;
}
.theme-winter-night .connect-box { background: #d6eaf0; border-color: #9abfc8; }
.theme-winter-night .connect-value { background: #f5fcff; border-color: #b0cfd8; color: var(--winter-ink); }
.theme-winter-night .connect-field-row { display: flex; flex-wrap: wrap; }
.theme-winter-night .connect-field-row .connect-value { flex: 1 1 13ch; }
.theme-winter-night .connect-field-row .btn-copy-sm { flex: 0 0 auto; padding-inline: .5rem; }
.theme-winter-night .chat-dock-tab {
  color: #0b363a;
  background: linear-gradient(#cbefed, #7dbcc0);
  border-color: #5c9ca5;
  box-shadow: -3px 4px 0 #16434b, -6px 8px 16px #061e24;
}
.theme-winter-night .chat-dock-panel {
  background: linear-gradient(#eaf9fb, #cbe6ea);
  border-color: #5c9ca5;
}
.theme-winter-night .chat-dock-head {
  background: linear-gradient(#1b5362, #103846);
  border-color: #4c8793;
  color: var(--winter-white);
}
.theme-winter-night .chat-dock-head .muted { color: var(--winter-muted); }
.theme-winter-night .chat-dock-compose { background: #e4f3f7; border-color: #a1c5cf; }
.theme-winter-night .chat-dock-panel :is(.chat-room-item, .chat-notify-btn, .chat-compose-tool) {
  background: #f0fafd;
  color: var(--winter-ink);
  border-color: #9bbec9;
}
.theme-winter-night .chat-dock-panel :is(.chat-room-item, .chat-notify-btn, .chat-compose-tool):hover {
  background: #d4ebf2;
}
.theme-winter-night .chat-dock-panel .chat-notify-btn.is-muted { background: #c5dce4; }
.theme-winter-night .chat-dock-compose .chat-input { background: #f8fdff; border-color: #abc8d2; }
.theme-winter-night .chat-dock-panel .chat-msg.user:not(.chat-style-guardian, .chat-style-pixel, .chat-style-winter, .chat-style-frost-night, .chat-style-festive-garland, .is-selected) {
  background: #f5fbfe;
}
.theme-winter-night .chat-dock-panel :is(.chat-room-name, .chat-msg:not(.chat-style-guardian, .chat-style-winter, .chat-style-frost-night, .chat-style-festive-garland) .chat-msg-author) {
  color: #174656;
}

.theme-winter-night .home-app-strip {
  border: 1px solid #a7dbdd;
  background: linear-gradient(120deg, #c1edeb, #edf9fb 74%);
  box-shadow: 4px 4px 0 #051e25;
}
.theme-winter-night .home-app-copy .brand-kicker::after {
  content: "";
  display: inline-block;
  width: 27px;
  height: 15px;
  margin-inline-start: .55rem;
  vertical-align: -.25rem;
  transform: rotate(-12deg);
  background: repeating-linear-gradient(125deg, #b92f40 0 4px, #ffe5c5 4px 7px);
  clip-path: polygon(0 13%, 20% 28%, 26% 6%, 74% 6%, 80% 28%, 100% 13%, 100% 87%,
    80% 72%, 74% 94%, 26% 94%, 20% 72%, 0 87%);
  pointer-events: none;
}
.theme-winter-night .home-app-downloads {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 22rem);
  gap: .65rem;
}
.theme-winter-night .home-app-downloads .rustore-badge-banner {
  width: 100%;
  min-width: 0;
  background: linear-gradient(130deg, #113746, #1e5363);
  border-color: #477d8b;
  box-shadow: 3px 3px #123440;
}
.theme-winter-night .home-promo {
  padding: 0;
  border: 1px solid #407880;
  background: #0c3038;
  box-shadow: 4px 4px 0 #061e24;
}
.theme-winter-night .home-promo-glow { display: none; }
.theme-winter-night .home-promo-slide:first-child {
  display: flex;
  align-items: center;
  min-height: 26rem;
  padding: clamp(1.35rem, 5vw, 3rem);
  background:
    linear-gradient(90deg, #08282d 0%, rgba(8, 40, 45, .92) 30%, rgba(8, 40, 45, .2) 66%, transparent),
    url('./assets/ui/themes/winter-night.webp') right 55% / cover no-repeat;
}
.theme-winter-night .home-promo-inner { max-width: 28rem; gap: .7rem; }
.theme-winter-night .home-promo h1 {
  color: var(--winter-white);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.02;
  text-shadow: none;
}
.theme-winter-night .home-heading-classic { display: none; }
.theme-winter-night .home-heading-winter { display: inline; }
.theme-winter-night .home-promo h1 + p,
.theme-winter-night .home-promo-perks li { color: var(--winter-muted); }
.theme-winter-night .home-promo :is(.brand-kicker, .home-promo-perks strong) { color: #baf1e0; }
.theme-winter-night .home-promo-games li { color: #e5faf5; background: #123a40; border-color: #427e86; }
.theme-winter-night .home-promo-perks li::before { background: #68d6b1; box-shadow: 1px 1px 0 #327b68; }
.theme-winter-night :is(.home-promo-actions, .top-right) .btn.game {
  min-height: 2.75rem;
  border: 2px solid #0c614d;
  border-image: none;
  border-radius: 4px;
  text-shadow: none;
}
.theme-winter-night .home-promo-actions .btn.game:not(.primary) {
  background: #d2f1f0;
  color: #0b363a;
  border-color: #8cc8cb;
}
.theme-winter-night .home-top-servers {
  padding: 1.15rem;
  border: 0;
  border-radius: 0;
  background: #0c3038;
  box-shadow: none;
}
.theme-winter-night .home-top-head h2 { color: var(--winter-white); font-size: 1.2rem; }
.theme-winter-night :is(.home-top-all, .home-top-empty) { color: var(--winter-muted); }
.theme-winter-night .home-top-item { background: #e3f4f5; border-color: var(--winter-edge); }
.theme-winter-night .home-promo-dots { margin-bottom: .8rem; }
.theme-winter-night .home-promo-dots button { border-color: #6faeb4; background: #33616a; }
.theme-winter-night .home-promo-dots button.is-active { background: #91e3d0; }

.theme-winter-night :is(.home-app-strip, .home-promo, .news-list > .news-card:first-child)::after {
  --festive-red: radial-gradient(circle at center, #fff0df 0 1px, #e54847 1.5px 3px, #e5484740 4px, transparent 5px);
  --festive-gold: radial-gradient(circle at center, #fff9da 0 1px, #f5aa2c 1.5px 3px, #f5aa2c45 4px, transparent 5px);
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 2;
  border: 1px solid #608e85;
  pointer-events: none;
  background:
    var(--festive-red) 0 top / 56px 10px repeat-x,
    var(--festive-gold) 28px top / 56px 10px repeat-x,
    var(--festive-gold) 0 bottom / 56px 10px repeat-x,
    var(--festive-red) 28px bottom / 56px 10px repeat-x,
    var(--festive-gold) left 0 / 10px 56px repeat-y,
    var(--festive-red) left 28px / 10px 56px repeat-y,
    var(--festive-red) right 0 / 10px 56px repeat-y,
    var(--festive-gold) right 28px / 10px 56px repeat-y;
}

.theme-winter-night :is(.home-app-strip, .news-list > .news-card:first-child)::after {
  border-color: #8aacb1;
}

@media (min-width: 900px) {
  .theme-winter-night .home-promo-track { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .theme-winter-night .home-top-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .theme-winter-night .home-app-downloads { width: 100%; }
  .theme-winter-night .home-promo-slide:first-child {
    align-items: flex-start;
    padding: 1.15rem 1rem clamp(11rem, 48vw, 17rem);
    background:
      linear-gradient(#08282d 42%, rgba(8, 40, 45, .88) 60%, transparent 84%),
      url('./assets/ui/themes/winter-night.webp') right bottom / auto 56% no-repeat #08282d;
  }
}
