.community-page {
  align-items: start;
  width: min(100% - 44px, 1860px);
  grid-template-columns: minmax(260px, 360px) minmax(620px, 1fr) minmax(260px, 360px);
  gap: 22px;
}

.game-page.community-page {
  width: 100%;
}

.community-page .layout-3col {
  align-items: start;
}

.community-page .community-main {
  display: block;
}

.community-page .community-left,
.community-page .community-right {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 88px);
  overflow: auto;
}

.community-main {
  min-width: 0;
}

.community-left,
.community-right {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  scrollbar-width: thin;
}

.community-left::-webkit-scrollbar,
.community-right::-webkit-scrollbar {
  width: 6px;
}

.community-left::-webkit-scrollbar-thumb,
.community-right::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(120, 145, 210, 0.35);
}

.community-game-rail {
  border: 1px solid rgba(120, 145, 210, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(196, 60, 255, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(10, 20, 50, 0.92), rgba(5, 12, 32, 0.86));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2);
  padding: 14px;
}

.community-game-rail h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.community-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.community-game-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(120, 145, 210, 0.14);
  border-radius: 8px;
  display: block;
  isolation: isolate;
  background: rgba(5, 13, 33, 0.94);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.community-game-tile:hover,
.community-game-tile:focus-visible {
  border-color: rgba(53, 215, 255, 0.78);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(217, 92, 255, 0.18);
  outline: none;
  transform: translateY(-4px);
}

.community-game-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(3, 7, 20, 0) 18%, rgba(3, 7, 20, 0.82) 72%, rgba(3, 7, 20, 0.97) 100%),
    radial-gradient(circle at 18% 18%, rgba(53, 215, 255, 0.32), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(217, 92, 255, 0.3), transparent 32%);
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.community-game-tile:hover::before,
.community-game-tile:focus-visible::before {
  opacity: 1;
}

.community-game-tile img {
  width: 100%;
  aspect-ratio: 16 / 11;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.34s ease, filter 0.22s ease;
}

.community-game-tile:hover img,
.community-game-tile:focus-visible img {
  filter: saturate(1.12) contrast(1.04);
  transform: scale(1.07);
}

.community-game-tile .game-badge {
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 9px;
  padding: 6px 9px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.community-game-tile:hover .game-badge,
.community-game-tile:focus-visible .game-badge {
  opacity: 1;
  transform: translateY(0);
}

.community-game-tile b,
.community-game-tile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-game-tile b {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 30px;
  z-index: 2;
  padding: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.community-game-tile small {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 0;
  color: #ffc247;
  font-size: 10px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.community-game-tile:hover b,
.community-game-tile:focus-visible b,
.community-game-tile:hover small,
.community-game-tile:focus-visible small {
  opacity: 1;
  transform: translateY(0);
}

.community-featured {
  margin-bottom: 22px;
}

.community-hero-panel,
.community-composer,
.community-post,
.community-alert,
.community-empty {
  border: 1px solid rgba(120, 145, 210, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 18%, rgba(53, 215, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(10, 20, 50, 0.92), rgba(5, 12, 32, 0.86));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
}

.community-hero-panel {
  min-height: 148px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.community-hero-panel small,
.community-composer__actions span {
  color: #35d7ff;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.community-hero-panel h1 {
  margin: 6px 0 10px;
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.community-hero-panel p,
.community-muted {
  color: #9caad2;
  line-height: 1.6;
}

.community-hero-panel a,
.community-composer__actions button,
.community-comment-form button,
.community-view-all {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  background: linear-gradient(100deg, #c43cff, #4d78ff);
  color: #fff;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.community-alert {
  margin-top: 16px;
  padding: 14px 16px;
  color: #ffd673;
}

.community-composer {
  margin-top: 18px;
  padding: 18px;
}

.community-composer__head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
}

.community-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #ffc247, #f044ff);
  color: #08122b;
  font-weight: 950;
  flex: 0 0 auto;
  overflow: hidden;
}

.community-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-composer textarea,
.community-comment-form input {
  width: 100%;
  border: 1px solid rgba(120, 145, 210, 0.16);
  border-radius: 10px;
  outline: none;
  background: rgba(5, 12, 31, 0.86);
  color: #fff;
  padding: 13px 14px;
  resize: vertical;
}

.community-composer__actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-upload input {
  display: none;
}

.community-upload {
  min-height: 42px;
  border: 1px dashed rgba(53, 215, 255, 0.44);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
}

.community-feed {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.community-empty {
  padding: 22px;
  color: #9caad2;
  text-align: center;
}

.community-post {
  padding: 18px;
}

.community-post__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-post__head b,
.community-comment__meta b {
  display: block;
  color: #fff;
}

.community-post__head small,
.community-comment__meta small {
  color: #7f8bb0;
  font-size: 11px;
}

.community-post__body {
  margin-top: 14px;
  color: #dce6ff;
  line-height: 1.7;
}

.community-post__image {
  width: 100%;
  max-height: 520px;
  margin-top: 14px;
  border: 1px solid rgba(120, 145, 210, 0.16);
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

.community-post__stats,
.community-post__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-post__stats {
  margin-top: 14px;
  color: #9caad2;
  font-size: 12px;
}

.community-stat-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.community-stat-like i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #318dff, #29c2ff);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.community-post__actions {
  margin-top: 12px;
  border-top: 1px solid rgba(120, 145, 210, 0.14);
  border-bottom: 1px solid rgba(120, 145, 210, 0.14);
  padding: 7px 0;
  justify-content: flex-start;
  gap: 14px;
}

.community-post__actions button,
.community-reply-btn {
  border: 0;
  background: transparent;
  color: #9caad2;
  font-weight: 900;
  cursor: pointer;
}

.community-post__actions button {
  min-width: 76px;
  min-height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.community-post__actions button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.community-post__actions .community-focus-comment:hover {
  background: transparent;
}

.community-like-btn.liked {
  color: #4d8cff;
}

.community-like-icon,
.community-comment-icon,
.community-share-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  position: relative;
}

.community-like-icon {
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.community-comment-icon {
  border: 0;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.community-comment-icon::before,
.community-comment-icon::after {
  content: none;
  display: none;
}

.community-share-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 17px;
  height: 13px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: skewX(-18deg) rotate(-18deg);
  border-radius: 2px;
}

.community-share-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 2px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.community-comments-panel {
  margin-top: 14px;
  border: 1px solid rgba(120, 145, 210, 0.12);
  border-radius: 14px;
  background: #242526;
  padding: 12px;
}

.community-comments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.community-comments-toolbar strong {
  color: #e4e6eb;
  font-size: 15px;
  font-weight: 950;
}

.community-comments-toolbar select {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b0b3b8;
  font-size: 14px;
  font-weight: 900;
  padding: 0 4px;
}

.community-comments {
  display: grid;
  gap: 10px;
}

.community-comment {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.community-comment::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  bottom: -11px;
  width: 2px;
  background: #4b4f56;
}

.community-comment:last-child::before {
  display: none;
}

.community-comment .community-avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
  border: 2px solid #242526;
}

.community-comment__body {
  position: relative;
  width: fit-content;
  max-width: min(100%, 680px);
  border: 0;
  border-radius: 18px;
  background: #3a3b3c;
  padding: 10px 14px;
  color: #e4e6eb;
}

.community-comment__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.community-comment-menu {
  border: 0;
  background: transparent;
  color: #b0b3b8;
  cursor: pointer;
  font-weight: 950;
  line-height: 1;
  padding: 0;
}

.community-comment-owner-menu {
  position: relative;
}

.community-comment-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  min-width: 120px;
  border: 1px solid rgba(120, 145, 210, 0.16);
  border-radius: 8px;
  display: none;
  overflow: hidden;
  background: #3a3b3c;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.community-comment-owner-menu.open .community-comment-dropdown {
  display: block;
}

.community-comment-dropdown button {
  width: 100%;
  min-height: 36px;
  border: 0;
  display: block;
  background: transparent;
  color: #e4e6eb;
  font-weight: 850;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.community-comment-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.community-comment__body p {
  margin: 3px 0 0;
  color: #e4e6eb;
  line-height: 1.55;
}

.community-edit-form {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

.community-comment.editing .community-comment-text {
  display: none;
}

.community-comment.editing .community-edit-form {
  display: flex;
}

.community-edit-form input {
  min-width: min(420px, 58vw);
  border: 0;
  border-radius: 999px;
  background: #242526;
  color: #e4e6eb;
  padding: 10px 13px;
}

.community-edit-form button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e6eb;
  font-weight: 900;
  padding: 0 12px;
  cursor: pointer;
}

.community-comment__actions {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  grid-column: 2;
  margin-top: 4px;
  margin-left: 8px;
}

.community-comment__actions small {
  color: #b0b3b8;
  font-size: 12px;
}

.community-comment__actions button {
  border: 0;
  background: transparent;
  color: #b0b3b8;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  padding: 0;
}

.community-replies {
  position: relative;
  margin-left: 31px;
  display: grid;
  gap: 10px;
}

.community-replies::before {
  content: "";
  position: absolute;
  left: -11px;
  top: -16px;
  width: 26px;
  height: 32px;
  border-left: 2px solid #4b4f56;
  border-bottom: 2px solid #4b4f56;
  border-radius: 0 0 0 12px;
}

.community-comment-form {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.community-comment-form input {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #3a3b3c;
  color: #e4e6eb;
}

.community-comment-form button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  padding: 0;
  background: #4d78ff;
}

.community-rule-list,
.community-noti-mini {
  display: grid;
  gap: 10px;
}

.community-rule-list span,
.community-noti-mini a {
  border: 1px solid rgba(120, 145, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #dce6ff;
  padding: 10px 12px;
  text-decoration: none;
}

.community-noti-mini b,
.community-noti-mini small {
  display: block;
}

.community-noti-mini small {
  margin-top: 4px;
  color: #8fa0cd;
  line-height: 1.45;
}

.community-noti-mini a.unread {
  border-color: rgba(255, 194, 71, 0.5);
  background: rgba(255, 194, 71, 0.08);
}

.community-view-all {
  margin-top: 14px;
  width: 100%;
}

.community-notifications-page {
  width: min(100% - 44px, 980px);
  margin: 28px auto 42px;
}

.community-notifications-page .community-hero-panel button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  background: linear-gradient(100deg, #c43cff, #4d78ff);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.community-notification-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.community-notification-item {
  border: 1px solid rgba(120, 145, 210, 0.18);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  background: rgba(10, 20, 50, 0.88);
  color: #dce6ff;
  padding: 14px;
  text-decoration: none;
}

.community-notification-item.unread {
  border-color: rgba(255, 194, 71, 0.55);
  background: rgba(255, 194, 71, 0.08);
}

.community-notification-item b,
.community-notification-item small,
.community-notification-item p {
  display: block;
}

.community-notification-item b {
  color: #fff;
}

.community-notification-item small {
  margin-top: 3px;
  color: #8fa0cd;
  font-size: 11px;
}

.community-notification-item p {
  margin-top: 8px;
  color: #b8c5e8;
  line-height: 1.55;
}

:root[data-theme="light"] .community-hero-panel,
:root[data-theme="light"] .community-composer,
:root[data-theme="light"] .community-post,
:root[data-theme="light"] .community-alert,
:root[data-theme="light"] .community-empty,
:root[data-theme="light"] .community-game-rail {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text);
}

:root[data-theme="light"] .community-hero-panel h1,
:root[data-theme="light"] .community-post__head b,
:root[data-theme="light"] .community-comment__meta b,
:root[data-theme="light"] .community-game-rail h2,
:root[data-theme="light"] .community-game-tile b {
  color: var(--theme-text) !important;
}

:root[data-theme="light"] .community-hero-panel p,
:root[data-theme="light"] .community-post__body,
:root[data-theme="light"] .community-comment__body p,
:root[data-theme="light"] .community-rule-list span {
  color: #52607f !important;
}

:root[data-theme="light"] .community-composer textarea,
:root[data-theme="light"] .community-comment-form input,
:root[data-theme="light"] .community-comment__body,
:root[data-theme="light"] .community-comments-panel,
:root[data-theme="light"] .community-comments-toolbar select,
:root[data-theme="light"] .community-rule-list span,
:root[data-theme="light"] .community-noti-mini a,
:root[data-theme="light"] .community-notification-item {
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="light"] .community-notification-item b {
  color: var(--theme-text) !important;
}

:root[data-theme="light"] .community-notification-item p {
  color: #52607f !important;
}

:root[data-theme="light"] .community-game-tile {
  background: #ffffff !important;
  border-color: var(--theme-border) !important;
  box-shadow: 0 10px 22px rgba(34, 51, 91, 0.08);
}

:root[data-theme="light"] .community-game-tile b {
  color: #fff !important;
}

:root[data-theme="light"] .community-game-tile small {
  color: #ffc247 !important;
}

:root[data-theme="light"] .community-comments-toolbar strong,
:root[data-theme="light"] .community-comment__meta b {
  color: var(--theme-text) !important;
}

:root[data-theme="light"] .community-comment__body p,
:root[data-theme="light"] .community-comment__actions button,
:root[data-theme="light"] .community-comment-menu,
:root[data-theme="light"] .community-comment-dropdown button,
:root[data-theme="light"] .community-post__actions button,
:root[data-theme="light"] .community-comments-toolbar select {
  color: #52607f !important;
}

:root[data-theme="light"] .community-comment-dropdown,
:root[data-theme="light"] .community-edit-form input,
:root[data-theme="light"] .community-edit-form button {
  background: #ffffff !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

:root[data-theme="light"] .community-like-btn.liked {
  color: #e11d48 !important;
}

@media (max-width: 1280px) {
  .community-page {
    grid-template-columns: 1fr;
  }

  .community-left,
  .community-right {
    display: none;
  }
}

@media (max-width: 640px) {
  .community-hero-panel,
  .community-composer__actions,
  .community-post__actions,
  .community-post__stats {
    align-items: stretch;
    flex-direction: column;
  }

  .community-comment-form {
    grid-template-columns: 1fr;
  }
}

.game-page.community-page {
  width: 100%;
}

.community-page .layout-3col {
  align-items: start;
}

.community-page .community-main {
  display: block;
  min-width: 0;
}

.community-page .community-left,
.community-page .community-right {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 88px);
  overflow: auto;
}

.community-featured {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.community-featured .featured-game {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  border: 1px solid rgba(0, 234, 255, 0.28);
  border-radius: 10px;
  background: #020617;
  color: #fff;
  text-decoration: none;
}

.community-featured .featured-game img {
  width: 100%;
  height: 100%;
  min-height: 138px;
  object-fit: cover;
  display: block;
}

.community-featured .card-copy {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  gap: 2px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.community-featured .featured-game::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.community-featured .featured-game em {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  color: #ffd166;
  font-style: normal;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .community-page .community-left,
  .community-page .community-right {
    display: none;
  }

  .community-featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* OvOGames game-page shell: side columns must stay identical to game.php. */
.game-page.community-page {
  width: auto;
  padding: 0 20px;
}

.community-page .layout-3col {
  width: 100%;
}

.community-page .side-games {
  overflow: visible;
}

.community-page .side-games .similar-grid {
  margin: 0;
}

.community-page .community-main,
.notifications-game-page .community-notifications-page {
  width: auto;
  margin: 1px 0 42px;
}

.notifications-game-page .community-notifications-page {
  max-width: none;
}

@media (min-width: 1600px) {
  .community-page .layout-3col {
    max-width: 1840px;
    grid-template-columns: 500px minmax(0, 1fr) 500px;
    gap: 24px;
  }

  .community-page .side-games {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    grid-auto-flow: row dense;
    gap: 12px;
    align-items: stretch;
    align-content: start;
  }

  .community-page .side-games--left > .similar-grid {
    display: contents;
  }

  .community-page .side-games--right > .similar-grid {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
